Commit graph

602,964 commits

Author SHA1 Message Date
Laurent Pinchart
fcb60baab3 UPSTREAM: drm/bridge: Make (pre/post) enable/disable callbacks optional
Instead of forcing bridges to implement empty callbacks make them all
optional.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
(cherry picked from commit c8a3b2ae07)

Change-Id: Id37cbb6114e69957dfd6b72c8bd7b66dcc6f0590
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-14 14:57:20 +08:00
Mark Yao
2ab91f190d drm/rockchip: vop: fixup error handle on crtc register
Change-Id: I969a3994360331f4ce66e7affcc9ed3869599777
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-14 11:47:04 +08:00
Jeffy Chen
2169a9db46 UPSTREAM: drm/rockchip: Reorder drm bind/unbind sequence
Current drm bind/unbind sequence would cause some memory issues.
For example we should not cleanup iommu before cleanup mode config.

Reorder bind/unbind sequence, follow exynos drm.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
[seanpaul fixed spelling typo in commit subject]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-11-git-send-email-jeffy.chen@rock-chips.com

(cherry picked from commit ccea91998c)

Change-Id: I8571a34419735f8b8a51666b31b91cbdb18250bd
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-14 11:47:03 +08:00
Mark Yao
8ecd10c962 drm/rockchip: backlight: fix modules compile error
Fixes:
error: redefinition of 'rockchip_drm_backlight_update'
error: redefinition of 'of_rockchip_drm_sub_backlight_register'

Change-Id: I4eeebc6075387f720acec597cee765e2a1a83b7c
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-14 11:47:02 +08:00
Mark Yao
abc940812c drm/bridge: analogix: fix modules compile error
sync to upstream commit:
  3424e3a drm: bridge: analogix/dp: split exynos dp driver to bridge directory

fix following modules compile error:

ERROR: "analogix_dp_enable_video_mute" [drivers/gpu/drm/bridge/analogix/analogix_dp_core.ko] undefined!
ERROR: "analogix_dp_config_interrupt" [drivers/gpu/drm/bridge/analogix/analogix_dp_core.ko] undefined!

Change-Id: I340d82f238485617604afd44047644adc9620f47
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-14 11:47:01 +08:00
Feng Mingli
f4adf1bc37 usb: dwc_otg_310: pcd: hold wake lock until phy suspended and clk disabled
When begin connecting to PC in device mode, the driver will hold a
wake lock to prevent system from entering deep sleep. If it fails
to connect to PC or doesn't detect the vbus, the driver will suspend
usb phy and disable usb clk, and release the wake lock.

If unlock the wake lock first, system may enter deep sleep before
suspend usb phy and disable usb clk. Then wake up system by pull
out the usb cable, it may cause usb interrupt abnormal.

TEST=rk3126c connect the usb charger into the charging interface,
after the system entered deep sleep, pull out the usb cable with
the following log:

irq 42: nobody cared (try booting with the "irqpoll" option)
CPU: 0 PID: 146 Comm: charger Not tainted 3.10.104 #133
[<c0014088>] unwind_backtrace+0x0/0xe0
[<c00118cc>] show_stack+0x10/0x14
[<c00b0be0>] __report_bad_irq+0x28/0xb8
[<c00b0e68>] note_interrupt+0x138/0x1cc
[<c00aef88>] handle_irq_event_percpu+0x2c0/0x2f4
[<c00aeff8>] handle_irq_event+0x3c/0x5c
[<c00b1a20>] handle_fasteoi_irq+0xbc/0x124
[<c00ae764>] generic_handle_irq+0x20/0x30
[<c000e4cc>] handle_IRQ+0x64/0x8c
[<c000853c>] gic_handle_irq+0x38/0x5c
handlers:
[<c042b3ec>] dwc_otg_common_irq
[<c0438704>] dwc_otg_pcd_irq
[<c03fab48>] usb_hcd_irq
Disabling IRQ #42

