Commit Graph

608093 Commits

Author SHA1 Message Date
Laxman Dewangan
2fbdff89ce UPSTREAM: regulator: Add settling time for non-linear voltage transition
Some regulators (some PWM regulators) have the voltage transition
non-linear i.e. exponentially. On such cases, the settling time
for voltage transition can not be presented in the voltage-ramp-delay.

Add new property for non-linear voltage transition and handle this
in getting the voltage settling time.

Change-Id: I3b3b8b173beaa3ecbc959b241c791d0816e5b7d2
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit d6c1dc3f52)
2018-03-22 11:14:38 +08:00
Laxman Dewangan
a21f433fab UPSTREAM: regulator: DT: Add settling time property for non-linear voltage change
Some regulators (some PWM regulators) have the voltage transition
exponentially. On such cases, the settling time for voltage change
is treated as constant time.

Add DT property for providing the settling time for any level of
voltage change for non-linear voltage change.

signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Change-Id: Ia88df848c62aecb0e03838a00398655a44dc220f
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit cfd2cedb48)
2018-03-22 11:14:38 +08:00
H. Nikolaus Schaller
3c27fb4c51 UPSTREAM: regulator: core: silence warning: "VDD1: ramp_delay not set"
commit 73e705bf81 ("regulator: core: Add set_voltage_time op")

introduced a new rdev_warn() if the ramp_delay is 0.

Apparently, on omap3/twl4030 platforms with dynamic voltage
management this results in non-ending spurious messages like

[  511.143066] VDD1: ramp_delay not set
[  511.662322] VDD1: ramp_delay not set
[  513.903625] VDD1: ramp_delay not set
[  514.222198] VDD1: ramp_delay not set
[  517.062835] VDD1: ramp_delay not set
[  517.382568] VDD1: ramp_delay not set
[  520.142791] VDD1: ramp_delay not set
[  520.502593] VDD1: ramp_delay not set
[  523.062896] VDD1: ramp_delay not set
[  523.362701] VDD1: ramp_delay not set
[  526.143035] VDD1: ramp_delay not set

I have observed this on GTA04 while it is reported to occur on
N900 as well: https://bugzilla.kernel.org/show_bug.cgi?id=178371

This patch makes the warning appear only in debugging mode.

Change-Id: I29b9fcc6f5507bd9763d26d076d72e8ccb0e25ec
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit ba14fa1a57)
2018-03-22 11:14:38 +08:00
Matthias Kaehlcke
7256fb26c9 UPSTREAM: regulator: core: Add set_voltage_time op
The new op is analogous to set_voltage_time_sel. It can be used by
regulators which don't have a table of discrete voltages. The function
returns the time for the regulator output voltage to stabilize after
being set to a new value, in microseconds. If the op is not set a
default implementation is used to calculate the delay.

This change also removes the ramp_delay calculation in the PWM
regulator, since the driver now uses the core code for the calculation
of the delay.

Change-Id: I401ace81648be8e8eab2e4bd3a0f41ed9766fae1
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 73e705bf81)
2018-03-22 11:14:38 +08:00
Matthias Kaehlcke
d8b6c0af69 UPSTREAM: regulator: core: Don't skip set_voltage_time when ramp delay disabled
The current code assumes that only the ramp_delay is used to determine
the time needed for the voltage to stabilize. This may be true for the
calculation done by regulator_set_voltage_time_sel(), however regulators
can implement their own set_voltage_time_sel() op which would be skipped
if no ramp delay is specified. Remove the check in
_regulator_do_set_voltage(), the functions calculating the ramp delay
return 0 anyway when the ramp delay is not configured.

Change-Id: Ia15f06f27b5dfa230cd8c7f548965a8fa283c263
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit d89564efe7)
2018-03-22 11:14:38 +08:00
Matthias Kaehlcke
8681485ecb UPSTREAM: regulator: core: Simplify error flow in _regulator_do_set_voltage()
If the voltage can not be set jump to the end of the function. This
avoids having to check for an error multiple times and eliminates one
level of nesting in a follow-up change.

