Commit Graph

593871 Commits

Author SHA1 Message Date
Xing Zheng
92cfd751b4 clk: rockchip: rk3399: To prevent the dclk_vopx below the FRAC clock
In most case, we use the VPLL directly for HDMI or DP, and the
the frac dclk will bring the big jitter for dclk. So we don't need
to use the dclk_vopx_frac.

Change-Id: I0d27e5fcb8b4c9a28c0102074c1d6da9426386f4
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-05-10 19:13:12 +08:00
Heiko Stuebner
bdba697e30 FROMLIST: clk: rockchip: make rk3399 vop dclks keep their rate on parent rate changes
The rk3399 hdmi phy is supplied by the vpll directly and needs to adapt
that frequency depending on the selected resolution on the hdmi output.
For the hdmi-phy the vpll frequency is supplied unchanged without
any dividers being present there.

The vpll also is one of the sources the general display clock of the
visual output processor (vop) and as it is somewhat special for
display operations possibly also the preferred pll source. Here a divider
is available between the pll-mux and the vop clock, so that this part
can adapt the resulting frequency if needed.

So to keep the vop clock in line with the target rate, set the newly
introduced CLK_KEEP_REQ_RATE flag for the dclk_vop clocks on rk3399.

(am from https://patchwork.kernel.org/patch/8993771/)

Change-Id: Iba9a179b764472f22d7531eb0c662dcd982433d4
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-05-10 19:12:08 +08:00
Heiko Stuebner
b7a2aa66b2 FROMLIST: clk: adjust clocks to their requested rate after parent changes
Given a hirarchy of clk1 -> [div] -> clk2, when the rate of clk1 gets
changed, clk2 changes as well as the divider stays the same. There may
be cases where a user of clk2 needs it at a specific rate, so clk2
needs to be readjusted for the changed rate of clk1.

So if a rate was requested for the clock, and its rate changed during
the underlying rate-change, with this change the clock framework now
tries to readjust the rate back to/near the requested one.

The whole process is protected by a new clock-flag to not force this
behaviour change onto every clock defined in the ccf.

(am from https://patchwork.kernel.org/patch/8993761/)

Change-Id: Ie2636710cb4e66815ee45b28ec86eeaaa47c55c7
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-05-10 19:11:30 +08:00
Heiko Stuebner
dd7fe1d5e1 FROMLIST: clk: fix inconsistent use of req_rate
The req_rate property seems to be made to hold the rate requested through
clk_set_rate. Currently it gets initialized in clk_init to the clocks
current rate and then adapted in clk_set_rate calls. Orphan clocks and
their children get initialized to a rate of 0 and req_rate never gets
re-set when these lose their orphan-status.

Initializing req_rate to the clocks rate also is unintuitive as it just
copies the value that is already in the rate property and also looses the
information if a component actually requested a specific rate.

So separate the requested rate and only set it in clk_core_set_rate_nolock
when a real rate gets requested. The users of the req_rate __clk_put and
clk_set_rate_range that adjust a clock based on that value use req_rate
at first and fall back to rate if no rate had been requested now.

(am from https://patchwork.kernel.org/patch/8993751/)

Change-Id: I9e345e1e9d0c101d5c3c7064b6c2d2724f9eac4f
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2016-05-10 19:11:09 +08:00
Caesar Wang
0bc13c72ec arm64: dts: rk3399: disabled the edp on evb2 cros
As the pervious discussed, disabled the edp node for dts. Otherwise
you connected the mipi panel will show white since the edp will force
to use the extend screen.

Change-Id: I3e716f4a9d92d4faae5d7a12d792c71fe16f489e
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-10 18:28:35 +08:00
Caesar Wang
85c1722608 ARM64: rockchip_cros_defconfig: enable the regulator LP8752
The gpu can't work with chromeos since the regulator has not enabled.
Okay, the gpu can work for chromeos with rk3399 evb2 on now.

Change-Id: If23affff151a99206b86c2a3f40c21752bdc2d54
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-10 18:28:06 +08:00
Finley Xiao
9781d414b4 ARM64: rockchip_defconfig: enable THERMAL_GOV_USER_SPACE
Change-Id: I572ef6030ec1e72b7f46bc00d887d91e94c12c0c
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2016-05-10 18:27:37 +08:00
Zheng Yang
49665d106f video: rockchip: hdmi: fix compile warning
Change-Id: I3573f4d42074b656420cc5567d73e660232f2b84
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2016-05-10 18:27:08 +08:00
Mark Yao
cb794081c6 drm/rockchip: vop: fix compile warning
fix warning:
    warning: 'ret' may be used uninitialized in this function

Change-Id: I743ed9788366322beeceddd556fae0c2a7cdd463
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-10 18:05:36 +08:00
Yakir Yang
09e82f8935 drm/rockchip: rga: fix 'ret' may be used uninitialized in probe time
Change-Id: I3eeb2abf2b5f098d3c2298673eeecd130ad99cb7
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-05-10 16:10:47 +08:00
xuhuicong
2dde9ade48 video: rockchip: hdmi: v2: solve 480i/576i 10bit output abnormal
Change-Id: I60ee3b8882bc16bab48a51530635f50958bacfd3
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:35:13 +08:00
xuhuicong
4295210b03 ARM64: dts: rk3399-android: add HDMI device node support
Change-Id: I29b46d097351c55df66782d55c004c356049fb37
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:34:12 +08:00
xuhuicong
c06b84a124 ARM64: dts: rk3399: add HDMI DDC/CEC pinctrl
Change-Id: Ic3417a5153ceabad3f9c69ffe5b6fa542e7a84c1
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:31:51 +08:00
xuhuicong
972bdf6aef video: rockchip: hdmi: misc clean up to hdmi driver
remove unused dts properties parsed code and print an error message
when enable hdmi clk error

Change-Id: I92f37f5c1dc2cd8dbf18744f4fd17a52bc25080f
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:28:06 +08:00
xuhuicong
e659022b93 video: rockchip: hdmi: support rk3399 hdmi
RK3399 hdmi register layout is similar with rk3288 and rk3368, so most
code can reuse. but hdmi resign is upgrade from 20 to 21 so it has a
little diffrence. and the hdmi phy clk is Independent from dclk too.

Change-Id: I83b30c92d9572fc9ceaf52777d224e5cec1823be
Signed-off-by: xuhuicong <xhc@rock-chips.com>
2016-05-10 10:27:18 +08:00
Elaine Zhang
fb1738eb00 regulator: rockchip: lp8752: fix up the compile warning
fix up the warning:
drivers/regulator/lp8752.c: In function 'lp8752_buck_set_mode':
drivers/regulator/lp8752.c:93:2: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: Iee9f69791bbcea2e6b3a16713b76e93cfc0a2b67
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2016-05-10 09:20:40 +08:00
Huang Jiachai
e295c725bd video: rockchip: fix compile warning: may be used uninitialized
Change-Id: Ia162b79443e8361d93575963c6603999ffc3e405
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2016-05-09 17:10:14 +08:00
Zhiqin Wei
a3926cf98e drivers: video: rockchip: rga2: Fix compile warning
Change-Id: I3622b70a5b15014ccb5fb9fc09bced97db194dc8
Signed-off-by: Zhiqin Wei <wzq@rock-chips.com>
2016-05-09 16:43:56 +08:00
Simon
ad8d04570c iommu: rk-iommu: fix build warning when enable CONFIG_CC_OPTIMIZE_FOR_SIZE
Change-Id: Iff20759a625df9f6c6138eaa8d963d67a483c01d
Signed-off-by: Simon <xxm@rock-chips.com>
2016-05-09 16:32:37 +08:00
Sugar Zhang
5cd1658890 ASoC: es8316: fix warning: 'val' may be used uninitialized
Change-Id: If7bdba3cd7a23879a2cf41202d21fadaef614f23
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2016-05-09 14:15:50 +08:00
Alpha Lin
4e6f3ce852 rockchip/vcodec: seperate power-on timer for independent hw
Seperate power-on timer for rkvdec and vpu when they are not
in combo mode (definitly independence).

Before this patch, h/w power off schedule will be interrupted
by the other h/w, and power off will be triggered when h/w
still running a task.

Change-Id: I29124e90afccc727d2e7a04098727aa4a2c3e8bb
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
2016-05-06 09:29:46 +08:00
Caesar Wang
9be1984799 ARM64: rockchip_cros_defconfig: enable the GOV_POWER_ALLOCATOR
Enable the GOV_POWER_ALLOCATOR for rk3399.

Change-Id: I8f7e457a09543d730e30c1ce74a9b5dffba57e10
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-05 19:24:02 +08:00
Caesar Wang
b7f56e4165 ARM64: config: enable the devfreq_thermal for rockchip
It will enable the devfreq thermal that's generic devfreq cooling
mechanism through frequency reduction for devices using devfreq.
This will throttle the device by limiting the maximum allowed DVFS
frequency corresponding to the cooling level.

Change-Id: Ia017ecf46599700382b9604e375193135f7d1d24
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-05 19:22:51 +08:00
chenzhen
4f613eb82e MALI: rockchip: add "platform specific code" of rk platform
Change-Id: Ia58cba15b43f875ac572a3b35807b5ec48e3df01
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2016-05-05 19:20:46 +08:00
Wu Liang feng
a5bf8df9a7 ARM64: dts: rk3399-android: set usbdrd_dwc3_0 in peripheral mode
Change-Id: I775283d3b3c8180e352281568d1b77ab5c5a544c
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
2016-05-05 18:41:01 +08:00
Shawn Lin
a7a3b1a72d mmc: sdhci-of-arasan: fix using sleep function whthin spinlock
Let's use unlock/lock around phy APIs as them will call
mutex which is sleepable casuing failure of kernel debug
check.

Change-Id: Ic7670bfc9ed763cc9bdec53f85f553bc0be1416c
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-05-05 14:47:31 +08:00
Mark Yao
c1b1c53c7e drm/rockchip: vop: fix pin_pol config
rgb/edp/hdmi/mipi pin_pol is removed after (e5683dd FROMLIST:
drm/rockchip: get rid of rockchip_drm_crtc_mode_config), that
is wrong.

This patch re-add those pin_pol config.

Change-Id: I46f3e32ad405f4b6e2f76110757248e8516693c4
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-05 11:09:29 +08:00
Zain Wang
6423c41361 regulator: mp8865: update mp8865 enable_time
enable_time is controlled by capacitance connected to Pin SS,
it described more detailedly in mp8865 datasheet Page 15.
Capacitance is 12nF now.

Change-Id: Ib604a4e109db7ab125104e5cf3067864fefb6fe0
Signed-off-by: Zain Wang <wzz@rock-chips.com>
2016-05-04 19:29:54 +08:00
xiaoyao
0de499f937 ARM64: dts: rk3399: support bluetooth for rk3399-evb
Change-Id: Id1eb05cc4cc39d026b6c26f1635760eed38c8968
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
2016-05-04 18:51:32 +08:00
Mark Yao
47510f4818 drm/rockchip: vop: Initialize vskiplines to zero
There is a path that use vskiplines with non-initialize.
That would cause vop abnormal behavior.

Change-Id: I53c6c575d6acc16aeae761dbb4867f3bc8bfe5ce
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:29:14 +08:00
Mark Yao
9bde4e671f drm/rockchip: vop: fix iommu crash with async atomic
On Async atomic_commit callback, drm_atomic_clean_old_fb will
clean all old fb, but because async, the old fb may be also on
the vop hardware, dma will access the old fb buffer, clean old
fb will cause iommu page fault.

Reference the fb and unreference it when the fb actuall swap out
from vop hardware.

Change-Id: I585786884295060efdaef0a00c3cbd75244399d7
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:27:54 +08:00
Mark Yao
ed547bb16f drm/rockchip: vop: support plane zpos property
Change-Id: Idd0265020a591ce5b34d117442104f625e331119
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:24:59 +08:00
Mark Yao
751837be5e drm/rockchip: vop: rk3399: add area plane
Change-Id: Ia6f77353363e25423ac29129372bc510565682f8
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:24:13 +08:00
Mark Yao
574b3c4c2a drm/rockchip: vop: rk3288: add area plane
Change-Id: Iac8fde019020d8f1a671d52c1a4d91ad2d050d43
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:22:57 +08:00
Mark Yao
6c060b5946 drm/rockchip: vop: support multi area plane
The series vop of VOP_FULL framework support area plane, such as
RK3288 and RK3399, one group of area planes share same hardware,
reuse the hardware on different scanout time, this design is
useful to support mulit planes with low hardware consume.

Change-Id: Ie53211ce9ed22d03f7668637efbb7c95d9a8eb5b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:19:10 +08:00
Mark Yao
eaf6764dee drm: introduce share plane
The plane hardware is used when the display scanout run into plane active
scanout, that means we can reuse the plane hardware resources on plane
non-active scanout.

Because resource share, There are some limit on share plane: one group
of share planes need use same zpos, can't not overlap, etc.

We assume share plane is a universal plane with some limit flags.
people who use the share plane need know the limit, should call the ioctl
DRM_CLIENT_CAP_SHARE_PLANES, and judge the planes limit before use it.

Change-Id: Iecc3d8e7f1ce29d567cdbad689ba4dbad3d594e1
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-04 18:16:50 +08:00
Mark Yao
e5683dd6c1 FROMLIST: drm/rockchip: get rid of rockchip_drm_crtc_mode_config
We need to take care of the vop status when use
rockchip_drm_crtc_mode_config, if vop is disabled,
the function would failed, that is terrible.

Save output_type and output_mode into rockchip_crtc_state,
it's nice to make them into atomic.

Conflicts:

	drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
	drivers/gpu/drm/rockchip/dw-mipi-dsi.c
	drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
	drivers/gpu/drm/rockchip/inno_hdmi.c
	drivers/gpu/drm/rockchip/rockchip_drm_drv.h
	drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Change-Id: I43c49a92b2b9df02ce8a055bd16948b400ab0f47
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
(am from https://patchwork.kernel.org/patch/8844321/)
2016-05-04 18:15:26 +08:00
Caesar Wang
629b58a49a UPSTREAM: arm64: Enable the timer on Rockchip architecture
On the RK3368 SoC, support the APB timers for rockchip platform.

Change-Id: I2bee09c4140994d3d2e23f1820663230d82547de
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit c840f28bbf)
2016-05-03 17:48:47 +08:00
Shawn Lin
e19fe663b1 UPSTREAM: clocksource/drivers/rockchip: Add err handle for rk_timer_init
Currently rockchip_timer doesn't do some basic cleanup work when
failing to init the timer. Let's add err handle routine to deal
with all the err cases.

Change-Id: I73bbd32592e6fe157a8d166743db3fc130d0004c
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit 522ed95c26)
2016-05-03 17:48:47 +08:00
Daniel Lezcano
c21cd84a43 UPSTREAM: clocksource/drivers/rockchip: Add COMPILE_TEST option
Increase the compilation test coverage by adding the COMPILE_TEST option.

Due to the dsb() usage in the driver, this driver is only compilable on
ARM and ARM64.

Change-Id: I5f2c1a5353a7b20c80dcfc3cd3900510f56a0729
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 40ada2aac5)
2016-05-03 17:48:47 +08:00
Caesar Wang
6d18246823 UPSTREAM: clocksource/drivers/rockchip: Remove dsb() usage
The dsb() instruction is pointless in this code.

Remove it.

That also fixes the ARM64 compilation issue.

Change-Id: I0c8e33abe0d976714f4df288fe5ac52ffb8ded5b
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 23b8f81f38)
2016-05-03 17:48:47 +08:00
Caesar Wang
2e2e74d27f UPSTREAM: clocksource/drivers/rockchip: Make the driver more readable
Let's checkstyle to clean up the macros with such trivial details.