Change-Id: Id36717ae68e02226255c1207aeded0bd6fb356cd
Signed-off-by: Feng Mingli <fml@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-08-11 15:32:23 +08:00
Jacob Chen
5f173fa7d8 ARM: dts: rk3288-evb: set "system-power-controller" for act8846
PMIC should set "system-power-controller" in dts, otherwise
it couldn't be closed when system shutdown.

Change-Id: I3efd7efb1b1911621f21e8a741e2f6c2eebb60dc
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-11 15:00:38 +08:00
Zheng Yang
d954549584 drm/rockchip: hdmi: disable RK3368 2160P RGB444/YCbCr444/YCbCr422 mode
Change-Id: I573db9cd41031f45cac359fc9314491ebd1ba8fc
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-08-11 14:54:13 +08:00
Mark Yao
d1917fb492 drm/rockchip: vop: correct dclk_ddr define for rk3368
dclk_ddr is supported on rk3368 vop, it would effect the
display quality on YUV420 mode.

Change-Id: Ia624a1f397e732d80d3908b8e712ae79d3ad7948
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Reported-by: Huacong Yang <will.yang@rock-chips.com>
2017-08-11 10:01:48 +08:00
Elaine Zhang
a36a1a666f clk: rockchip: add special approximation to fix up fractional clk's jitter
From Rockchips fractional divider description:
  3.1.9  Fractional divider usage
  To get specific frequency, clocks of I2S, SPDIF, UARTcan be generated by
  fractional divider. Generally you must set that denominator is 20 times
  larger than numerator to generate precise clock frequency. So the
  fractional divider applies only to generate low frequency clock like
  I2S, UART.

Therefore add a special approximation function that handles this
special requirement.

Change-Id: I80260392539da9d8cab79a5f6e37534d003bdbd1
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-08-10 12:13:49 +08:00
Elaine Zhang
18138af79b clk: fractional-divider: allow overriding of approximation
Fractional dividers may have special requirements concerning numerator
and denominator selection that differ from just getting the best
approximation.

For example on Rockchip socs the denominator must be at least 20 times
larger than the numerator to generate precise clock frequencies.

Therefore add the ability to provide custom approximation functions.

Change-Id: I656a5851a3e2581b7f1b44bd67681ac00172873d
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-08-10 12:13:28 +08:00
Geliang Tang
cf30714766 UPSTREAM: clk: move the common clock's to_clk_*(_hw) macros to clk-provider.h
to_clk_*(_hw) macros have been repeatedly defined in many places.
This patch moves all the to_clk_*(_hw) definitions in the common
clock framework to public header clk-provider.h, and drop the local
definitions.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit 5fd9c05c84)

Change-Id: Ib0f9de8b9aeb30302b9d21e6668a35d18764517e
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-08-10 12:13:17 +08:00
Elaine Zhang
594ae9da1e dt-bindings: add documentation for rk3126 clock
This add bindings documentation for rk3126 SoCs.

Change-Id: I1ff436e123698ff7ed6c10366a2da6907d9199a6
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2017-08-10 12:12:50 +08:00
Mark Yao
acec133d76 arm64: dts: rockchip: rk3399-android: add secure memory
Change-Id: I247c1d4351d03196662f96fc95fc8ce35bc57326
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-10 11:50:38 +08:00
Mark Yao
03d6a385ab dt-bindings: rockchip: drm: add secure memory region
Change-Id: Ibbfae144d5b79972ffa913801c7054c8af4bcd41
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 16:38:06 +08:00
Mark Yao
0fc8ce4b39 drm/rockchip: gem: support secure memory
Change-Id: I91dfbbfbf5d13983edfb79585e9beb980566f784
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 16:36:50 +08:00
Mark Yao
258970afc5 drm/rockchip: gem: add get phys ioctl
Change-Id: Ic9b8c6acfaeb47ec720dbad3d8f5141ef7b13e5d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 16:35:04 +08:00
Mark Yao
2965ada189 drm/rockchip: gem: support force alloc cma buffer with flags
Change-Id: I4749eac53609f865d0d4230364b1cbaf39ee0955
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 16:34:59 +08:00
Sandy Huang
9cd1d94f3f drm/rockchip: lvds: RGB output should enable LVDS channel 1
Change-Id: Iaa7b95f1316fa77425992574288b3262d5af84e7
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-08-09 16:16:12 +08:00
Sandy Huang
6e49287024 drm/rockchip: lvds: set funcs structures to const
Change-Id: Ie118a1184a315c8cb7808a14a87f23c8c9a47757
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-08-09 16:15:00 +08:00
Sandy Huang
69b4bbba55 drm/rockchip: lvds: add pinctrl for rk3288 rgb output
Change-Id: I4c483eb269d021860fe4249a3d25bcfb6c4f3f5f
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-08-09 16:12:47 +08:00
Mark Yao
93f90ec2cb video/rockchip: rga2: correct BGRA stride
Change-Id: I019e2e410936f43b244ddde260cbd51c16a175e4
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 15:03:37 +08:00
Finley Xiao
a54bcc81e0 PM / devfreq: rockchip_dmc: Fix locking when rounding rate
There's no need to take the rcu read lock when rounding rate.

