Commit Graph

605496 Commits

Author SHA1 Message Date
Peng Zhou
c599654dac camera: rockchip: cif: fix fival_list alloc and free
fix fival_list alloc and free with API doesn't match

Change-Id: I4d24a783cf8caaba3aa1575be26078cc7e1336fc
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-12-15 17:28:01 +08:00
Meng Dongyang
c101690c54 phy: rockchip-inno-usb2: power on phy if host connected when resume
In current code, the id irq will be disabled in suspend, if the otg
cable is connected during suspend, the id interrupt will be missing.
This patch checkout the voltage of id pin, power on phy and turn
on vbus if the otg cable is connected.

Change-Id: I988ecdf12e40fdfbc5360896cfb983879ebe23eb
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2017-12-15 12:08:16 +08:00
Peng Zhou
3592b98ce3 media: v4l2buf: fix videobuf ext_lock locked
Fixed the videobuf ext_lock locked result no buffer used.

Change-Id: I25384fb79200bd3a9b1e604fd634d7f067168d1c
Signed-off-by: Peng Zhou <benjo.zhou@rock-chips.com>
2017-12-15 09:07:01 +08:00
Tao Huang
f121419cf8 Revert "ANDROID: binder: Add thread->process_todo flag."
This reverts commit 6c70907428.

Which unable to pass
VtsKernelBinderTest#BinderDriverInterfaceTest.Transaction_IPC64_64bit
VtsKernelBinderTest#BinderDriverInterfaceTest.Transaction_IPC64_32bit

frameworks/native/libs/binder/tests/binderDriverInterfaceTest.cpp:84
Value of: ret
 Actual: -1
Expected: expect_ret
Which is: 0
Google Test trace:
frameworks/native/libs/binder/tests/binderDriverInterfaceTest.cpp:252: 1st WriteRead
frameworks/native/libs/binder/tests/binderDriverInterfaceTest.cpp:87
Value of: (*__errno())
 Actual: 11
Expected: expect_errno
Which is: 0
Google Test trace:
frameworks/native/libs/binder/tests/binderDriverInterfaceTest.cpp:252: 1st WriteRead

Change-Id: I982d7a2a8690c9d1ae7533e91bf7d41e814cdc54
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-15 09:06:15 +08:00
Tao Huang
a979f578cc Revert "ANDROID: binder: clarify deferred thread work."
This reverts commit 3f883f9b5c.

Change-Id: I7b597f826bf975ac2221ee4558c8164408f3fc1b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-15 09:06:09 +08:00
Xinhuang Li
2801809213 arm64: dts: rk3328-evb-android: modify spdif_tx from spdifm2_tx to spdifm0_tx
Change-Id: I6e7e82069441a9d1f5a7af1aceb18c901dacffea
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2017-12-14 18:28:33 +08:00
Caesar Wang
e014552989 ARM: dts: rockchip: remove the psci on rk3036 kylin
As the kylin had not ready supported it during the short time.
Due to kylin enabled the psci will cause crash on bootup.

..
[    0.000000] psci: probing for conduit method from DT.
[    0.000000] Bad mode in prefetch abort handler detected
[    0.000000] Internal error: Oops - bad mode: 0 [#1] SMP ARM
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.4.103 #294
[    0.000000] Hardware name: Generic DT based system
[    0.000000] task: c130d040 task.stack: c1300000
[    0.000000] PC is at 0xa60656a8
[    0.000000] LR is at __invoke_psci_fn_smc+0x38/0x44
[    0.000000] pc : [<a60656a8>]    lr : [<c0922234>]    psr: 600001d6

Change-Id: I2edc8d1becc63e932321698b6d4a6090b527a360
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-12-14 18:27:41 +08:00
xuhuicong
21622e96da arm64: dts: rk3328-evb-android: enable uboot loader logo display
Change-Id: I138ff0118882d1be11c21cd868d1b142605f6eec
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2017-12-14 15:42:41 +08:00
Caesar Wang
848ba9f9b3 net: wireless: rockchip_wlan: fixes the warning with gcc-7.2 build
when used the arm-linux-gnueabihf-gcc-7.2.1, had the below
warning information:

1) drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/siutils.c:607:14:
    warning: self-comparison always evaluates to false
    [-Wtautological-compare]

2) drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_common.c:3583:16:
    warning: comparison between pointer and zero character constant
    [-Wpointer-compare] error, forbidden warning: dhd_common.c:3583

Change-Id: Ida287252b7f20b17b68365b965edbff63ae7cbf9
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-12-14 15:36:23 +08:00
Yankun Zheng
bdf6d5faff ARM: dts: rk3229-at-gva: delete mode-bootloader property
The reboot bootloader flag has been written in misc,
do not need to write in the register

Change-Id: I161b94d554c3a0cb21f6d85b981a247aa1b110ff
Signed-off-by: Yankun Zheng <zyk@rock-chips.com>
2017-12-14 14:30:27 +08:00
Caesar Wang
cd8c778456 net: rfkill: fixes the warning with gcc-7.2 build
when used the arm-linux-gnueabihf-gcc-7.2.1, had the below
warning information:
net/rfkill/rfkill-bt.c:711:5: warning: this ‘if’ clause does not
guard... [-Wmisleading-indentation] error, forbidden warning

Change-Id: I7834078bb731e1115f6e8328a56158b0d9f2991e
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-12-14 10:06:09 +08:00
Chen Liang
a9b598724b arm64: dts: rockchip: add core dtsi file for PX30 and RK3326 SoCs
This patch adds core dtsi file for Rockchip PX30 and RK3326 SoCs.

Change-Id: Iccd663330632fddfed30093303aaec7c7a1b8b13
Signed-off-by: Chen Liang <cl@rock-chips.com>
2017-12-14 09:40:08 +08:00
Finley Xiao
49dda19957 arm: dts: rockchip: Add clock assign for rk3126 and rk3128 cru
Add "assigned-clocks" for rk3126 and rk3128 cru nodes, to intalize
clock rate for plls, bus and peripher.

Change-Id: Ie91c8b194feff5db91af6e9930d5f475175242f9
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-13 20:26:50 +08:00
Rocky Hao
557c1d80b9 ARM: rockchip_defconfig: enable RK_VIRTUAL_THERMAL
Change-Id: I36db5d8e4194c96e8a63be795d6403192ca60d4b
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-13 18:39:59 +08:00
Rocky Hao
c6cd509617 ARM: dts: rockchip: rk3126-bnd-d708: enable tsadc node
Change-Id: I40a5e8fe4563673d51aa60a99afe21c7b855a177
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-13 18:39:59 +08:00
Rocky Hao
c581befe92 ARM: dts: rockchip: add tsadc node and thermal config for rk312x
Change-Id: I5d3c5c77ec8e14b26ee7ef02cf4aec4729558d02
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-13 18:39:59 +08:00
Rocky Hao
2954d5a6db thermal: rockchip: add virtual tsadc support for rk3126
rk previous SOCs such as rk3126 have no tsadc module, so a virtual tsadc is
implemented to control the thermal problem.

the virtual tsadc is designed on considering 2 factors, one is heating
modules' heating time and the working frequences, the other one is current
leval monitored by coulometer.

Change-Id: I0c7d8b952004d4f7918a41c925c50d38aaa65673
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
2017-12-13 18:39:59 +08:00
Wenping Zhang
0c3d5875c3 leds: leds-is31fl32xx: enable multi-control mode and solve register failed issue during reboot.
Change-Id: I299ae4c97adde806c10ce74d2b843a82a4956682
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:36:20 +08:00
Wenping Zhang
f745a93405 leds: add multi-control for leds's trigger.
userspace can control all leds by one ioctl through file node:
/dev/led_multi_ctrl.

Change-Id: I10ac19b86b46b3dc9a88809f1be5ebc95398212c
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:36:20 +08:00
Wenping Zhang
a0505a722c leds: leds-is31fl32xx: merge modifies from develop-3.10.
1. fix cpu stall issue during reboot:
   In previous code, i2c write and read is executed in function
   is31fl32xx_brightness_set,this function may be called in softirq
   context if leds are in timer or oneshot trigger, so there are
   possibilities cpu will be stalled during led operations.
   Here we just move the i2c operation to workqueue to make sure
   not in irq context.
