Commit Graph

613839 Commits

Author SHA1 Message Date
David.Wu
cd59e670a8 arm64: dts: rockchip: Change the dr_mode from peripheral to otg for rk1808
Use the driver to auto switch the host/peripheral mode for rk1808,
so the dr_mode must be otg.

Change-Id: I9b05e06bacd141d5fbd00a9751f2a12a4e4385c8
Signed-off-by: David.Wu <david.wu@rock-chips.com>
2018-12-10 20:07:57 +08:00
David.Wu
833c56149e usb: dwc3: Change the dwc3 driver to dwc3-rockchip for rk1808 and rk3399pro-npu
Use the dwc3-rockchip driver to auto switch the host/peripheral dr_mode.

Change-Id: I497570fad4caaffc9da08086f2758653afb729db
Signed-off-by: David.Wu <david.wu@rock-chips.com>
2018-12-10 20:07:57 +08:00
David.Wu
98b799609e arm64: dts: rockchip: Add usbdrd3's compatible "rockchip,rk3399-dwc3" for rk3399pro-npu
We will use the dwc3-rockchip driver for rk3399pro-npu, this patch
is prepared for it.

Change-Id: I9c97002adbe9bd2fea01d8e209183f5211b3796c
Signed-off-by: David.Wu <david.wu@rock-chips.com>
2018-12-10 20:07:57 +08:00
David Wu
74aa9c38f5 arm64: dts: rockchip: Add usbdrd3's compatible "rockchip,rk3399-dwc3" for rk1808
We will use the dwc3-rockchip driver for rk1808, this patch is prepared
for it.

Change-Id: I7ca8baefd26ea6c67140b757c47e14625cfed609
Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-12-10 20:07:57 +08:00
David.Wu
80fb508ae6 arm64: configs: Enable CONFIG_USB and CONFIG_USB_DWC3_GADGET for rk3399pro_npu
The driver of dwc3-rockchip depends on CONFIG_USB and
CONFIG_USB_DWC3_GADGE. To use the driver, need to enable
them.

Change-Id: Iddfbf1ac2b413aa33f5803ffcfc165ec3555937f
Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-12-10 20:07:27 +08:00
Wang Panzhenzhuan
45e40867e0 arm64: dts: rockchip: rk3399-tve1030g: distinguish isp relate nodes for Android 9.0 & 8.1
rk3399-tve1030g*:
    isp0/1 for CameraHal1 in Android8.1 or lower version
    rkisp1_0/1 & mipi_dphy_rx0/tx1rx1 for CameraHal3 in Android9.0

Change-Id: I9198eccb0d76ad5e51ff6a2a5021e5acefbf0f49
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2018-12-10 18:23:49 +08:00
Zhangbin Tong
4e264676aa ARM: dts: add new dts file for rk3229 evb android avb
Change-Id: I1e76b87ffe691ab5171edc9215a13e1dd21cbf76
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2018-12-10 14:04:49 +08:00
Zhangbin Tong
53d0ac7346 arm: dts: rk3229-android: separate android fireware
Split DT source files to separate out android fireware specific DT
bindings.

Change-Id: I31361570a630057e50507593c6da693cf1200a12
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2018-12-10 14:04:18 +08:00
Weixin Zhou
0d6bd51f37 arm64: dts: rockchip: rk3399pro-evb: set vcc5v0_usb always on
Fix the device reconnect error after exit deepsleep.

Change-Id: I277875ad64b84d5b9fbf49d528ae75d571a04ff4
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-12-07 17:49:21 +08:00
Joseph Chen
393f834ac6 power: rk816-battery: ac/usb implement "input_current_limit" sysfs node
store 0 to disable charger input current supply, otherwise
enable charger input current supply

Change-Id: Iabf61d3c8e6469cb5d6466677e06b73c6af37bcb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-07 14:53:16 +08:00
Elaine Zhang
be86533d88 regulator: rk809 & rk817: fix up the is_enable return error
mark rk8xx_is_enabled_wmsk_regmap as is_enable callback func for siwtch ops.