This patch fixes the following BUG:
BUG: sleeping function called from invalid context at kernel/locking/mutex.c:620
in_atomic(): 0, irqs_disabled(): 0, pid: 153, name: kworker/u16:2
5 locks held by kworker/u16:2/153:
 #0:  ("%s"("devfreq_wq")){......}, at: [<ffffff80080b8cf4>] process_one_work+0x1c4/0x58c
 #1:  ((&(&devfreq->work)->work)){......}, at: [<ffffff80080b8cf4>] process_one_work+0x1c4/0x58c
 #2:  (&devfreq->lock){......}, at: [<ffffff80089534c8>] devfreq_monitor+0x28/0x8c
 #3:  (&vop->vop_lock){......}, at: [<ffffff80084c826c>] dmc_notifier_call+0x14/0x34
 #4:  (rcu_read_lock){......}, at: [<ffffff80089557f0>] rockchip_dmcfreq_target+0x0/0x2e0
CPU: 3 PID: 153 Comm: kworker/u16:2 Not tainted 4.4.77 #2573
Hardware name: Rockchip Sheep board (DT)
Workqueue: devfreq_wq devfreq_monitor
Call trace:
[<ffffff8008089930>] dump_backtrace+0x0/0x1c8
[<ffffff8008089b0c>] show_stack+0x14/0x1c
[<ffffff800839718c>] dump_stack+0x8c/0xac
[<ffffff80080c8d5c>] ___might_sleep+0x11c/0x128
[<ffffff80080c8ddc>] __might_sleep+0x74/0x84
[<ffffff8008c371a4>] mutex_lock_nested+0x4c/0x39c
[<ffffff80089458d8>] clk_prepare_lock+0x58/0xc8
[<ffffff8008946ec8>] clk_round_rate+0x34/0x94
[<ffffff800895589c>] rockchip_dmcfreq_target+0xac/0x2e0
[<ffffff80089533f4>] update_devfreq+0x100/0x1ac
[<ffffff80089534d0>] devfreq_monitor+0x30/0x8c
[<ffffff80080b8e1c>] process_one_work+0x2ec/0x58c
[<ffffff80080ba16c>] worker_thread+0x300/0x428
[<ffffff80080bf3e0>] kthread+0x104/0x10c
[<ffffff8008082840>] ret_from_fork+0x10/0x50

Change-Id: I31f75a55da72cab597796edd5c339222094fff97
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-09 12:48:20 +08:00
Zhen Chen
f52f7396d8 ARM: dts: rk312x: add node for GPU
Change-Id: If5942626e2d99fcfd341cbceec3b367d0e9def1a
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2017-08-09 11:43:16 +08:00
Mark Yao
b34356fc63 drm/rockchip: vop: zpos set to INT_MAX if not enabled
Change-Id: Ia78c26f400d0cc4192cae183f83b7f06575c9332
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 09:39:27 +08:00
Mark Yao
2421f54c77 drm/rockchip: vop: correct win23 alpha define
Change-Id: I3e3bfbb9164b35a9f96d4bc71ab4c023d8270fc5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-09 09:38:37 +08:00
Sandy Huang
59971be7a4 drm/rockchip: lvds: mipi_lvds_ctl set to mipi dsi controller base address
So we can define reg offset according to TRM, otherwise it will make
us confused.