Change-Id: Icead960f8403e2e962cd94fc516a5f633f5c3fc7
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 31dfe686ed)
2018-03-22 11:14:38 +08:00
Matthias Kaehlcke
4091ac228d UPSTREAM: regulator: core: Use local ops variable in _regulator_do_set_voltage()
Change-Id: I3539bd69bedac7edcda55987b293f5588e749f3e
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 57995a4860)
2018-03-22 11:14:38 +08:00
Wyon Bi
2ad329307f drm/rockchip: lvds: clean up pinctrl handling on px30
Change-Id: I2388110526b7e6e6a9839dfee1cbcb866c93dd27
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-03-22 11:13:52 +08:00
Wyon Bi
e4d312108f arm64: dts: rockchip: px30-android: add route_rgb node
Change-Id: Ic3b8763f5a01282a339fa4b1c15fa24fda256c76
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-03-22 11:13:52 +08:00
Wyon Bi
22f04ad334 arm64: dts: rockchip: px30: add rgb node
Change-Id: I3bc1bd408bd97dcd18293efc258635d1f68766b3
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-03-22 11:13:52 +08:00
Wyon Bi
9b9fea95bf drm/rockchip: rgb: Add support for PX30
Change-Id: I56f8edccdc1bca477c81c44a3bcaa7287c7dd7ba
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-03-22 11:13:52 +08:00
Xu Hongfei
ed107f0e86 camera: rockchip: change gc2415 fps to 20fps for the test of cts/vts
Change-Id: Ia70e9abb9a5e41e1e79267e8bfaa4dbbf4659977
Signed-off-by: Xu Hongfei <xuhf@rock-chips.com>
2018-03-22 09:52:21 +08:00
JinSen Chen
fd3618748b ARM: dts: rk3288-android: Add system/vendor partition nodes
Change-Id: Ibb6b1449a11c195a9316583270b82120b17f7cbb
Signed-off-by: JinSen Chen <kevin.chen@rock-chips.com>
2018-03-22 09:51:47 +08:00
Jerry Xu
244bfe93a4 ARM: dts: rk322x: add tsp support
Change-Id: I8fecbd1f5a792c3e2810b552b72873d1c4eed73c
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-03-21 21:09:13 +08:00
Jerry Xu
865806b7db arm64: dts: rockchip: add tsp support for rk3328
Change-Id: I981d8fb53b44d79bc1a425b93699a30de6982dff
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-03-21 20:56:17 +08:00
Jerry Xu
7af07167d8 Documentation: media: rockchip: Documentation for TSP
Change-Id: I65bb0821e882e842324dc7f23140174e6bc751ca
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-03-21 20:54:52 +08:00
Jerry Xu
6c5af216e1 media: rockchip-tsp: add tsp driver
Change-Id: I22ea801c6d5b21edd41149dc4dca897c544907c9
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2018-03-21 20:52:31 +08:00
Felipe Balbi
524ec9aad4 UPSTREAM: usb: gadget: u_ether: remove interrupt throttling
According to Dave Miller "the networking stack has a
hard requirement that all SKBs which are transmitted
must have their completion signalled in a fininte
amount of time. This is because, until the SKB is
freed by the driver, it holds onto socket,
netfilter, and other subsystem resources."

In summary, this means that using TX IRQ throttling
for the networking gadgets is, at least, complex and
we should avoid it for the time being.

Change-Id: Ice4107af47309054e67f1ab22cc7c2c6a393263d
Cc: <stable@vger.kernel.org>
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Suggested-by: David Miller <davem@davemloft.net>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit fd9afd3cbe)
2018-03-21 20:50:12 +08:00
Zheng Yang
c8da07269b phy: rockchip: inno-hdmi: no need to or efuse phy flag shift
The phy flag shift offset is defined in dts file, there is
no need to or the shift in the phy driver.

Change-Id: I13a33a536dabea68adf07a73cc2d13439719c589
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-03-21 20:48:57 +08:00
Zheng Yang
d2e6be70ae ARM: dts: rk322x: rename phy_flag to hdmi_phy_flag
Change-Id: I911d1e65778126521a1842d5ee7d3effee18dc91
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-03-21 20:48:57 +08:00
Sandy Huang
8db42d7949 drm/rockchip: vop: add support mcu register config
For px30 and rk3308