Change-Id: Ice90f92438a73f77c61aadd1c43441626c24e075
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-12-07 14:51:34 +08:00
Weixin Zhou
98c0b83b3b arm64: dts: rockchip: rk3399pro-evb: fix mpu6500 orientation
Change-Id: I38b1490de055ec42307c59c9ed9317e577fe4bd5
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-12-07 14:49:31 +08:00
Wyon Bi
4c56e6306b drm/rockchip: rk618: remove unused files
Change-Id: I76e3e24d8aa391b5491e05474357bfec139d3827
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-12-07 11:05:03 +08:00
Zain Wang
e47d6954e3 arm64: dts: rockchip: rk3328-evb: enable rockchip_suspend
Change-Id: I1348d18031557ca6f45826ee6ddf3b6b224a5075
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2018-12-06 16:54:34 +08:00
William Wu
3099e13bdb usb: gadget: f_uvc: support uvc and adb use independently
If we use usb gadget as uvc and adb composite function,
the adb will be disconnected if the uvc camera apk is
closed. I can reproduce this issue by the following steps
on rk3399/rk3288 platforms.

1. Set usb gadget as uvc and adb composite function,
   and open uvc camera apk on rk3399/rk3288 platforms.
2. Connect usb to PC, and use adb shell;
3. Close the uvc camera apk;

And then, the adb will also be disconnected. It's because
that when close the uvc camera apk, the userspace calls
v4l2_release -> uvc_v4l2_release -> uvc_function_disconnect
-> usb_gadget_deactivate -> usb_gadget_disconnect ->
pullup(gadget, 0), this cause usb controller disconnect the
usb connection.

This patch adds a uvc_enabled flag to indicate that usb
is connected, don't call pullup(gadget, 0) to disconnet
usb if we only close uvc camera apk but not plug out usb
cable.

Change-Id: I0cc5ce8a24e8e06e0dc9215dfd1b92ef702e4311
Signed-off-by: William Wu <william.wu@rock-chips.com>
2018-12-06 16:36:47 +08:00
Zhengjun Xing
f025f3ea83 UPSTREAM: xhci: Fix kernel oops in trace_xhci_free_virt_device
commit 44a182b9d1 ("xhci: Fix use-after-free in xhci_free_virt_device")
set dev->udev pointer to NULL in xhci_free_dev(), it will cause kernel
panic in trace_xhci_free_virt_device. This patch reimplement the trace
function trace_xhci_free_virt_device, remove dev->udev dereference and
added more useful parameters to show in the trace function,it also makes
sure dev->udev is not NULL before calling trace_xhci_free_virt_device.
This issue happened when xhci-hcd trace is enabled and USB devices hot
plug test. Original use-after-free patch went to stable so this needs so
be applied there as well.

