This issue is caused by set wake_host_gpio to out put,
so cancel set wake_host_gpio to out put
Change-Id: If776c1a9f54914cf0da728925fb8c8bbb5886155
Signed-off-by: Longjian Lin <llj@rock-chips.com>
Now we have a way retraining the link in case link broken
during PCIe transfer by uDMA
Change-Id: Ica4a2dfff432515bd8d32e79b8fb9504de56e82d
Signed-off-by: Simon Xue <xxm@rock-chips.com>
Debugfs may not support on some platforms. So remove
the debugfs and add sysfs interface. This patch also
change the name "rk_usb_force_mode" to "dwc3_mode".
Change-Id: I461919a02b1ee126c494f43f74af5295bb20c0a4
Signed-off-by: William Wu <william.wu@rock-chips.com>
The driver that instantiates the bridge should own the drvdata, as all
driver model callbacks (probe, remove, shutdown, PM ops, etc.) are also
owned by its driver struct. Moreover, storing two different pointer
types in driver data depending on driver initialization status is barely
a good practice and in fact has led to many bugs in this driver.
Let's clean up this mess and change Analogix entry points to simply
accept some opaque struct pointer, adjusting their users at the same
time to avoid breaking the compilation.
Change-Id: Ie06ce63a5daae532df69d2447b0673b91032d61c
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Acked-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20180110162348.22765-2-thierry.escande@collabora.com
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry-picked from 6b2d8fd98d)
This patch fix some coding style issues reported by checkpatch.pl.
Change-Id: I6a0163fb849203e722dc0e462ddaf3f96cd080a7
Signed-off-by: William Wu <william.wu@rock-chips.com>
As policy->cur may be changed by thermal and cpufreq_suspend, the setspeed
may be changed after resume.
Change-Id: I6d4e0672ff39127c522f305719afd52806c31f48
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
if miss this commit will appear hdmi display abnormal at
some TV.
Change-Id: I09833db307dae9622319940ac4f773836db1de81
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
The bus format is therefore retrieved from the connected panel
information.
Change-Id: Ie8489f75f828f25d6bdd59e8d1efb7959a3a6a28
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
On LVDS buses, usually each sample is transferred serialized in seven
time slots per pixel clock, on three (18-bit) or four (24-bit) differential
data pairs at the same time. The remaining bits are used for control signals
as defined by SPWG/PSWG/VESA or JEIDA standards. The 24-bit RGB format
serialized in seven time slots on four lanes using JEIDA defined bit mapping
will be named MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, for example.
LVDS RGB formats
-----------------------------------------------------------------------
Identifier Code Data organization
Timeslot Lane 3 2 1 0
MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010 0 d b1 g0
1 d b0 r5
2 d g5 r4
3 b5 g4 r3
4 b4 g3 r2
5 b3 g2 r1
6 b2 g1 r0
MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x1011 0 d d b1 g0
1 b7 d b0 r5
2 b6 d g5 r4
3 g7 b5 g4 r3
4 g6 b4 g3 r2
5 r7 b3 g2 r1
6 r6 b2 g1 r0
MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x1012 0 d d b3 g2
1 b1 d b2 r7
2 b0 d g7 r6
3 g1 b7 g6 r5
4 g0 b6 g5 r4
5 r1 b5 g4 r3
6 r0 b4 g3 r2
Change-Id: I7ca6442a761ac6ff29eb8b23d57647bf14d734ba
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
This modification prevents the emmc from issuing calibration timeout
errors at low temperatures
Change-Id: I5c3fddb8ea0ecf32d43e8e8190297638a1040a98
Signed-off-by: Chen Lei <lei.chen@rock-chips.com>
xHC can generate two events for a short transfer if the short TRB and
last TRB in the TD are not the same TRB.
The driver will handle the TD after the first short event, and remove
it from its internal list. Driver then incorrectly prints a warning
for the second event:
"WARN Event TRB for slot x ep y with no TDs queued"
Fix this by not printing a warning if we get a event on a empty list
if the previous event was a short event.
Change-Id: I3398d06f692e0744d051d89e3e7b876255fdaeed
Cc: <stable@vger.kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit e4ec40ec4b)
This patch adds a kernel node "u3phy_mode" in sysfs to config
USB 2.0 only or USB 2.0/3.0 mode for combphy USB mode. This
method is only used for USB Host mode.
It needs to reinit the xHCI when switch between USB 2.0 only
and USB 2.0/3.0 mode dynamically. In order to reinit the xHCI,
we use the "otg_mode" node in sysfs to remove/add xHCI HCD.
<How to use>
1. Default is USB 3.0 OTG mode, config to USB 2.0 only mode
echo u2 > /sys/devices/platform/<u3phy dev name>/u3phy_mode
echo host > /sys/devices/platform/<u2phy dev name>/otg_mode
2. Default is USB 3.0 Host mode, config to USB 2.0 only mode
echo otg > /sys/devices/platform/<u2phy dev name>/otg_mode
echo u2 > /sys/devices/platform/<u3phy dev name>/u3phy_mode
echo host > /sys/devices/platform/<u2phy dev name>/otg_mode
3. Default is USB 2.0 only Host mode, config to USB 3.0 mode
echo otg > /sys/devices/platform/<u2phy dev name>/otg_mode
echo u3 > /sys/devices/platform/<u3phy dev name>/u3phy_mode
echo host > /sys/devices/platform/<u2phy dev name>/otg_mode
Change-Id: Ia7d00ba4718da0e04dae38a9a50eea8c464fbbad
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
This patch adds support for the ultrasonic ranger srf04 of devantech.
This device is measuring the distance of objects in a range between 1 cm
and 3 meters and a theoretical resolution of 3 mm.
There are two GPIOs used:
- trigger: set as output to the device when the measurement should start
- echo: set by the device when the ultrasonic wave is sent out and reset
when the echo is recognized; this needs to be an interrupt input
The time between setting and resetting the echo pin is the time the
waveform needed for one round trip. This time is recorded in the interrupt
handler.
The distance is calculated in the read function by using the ultrasonic
speed at 20 degrees celsius which is about 343 m/s.
Conflicts:
drivers/iio/proximity/Makefile
Change-Id: I570e4008e1db87c7af9a9107260fda48bfb6542a
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
(cherry picked from commit feda284004)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This patch adds dt binding for devantech ultrasonic ranger srf04.
The vendor "devantech" was already added to the vendor list with
"[PATCH v4 1/3] iio: distance: srf08: add trivial DT binding"
Change-Id: I31278852798c6688f16902e3cc5222d503857667
Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
(cherry picked from commit 2fb5904d92)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Some USB devices does not support power off during suspend, so the vbus
of the USB host port should be kept on during suspend.
Change-Id: Ia3b054f9c53c33b637a02629e8cb3f050a5158b6
Signed-off-by: Bin Yang <yangbin@rock-chips.com>
Innosilicon LVDS/TTL PHY implements LVDS TIA/EIA protocol.
Normally, Innosilicon LVDS/TTL PHY contains four 7-bit
parallel-load serial-out shift registers, a 7X clock PLL,
and five Low-Voltage Differential Signaling (LVDS) line drivers
in a single integrated circuit. These functions allow 28 bits
of single-ended LVTTL data to be synchronously transmitted over
five balanced-pair conductors for receipt by a compatible receiver.
In addition, Innosilicon LVDS/TTL PHY could extend from 4 lanes
to N lanes (N is required by the customer). Therefore, the TTL
lines extend respectively.
Change-Id: Ib48537c49dec919e2ed5bc6347217fe83be07371
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
We use jitter bypass mode for spdif, so do not need to set jitter mode
related bit in SPDIF_CTRL_ADDR register. Also, we need to enable
SPDIF_ENABLE bit.
(am from https://patchwork.kernel.org/patch/10417647/)
Change-Id: Ieab2803435d8747ebc3890edaf9682dca9e3a3f3
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Lin Huang <hl@rock-chips.com>
The rk809 sleep pin connect to rk1808 gpio0_a4.
The reserved function of the gpio0_a4 caused rk809 reset.
Change-Id: Iee36da1f67831b7e58076a614929cfac6675a99d
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
This patch adds "snps,xhci-trb-ent-quirk" for DWC3 controllers
in RK1808/RK3328/RK3399/RK3399pro-npu.
Change-Id: I708f62747150316d66459f02b399d7c9b2667636
Signed-off-by: William Wu <william.wu@rock-chips.com>
On some xHCI controllers (e.g. Rockchip RK3399/RK3328/RK1808),
which are integrated in DWC3 IP, need to enable the Evaluate
Next TRB(ENT) flag in the TRB data structure to force xHC to
pre-fetch the next TRB of a TD. It's useful for the stability
of xHCI when transfer large data.
I have verify this patch on the following three cases:
Case 1:
On RK3399/RK3399Pro platforms, I found that when USB 3.0
read/write at the same time in the following test case,
it may easily fail without this patch.
Host transfer: 1024B, 4MB, 4MB, 4MB
Device transfer: 1024B, 4MB, 4MB, 4MB
Both Host and Device transfer "24B, 4MB, 4MB, 4M" Repeatedly
until transfer fail.
Case 2:
On RK3399 platform, Type-C1 USB 3.0 port connects with HUB
and Orbbec USB 3.0 Camera with the enumeration information:
usb 5-1: new high-speed USB device number 2 using xhci-hcd
usb 5-1: New USB device found, idVendor=05e3, idProduct=0610
usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 5-1: Product: USB2.1 Hub
usb 5-1: Manufacturer: GenesysLogic
hub 5-1:1.0: USB hub found
hub 5-1:1.0: 2 ports detected
usb 6-1: new SuperSpeed USB device number 2 using xhci-hcd
usb 6-1: New USB device found, idVendor=05e3, idProduct=0620
usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 6-1: Product: USB3.1 Hub
usb 6-1: Manufacturer: GenesysLogic
hub 6-1:1.0: USB hub found
hub 6-1:1.0: 2 ports detected
usb 5-1.2: new high-speed USB device number 3 using xhci-hcd
usb 5-1.2: New USB device found, idVendor=2bc5, idProduct=050d
usb 5-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=3
usb 5-1.2: Product: USB
usb 5-1.2: Manufacturer: USB
usb 5-1.2: SerialNumber: USB
uvcvideo: Found UVC 1.00 device USB (2bc5:050d)
usb 6-1.2: new SuperSpeed USB device number 3 using xhci-hcd
usb 6-1.2: New USB device found, idVendor=2bc5, idProduct=060d
usb 6-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 6-1.2: Product: Orbbec(R) Astra(TM)
usb 6-1.2: Manufacturer: Orbbec(R)
Without this patch, it's possible to fail to open the Orbbec USB 3.0
camera or fail to preview image.
Case3:
On RK3399Pro platform, transfer the NPU data between the NPU USB 3.0
device and RK3399 USB 3.0 host.
Change-Id: I87b1d8b8b6912d77b988362f2f6dcd7766da8b0e
Signed-off-by: William Wu <william.wu@rock-chips.com>
If an xhci platform needs to enable the ENT flag in the TRB
to force the xHC to pre-fetch the next TRB of a TD, then
add the XHCI_TRB_ENT_QUIRK flag.
Change-Id: Ib7cc095a848f0846ad995529ad703ae4e4ee4d44
Signed-off-by: William Wu <william.wu@rock-chips.com>