Change-Id: I6cf0c7cf5e48bcb4d52a483fdba7c4ce26677f06
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit a0d2216ec0)
2016-05-03 17:48:47 +08:00
Caesar Wang
e144ed1742 arm64: dts: rk3399: fix the incorrect crit temperture
Fix the incorrect critial temperture for gpu thermal.

Change-Id: I9ecfc107afcdbb421ae40cc796c40a39d6d68677
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2016-05-03 17:48:04 +08:00
Elaine Zhang
a8b948f89f ARM64: dts: rk3399: support for evb rev1 and evb rev2
For evb1
- rk3399-evb-rev1-android.dts
- rk3399-evb-rev1-cros.dts

For evb2
- rk3399-evb-rev2-android.dts
- rk3399-evb-rev2-cros.dts

Change-Id: I95a2d4229c0a7581ca5ae777340f4d26e86503ba
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2016-05-03 17:39:49 +08:00
Huang, Tao
025cebcd42 ARM64: rockchip_defconfig: enable THERMAL_DEFAULT_GOV_FAIR_SHARE
Change-Id: Ide2ca2361cb13454d0e3269a929a57463da53985
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-05-03 16:34:49 +08:00
Zhiqin Wei
02b93726be ARM64: dts: rk3399: android: Enable rga device
Change-Id: I7c348158c410b8bd32a574a607a975fe5e8b74a5
Signed-off-by: Zhiqin Wei <wzq@rock-chips.com>
2016-04-28 11:59:39 +08:00
Shawn Lin
931cefd0d5 ARM64: dts: rk3399-evb: add mmc-hs400-enhanced-strobe support
This patch enables mmc-hs400-enhanced-strobe for rk3399-evb, so
enhanced strobe function will be used if any eMMC 5.1 is probed.