[ 1092.022457] usb 2-4: USB disconnect, device number 6
[ 1092.092772] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[ 1092.101694] PGD 0 P4D 0
[ 1092.104601] Oops: 0000 [#1] SMP
[ 1092.207734] Workqueue: usb_hub_wq hub_event
[ 1092.212507] RIP: 0010:trace_event_raw_event_xhci_log_virt_dev+0x6c/0xf0
[ 1092.220050] RSP: 0018:ffff8c252e883d28 EFLAGS: 00010086
[ 1092.226024] RAX: ffff8c24af86fa84 RBX: 0000000000000003 RCX: ffff8c25255c2a01
[ 1092.234130] RDX: 0000000000000000 RSI: 00000000aef55009 RDI: ffff8c252e883d28
[ 1092.242242] RBP: ffff8c252550e2c0 R08: ffff8c24af86fa84 R09: 0000000000000a70
[ 1092.250364] R10: 0000000000000a70 R11: 0000000000000000 R12: ffff8c251f21a000
[ 1092.258468] R13: 000000000000000c R14: ffff8c251f21a000 R15: ffff8c251f432f60
[ 1092.266572] FS:  0000000000000000(0000) GS:ffff8c252e880000(0000) knlGS:0000000000000000
[ 1092.275757] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1092.282281] CR2: 0000000000000000 CR3: 0000000154209001 CR4: 00000000003606e0
[ 1092.290384] Call Trace:
[ 1092.293156]  <IRQ>
[ 1092.295439]  xhci_free_virt_device.part.34+0x182/0x1a0
[ 1092.301288]  handle_cmd_completion+0x7ac/0xfa0
[ 1092.306336]  ? trace_event_raw_event_xhci_log_trb+0x6e/0xa0
[ 1092.312661]  xhci_irq+0x3e8/0x1f60
[ 1092.316524]  __handle_irq_event_percpu+0x75/0x180
[ 1092.321876]  handle_irq_event_percpu+0x20/0x50
[ 1092.326922]  handle_irq_event+0x36/0x60
[ 1092.331273]  handle_edge_irq+0x6d/0x180
[ 1092.335644]  handle_irq+0x16/0x20
[ 1092.339417]  do_IRQ+0x41/0xc0
[ 1092.342782]  common_interrupt+0xf/0xf
[ 1092.346955]  </IRQ>

Fixes: 44a182b9d1 ("xhci: Fix use-after-free in xhci_free_virt_device")
Change-Id: I233aed0fdbe490d6d01a908dc0242f19781339f1
Cc: <stable@vger.kernel.org>
Signed-off-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
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 d850c16583)
2018-12-06 10:17:00 +08:00
Mathias Nyman
50ed1d0da9 UPSTREAM: xhci: Fix USB3 NULL pointer dereference at logical disconnect.
Hub driver will try to disable a USB3 device twice at logical disconnect,
racing with xhci_free_dev() callback from the first port disable.

This can be triggered with "udisksctl power-off --block-device <disk>"
or by writing "1" to the "remove" sysfs file for a USB3 device
in 4.17-rc4.

USB3 devices don't have a similar disabled link state as USB2 devices,
and use a U3 suspended link state instead. In this state the port
is still enabled and connected.

hub_port_connect() first disconnects the device, then later it notices
that device is still enabled (due to U3 states) it will try to disable
the port again (set to U3).

The xhci_free_dev() called during device disable is async, so checking
for existing xhci->devs[i] when setting link state to U3 the second time
was successful, even if device was being freed.

The regression was caused by, and whole thing revealed by,
Commit 44a182b9d1 ("xhci: Fix use-after-free in xhci_free_virt_device")
which sets xhci->devs[i]->udev to NULL before xhci_virt_dev() returned.
and causes a NULL pointer dereference the second time we try to set U3.

Fix this by checking xhci->devs[i]->udev exists before setting link state.

The original patch went to stable so this fix needs to be applied there as
well.

Fixes: 44a182b9d1 ("xhci: Fix use-after-free in xhci_free_virt_device")
Change-Id: I568357fcb3ab320b628f6998ba1e571d40ecaa06
Cc: <stable@vger.kernel.org>
Reported-by: Jordan Glover <Golden_Miller83@protonmail.ch>
Tested-by: Jordan Glover <Golden_Miller83@protonmail.ch>
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 2278446e2b)
2018-12-06 10:17:00 +08:00
Zhengjun Xing
c51d966e8e UPSTREAM: xhci: Fix NULL pointer in xhci debugfs
Commit dde634057d ("xhci: Fix use-after-free in xhci debugfs") causes a
null pointer dereference while fixing xhci-debugfs usage of ring pointers
that were freed during hibernate.

The fix passed addresses to ring pointers instead, but forgot to do this
change for the xhci_ring_trb_show function.

The address of the ring pointer passed to xhci-debugfs was of a temporary
ring pointer "new_ring" instead of the actual ring "ring" pointer. The
temporary new_ring pointer will be set to NULL later causing the NULL
pointer dereference.