2. fix reboot crash issue.

Change-Id: If8520528b092cf4d5c4f1c7dcf2d353acd1c9b9d
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:36:20 +08:00
Wenping Zhang
a5763e48f0 leds: leds-is31fl32xx: add delayed register function.
This function is used for led scrolling, set "default-trigger-delay-ms"
in led dts node to enable this function.

Change-Id: I4dff3ab29d8ef18344df4c3a0f18a595a404154c
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:36:20 +08:00
Zheng Yang
a7d17fdc65 drm: bridge: dw-hdmi: fix tmds clk in status show
According to HDMI 2.0 chapter 6.1, for TMDS character Rates
avove 340Mcsc, the TMDS Clock Rate shall be one fourth of
the TMDS Character Rate.

Change-Id: I4cc78aa1a5fbf6cec93e787dde49e482d0b4d342
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-13 18:34:49 +08:00
Finley Xiao
09f340ba86 clk: rockchip: px30: Fix aclk and hclk for vpu, sdcard and crypto
Change-Id: I6f3d77033b493bdaac9d05c2be5eea38290a089e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-13 18:32:21 +08:00
Wenping Zhang
a2ad800c08 leds: leds-is31fl32xx: fix compile errors.
The is32fl32xx led driver from upstream is written for new led
framework, so just modify this driver for some api difference
between our current led framework.

Change-Id: I0fd9af4bc2cd419d3e0bcd1b2348d34d166d652b
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
2017-12-13 18:05:58 +08:00
Finley Xiao
feb173722d soc: rockchip: power-domain: Modify power domain driver for px30
This driver is modified to support PX30 SoC.

Change-Id: I0226327d6d63302627a823bf73a5f8239b70adaf
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-12-13 18:03:22 +08:00
shengfei Xu
7051792ae3 regulator: rk808: rk816: fix up the DCDC and LDO setting off in sleep mode
Change-Id: I1022a7a8951a3115ac01a43f2165b5eac6202ab4
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-12-13 17:24:55 +08:00
shengfei Xu
1fca941134 ARM: dts: rockchip: rk3126-bnd-d708: set DCDC initial mode
Change-Id: Ibb18ea7605ead33abcddde6690a4ae4016c01974
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-12-13 17:23:32 +08:00
shengfei Xu
14d16c1848 regulator: rk808: maps a hardware mode defined in a DTS to a standard mode
Change-Id: I304e0cbb3544abde112180b6ec459670d91c99ae
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-12-13 17:23:19 +08:00
Tao Huang
cfdb04d8c4 ARM: rockchip: Fix secondary CPU startup in thumb2 kernel
The secondary CPU starts up in ARM mode. When the kernel is compiled in
thumb2 mode we have to explicitly compile the secondary startup
trampoline in ARM mode.

Change-Id: I52d2167ab4c4e1da5ac1a800390ab04ba724dd72
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 17:20:58 +08:00
Xinhuang Li
8abc733872 clk: rockchip: rk3328: modify the wrong clk definition for encoder
Change-Id: I56ef3a201fc57d8ae368a5d1448e9e85e9143703
Signed-off-by: Xinhuang Li <buluess.li@rock-chips.com>
2017-12-13 17:05:54 +08:00
Mark Brown
d8df99ad35 UPSTREAM: regmap: Fix typo in IS_ENABLED() check
Change-Id: If9635a5933d7addea8522ce3b9259faa5b455008
Reported-by: Andreas Ziegler <andreas.ziegler@fau.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit f458e6102c)
2017-12-13 16:14:37 +08:00
Jonas Gorski
434530f363 UPSTREAM: regmap: make LZO cache optional
Commit 2cbbb579bc ("regmap: Add the LZO cache support") added support
for LZO compression in regcache, but there were never any users added
afterwards. Since LZO support itself has its own size, it currently is
rather a deoptimization.