Change-Id: Ic19bfb871207c778842531a170eb92792139e862
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-03-21 20:44:55 +08:00
Xing Zheng
4da6b9253e arm64: rockchip_linux_defconfig: enable rk3308 acodec
Change-Id: If14a78bec87aefdb2bcf0ed283a8a1e45c20b6e5
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-03-21 19:47:46 +08:00
Xing Zheng
103450b92e arm64: dts: rockchip: Add acodec node for rk3308
Change-Id: I76f4a877711d33620bdef295e9047bdba26d4da4
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-03-21 19:47:03 +08:00
Putin Lee
56961708dd ARM: dts: rockchip: enable rga device node for rk3229-evb-android
Change-Id: I6063f701e49d8bb862012028f3584b54be2c6aa7
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2018-03-21 19:43:46 +08:00
Putin Lee
c5b55cfaa7 ARM: dts: rockchip: add rga node for rk322x
Change-Id: I26edff00d84d2368da2d3b9c55b90e386a347003
Signed-off-by: Putin Lee <putin.li@rock-chips.com>
2018-03-21 19:43:37 +08:00
Chris Zhong
e9a6000ec5 arm64: dts: rockchip: support rk3308-evb-rev1 board
Change-Id: I4ba8107b667847506d2d5189b83ee434607ae958
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2018-03-21 16:46:13 +08:00
Meng Dongyang
a23e379ba3 usb: dwc2: set op_state to peripheral when resume
The operation mode of controller will change to peripheral when
resume if PD is power off during suspend, current code disconnect
hcd and set lx state to L3 in this case to make sure the controller
will be reinit in device mode, but that's not enough, the op_state
is still host which is change when init or ID change interrupt
occur. If the ID change happened after suspend the driver would
miss the interrupt, so when the application call the pullup function
to stop gadget and start again to change to another function, the
disconnect gadget operation can't be done and the gadget restart
directly. This will result in NULL point when gadget work. This
patch set op_state to OTG_STATE_B_PERIPHERAL when resume in this
case.

Change-Id: Ifbafb7fae43d634cfa879c9a066d1e114db4196e
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2018-03-21 16:42:50 +08:00
Andy Yan
5f6721903a arm64: configs: add rk3308_linux_defconfig
Change-Id: I53e3fe76ca157904941a3c03b8bdde81625fb6c9
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-03-21 14:20:45 +08:00
Zhou weixin
244f83c3f5 arm64: dts: rockchip: add always-on vccio_sd for uart debug on PX30/RK3326 boards
Change-Id: Ied5cc8f0cc3fb4a00aef3cd14846c2ead0e7a95e
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-03-21 11:26:46 +08:00
Tao Huang
3fa24cc540 Revert "ASoC: rockchip: i2s: protect I2S_XFER_TXS/I2S_XFER_RXS with mutex"
This reverts commit 686662c6f1.

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
in_atomic(): 1, irqs_disabled(): 128, pid: 385, name: FastMixer
2 locks held by FastMixer/385:
 #0:  (snd_pcm_link_rwlock){......}, at: [<ffffff9008f4130c>] snd_pcm_stream_lock+0x5c/0x68
 #1:  (&(&substream->self_group.lock)->rlock){......}, at: [<ffffff9008f41314>] snd_pcm_stream_lock+0x64/0x68