This issue was seen when reading xhci related files in debugfs:

cat /sys/kernel/debug/usb/xhci/*/devices/*/ep*/trbs

[  184.604861] BUG: unable to handle kernel NULL pointer dereference at (null)
[  184.613776] IP: xhci_ring_trb_show+0x3a/0x890
[  184.618733] PGD 264193067 P4D 264193067 PUD 263238067 PMD 0
[  184.625184] Oops: 0000 [#1] SMP
[  184.726410] RIP: 0010:xhci_ring_trb_show+0x3a/0x890
[  184.731944] RSP: 0018:ffffba8243c0fd90 EFLAGS: 00010246
[  184.737880] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000000000295d6
[  184.746020] RDX: 00000000000295d5 RSI: 0000000000000001 RDI: ffff971a6418d400
[  184.754121] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[  184.762222] R10: ffff971a64c98a80 R11: ffff971a62a00e40 R12: ffff971a62a85500
[  184.770325] R13: 0000000000020000 R14: ffff971a6418d400 R15: ffff971a6418d400
[  184.778448] FS:  00007fe725a79700(0000) GS:ffff971a6ec00000(0000) knlGS:0000000000000000
[  184.787644] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  184.794168] CR2: 0000000000000000 CR3: 000000025f365005 CR4: 00000000003606f0
[  184.802318] Call Trace:
[  184.805094]  ? seq_read+0x281/0x3b0
[  184.809068]  seq_read+0xeb/0x3b0
[  184.812735]  full_proxy_read+0x4d/0x70
[  184.817007]  __vfs_read+0x23/0x120
[  184.820870]  vfs_read+0x91/0x130
[  184.824538]  SyS_read+0x42/0x90
[  184.828106]  entry_SYSCALL_64_fastpath+0x1a/0x7d

Change-Id: Icd54424a559e7a028e270edfa0e28a0f9dd645f9
Fixes: dde634057d ("xhci: Fix use-after-free in xhci debugfs")
Cc: <stable@vger.kernel.org> # v4.15
Signed-off-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
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>
2018-12-06 10:17:00 +08:00
Alexander Kappner
fa6b063e20 UPSTREAM: xhci: Fix use-after-free in xhci debugfs
Trying to read from debugfs after the system has resumed from
hibernate causes a use-after-free and thus a protection fault.

