Commit Graph

309732 Commits

Author SHA1 Message Date
Finley Xiao
f45930cdbc clk: rockchip: rk3308: Fix clk_uart_src parent clock
Change-Id: I147051b08ef67a80778b352424f36057a74fc5d0
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-23 21:06:36 +08:00
Finley Xiao
d5e8f70d5f clk: rockchip: rk3308: Add pclk_wdt
Change-Id: I1946b3550c11d6fde424c8493eaf925ff2dcfce4
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-23 20:39:26 +08:00
Algea Cao
dd37ccac7f drm/bridge: synopsys: dw-hdmi: Update criteria to determine whether uboot logo is on
If hdmi plug in when kernel starting, hdmi may be without output.
Because the old criteria that to determine whether uboot logo is
on is hdmi phy pll locked and hdmi is connected. But in some
platform(such as rk3229), hdmi phy pll is locked even hdmi phy
is power down. In this case, the old criteria is unreliable.

So we add a new criteria that check Frame Composer register.If
the register value is not 0, we think that uboot logo is on,
hdmi has been setup.

Change-Id: Ifaa27030e5f5d551bec8f971694ff5d9c34a7c1d
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-03-23 18:09:12 +08:00
Liang Chen
b2849bcc8d video: rockchip: vpu: Add devfreq feature for rk322x
Change-Id: Ic1de49c79b7447cdecbff0cf1cf49c2c594193df
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-03-23 17:24:32 +08:00
Tao Huang
85b2fa8c51 regulator: remove unused rk29-pwm-regulator
Change-Id: Ic16bc131ebd7efae66dea9098dc9c4516e60e0f1
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-03-23 12:13:36 +08:00
David Wu
e6f2796ef5 pwm: rockchip: Disable irq for pwm config
Add irq disabled protection at the PWM configuration, which can
speed up the PWM configuration and reduce the possibility of
interrupting the configuration.

Change-Id: I8ca3c4b9790b747c12804fa82b51456a0de7fb92
Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-03-23 09:23:36 +08:00
Matthias Kaehlcke
411da4b351 UPSTREAM: regulator: Allow for asymmetric settling times
Some regulators have different settling times for voltage increases and
decreases. To avoid a time penalty on the faster transition allow for
different settings for up- and downward transitions.

Change-Id: Iab14df27c8275945a31a55630ce3c926acf5828d
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-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 3ffad468cf)
2018-03-22 11:14:38 +08:00
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
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
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
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
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
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
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
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
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
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
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
Finley Xiao
310a0955e9 clk: rockchip: px30: Make usb480m critical
Gpu 480M is from usb480m and the source clocks should be always on
if change gpu frequency after power off pd.

Change-Id: I11b5b05381e1745919b7137a64e4d334786cf433
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-20 14:14:45 +08:00
Zhang Yunlong
01fc57fe3f soc: rockchip: rk_camera: correct macro definition
Change-Id: Ib7bba62d4f25905e5e42d5f76092eddeb8806ee9
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>
2018-03-20 14:13:22 +08:00
David Wu
e38aa951c8 pwm: rockchip: Make pwm pinctrl setting after pwm enabled
If the PWM pinctrl uses default state, the iomux setting will
be done at probe, the PWM may not be enabled at this moment.
It will make PWM into an intermediate state, destroy the default
hardware state, the PWM is not ready for work yet. So it is better
for doing PWM pinctrl setting after PWM enabled.

Change-Id: Iea34a7baf6a4d7df0c631f7f4fdab5b9d61bbd5f
Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-03-19 16:30:38 +08:00
Finley Xiao
86eabe311f clk: rockchip: rk3228: remove the flag ROCKCHIP_PLL_SYNC_RATE for GPLL
To slove the display shaking, when uboot logo display to kernel show.

Change-Id: Ifc97f72df27b4e8dbcd34ab8ed65ac027fd424d1
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-19 15:48:14 +08:00
Sandy Huang
2f4dee4910 drm/rockchip: fix kernel panic when drm driver probe failed
For some reason drm driver maybe probe failed, so the drm_dev is
null. this will lead to kernel panic when enter suspend function.