Change-Id: If5f30e0d759f7a9850bec82c3d53d9bb26ba8c3d
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-04-28 11:50:27 +08:00
Shawn Lin
8714599140 mmc: add hs400 enhanced strobe support for mmc subsystem
HS400 enhanced strobe is a new feature introduced by eMMC
spec 5.1, let's implement it and enjoy it!

please note that currently I have no much bandwith to split this
big patch into patchset. So please use, test and applied! Thanks.

Change-Id: I874f18a617a1b69e3ff56f5c134feb817b6985b9
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-04-28 11:49:40 +08:00
Shawn Lin
ddfc5a9bcc Documentation: mmc: add mmc-hs400-enhanced-strobe
Let's add some description of mmc-hs400-enhanced-strobe
which can be used to support hs400 enhanced strobe function
introduced by eMMC spec 5.1

Change-Id: I03b8e803071dc7034bddf655892b12eabcaa852a
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-04-28 11:48:58 +08:00
Huang, Tao
1b96a26c65 netfilter: xt_qtaguid: fix crash on non-full sks
If sock is request_sock then kernel will crash. So use
skb_to_full_sk() and sk_fullsock() helper to make sure
we get full sock.

Change-Id: Iefd548e0591055b1a8031f0835c4dca7b9d42b61
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
2016-04-27 18:43:41 +08:00