Change-Id: I1687542fcaf7ac4e6e78d863e8940f6604794407
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-08-09 09:33:42 +08:00
Sandy Huang
5d365c42c8 drm/rockchip: lvds: update rk336x according rk3288 lvds function define
Change-Id: I9dbb9dc55f3d6d7ae498e94f595e8de47c6a4d43
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-08-09 09:33:32 +08:00
Tao Huang
1f579ea18f Revert "sched/tune: Initialize raw_spin_lock in boosted_groups"
This reverts commit 9a9259a78c.

It seems schedtune_init_cgroups and schedtune_boostgroup_init
all call raw_spin_lock_init(&bg->lock), it is wrong.

Change-Id: Icbdfeaf81f4fb59fdcc02623ac5e26d41bd1e496
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-08-09 09:22:46 +08:00
Finley Xiao
46bc7979ad arm64: dts: rockchip: rk3399: modify gpu opp table
As gpu clock sources had been changed, the gpu frequencies also
should modifiy.
1. 297MHz is not support and replace it with 300MHz.
2. If enable tow vops, 500MHz is not support,
   so remove it from the default table.

Change-Id: If2a653571f0222e895f7df825eeb8ae43ce99332
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-08 15:41:22 +08:00
WeiYong Bi
89b7ad3a8e drm/rockchip: dsi: partial revert commit 47aef8
fix anomaly display issue for rk3368 caused by commit 47aef8

Fixes 47aef8 (drm/rockchip: dw-mipi-dsi: organize dw_mipi_dsi_set_mode function)

Change-Id: Ida274c65898b13468a2f984555efdf67cf32aab7
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-08-08 15:31:13 +08:00
Jianqun Xu
179afdb660 ARM: dts: rockchip: rk3288 add efuse_id for cpuinfo
Add efuse_id for cpuinfo to get system serial number.

Change-Id: If197c2961611364a2cb94972c33171bea105c61b
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
2017-08-08 11:31:41 +08:00
Zheng Yang
0a261ab9b1 drm/rockchip: hdmi: fix parse phy table error
The value of sym_ctr and term is reversed.

Change-Id: I29adaf9a8590ff27c912d22e2370db2ef5b2c305
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2017-08-07 18:40:02 +08:00
Huibin Hong
1900a271f7 ARM: dts: rockchip: rk322x: add spi node and spi pinctrl
Change-Id: I5bf28e2319ceb90bdc52d732cce2f646b29cae36
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-08-07 18:07:06 +08:00
Finley Xiao
4ba32acffe ARM: dts: rockchip: rk3288-andriod: fix dmc auto-min-freq
Change-Id: Iaaa3c7cd250b92c36bf16b294fc14779e5aa3996
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-07 18:06:30 +08:00
Tao Huang
c59177a487 sched/fair: fix start_cpu lockdep warning
Should warn on !rcu_read_lock_sched_held.

Change-Id: Id4b38e8c2dee83aedb4b7a2f19588b31b07c1116
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2017-08-07 16:59:52 +08:00
WeiYong Bi
9288502dd4 phy: rockchip-inno-mipi-dphy: enable PLL only when the PHY is power on
Change-Id: I6ff1a0a533a9f45f13d5be39fd5f68b5a0e18deb
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-08-05 10:21:50 +08:00
Mark Yao
b3702b38a1 drm/rockchip: vop: fixup post scale configure
Fixes: 7f1f1ef ("drm/rockchip: vop: don't force enable post scale")
Change-Id: I57b44e7fe00bce7615ecde2e1f23837c74532c68
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-04 17:12:00 +08:00
zzc
f62b360d66 net: wireless: rockchip_wlan: add rtl8723bs support
update rtl8723bs wifi driver to version v4.4.2_17831.20160519_BTCOEX20151223-654a