Steps to reproduce:
Hibernate system, resume from hibernate, then run
$ cat /sys/kernel/debug/usb/xhci/*/command-ring/enqueue

[ 3902.765086] general protection fault: 0000 [#1] PREEMPT SMP
...
[ 3902.765136] RIP: 0010:xhci_trb_virt_to_dma.part.50+0x5/0x30
...
[ 3902.765178] Call Trace:
[ 3902.765188]  xhci_ring_enqueue_show+0x1e/0x40
[ 3902.765197]  seq_read+0xdb/0x3a0
[ 3902.765204]  ? __handle_mm_fault+0x5fb/0x1210
[ 3902.765211]  full_proxy_read+0x4a/0x70
[ 3902.765219]  __vfs_read+0x23/0x120
[ 3902.765228]  vfs_read+0x8e/0x130
[ 3902.765235]  SyS_read+0x42/0x90
[ 3902.765242]  do_syscall_64+0x6b/0x290
[ 3902.765251]  entry_SYSCALL64_slow_path+0x25/0x25

The issue is caused by the xhci ring structures being reallocated
when the system is resumed, but pointers to the old structures
being retained in the debugfs files "private" field:

The proposed patch fixes this issue by storing a pointer to the xhci_ring
field in the xhci device structure in debugfs rather than directly
storing a pointer to the xhci_ring.

Change-Id: Ic60c7b4c7599209b89775e03b5cc4f9d9cdba6ac
Fixes: 02b6fdc2a1 ("usb: xhci: Add debugfs interface for xHCI driver")
Signed-off-by: Alexander Kappner <agk@godking.net>
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>
2018-12-06 10:17:00 +08:00
Mathias Nyman
87802b3d7a UPSTREAM: xhci: Fix xhci debugfs NULL pointer dereference in resume from hibernate
Free the virt_device and its debugfs_private member together.

When resuming from hibernate the .free_dev callback unconditionally
freed the debugfs_private member, but could leave virt_device intact.

This triggered a NULL pointer dereference after resume when usbmuxd
sent a USBDEVFS_SETCONFIGURATION ioctl to a device, trying to add a
endpoint debugfs entry to a already freed debugfs_private pointer.

Change-Id: Ib0ed39ee0f82f3f5c3af5c46949a6a5f6dfe190d
Fixes: 02b6fdc2a1 ("usb: xhci: Add debugfs interface for xHCI driver")
Reported-by: Alexander Kappner <agk@godking.net>
Tested-by: Alexander Kappner <agk@godking.net>
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>
2018-12-06 10:17:00 +08:00
Algea Cao
5f96ef7e0f drm/rockchip: Add hdmi shutdown interface
When system shutdown, shutdown interface will be called.
Hdmi should be disabled when system shutdown.

Change-Id: I09ec1d7d3801bf8a8277c91072fa09bd1b430809
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-12-06 09:30:59 +08:00
Algea Cao
9b93bb6b3c drm/rockchip: tve: Add tve shutdown interface
When system shutdown, shutdown interface will be called.
TVE should be disabled when system shutdown.

Change-Id: If9dd29605cc0bd67aa8e9c494a98f89e625e4c50
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-12-05 18:17:16 +08:00
Sugar Zhang
9a0b8a7eb2 clk: rockchip: px30: Export clk id for sclk_i2s0_tx/rx mux
Change-Id: I697d20fb0c69f9dcd76aaf2d18d666db2241360d
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
abba102d04 ASoC: rockchip: pdm: Correct PDM_CTRL0 reg value
This patch fix the wrong reg value for rk322x/rk322xh,
cuz there is no STORE JUSTIFIED MODE on it.

on rk322x/rk322xh, the same bit means PDM_MODE/RESERVED,
if the bit is set to RESERVED, the controller will not work.

Change-Id: I9bfc055e792d73a66f51c78c7c2ff5c4cba620ae
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
e0fa2af584 ASoC: rockchip: pdm: Mark RXFIFO_DATA as volatile and precious
This patch marks RXFIFO_DATA as precious to avoid being read
outside a call from the driver, such as regmap debugfs

Change-Id: Id94a3d6f4ea382fc09547241dabc6ab84ca74139
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
a5d947fe00 ASoC: rockchip: spdifrx: Mark SPDIFRX_SMPDR as volatile and precious
This patch marks SPDIFRX_SMPDR as precious to avoid being read
outside a call from the driver, such as regmap debugfs.

Change-Id: Icc5398e0e192b86e191770b9ebd1251f97e6a048
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
81901bd3af ASoC: rockchip: spdif: Mark SPDIF_SMPDR as volatile
This patch marks SPDIF_SMPDR as volatile to make it resaonable,
which also requires marking it as readable, even though it isn't.

Change-Id: Ia59136a4d7a9a3984d4f4b2518f835ead7419aec
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
97239e32ff arm64: dts: rockchip: Add 'rockchip,grf' property for i2s-tdm
Change-Id: I42f461651f272c2c17ad08599b2b4d16e55b5ce5
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
9d3c30ad8e dt-bindings: sound: Add 'rockchip,grf' for rockchip i2s-tdm
This patch adds 'rockchip,grf' property for rockchip i2s-tdm.

Change-Id: If71fb12ac2d8969f291f69f694e0768427730983
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
91e521d581 ASoC: rockchip: i2s_tdm: Add grf configuration
This patch adds grf configs to fix the clk paths
when used in tx/rx only slave mode.

Change-Id: I704687d86f1e8c25181d1e87e00107560c9e36fe
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
6113767b45 arm: dts: rockchip: add reset properties for i2s
Change-Id: I4c04448a7f1630aec0f0a6e32edbcf9e6669efcb
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
adaf81f4a7 arm64: dts: rockchip: add reset properties for i2s
Change-Id: I1bdc5a417b412d484ba0caccc9e57da6a928de54
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
5af049f8eb ASoC: rockchip: i2s_tdm: Correct some regmap config
When restoring registers during runtime resume, we must not write to
I2S_TXDR which is the transmit FIFO as this queues up a sample to be
output and pushes all of the output channels down by one.

This can be demonstrated with the speaker-test utility:

for i in a b c; do speaker-test -c 2 -s 1; done

which should play a test with through the left speaker three times but if
the I2S hardware starts runtime suspended the first sample will be played
through the right speaker.

Fix this by marking I2S_TXDR as volatile (which also requires marking it
as readable, even though it technically isn't).  This seems to be the
most robust fix, the alternative of giving I2S_TXDR a default value is
more fragile since it does not prevent regcache writing to the register
in all circumstances.

While here, also fix the configuration of I2S_RXDR and I2S_FIFOLR; these
are not writable so they do not suffer from the same problem as I2S_TXDR
but reading from I2S_RXDR does suffer from a similar problem.

Change-Id: Id91d3f54f3fda0e9140c9da162b0dff2c3df067b
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
John Keeping
d83ced5248 UPSTREAM: ASoC: rockchip: i2s: fix playback after runtime resume
When restoring registers during runtime resume, we must not write to
I2S_TXDR which is the transmit FIFO as this queues up a sample to be
output and pushes all of the output channels down by one.

This can be demonstrated with the speaker-test utility:

	for i in a b c; do speaker-test -c 2 -s 1; done

which should play a test through the left speaker three times but if the
I2S hardware starts runtime suspended the first sample will be played
through the right speaker.

Fix this by marking I2S_TXDR as volatile (which also requires marking it
as readable, even though it technically isn't).  This seems to be the
most robust fix, the alternative of giving I2S_TXDR a default value is
more fragile since it does not prevent regcache writing to the register
in all circumstances.

While here, also fix the configuration of I2S_RXDR and I2S_FIFOLR; these
are not writable so they do not suffer from the same problem as I2S_TXDR
but reading from I2S_RXDR does suffer from a similar problem.

Change-Id: I47e67b51f8251486bb5e937619fdec89fc055f14
Fixes: f0447f6cbb ("ASoC: rockchip: i2s: restore register during runtime_suspend/resume cycle", 2016-09-07)
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
(cherry picked from commit c66234cfed)
2018-12-05 18:16:28 +08:00
Sugar Zhang
1c84facc5b dt-bindings: sound: rockchip-i2s: Add reset property
This patch adds the reset property for reset mechanism.

Change-Id: Ia60cc1f140860613b35ec42d703094bff8b46893
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
130c994af3 ASoC: rockchip: i2s: Add reset mechanism
This patch brings i2s back to normal by resetting i2s m/h
logic if i2s' clear operation is failed.

Change-Id: I2fd47039b522ac89499b4a2912d5ffb7a469e75e
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Sugar Zhang
013ace76f0 ASoC: rockchip: i2s_tdm: Add reset mechanism
This patch brings i2s back to normal by resetting i2s tx/rx
relative logic if i2s' clear operation is failed.

Change-Id: I52e4713d26f781962278802bd1f9bbce3fe4b751
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-12-05 18:16:28 +08:00
Herman Chen
dc6c729aa1 video: rockchip: vpu: Add clean cache for rkvdec
Add different clean cache operation for vpu / hevc / rkvdec.

Change-Id: I22f89d7648338f9788f5f2fff26b4ce815865809
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-12-05 15:25:27 +08:00
Elaine Zhang
808af4ff0f arm64: dts: rockchip: add pvtm clk node for rk3368
Change-Id: Ieca322f3fdfcf76ccf28642c6c07a46d4213c1d7
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-12-05 11:27:52 +08:00
Elaine Zhang
6950dffaa3 clk: rockchip: add support for pvtm clk
add pvtm 32K internal clock setting and select enable.

Change-Id: I60225d29e16c5b96f285623260bea475c78a026a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-12-05 11:26:45 +08:00
Elaine Zhang
ed0c1b9bc9 dt-bindings: clock: Binding documentation for Rockchip pvtm 32k clock
Change-Id: Ic8ff577553bf9267f8b4e7ec72974a61d035be2d
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-12-05 11:26:39 +08:00
Wyon Bi
f484097e4b drm/bridge: lt8912: disabled LP mode in HBP region
Change-Id: I5d40e835e2df47c4ef4acbe2471acd79be66771a
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-12-04 17:33:45 +08:00
Hu Kejun
7b45e7e687 media: rockchip: isp1: change isp fmt&size by default sensor fmt
Change-Id: I5b28a783fff3ec06fd6b6bbbb3905340e46b2d3b
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-04 16:41:51 +08:00
Hu Kejun
e6a1c2bd17 media: i2c: gc0312: fix broken pixels of two columns
Change-Id: I2efde13ec63d5fccf7280bb574b0d9f8b96c470a
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
2018-12-04 15:15:51 +08:00
William Wu
f26098251d HACK: usb: devio: add delay to fix ss bulk transfer issue
On RK3399/RK3399Pro platforms, We found that when USB 3.0
read/write at the same time in the following test case,
it may easily fail to transfer data with unknown problem.

Host transfer: 24B, 4MB, 4MB, 4MB
Device transfer : 24B, 4MB, 4MB, 4MB

Both Host and Device transfer "24B, 4MB, 4MB, 4M" Repeatedly
until transfer fail.

This patch adds 150us between the 24B and 4MB data to work
around the transfer issue. This patch may affect the USB 3.0
transmission performance, so we mark it as a HACK. We can
revert this patch if we find the root cause and fix this
issue with more reasonable patches.

Change-Id: Iff923ff895396a41a87e6a7df2bfa0072a13e2fc
Signed-off-by: William Wu <william.wu@rock-chips.com>
2018-12-03 18:51:48 +08:00
Herman Chen
e1755f0a19 video: rockchip: vpu: Fix address translate error
Some hardware need to translate scaling list table address to u32
address in register. The dma_addr_t on 64bit kernel will cause
overwriting to later register file.

Change-Id: Ib01d8e260b3e83dabafc13b3bfac02595faa6d63
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
2018-12-03 17:45:07 +08:00
Nickey Yang
187a6da61f arm64: dts: rockchip: fix wrong lcd_en settings on rk1808-evb.
GPIO0_C4 is used for lcd_en,not for backlight_en.
So fix it.

Change-Id: Id38ea83d65c91e2d7772d79caa6bad84a5d4398c
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2018-12-03 14:55:08 +08:00
jon.lin
19e6e2a580 drivers: rkflash: support 4KB page size slc nand
1.support 4KB page size slc nand;
2.support idblock update when NANDC version is 9.

Change-Id: Ia4c170270264fd46dbd2bc627d0780b8fe46f7d5
Signed-off-by: jon.lin <jon.lin@rock-chips.com>
2018-12-03 11:31:20 +08:00
zain wang
d576fa1a11 arm64: dts: rockchip: rk3326-evb: add pinctrl to pwm3
Change-Id: If8ba9ddfe2c600bd747db9a4d8a3f06633bc25f6
Signed-off-by: zain wang <wzz@rock-chips.com>
2018-12-03 11:30:27 +08:00
Wang Panzhenzhuan
58ada56569 arm64: dts: rockchip: rk3399-android.dtsi enable cif_clkout for dvp camera
Change-Id: Ie07a28e060fdfeb1acffae4b435b5388f25136b6
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
2018-12-03 11:29:34 +08:00