CPU: 4 PID: 385 Comm: FastMixer Not tainted 4.4.120 #4996
Hardware name: Rockchip RK3399 Excavator Board edp (Android) (DT)
Call trace:
[<ffffff900808cf7c>] dump_backtrace+0x0/0x2b4
[<ffffff900808d244>] show_stack+0x14/0x1c
[<ffffff90085670bc>] dump_stack+0xa8/0xd8
[<ffffff90080ead48>] ___might_sleep+0x178/0x17c
[<ffffff90080eae08>] __might_sleep+0xbc/0xd4
[<ffffff900935a6d0>] mutex_lock_nested+0xa4/0x504
[<ffffff9008fa431c>] rockchip_i2s_trigger+0x164/0x3d0
[<ffffff9008f89960>] soc_pcm_trigger+0x188/0x1b8
[<ffffff9008f3df74>] snd_pcm_do_start+0x54/0x68
[<ffffff9008f3ddcc>] snd_pcm_action_single+0x50/0x98
[<ffffff9008f3eafc>] snd_pcm_action+0x50/0x150
[<ffffff9008f49824>] snd_pcm_start+0x20/0x28
[<ffffff9008f4f5e0>] snd_pcm_lib_write1+0x4a4/0x508
[<ffffff9008f4f6d0>] snd_pcm_lib_write+0x8c/0xac
[<ffffff9008f3fd0c>] snd_pcm_ioctl_xferi_compat+0x188/0x35c
[<ffffff9008f49374>] snd_pcm_ioctl_compat+0x32c/0x7bc
[<ffffff90082f2de8>] compat_SyS_ioctl+0x1f4/0x258
[<ffffff90080832f0>] el0_svc_naked+0x24/0x28

Change-Id: Id4ad668bb5b8cdbb79aecc1d00fed200acf0d6da
2018-03-21 10:45:13 +08:00
Xing Zheng
2aec620881 ASoC: rk3308_codec: Add bindings documentation for RK3308 audio codec
Change-Id: I5163dcf9f463ef75120d4c29581f5db3eceb5c1c
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-03-21 09:27:44 +08:00
Xing Zheng
b9d0976101 ASoC: codecs: Add RK3308 internal codec driver
This adds support for the RK3308 audio codec.

Change-Id: Ieccdebaa27f4a46f6de9406046a6e02e20398013
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-03-21 09:27:44 +08:00
David Wu
61c942ad00 arm64: dts: rk3308: Add mac node at dtsi level
Change-Id: I6023ccfb6d318ede47693c5fe57a481d641df22e
Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-03-20 21:04:16 +08:00
Nickey Yang
525c583992 ARM64: dts: rockchip: remove hdmi-codec node on rk3399-sapphire-excavator-linux and rk3399-videostrong-linux
hdmi_sound is defined in "rk3399-sapphire.dtsi"
So we do not need to define it again.

Change-Id: Ieb7e11240d06d64c82954ee725589b667480a4cc
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2018-03-20 21:02:36 +08:00
Nickey Yang
52a7c89b37 ARM64: dts: rockchip: add rt5640 related nodes for vs-rk3399
Change-Id: Ief8e698e5ff64a059a07fa1bf5eada87b3bf5a2c
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
2018-03-20 21:00:45 +08:00
Zhou weixin
ac704a8703 drivers/input/touchscreen/gsl3673_800x1280: reduce crrent in sleepmode
Change-Id: Id7da8a686574b539aeedf4da0ea34e1d8ff69831
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-03-20 20:59:15 +08:00
Shawn Lin
acac4351e6 clk: rockchip: Don't set invalid cached phase
We cache the invalid cached phase when the clock provider be
reparented from orphan to its real parent in the first place,
thus we may mess up the initialization of MMC cards since we
only set the default sample phase and drive phase later on.
So we should skip to restore the invalid phase.

Change-Id: I2d995a4ab53b824737718482f35fcaaf84767dfb
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2018-03-20 20:56:35 +08:00
Shawn Lin
84901c7616 FROMLIST: clk: Don't show the incorrect clock phase
It's found that the clock phase output from clk_summary is
wrong compared to the actual phase reading from the register.

cat /sys/kernel/debug/clk/clk_summary | grep sdio_sample
sdio_sample     0        1        0 50000000          0 -22

It exposes an issue that clk core, clk_core_get_phase, always
returns the cached core->phase which should be either updated
by calling clk_set_phase or directly from the first place the
clk was registered.

When registering the clk, the core->phase getting from ->get_phase()
may return negative value indicating error. This is quite common
since the clk's phase may be highly related to its parent chain,
but it was temporarily orphan when registered, since its parent
chains hadn't be ready at that time, so the clk drivers decide to
return error in this case. However, if no clk_set_phase is called or
maybe the ->set_phase() isn't even implemented, the core->phase would
never be updated. This is wrong, and we should try to update it when
all its parent chains are settled down, like the way of updating clock
rate for that. But it's not deserved to complicate the code now and
just update it anyway when calling clk_core_get_phase, which would be
much simple and enough.