So make it optional by introducing a symbol that can be selected by
drivers wanting to make use of it.

Saves e.g. ~46 kB on MIPS (size of LZO support + regcache LZO code).

Change-Id: I38a5164c2169f889a10f6c47968c1dbd187c6725
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 34a730aa74)
2017-12-13 16:10:16 +08:00
Tao Huang
356bf4e371 ARM: rockchip: pm: fix compilation error for !PM_SLEEP
Fixes: 580ad3d371 ("rockchip: pm: add deep sleep support for rk3288")
Change-Id: I8034cd47f289f51b21c47ee8f68ee1ae125026e7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 16:00:53 +08:00
Tao Huang
fc5f7f4e52 drm/rockchip: dw-hdmi: fix compilation warning for !PM_SLEEP
Change-Id: I404951709bef35cc2297fcc99002930ded17fe74
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:58:54 +08:00
Tao Huang
e4b484d077 input: sensor-dev: fix compilation warning for !PM_SLEEP
Change-Id: I4f63d7a86ebe3d0015a4d409f0f256b70f7e7cf8
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:56:09 +08:00
Tao Huang
210c1a7480 net: wireless: rockchip_wlan: fix compilation warning for !PM_SLEEP
Change-Id: Ia37c81cc6cabe3bd4ea6048fd9102ea36808dd5b
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:42:42 +08:00
Tao Huang
c8fa9b3b91 staging: iio: imu: inv_mpu: fix compilation warning for !PM_SLEEP
Change-Id: I23ec57a842175ad39cf6a76c87181b36c64e78ca
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:41:57 +08:00
Tao Huang
1629f6ccbc rockchip_sip: add dummy sip_smc_remotectl_config
Change-Id: Ib015b6ed3a3f6c66e34c84e4964b9cfafc8c6501
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:37:03 +08:00
Tao Huang
43c9e54b19 soc: rockchip: rockchip_dmc: fix compilation error for !DRM_ROCKCHIP
Change-Id: I6f02fef9ecf9b74e16b8e35d5f9c23afa1d7ebc7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:35:13 +08:00
Tao Huang
1d22a86e68 ARM: rockchip: build embedded if PM_SLEEP=y
Change-Id: I182ebf684392aed3a264a9d7f0d729031be210e4
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-12-13 15:12:35 +08:00
Zhang Yunlong
6c6d85b4d1 camera: rockchip: camsys_drv: v0.0x22.8
3399 ISP power management is wrong, correct it.

Change-Id: I6aa4e7a0dd941ec9ff02467c0e1e6b15f1771a2b
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>
2017-12-13 14:10:37 +08:00
Zheng Yang
df5711cded drm/rockchip: dw-hdmi: set default color depth to 8 bit
If color depth is automatic, it is same as 8bit.
If tmdsclk > max_tmds_clock, fall back to 8bit.

Change-Id: Ia8cbf5206831ef99456ae59add94c6f8b5a33380
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-12-13 14:09:48 +08:00
Zorro Liu
79d6c71215 arm64: dts: rockchip: change logo mode to center for rk3399-android.dtsi
Change-Id: Ibb7f9bd5575937a1e9b227156e195058e285bd1e
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2017-12-13 11:33:45 +08:00
Jianqun Xu
024bde41c3 drm/rockchip: use __GFP_DMA32 for shmem-backed gem
Rockchip requires bo-pages to be in the DMA32 zone. Explicitly request this
by setting __GFP_DMA32 as mapping-gfp-mask during shmem initialization.
This drops HIGHMEM from the gfp-mask and uses DMA32 instead. shmem-core
takes care to relocate pages during swap-in in case they have been loaded
into the wrong zone.

It is _not_ possible to pass __GFP_DMA32 to shmem_read_mapping_page_gfp()
as the page might have already been swapped-in at that time. The zone-mask
must be set during initialization and be kept constant for now.

Change-Id: I6db4f9e8ed716a1f7c90c7d92920122a484bf45d
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2017-12-13 09:41:02 +08:00
Jacob Chen
bbea8b144e clk: rockchip: do not register ddrclk if PSCI is not enabled on arm32
ARM32 system can run without trustos,
we should prevent arm_smccc_smc being called in such system.