Change-Id: I1976f1ece2f318ab7eb11308bc019691ff84d319
Signed-off-by: zzc <zzc@rock-chips.com>
2017-08-04 16:13:31 +08:00
Jacob Chen
4fd28eafda dt-bindings: Document the Rockchip RGA bindings
Add DT bindings documentation for Rockchip RGA

Change-Id: Ie53383728c30a1245cd26a097622d3a564db7aa2
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:39:19 +08:00
Jacob Chen
ad9703226a FROMLIST: rockchip/rga: v4l2 m2m support
Rockchip RGA is a separate 2D raster graphic acceleration unit. It
accelerates 2D graphics operations, such as point/line drawing, image
scaling, rotation, BitBLT, alpha blending and image blur/sharpness

The drvier is mostly based on s5p-g2d v4l2 m2m driver
And supports various operations from the rendering pipeline.
 - copy
 - fast solid color fill
 - rotation
 - flip
 - alpha blending

The code in rga-hw.c is used to configure regs accroding to operations
The code in rga-buf.c is used to create (1-Level)mmu table for RGA
The tables is stored in a list, and be removed when buffer is cleanup
(am form https://patchwork.linuxtv.org/patch/42846/)

Change-Id: I3ddd885beb2388be2ef23fe75806719d1fda8695
Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:39:06 +08:00
Jacob Chen
10a0fcf693 FROMLIST: v4l: add porter duff blend controls
At peresent, we don't have a control for Compositing and Blend.
All drivers are just doing copies while actually many hardwares
supports more functions.

So Adding V4L2 controls for Compositing and Blend, used for for
composting streams.
(am from https://patchwork.linuxtv.org/patch/42848/)
The values are based on porter duff operations.
Defined in below links.
https://developer.xamarin.com/api/type/Android.Graphics.PorterDuff+Mode/

Change-Id: I16245fc8389a433ebdcb228081a80daa48e8c539
Suggested-by: Nicolas Dufresne <nicolas@ndufresne.ca>
Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:38:54 +08:00
Jacob Chen
b466f888ab arm64: dts: rk3399: change rga node for v4l2 rga
remove some unnecessary prop

Change-Id: I37c841b6048fcacaa7442cfc23872e2ccaf92e6c
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:37:47 +08:00
Jacob Chen
c8798f6bc8 ARM: dts: rk3288: change rga node for v4l2 rga
remove some unnecessary prop

Change-Id: Ibdb8e781d7a6ab6ede4041f8e78f9c61674da498
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:36:47 +08:00
Jacob Chen
84c8570015 ARM: rockchip_linux_defconfig: change to use v4l2 rga
At present no component in linux depend on drm RGA, i'd like to remove it

Change-Id: I92e12e716e881463985fdf7c1430d47e34ba4155
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:34:53 +08:00
Jacob Chen
94d97ff487 arm64: rockchip_linux_defconfig: change to use v4l2 rga
At present no component in linux depend on drm RGA, i'd like to remove it

Change-Id: Ibf531641d3dd30bd87f83dbfe1fd06af2d3dffcb
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:33:41 +08:00
Jacob Chen
2792966e9f drm/rockchip: remove rga driver
we have to many rga drivers.. let's remove it to avoid misunderstanding

Change-Id: I807c9ff7dc967a00d30ccba5adc5d234e27b9d6a
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-04 15:33:02 +08:00
WeiYong Bi
fdb1767c62 arm64: dts: rockchip: rk3399: Correct DPHY PLL clock
clk_24m --> Gate --> clk_mipidphy_ref --> Gate --> clk_dphy_pll

Change-Id: Icb5283c0854a475a5f2fc436e7d4448393b5ac95
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-08-04 15:30:30 +08:00
WeiYong Bi
deeacfd957 drm/rockchip: dsi: fix Non-SNPS PHY power on sequence
Change-Id: If9f131ec6ebc8b194034bf231ca2bcc120440860
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-08-04 09:16:10 +08:00
Huang Jiachai
c4e97a6379 drm/rockchip: get connector in bridge mode
Change-Id: I08535f5c2d83783dc86ae641daeb530dedec36e6
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
2017-08-03 20:25:32 +08:00