Change-Id: I21e8899f4dc6cb0d244ea8c9741337b17da3308d
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Jerome Brunet <jbrunet@baylibre.com>
(cherry picked from git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git
commit 1f9c63e8de)
2018-03-20 20:56:19 +08:00
Shawn Lin
6a0dbbc7e1 arm64: dts: rockchip: remove always-on and boot-on from vcc{io}_sd of PX30/RK3326 boards
vccio_sd and vcc_sd are well better controlled by MMC core
and please don't bother taking care of them instead, otherwise
reboot w/ a working SD3.0 card will fail to respond the correct
OCR in the first place as missing a proper power removal.

Change-Id: I9efa11e25198b66e21538bd6603a3bab6638dc5f
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2018-03-20 20:51:03 +08:00
Algea Cao
6ad9ec862c drm/rockchip: tve: get vdac adjust value from efuse
Change-Id: Idf50443557cfc73fb47613027785bbf88e49f567
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-03-20 20:50:19 +08:00
Algea Cao
ef6e3f4cef ARM: dts: rk322x: tve support get dac adjust value
Efuse byte 29 bit 3-7 is used for tve dac.

Change-Id: Ic119b25ae8b74969ff7968d8772f7a008d3c920c
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-03-20 20:50:19 +08:00
Sandy Huang
38a1973ae2 drm/rockchip: 3229 vop: fix mistake fild when in interlace mode
set frame effect to fix mistake fild when in interlace mode

Change-Id: I74143cc28cbd9a7864a1df57979f3888137c141c
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-03-20 20:46:55 +08:00
Sandy Huang
ac1f715f53 drm/rockchip: vop: fix lb mode config error
when video width is bigger than 3840 the linebuffer mode
should be LB_YUV_3840X5.

Change-Id: I27dce8a6fcb7f6f5b8d196671a515c68f188c101
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-03-20 20:46:37 +08:00
Wyon Bi
6ee21b2eae drm/rockchip: vop: Fix bcsh_out_mode register field definitions
Change-Id: I5436d748be938ee5795ce7b3fd49f582fad58bdf
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2018-03-20 20:46:07 +08:00
Huang jianzhi
cd028dbdac ARM: dts: rockchip: rk3229-evb-android: Modify pwm frequency from 40k to 200k
Change-Id: I53a363b1c54165189fb246ed7030c372786badd2
Signed-off-by: Huang jianzhi <jesse.huang@rock-chips.com>
2018-03-20 14:36:20 +08:00
Xu Hongfei
710c5332ee camera: rockchip: change gc0312 fps to 20fps for the test of cts/vts
Change-Id: Ic409f1ff0918482367da10cd3d7f07ef957a34b1
Signed-off-by: Xu Hongfei <xuhf@rock-chips.com>
2018-03-20 14:35:57 +08:00
Zheng Yang
41ada5352f phy: rockchip: inno-hdmi: fix vco calculating in recalc_rate
On 32bit platform, vco may be out of range. The variable type
of vco needs to be set to u64.

Change-Id: I2f6b967278986bb77bf74c7a11794fc4d73645db
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-03-20 14:29:43 +08:00
Tao Huang
e07667aa2d usb: bc: Fix compile error when !DWC_OTG_310
Change-Id: I726d459a5e9a7043bc6543fe58fee51b8cc5f034
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-03-20 14:25:44 +08:00
Sandy Huang
91783f5900 drm/panel: simple: add support spi init screen
Change-Id: I58c77b5042d3a7456b553f369f7a44286472f582
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-03-20 14:18:02 +08:00
Sandy Huang
6200d44596 drm/panel: simple: rename dsi panel cmd name
panel init cmds is not only for dsi panel, some mcu screen and
spi screen also need init cmds, so we update this panel init cmd
name and reuse this part logic.

Change-Id: I9e633647fa3f3d92eb90b443a8a5da99a24a3b42
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-03-20 14:16:32 +08:00