Change-Id: Ic87b78107b464e3ab8dc72a3ca1fa9a64e358580
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-12-12 20:10:47 +08:00
Meng Dongyang
20694a9e4b usb: dwc2: modify host_nperio_tx_fifo_size for rockchip platform
According to DWC2 datasheet, the reset value of NPTxFDep in GNPTXFSIZ
register is OTG_TX_HNPERIO_DFIFO_DEPTH parameter,it specifies the Maximum
Non-Periodic TxFIFO depth and the memory allocation for the host when the
controller is in host mode. Software init host_nperio_tx_fifo_size with
the value of NPTxFDep during dwc2 probe.

But in some platform such as rk3126c, it must delay at least 100ms to wait
the controller change to host mode, it will increase usb controller probe
time, this patch modifies the host nperio_tx_fifo_size directly after valiate
parameter to speed up boot kernel.

Change-Id: Ia7d0f4f2cc1d80742d764807a8ee44cbc03c43ce
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2017-12-12 20:10:13 +08:00
Chris Zhong
3e2f8da104 ASoC: support ES8328 I2C driver
Change-Id: I7bc2d9a1796443dc61cf80498c1c016cea698a7a
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2017-12-12 19:06:44 +08:00
Chris Zhong
5a19c7f8e0 ASoC: es8328: Enabling support for 12Mhz sysclk
Change-Id: If9dea6039ab562023c81c2394c9286b7adc4a8c5
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
2017-12-12 19:06:31 +08:00
Yankun Zheng
fb0938d89f ARM: dts: rockchip: Modify pinctrl configuration for android things SOM.
fix the pinctrl default state is repeatedly defined
between rk3229-at-gva.dts and rk3229-at-som.dtsi

Change-Id: I117b3d97d446899ad7f35234df7c8dc0da60634e
Signed-off-by: Yankun Zheng <zyk@rock-chips.com>
2017-12-12 19:03:20 +08:00
Douglas Anderson
c25b6442b4 FROMLIST: phy: rockchip-typec: Try to turn the PHY on several times
Bind / unbind stress testing of the USB controller on rk3399 found
that we'd often end up with lots of failures that looked like this:

  phy phy-ff800000.phy.9: phy poweron failed --> -110
  dwc3 fe900000.dwc3: failed to initialize core
  dwc3: probe of fe900000.dwc3 failed with error -110

Those errors were sometimes seen at bootup too, in which case USB
peripherals wouldn't work until unplugged and re-plugged in.

I spent some time trying to figure out why the PHY was failing to
power on but I wasn't able to.  Possibly this has to do with the fact
that the PHY docs say that the USB controller "needs to be held in
reset to hold pipe power state in P2 before initializing the Type C
PHY" but that doesn't appear to be easy to do with the dwc3 driver
today.  Messing around with the ordering of the reset vs. the PHY
initialization in the dwc3 driver didn't seem to fix things.

I did, however, find that if I simply retry the power on it seems to
have a good chance of working.  So let's add some retries.  I ran a
pretty tight bind/unbind loop overnight.  When I did so, I found that
I need to retry between 1% and 2% of the time.  Overnight I found only
a small handful of times where I needed 2 retries.  I never found a
case where I needed 3 retries.

I'm completely aware of the fact that this is quite an ugly hack and I
wish I didn't have to resort to it, but I have no other real idea how
to make this hardware reliable.  If Rockchip in the future can come up
with a solution we can always revert this hack.  Until then, let's at
least have something that works.

This patch is tested atop Enric's latest dwc3 patch series ending at:
  https://patchwork.kernel.org/patch/10095527/
...but it could be applied independently of that series without any
bad effects.

For some more details on this bug, you can refer to:
  https://bugs.chromium.org/p/chromium/issues/detail?id=783464

Change-Id: I7909731247739694f56bf89ab3064889f2b34d3c
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10105833/)
2017-12-12 18:28:33 +08:00