Change-Id: Ic529ba9103d27b0766189285bd6cf8e43b23b912
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2018-03-19 15:06:37 +08:00
Finley Xiao
40b3301c59 clk: rockchip: rk3228: Fix sclk_wifi div_width
Change-Id: I8e216249fbd588ce55660eba9911fc59aedc920d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-18 21:41:43 +08:00
Meng Dongyang
079b3c7cdb usb: dwc2: make hcd into L3 power off state when suspend
The controller will reset and run into error state if turn
off power when suspend in host mode. This patch stop hcd to
make the controller into L3 state to make sure that the
controller and driver state will reset when resume.

Change-Id: If66bc1a249e919f440ecde0c66f18dabde0b2e62
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
2018-03-16 17:51:16 +08:00
shengfei Xu
ab4a44bf83 power: rk817_charger: enable boost if charger offline
Change-Id: I43d1ded1098c7b37c40bc6a66949b77a0c1e1172
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-03-16 17:50:19 +08:00
Liang Chen
1641eb4fc2 PM / devfreq: adjust opp-table by board IR-Drop
Change-Id: I94280b3f4a122961c0201cf9f8fbf5dc34058581
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-03-16 17:49:29 +08:00
Liang Chen
3ccca07e3f cpufreq: dt: adjust opp-table by board IR-Drop
Change-Id: Ia51daad4bf5b73621875d1608cd0e486024fcf95
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-03-16 17:49:29 +08:00
Liang Chen
f31ed416e5 soc: rockchip: add support for adjust opp-table by board IR-Drop
The IR-Drop is always different between different boards, so we
need know the IR-Drop to adjust opp-table to guarantee stably
for the board.

Change-Id: I8ad05d30e15a7e62910a952cc6fa199d70129660
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-03-16 17:49:29 +08:00
Zhaoyifeng
5790f6182b drivers: rk_nand: update ftl for rk3226 and px30
1. Optimize the garbage processing.
2. Add data list for block manager.

Change-Id: I1c5563151e80dd3b3e941835dd93e2fe4eb4e20b
Signed-off-by: Zhaoyifeng <zyf@rock-chips.com>
2018-03-16 17:49:19 +08:00
Zheng Yang
595ad3137e phy: rockchip: inno-hdmi: fix 322x hdmi tmdsclk 27M PLL setting
On some chip, HDMI post PLL is not stable when it's vco is 1080M,
but it work ok when vco is 270M. We use a efuse bit to distinguish
these chip.

Change-Id: I143363d67e60747ee52d405edace3ec611de3e6e
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-03-15 19:09:47 +08:00
Zheng Yang
dcd0e2c2b5 phy: rockchip: inno-hdmi: manual power down RK3228 post-PLL with no uboot logo
Inno hdmi phy post pll is enabled by default on rk3228, it's need to
manual power down post pll if uboot logo is not shown.

Change-Id: I7ed4de2eae2d723f390dae44281281b9e81f4e1d
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-03-15 14:26:43 +08:00
Algea Cao
f27ca618fc phy: rockchip: inno-hdmi: Add rk3228 phy pll recalculate rate
Change-Id: Ifad3edda80e86dff39e8decd75d51a5670c12871
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
2018-03-15 14:25:14 +08:00
Shawn Lin
865523b715 BACKPORT: FROMLIST: clk: rockchip: Restore the clock phase after the rate was changed
There are many factors affecting the clock phase, including clock
rate, temperature, logic voltage and silicon process, etc. But clock
rate is the most significant one here, and the driver should be aware
of the change of the clock rate. As mmc controller need a fixed phase
after tuning was completed, at least before explicitly doing re-tune,
so this patch try to restore the clock phase by monitoring the event
of rate change.

Change-Id: Id1ccdfd2e8d4e2eb9f6a1923b3813138dbaf99f7
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/10269525/)
2018-03-15 11:31:58 +08:00
Finley Xiao
0e7eba3141 clk: rockchip: rk3308: Rename gmac to mac
Change-Id: I31e9fddcffde824c2b41bd3eddccf3a995cfb913
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-14 14:42:20 +08:00
Finley Xiao
ec51d82bdc clk: rockchip: rk3308: Add CLK_IGNORE_UNUSED for clocks with div50
Change-Id: I3b01a93741af7e66f57b5c93c33746d8cbe21bfe
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-03-14 14:05:04 +08:00