firefly-linux-kernel-4.4.55.git
7 years agodrm/rockchip: lvds: add loader protect
WeiYong Bi [Mon, 10 Jul 2017 08:30:02 +0000 (16:30 +0800)]
drm/rockchip: lvds: add loader protect

Change-Id: Ia0866cb9125a98ffb4ce99be26be9e0ccd665765
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
7 years agoARM: dts: sync tinker board dts
Jacob Chen [Wed, 19 Jul 2017 08:15:35 +0000 (16:15 +0800)]
ARM: dts: sync tinker board dts

Sync our kernel with asus to reduce rebase work.

origin:
https://github.com/TinkerBoard/debian_kernel/blob/linux4.4-rk3288/arch/arm/boot/dts/rk3288-miniarm.dts
with dmc and camera nodes deleted

Change-Id: I7e699ca57465c03f41acb4ae47e5e70794118489
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3288: add dts file for lvds panel
Huang Jiachai [Fri, 14 Jul 2017 06:51:31 +0000 (14:51 +0800)]
arm64: dts: rockchip: rk3288: add dts file for lvds panel

Change-Id: I5991d0301935b5bdf51aead7719f84b6aa9264c5
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
7 years agophy: rockchip-inno-hdmi-phy: update 3328 phy pixclock in the recalc_rate
Zheng Yang [Thu, 20 Jul 2017 02:15:32 +0000 (10:15 +0800)]
phy: rockchip-inno-hdmi-phy: update 3328 phy pixclock in the recalc_rate

If default phy pre-pll output pixclock is same to the requested rate,
the set_rate function is not called, inno->pixclock is zero and
make phy work not ok. This patch update inno->pixclock both in the
recalc_rate and set_rate, make pixclock be the real value.

Change-Id: Ifd4e145c499c2e82f96918ca62235627bf326734
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
7 years agodrm/panel: support drm_find_panel_by_connector
Mark Yao [Thu, 6 Jul 2017 07:43:10 +0000 (15:43 +0800)]
drm/panel: support drm_find_panel_by_connector

Change-Id: Iee970e013ff8b1558a060f334c700dea36c38d0f
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agodrm/rockchip: vop: add rk3399 cabc registers
Mark Yao [Fri, 7 Jul 2017 06:56:08 +0000 (14:56 +0800)]
drm/rockchip: vop: add rk3399 cabc registers

Change-Id: Ia7929e4c62ac031453fdb50ed4dcb20d11faee95
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agodrm/rockchip: add cabc support
Mark Yao [Wed, 28 Jun 2017 07:11:01 +0000 (15:11 +0800)]
drm/rockchip: add cabc support

CABC(Content Adaptive Backlight Control) is used to
increase the contrast of such LCD-screens the backlight
can be (globally) dimmed when the image to be displayed
is dark (i.e. not comprising high intensity image data)
while the image data is numerically corrected and adapted
to the reduced backlight intensity.

Change-Id: I0bd84375264675943f1b601f0cac8b843567087d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3399: add 528MHz and 600MHz for dmc
Finley Xiao [Tue, 18 Jul 2017 03:21:31 +0000 (11:21 +0800)]
arm64: dts: rockchip: rk3399: add 528MHz and 600MHz for dmc

Only 200MHz, 300MHz, 400MHz, 528MHz, 600MHz, 666MHz, 732MHz and
800MHz are available at present.

Change-Id: I3a376b389fe6b06b3b32f0c695de2cbde05dfeea
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
7 years agodrm/rockchip: lvds: set correct step to power off lvds
Huang Jiachai [Fri, 14 Jul 2017 06:59:33 +0000 (14:59 +0800)]
drm/rockchip: lvds: set correct step to power off lvds

Change-Id: I6ce0fea548a0bc66c231ac184b45b74fd9acaf1f
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3368: fix compatible string for lvds node
WeiYong Bi [Thu, 13 Jul 2017 01:46:02 +0000 (09:46 +0800)]
arm64: dts: rockchip: rk3368: fix compatible string for lvds node

Replace "rockchip,rk33xx-lvds" with "rockchip,rk3368-lvds"

Change-Id: I065de5d994f167129591025e4251944478fa43e7
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
7 years agodrm/rockchip: lvds: Add support for rk3366
WeiYong Bi [Wed, 12 Jul 2017 06:20:34 +0000 (14:20 +0800)]
drm/rockchip: lvds: Add support for rk3366

Change-Id: Iaf54c4667042b0b24a9083cb7ca931c1b0603804
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
7 years agoarm64: rockchip_defconfig: remove CONFIG_RK31XX_LVDS
WeiYong Bi [Fri, 14 Jul 2017 07:49:42 +0000 (15:49 +0800)]
arm64: rockchip_defconfig: remove CONFIG_RK31XX_LVDS

Change-Id: Ie7716e38dd68876ab037cc3ed6072dba4118a798
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3368-r88: Select xin32k from pwm1 out
Zhangbin Tong [Mon, 17 Jul 2017 08:00:22 +0000 (16:00 +0800)]
arm64: dts: rockchip: rk3368-r88: Select xin32k from pwm1 out

Change-Id: Iff675d47600cd7bf1d30564ca82697ce3b1fd9f4
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
7 years agoarm64: rockchip_defconfig: enable CONFIG_COMMON_CLK_PWM
Zhangbin Tong [Mon, 17 Jul 2017 07:58:46 +0000 (15:58 +0800)]
arm64: rockchip_defconfig: enable CONFIG_COMMON_CLK_PWM

Change-Id: Ie8c076e6d4c1a0a81c90f7dcd5653bef424b27e2
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
7 years agoUPSTREAM: clk: pwm: Use pwm_get_args() where appropriate
Stephen Boyd [Tue, 1 Mar 2016 19:00:18 +0000 (11:00 -0800)]
UPSTREAM: clk: pwm: Use pwm_get_args() where appropriate

The PWM framework has clarified the concept of reference PWM config (the
platform dependent config retrieved from the DT or the PWM lookup table)
and real PWM state.

Use pwm_get_args() when the PWM user wants to retrieve this reference
config and not the current state.

This is part of the rework allowing the PWM framework to support
hardware readout and expose real PWM state even when the PWM has just
been requested (before the user calls pwm_config/enable/disable()).

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit dd0b38b7ca0d8c8aadcf8a17d7c90d36ab8ab6e4)

Change-Id: I54c4b3853359b5fa41f8f949b504f82c6f069034
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
7 years agodrm/rockchip: lvds: if port is null return -EINVAL
Huang Jiachai [Tue, 18 Jul 2017 03:59:59 +0000 (11:59 +0800)]
drm/rockchip: lvds: if port is null return -EINVAL

Change-Id: I9503b4f2d317a12d91ce136213d8d2e629b72823
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
7 years agoARM: dts: rk3288: rename mipi to dsi
xubilv [Thu, 13 Jul 2017 09:04:54 +0000 (17:04 +0800)]
ARM: dts: rk3288: rename mipi to dsi

Change-Id: I35d348068df3720608fc9cd22f97be0264a03f67
Signed-off-by: xubilv <xbl@rock-chips.com>
7 years agousb: dwc_otg_310: fix bad unlock balance issue
William Wu [Mon, 17 Jul 2017 12:10:46 +0000 (20:10 +0800)]
usb: dwc_otg_310: fix bad unlock balance issue

There is a bad unlock balance issue in the following case:
1. Use micro USB 2.0 interface;
2. Vbus 5v is always powered on;
3. Wait until DWC2 completes initialization, and then plug
   in OTG to Host cable;
4. Plug out the OTG cable, and then we will reproduce this
   issue, and we'll get the following log if we enable the
   kernel lock debugging.

=====================================
[ BUG: bad unlock balance detected! ]
4.4.71 #303 Not tainted
-------------------------------------
swapper/0/0 is trying to release lock (&(sl)->rlock) at:
[<c0795848>] dwc_otg_pcd_suspend_cb+0x20/0x48
but there are no more locks to release!

other info that might help us debug this:
1 lock held by swapper/0/0:

stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.71 #303
Hardware name: Rockchip (Device Tree)
[<c0110018>] (unwind_backtrace) from [<c010c04c>] (show_stack+0x10/0x14)
[<c010c04c>] (show_stack) from [<c0423e28>] (dump_stack+0x9c/0xd4)
[<c0423e28>] (dump_stack) from [<c021803c>] (print_unlock_imbalance_bug.part.7+0x8c/0xb8)
[<c021803c>] (print_unlock_imbalance_bug.part.7) from [<c018ce74>] (lock_release+0x284/0x54c)
[<c018ce74>] (lock_release) from [<c0c0e03c>] (_raw_spin_unlock+0x18/0x54)
[<c0c0e03c>] (_raw_spin_unlock) from [<c0795848>] (dwc_otg_pcd_suspend_cb+0x20/0x48)
[<c0795848>] (dwc_otg_pcd_suspend_cb) from [<c0792cc4>] (dwc_otg_handle_usb_suspend_intr+0x68/0x37c)
[<c0792cc4>] (dwc_otg_handle_usb_suspend_intr) from [<c079329c>] (dwc_otg_handle_common_intr+0x2c4/0xd58)
[<c079329c>] (dwc_otg_handle_common_intr) from [<c0786a18>] (dwc_otg_common_irq+0xc/0x18)
[<c0786a18>] (dwc_otg_common_irq) from [<c0199e48>] (handle_irq_event_percpu+0x188/0x4d4)
[<c0199e48>] (handle_irq_event_percpu) from [<c019a1cc>] (handle_irq_event+0x38/0x5c)
[<c019a1cc>] (handle_irq_event) from [<c019d654>] (handle_fasteoi_irq+0xa8/0x124)
[<c019d654>] (handle_fasteoi_irq) from [<c0199454>] (generic_handle_irq+0x18/0x28)
[<c0199454>] (generic_handle_irq) from [<c0199754>] (__handle_domain_irq+0x88/0xb0)
[<c0199754>] (__handle_domain_irq) from [<c01014b4>] (gic_handle_irq+0x4c/0x94)
[<c01014b4>] (gic_handle_irq) from [<c010cbb8>] (__irq_svc+0x58/0x98)

It's because that when plug in OTG to host cable, the
core_if->lock will be initialized to hcd->lock (check_id()->
id_status_change()->cil_hcd_start()->dwc_otg_hcd_reinit()),
so we should release core_if->lock before call cil_pcd_suspend()
rather than release the pcd->lock inside of callback function.

Change-Id: I1e32f37c701d1a8d741947b6bf385c1bbcb6da78
Signed-off-by: William Wu <william.wu@rock-chips.com>
7 years agoarm64: dts: rockchip: add vpu for rk3366 android7.1
Zorro Liu [Fri, 14 Jul 2017 03:22:33 +0000 (11:22 +0800)]
arm64: dts: rockchip: add vpu for rk3366 android7.1

Change-Id: I798a6518a2a74fe07ae2bb82abaca2da501ae07b
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
7 years agoFROMLIST: drm: skip wait on vblank for set plane
Jonas Karlman [Tue, 2 May 2017 05:53:15 +0000 (07:53 +0200)]
FROMLIST: drm: skip wait on vblank for set plane

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
(am from https://github.com/LongChair/LibreELEC.tv/commit/debdec6)

Change-Id: I20d3d03638388fbb1e84215cba187f2e89089a62
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoUPSTREAM: drm/rockchip: Replace custom wait_for_vblanks with helper
Tomasz Figa [Wed, 14 Sep 2016 12:54:58 +0000 (21:54 +0900)]
UPSTREAM: drm/rockchip: Replace custom wait_for_vblanks with helper

Currently the driver uses a custom function to wait for flip to complete
after an atomic commit. It was needed before because of two problems:
 - there is no hardware vblank counter, so the original helper would
   have a race condition with the vblank interrupt,
 - the driver didn't support unreferencing cursor framebuffers
   asynchronously to the commit, which was what the helper expected.
Since both problems have been solved by previous patches, we can now
make the driver use the generic helper and remove custom waiting code.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
(cherry picked from commit 81c248f75a130c1ce46c67e8b05b37e8ffbbb33e)

Change-Id: Ida5a38b71f9e7812f415eb8889d906d2fe3b093e
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoUPSTREAM: drm/rockchip: Unreference framebuffers from flip work
Tomasz Figa [Wed, 14 Sep 2016 12:54:57 +0000 (21:54 +0900)]
UPSTREAM: drm/rockchip: Unreference framebuffers from flip work

Currently the driver waits for vblank and then unreferences old
framebuffers from atomic commit code path. This is however breaking the
legacy cursor API, which requires the updates to be fully asynchronous.
Instead of just adding a special case for cursor, we can have actually
smaller amount of code to unreference any changed framebuffer from a
flip work.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
(cherry picked from commit 47a7eb4597775ecdc29d2630d875a991f0449bf3)

Change-Id: Id36cdef1ea3962ac8c9a99549732d1810c57c4f9
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoUPSTREAM: drm/rockchip: Avoid race with vblank count increment
Tomasz Figa [Wed, 14 Sep 2016 12:54:56 +0000 (21:54 +0900)]
UPSTREAM: drm/rockchip: Avoid race with vblank count increment

Since VOP does not have a hardware vblank count register, the ongoing
commit might be racing with a requested vblank interrupt, which would
increment the software vblank counter before the changes being committed
actually happen.

To avoid this, we can extend .atomic_flush(), so after it sets cfg_done
bit, it polls the vblank interrupt bit until it's inactive to make sure
that any old vblank interrupt gets to the handler and then uses
synchronize_irq(vop->irq) to make sure the handler finishes running.

The polling case should happen very rarely, but even if, the total wait
time should be relatively low and in practice almost equal to the vop
hardirq handler running time.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
(cherry picked from commit 7caecdbec1128a934ee628f399110dff8a50c9a1)

Change-Id: Ic5f6231300214485ea569a2296c990aa123f6ff7
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoARM: dts: rockchip: add node for ov8858 on rk3288 evb
Jacob Chen [Wed, 12 Jul 2017 03:33:36 +0000 (11:33 +0800)]
ARM: dts: rockchip: add node for ov8858 on rk3288 evb

Disabled by default to avoid error messages.

Change-Id: I4fc05c0a782d6b1035b9e4bc7b31cc462d65166a
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
7 years agoARM: dts: rockchip: use iommu for rk3288 v4l2 isp
Jacob Chen [Tue, 11 Jul 2017 05:26:40 +0000 (13:26 +0800)]
ARM: dts: rockchip: use iommu for rk3288 v4l2 isp

we have videobuf2 cip isp support now

Change-Id: I7f6da305f2a4a658a4097e06361c694ca6ba9a18
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
7 years agomfd: rk808: add rk816 support
shengfei Xu [Fri, 7 Jul 2017 09:18:10 +0000 (17:18 +0800)]
mfd: rk808: add rk816 support

include sub modules: regulator, rtc, gpio, pwrkey

Change-Id: I59cc4b943403f1e0b1210a314cfcbf61fc193bdf
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
7 years agoARM: config: enable MIPI CSI config for rockchip linux
Jacob Chen [Mon, 17 Jul 2017 00:35:33 +0000 (08:35 +0800)]
ARM: config: enable MIPI CSI config for rockchip linux

Change-Id: I32d3b569ffeb44132b2e28efdb0f2759f9f8498c
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
7 years agoarm64: dts: rockchip: fix lcd pinctrl define error for rk3368
Huang Jiachai [Fri, 14 Jul 2017 07:17:20 +0000 (15:17 +0800)]
arm64: dts: rockchip: fix lcd pinctrl define error for rk3368

Change-Id: I843049573cda97cc226730e34f043bd54021951e
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3366: add leakage nvmem-cells for cpu
Finley Xiao [Fri, 14 Jul 2017 09:39:20 +0000 (17:39 +0800)]
arm64: dts: rockchip: rk3366: add leakage nvmem-cells for cpu

Change-Id: I5e546ecbf5e1d8cc0a36d8ebd439663e1658f23b
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
7 years agoarm64: dts: rockchip: Remove the rk3366-tb build
David Wu [Fri, 14 Jul 2017 09:43:42 +0000 (17:43 +0800)]
arm64: dts: rockchip: Remove the rk3366-tb build

Change-Id: I8260d583da480f49834647ad114f3d1346ef1bbd
Signed-off-by: David Wu <david.wu@rock-chips.com>
7 years agodrm/atomic: export drm_atomic_replace_property_blob_from_id
Mark Yao [Wed, 28 Jun 2017 07:00:51 +0000 (15:00 +0800)]
drm/atomic: export drm_atomic_replace_property_blob_from_id

Change-Id: Iebca91e396f6770b0b2ce588093119ea321f3fb5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agohid: rkvr: fix application of sizeof to pointer
lanshh [Fri, 14 Jul 2017 03:41:10 +0000 (11:41 +0800)]
hid: rkvr: fix application of sizeof to pointer

Change-Id: I698445dd006551090578fc04226d5c792094ad05
Signed-off-by: lanshh <lsh@rock-chips.com>
7 years agoarm64: dts: rockchip: Add rk3366-sheep and rk3366-android dts file for Android7.1
David Wu [Wed, 12 Jul 2017 02:34:40 +0000 (10:34 +0800)]
arm64: dts: rockchip: Add rk3366-sheep and rk3366-android dts file for Android7.1

Change-Id: Ib0f2dd27cb5154bed68e71780cfff4a1730399a3
Signed-off-by: David Wu <david.wu@rock-chips.com>
7 years agoarm64: dts: rockchip: Add drm dispaly nodes and move nod-drm display nodes to rk3366...
David Wu [Tue, 11 Jul 2017 12:21:27 +0000 (20:21 +0800)]
arm64: dts: rockchip: Add drm dispaly nodes and move nod-drm display nodes to rk3366-android-6.0.dtsi

Change-Id: I98cafab3739f322e1b3826e597b7191ddd0e49c3
Signed-off-by: David Wu <david.wu@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3368-r88: Fix power and platform suspend support
Zhangbin Tong [Thu, 13 Jul 2017 09:13:44 +0000 (17:13 +0800)]
arm64: dts: rockchip: rk3368-r88: Fix power and platform suspend support

Change-Id: I9b3d8178a3bf245cad91dec3c1284f395378ff68
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
7 years agoregulator: remove unused rockchip-pwm-regulator driver
Huang, Tao [Fri, 14 Jul 2017 01:24:38 +0000 (09:24 +0800)]
regulator: remove unused rockchip-pwm-regulator driver

Change-Id: I20594d198f49f6232b409031884ca27f95470592
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
7 years agoPM / devfreq: rockchip_dmc: fix coccinelle warnings
Huang, Tao [Fri, 14 Jul 2017 01:38:44 +0000 (09:38 +0800)]
PM / devfreq: rockchip_dmc: fix coccinelle warnings

drivers/devfreq/rockchip_dmc.c:665:2-3: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:676:2-3: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:686:2-3: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:697:2-3: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:707:2-3: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:766:2-3: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:776:2-3: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:1397:2-3: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:1022:3-4: Unneeded semicolon
drivers/devfreq/rockchip_dmc.c:662:5-11: inconsistent IS_ERR and PTR_ERR on line 664.
drivers/devfreq/rockchip_dmc.c:683:5-11: inconsistent IS_ERR and PTR_ERR on line 685.
drivers/devfreq/rockchip_dmc.c:704:5-11: inconsistent IS_ERR and PTR_ERR on line 706.
drivers/devfreq/rockchip_dmc.c:773:5-11: inconsistent IS_ERR and PTR_ERR on line 775.

Change-Id: I95f2f66649ead3d0c0f59ae713d9272863eb9f63
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
7 years agodrm/rockchip: gem: add begin/end cpu access
Mark Yao [Thu, 13 Jul 2017 06:57:02 +0000 (14:57 +0800)]
drm/rockchip: gem: add begin/end cpu access

Change-Id: Ie2c54addcf037cf501edcad76470e5e46c667b7e
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agodrm/prime: add dmabuf begin/end cpu access
Mark Yao [Thu, 13 Jul 2017 06:56:33 +0000 (14:56 +0800)]
drm/prime: add dmabuf begin/end cpu access

Change-Id: I0b4be7f8d78142024a2067db041e4f1c2670086c
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoARM: dts: rk3288-android: add 1800MHz for cpu
Finley Xiao [Thu, 13 Jul 2017 07:15:46 +0000 (15:15 +0800)]
ARM: dts: rk3288-android: add 1800MHz for cpu

Change-Id: I9206739d879b7648ae4e19df9f5a67ad9844c5d6
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
7 years agoclk: rockchip: Add adaptive frequency scaling for pll_rk3399
Finley Xiao [Wed, 12 Jul 2017 11:18:56 +0000 (19:18 +0800)]
clk: rockchip: Add adaptive frequency scaling for pll_rk3399

Change-Id: Id7be0fd4045f273052d69f49df1272922fb8f8dc
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
7 years agoRevert "ARM64: dts: rk3328-evb: enable tve"
algea.cao [Thu, 13 Jul 2017 02:28:32 +0000 (10:28 +0800)]
Revert "ARM64: dts: rk3328-evb: enable tve"

This reverts commit c69d61610a887799edcc2da4e31fbd8d699193e0.
There is conflict between cvbs and hdmi.Hdmi is used more than cvbs,
so disable cvbs by default.

Change-Id: I1c0966e0166715da0d4c11426686b28386d16a0c
Signed-off-by: algea.cao <algea.cao@rock-chips.com>
7 years agousb: dwc_otg_310: hcd: fix isoc urb actual length
Feng Mingli [Wed, 12 Jul 2017 08:54:22 +0000 (16:54 +0800)]
usb: dwc_otg_310: hcd: fix isoc urb actual length

USB isochronous urb consists of some isoc frames, urb use iso_frame_desc
structure record actual_length, then device drivers always use this and
don't care urb actual_length. But in usb devio driver, processcompl()
function will process urb complete and copy data to user depend on urb
actual_length.

In dwc controller driver, update_isoc_urb_state() function will only
update isoc frames actual_length, urb actual_length will be 0. When use
usb devio driver, there is no data copy to user, so need update urb
actual_length at the same time.

TEST=use libusb to transport isochronous data

Change-Id: I1dc8e8d8c6609924626761525b98f41a739aeb65
Signed-off-by: Feng Mingli <fml@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
7 years agocamera: rockchip: camsys_drv: 0.0x22.0x2
zhangyunlong [Thu, 13 Jul 2017 02:53:58 +0000 (10:53 +0800)]
camera: rockchip: camsys_drv: 0.0x22.0x2

modify the condition of DRM iommu, which makes code  more readable
by using of_parse_phandle to check whether the "iommus" phandle exists
in the isp device node.

Change-Id: I41d2c1c1e237364f19d79abb15aaca4a81616287
Signed-off-by: zhangyunlong <dalon.zhang@rock-chips.com>
7 years agoarm64: rockchip_linux_defconfig: enable CIF_ISP10
Jacob Chen [Mon, 10 Jul 2017 01:15:48 +0000 (09:15 +0800)]
arm64: rockchip_linux_defconfig: enable CIF_ISP10

Change-Id: I2e677e3b80b6ba065543ab0123e8154cf7d794a3
Signed-off-by: Jacob Chen <cc@rock-chips.com>
7 years agoarm64: dts: rk3399-sapphire-excavator-linux: add camera nodes
Jacob Chen [Tue, 11 Jul 2017 01:21:05 +0000 (09:21 +0800)]
arm64: dts: rk3399-sapphire-excavator-linux: add camera nodes

Change-Id: I7f2e356f33439723a9ebec6fd341e213ebb2c871
Signed-off-by: Jacob Chen <cc@rock-chips.com>
7 years agoarm64: dts: rk3399-linux: add cif isp nodes
Jacob Chen [Mon, 10 Jul 2017 01:14:39 +0000 (09:14 +0800)]
arm64: dts: rk3399-linux: add cif isp nodes

Change-Id: Iaadc9bcfdf7b2a236a0740170cc7bcfa0e7d9398
Signed-off-by: Jacob Chen <cc@rock-chips.com>
7 years agomedia: isp: migrate isp driver to videobuf2
Jacob Chen [Mon, 10 Jul 2017 02:43:08 +0000 (10:43 +0800)]
media: isp: migrate isp driver to videobuf2

Verify the functionality of isp driver with
sensor ov7750.
V4l2n or gstreamer is suitable for test.

Change-Id: I4f0cf68b84f4909dd1c132ec3506777f39d487ee
Signed-off-by: Jacob Chen <cc@rock-chips.com>
7 years agomedia: soc_camera: add ov7750 sensor driver
Jacob Chen [Mon, 10 Jul 2017 02:42:44 +0000 (10:42 +0800)]
media: soc_camera: add ov7750 sensor driver

Change-Id: Ibe6e393b5e1ce518181d285b5c08e191a0b2dca4
Signed-off-by: Jacob Chen <cc@rock-chips.com>
7 years agoARM: dts: rk3288: add leakage nvmem-cells property for cpu
Finley Xiao [Thu, 13 Jul 2017 01:19:36 +0000 (09:19 +0800)]
ARM: dts: rk3288: add leakage nvmem-cells property for cpu

Change-Id: I0238f29b0c79daa683ffd8a2a1f09f51761a5358
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
7 years agoarm64: dts: rk3399: add leakage nvmem-cells properties for cpu
Finley Xiao [Wed, 12 Jul 2017 11:23:36 +0000 (19:23 +0800)]
arm64: dts: rk3399: add leakage nvmem-cells properties for cpu

Change-Id: Id156f2a9a3871747d9379b49d09034238d204670
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
7 years agophy: rockchip-inno-mipi-dphy: Add support for rk3366
WeiYong Bi [Wed, 12 Jul 2017 06:20:07 +0000 (14:20 +0800)]
phy: rockchip-inno-mipi-dphy: Add support for rk3366

Change-Id: I1e0898b8b588bf71df9a0e1f848f350654446dcf
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
7 years agodrm/rockchip: dsi: Add support for rk3366
WeiYong Bi [Wed, 12 Jul 2017 06:19:47 +0000 (14:19 +0800)]
drm/rockchip: dsi: Add support for rk3366

Change-Id: I9edfea9652d8c56065590ea01480b49f1c432145
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
7 years agoUPSTREAM: Coccinelle: misc: Add support for devm variant in all modes
Vaishali Thakkar [Wed, 23 Nov 2016 08:46:42 +0000 (14:16 +0530)]
UPSTREAM: Coccinelle: misc: Add support for devm variant in all modes

Add missing support for the devm_request_threaded_irq in
the rules of context, report and org modes.

Misc:
----
To be consistent with other scripts, change confidence level
of the script to 'Moderate'.

Change-Id: I3ad8fc93081be82512e6143e27c8936c988a98f1
Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit d1e774f49f0305092c9975d9070aefe318f49872)

7 years agoUPSTREAM: Coccinelle: misc: Improve the result given by context mode
Vaishali Thakkar [Wed, 23 Nov 2016 08:46:46 +0000 (14:16 +0530)]
UPSTREAM: Coccinelle: misc: Improve the result given by context mode

To eliminate false positives given by the context mode, add
necessary arguments for the function request_threaded_irq.

Change-Id: I692db266239a03964d17505108e700bc1ffa9bd3
Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 35b303ae361611a6b418e385fee06fa08732b2e6)

7 years agoUPSTREAM: Coccinelle: misc: Improve the matching of rules
Vaishali Thakkar [Wed, 23 Nov 2016 08:46:39 +0000 (14:16 +0530)]
UPSTREAM: Coccinelle: misc: Improve the matching of rules

Currently because of the left associativity of the operators, pattern
IRQF_ONESHOT | flags does not match with the pattern when we have more
than one flag after the disjunction. This eventually results in giving
false positives by the script. This patch eliminates these FPs by
improving the rule.

Change-Id: I1043d1e6fca848997982305cd8fb3ac2706e7f1f
Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit dca24c4544d96989f521b5aa49fd44ae0ae5a5b6)

7 years agoUPSTREAM: Coccinelle: Add misc/boolconv.cocci
Andrew F. Davis [Mon, 17 Oct 2016 16:52:24 +0000 (11:52 -0500)]
UPSTREAM: Coccinelle: Add misc/boolconv.cocci

Add a script to check for unneeded conversions to bool.

Change-Id: I881d423eb72595b11a861eaf01c0c8eb8f262e05
Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 75238b9e6aadca6d9255d4b385e026385e78bb15)

7 years agoUPSTREAM: Coccinelle: flag conditions with no effect
Nicholas Mc Guire [Sat, 8 Oct 2016 15:51:45 +0000 (17:51 +0200)]
UPSTREAM: Coccinelle: flag conditions with no effect

Report code constructs where the if and else branch are functionally
identical. In cases where this is intended it really should be
documented - most reported cases probably are bugs.

Change-Id: I81c863f2a744d26dd1f0cd0b621580f73d0c70d5
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit c8990359d4b12f14656386526ddf904635076902)

7 years agoUPSTREAM: Coccinelle: pm_runtime: ensure relevance of pm_runtime reports
Julia Lawall [Thu, 22 Sep 2016 08:28:55 +0000 (10:28 +0200)]
UPSTREAM: Coccinelle: pm_runtime: ensure relevance of pm_runtime reports

pm_runtime.cocci starts with one rule that searches for a variety of
functions calls, followed by various rules that report errors.  Previously,
the only connection between the first rule and the rest was to check that
the first rule had matched somewhere.  Change the rules to propagate a
position from the first rule to the others, to make sure that the sites
reported on are the same as the sites that were identified as having the
relevant functions.

Change-Id: I2f5c56634f170348666acb373f7b9323c8edf68e
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit d97629f1686574a800a76eb0d2ce65e3f3d3ef92)

7 years agoUPSTREAM: Coccinelle: limit memdup_user transformation to GFP_KERNEL case
Julia Lawall [Wed, 21 Sep 2016 15:48:39 +0000 (17:48 +0200)]
UPSTREAM: Coccinelle: limit memdup_user transformation to GFP_KERNEL case

Memdup_user encapsulates a memory allocation with the flag GFP_KERNEL, so
only allow this flag in the original code.

Change-Id: I504d5558ef6bfa955983523918397872494b1abc
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 43d96390d57aa0e61d15ce2bcb887df8516d58f5)

7 years agoUPSTREAM: scripts/coccinelle: require coccinelle >= 1.0.4 on device_node_continue...
Luis R. Rodriguez [Wed, 29 Jun 2016 22:14:59 +0000 (15:14 -0700)]
UPSTREAM: scripts/coccinelle: require coccinelle >= 1.0.4 on device_node_continue.cocci

Make use of the new Requires: tag to be able to specify coccinelle binary
version requirements. The cocci file device_node_continue.cocci requires at
least coccinelle 1.0.4.

Change-Id: I11e894e3b2cbd88362271ea064ec3674ae9ffd71
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Acked-by: Nicolas Palix <nicolas.palix@imag.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit cc65e823363834a7ff0a2eca9bef2bbef64135f7)

7 years agoUPSTREAM: coccinelle: catch krealloc() on devm_*() allocated memory
Yann Droneaud [Mon, 23 May 2016 15:07:21 +0000 (17:07 +0200)]
UPSTREAM: coccinelle: catch krealloc() on devm_*() allocated memory

krealloc() must not be used against devm_*() allocated
memory regions:

- if a bigger memory is to be allocated, krealloc() and
  __krealloc() could return a different pointer than the
  one given to them, creating a memory region which is not
  managed, thus it will not be automatically released on
  device removal.

- if a bigger memory is to be allocated, krealloc() could
  kfree() the managed memory region which is passed to it.
  The old pointer is left registered as a resource for the
  device. On device removal, this dangling pointer will be
  used and an unrelated memory region could be released.

- if the requested size is equal to 0, krealloc() can also
  just behave like kfree(). Here too, the old pointer is
  kept associated with the device. On device removal, this
  invalid pointer will be used and an unrelated memory
  region could be released.

For all these reasons, krealloc() must not be used on a
pointer returned by devm_*() functions.

Change-Id: I36061f5668a1b1128df9414b577150281f0f8a5a
Cc: Tejun Heo <tj@kernel.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit b7b2ee41f300b69c67c798df0cd5b8648bcb26a3)

7 years agoUPSTREAM: coccinelle: recognize more devm_* memory allocation functions
Yann Droneaud [Mon, 23 May 2016 15:07:20 +0000 (17:07 +0200)]
UPSTREAM: coccinelle: recognize more devm_* memory allocation functions

Updates free/devm_free.cocci to recognize functions added by:

- commit 64c862a839a8 ('devres: add kernel standard devm_k.alloc functions')
- commit e31108cad3de ('devres: introduce API "devm_kstrdup"')
- commit 3046365bb470 ('devres: introduce API "devm_kmemdup')
- commit 43339bed7010 ('devres: Add devm_get_free_pages API')
- commit 75f2a4ead5d5 ('devres: Add devm_kasprintf and devm_kvasprintf API')

See also Documentation/driver-model/devres.txt

Change-Id: I5224960b028811484f27dd174629df6d5b052cd3
Cc: Joe Perches <joe@perches.com>
Cc: Manish Badarkhe <badarkhe.manish@gmail.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Eli Billauer <eli.billauer@gmail.com>
Cc: Himangi Saraogi <himangi774@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit a720c0644d14011d3a1bcc8d1b36e80571ad2ce1)

7 years agoUPSTREAM: coccinelle: also catch kzfree() issues
Yann Droneaud [Mon, 23 May 2016 15:07:19 +0000 (17:07 +0200)]
UPSTREAM: coccinelle: also catch kzfree() issues

Since commit 3ef0e5ba4673 ('slab: introduce kzfree()'),
kfree() is no more the only function to be considered:
kzfree() should be recognized too.

In particular, kzfree() must not be called on memory
allocated through devm_*() functions.

Change-Id: I9cde2ad48245c628c6708ab008e0513945a04cef
Cc: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 6dd9379e8f327e70d182b15be3ba21aa2b5d2cba)

7 years agoUPSTREAM: Coccinelle: noderef: Add new rules and correct the old rule
Vaishali Thakkar [Tue, 24 May 2016 04:19:17 +0000 (09:49 +0530)]
UPSTREAM: Coccinelle: noderef: Add new rules and correct the old rule

Add new rules to detect the cases where sizeof is used in
function calls as a argument.

Also, for the patch mode third rule should behave same as
second rule with arguments reversed. So, change that as well.

Change-Id: Id50b413c43d1c7f8c17a8cd784aa4d9d90046e62
Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit bf56cc04ef97c8ec536e3fcd16fc57902cba339f)

7 years agoUPSTREAM: scripts: coccinelle: remove check to move constants to right
Wolfram Sang [Sat, 19 Mar 2016 17:37:51 +0000 (18:37 +0100)]
UPSTREAM: scripts: coccinelle: remove check to move constants to right

The header mentions this check depends on personal taste. I agree.
Running coccicheck on patches before I apply them, this SmPL produced
enough false positives for me that I'd rather see it removed.

Change-Id: Ia9638b059dd9eedb5f266061ae61ede963870acd
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit f931362b38191016b7a6dc31d90a515b37658e02)

7 years agoUPSTREAM: Coccinelle: setup_timer: Add space in front of parentheses
Vaishali Thakkar [Sun, 20 Mar 2016 05:27:32 +0000 (10:57 +0530)]
UPSTREAM: Coccinelle: setup_timer: Add space in front of parentheses

Add space in front of the offending parentheses to silent the
parse error for older Coccinelle versions. This makes the rule
usable with all Coccinelle versions.

Change-Id: I44060c14a88fa322ac609474cc9b03b0856d5dab
Reported-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Fixes: c5eda8fd10c6 ("Coccinelle: Add api/setup_timer.cocci")
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 531f50388f1b05a297c6eab7a0c1e8e6d997678b)

7 years agoUPSTREAM: Coccinelle: Add api/setup_timer.cocci
Vaishali Thakkar [Wed, 10 Feb 2016 10:01:33 +0000 (15:31 +0530)]
UPSTREAM: Coccinelle: Add api/setup_timer.cocci

Use the timer API function setup_timer instead of structure field
assignments to initialize a timer.

Change-Id: I18ecc8a8ac368b893f0ceab9ad41add255bc3cd5
Signed-off-by: Vaishali Thakkar <vaishali.thakkar@oracle.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit c5eda8fd10c64720d5232189f812a3b1cc983b8b)

7 years agoUPSTREAM: coccinelle: bugon: reduce rule applicability
Julia Lawall [Wed, 3 Feb 2016 18:05:46 +0000 (19:05 +0100)]
UPSTREAM: coccinelle: bugon: reduce rule applicability

Rule r is only use in org or report mode, so only execute it in those
cases.

Change-Id: If04125246bc21159b37d41c67a5b2556ec8ede3a
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit f75621c6ecadbd1802a7142fd346511cea05250a)

7 years agoUPSTREAM: Coccinelle: pm_runtime: reduce rule applicability
Julia Lawall [Sun, 31 Jan 2016 16:26:57 +0000 (17:26 +0100)]
UPSTREAM: Coccinelle: pm_runtime: reduce rule applicability

Rule r is only used in org or report mode, so only execute it in those
cases.

Change-Id: Ib2311a33fca6544b885bbf44b9695e1984680f96
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 79ff2b3deae7db21e73f1e0add92c988135defd2)

7 years agoUPSTREAM: Coccinelle: array_size: reduce rule applicability
Julia Lawall [Sat, 30 Jan 2016 16:13:54 +0000 (17:13 +0100)]
UPSTREAM: Coccinelle: array_size: reduce rule applicability

Rule r is only use in org or report mode, so only execute it in those
cases.

Change-Id: I00224a5dda297070e31defd650247261e08dc830
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit c7eaa8873b3e50667e0b6529141139147f34748e)

7 years agoUPSTREAM: Coccinelle: reduce rule applicability
Julia Lawall [Sat, 30 Jan 2016 15:27:04 +0000 (16:27 +0100)]
UPSTREAM: Coccinelle: reduce rule applicability

Rule r is only use in org or report mode, so only execute it in those
cases.

Change-Id: Id2705a31f11329132b5af54ba933c208a49557bd
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 8f551befa2269dc244bcfbcad795132f833cb71c)

7 years agoUPSTREAM: coccinelle: tests: unsigned value cannot be lesser than zero
Andrzej Hajda [Thu, 7 Jan 2016 09:36:51 +0000 (10:36 +0100)]
UPSTREAM: coccinelle: tests: unsigned value cannot be lesser than zero

Unsigned expressions cannot be lesser than zero. Presence of comparisons
'unsigned (<|<=|>|>=) 0' often indicates a bug, usually wrong type of variable.
The patch beside finding such comparisons tries to eliminate false positives,
mainly by bypassing range checks.

gcc can detect such comparisons also using -Wtype-limits switch, but it warns
also in correct cases, making too much noise.

Change-Id: I9fbf55a16d9ae508ca46cba2f8292d5e4b4cc697
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 3f984cb39907f87515d83657ecd471ae396a6c4a)

7 years agosched/fair: fix building without CGROUP_SCHEDTUNE
Huang, Tao [Wed, 12 Jul 2017 13:03:19 +0000 (21:03 +0800)]
sched/fair: fix building without CGROUP_SCHEDTUNE

Fixes: e00ebdcb8a7c ("sched/tune: don't use schedtune before it is ready")
Change-Id: I86312b6d271365cfb94e6ca570771a6bca46e67b
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
7 years agoMerge tag 'lsk-v4.4-17.06-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
Huang, Tao [Wed, 12 Jul 2017 11:35:02 +0000 (19:35 +0800)]
Merge tag 'lsk-v4.4-17.06-android' of git://git.linaro.org/kernel/linux-linaro-stable.git

LSK 17.06 v4.4-android

* tag 'lsk-v4.4-17.06-android': (134 commits)
  ANDROID: sdcardfs: remove dead function open_flags_to_access_mode()
  ANDROID: android-base.cfg: split out arm64-specific configs
  usb: gadget: f_fs: Fix possibe deadlock
  ANDROID: uid_sys_stats: check previous uid_entry before call find_or_register_uid
  ANDROID: sdcardfs: d_splice_alias can return error values
  android: base-cfg: disable CONFIG_NFS_FS and CONFIG_NFSD
  schedstats/eas: guard properly to avoid breaking non-smp schedstats users
  BACKPORT: f2fs: sanity check size of nat and sit cache
  FROMLIST: f2fs: sanity check checkpoint segno and blkoff
  sched/tune: don't use schedtune before it is ready
  sched/fair: use SCHED_CAPACITY_SCALE for energy normalization
  sched/{fair,tune}: use reciprocal_value to compute boost margin
  sched/tune: Initialize raw_spin_lock in boosted_groups
  sched/tune: report when SchedTune has not been initialized
  sched/tune: fix sched_energy_diff tracepoint
  sched/tune: increase group count to 5
  cpufreq/schedutil: use boosted_cpu_util for PELT to match WALT
  sched/fair: Fix sched_group_energy() to support per-cpu capacity states
  sched/fair: discount task contribution to find CPU with lowest utilization
  sched/fair: ensure utilization signals are synchronized before use
  ...

7 years agoBACKPORT: FROMLIST: mmc: dw_mmc: introduce timer for broken command transfer over...
Addy Ke [Wed, 12 Jul 2017 01:49:46 +0000 (09:49 +0800)]
BACKPORT: FROMLIST: mmc: dw_mmc: introduce timer for broken command transfer over scheme

Per the databook of designware mmc controller 2.70a, table 3-2, cmd
done interrupt should be fired as soon as the the cmd is sent via
cmd line. And the response timeout interrupt should be generated
unconditioinally as well if the controller doesn't receive the resp.
However that doesn't seem to meet the fact of rockchip specified Soc
platforms using dwmmc. We have continuously found the the cmd done or
response timeout interrupt missed somehow which took us a long time to
understand what was happening. Finally we narrow down the root to
the reconstruction of sample circuit for dwmmc IP introduced by
rockchip and the buggy design sweeps over all the existing rockchip
Socs using dwmmc disastrously.

It seems no way to work around this bug without the proper break-out
mechanism so that we seek for a parallel pair the same as the handling
for missing data response timeout, namely dto timer. Adding this cto
timer seems easily to handle this bug but it's hard to restrict
the code under the rockchip specified context. So after merging this
patch, it sets up the cto timer for all the platforms using dwmmc IP
which isn't ideal but at least we don't advertise new quirk here.
Fortunately, no obvious performance regression was found by test and the
pre-existing similar catch-all timer for sdhci has proved it's an acceptant
way to make the code as robust as possible.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196321
Signed-off-by: Addy Ke <addy.ke@rock-chips.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
[shawn.lin: rewrite the code and the commit msg throughout]
Change-Id: I47238c9758fe74b98a1dd3939f22e569261e696f
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/9834331/)

7 years agodrm/rockchip: hdmi: Limit rk3229/rk3328 max output resolution
Zheng Yang [Tue, 11 Jul 2017 09:53:32 +0000 (17:53 +0800)]
drm/rockchip: hdmi: Limit rk3229/rk3328 max output resolution

Limit RK3229/RK3328 max output resolution to 4K 50/60 YCbCr420 mode.

Change-Id: Icb934f6f057503ccb619f4ca6167b0958def336a
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3328-evb: enable hdmiphy
Zheng Yang [Tue, 11 Jul 2017 08:36:06 +0000 (16:36 +0800)]
arm64: dts: rockchip: rk3328-evb: enable hdmiphy

Change-Id: I173ec8ec759a1404f31718c8647cf6eb6315061f
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3328: hdmi enable inno-hdmi-phy driver
Zheng Yang [Tue, 11 Jul 2017 08:33:16 +0000 (16:33 +0800)]
arm64: dts: rockchip: rk3328: hdmi enable inno-hdmi-phy driver

Change-Id: I3d4c6dfcaffeb6679666fcedf58e645d26205efa
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
7 years agodrm: bridge: dw-hdmi: delete phy ops read/write
Zheng Yang [Tue, 11 Jul 2017 08:28:19 +0000 (16:28 +0800)]
drm: bridge: dw-hdmi: delete phy ops read/write

RK3328/RK3228 phy registers are mapped by inno-hdmi-phy driver,
there is no need to register hdmi phy debugfs on RK3328/RK3228.

Change-Id: I1e259b75ee7af6f29dffd5526d67776d5c6853ae
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
7 years agodrm/rockchip: hdmi: use inno-hdmi-phy driver to operate rk3328 hdmi phy
Zheng Yang [Tue, 11 Jul 2017 08:19:06 +0000 (16:19 +0800)]
drm/rockchip: hdmi: use inno-hdmi-phy driver to operate rk3328 hdmi phy

Change-Id: Ic090fec14f076ba634d35cb85c59c160c47d0058
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
7 years agophy: rockchip-inno-hdmi-phy: support rk3328 hdmi phy
Zheng Yang [Tue, 11 Jul 2017 08:03:48 +0000 (16:03 +0800)]
phy: rockchip-inno-hdmi-phy: support rk3328 hdmi phy

RK3328 hdmi phy is an upgraded version of 3228 hdmi phy, with
a completely different register layout. It improves physical
and antistatic capabilities.

It's max output bandwidth is same as rk3228 hdmi phy, optimized
up to 3.72Gbps per TMDS link.

Change-Id: I03c718c49e44cfeaa113e3ed07eec7055b4380cc
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
7 years agoarm64: rockchip_linux_defconfig: enable CONFIG_PHY_ROCKCHIP_INNO_HDMI_PHY
Zheng Yang [Tue, 11 Jul 2017 08:01:59 +0000 (16:01 +0800)]
arm64: rockchip_linux_defconfig: enable CONFIG_PHY_ROCKCHIP_INNO_HDMI_PHY

Change-Id: Ie775672f43e6c2491d750c82f604c454a367e136
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
7 years agodrm/rockchip: vop: support get register by name
Mark Yao [Tue, 27 Jun 2017 02:52:25 +0000 (10:52 +0800)]
drm/rockchip: vop: support get register by name

When get vop base register byname failed, retry first entry.

Change-Id: I60f4ebd901d353966c94734dd796dc702ae06f3f
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agodt-bindings: rockchip: vop: introduce registers names
Mark Yao [Tue, 11 Jul 2017 07:00:50 +0000 (15:00 +0800)]
dt-bindings: rockchip: vop: introduce registers names

Change-Id: I0df821f2582b26e26cfe3059db19a90b206df5c5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoarm64: dts: rockchip: rk3399-android: enable fiq mode
Huibin Hong [Mon, 21 Nov 2016 10:10:01 +0000 (18:10 +0800)]
arm64: dts: rockchip: rk3399-android: enable fiq mode

Change-Id: Ib40f065ba6ac2f597a27db87a46a0d2f7c0714ed
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
7 years agoARM: dts: rk3288-android: enable dmc auto frequency adjustment
Steven Chen [Wed, 12 Jul 2017 03:51:34 +0000 (11:51 +0800)]
ARM: dts: rk3288-android: enable dmc auto frequency adjustment

Enable dmc auto frequency adjustment and
set dmc minimum frequency to 400MHz for better performance

Change-Id: I0d2a192f438c23d879158f55dc948205f67f8663
Signed-off-by: Steven Chen <cw@rock-chips.com>
7 years agospi: rockchip: test: update driver
Huibin Hong [Wed, 12 Jul 2017 02:27:51 +0000 (10:27 +0800)]
spi: rockchip: test: update driver

Change-Id: I773cdc245fcdf8eee10dd7983343f206aecb856c
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
7 years agospi: rockchip: rockchip_spi_prepare_dma return 1 if it is ok
Huibin Hong [Wed, 12 Jul 2017 02:22:18 +0000 (10:22 +0800)]
spi: rockchip: rockchip_spi_prepare_dma return 1 if it is ok

If rockchip_spi_prepare_dma return 0, spi_transfer_one_message
won't wait for the dma complete event. Which may cause unknown
error.

Change-Id: Idf51a737bbd9fa9b9d1ae749636fe524de1cbfa9
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
7 years agosoc: rockchip: vendor storage support realloc
Zhaoyifeng [Thu, 18 May 2017 06:39:09 +0000 (14:39 +0800)]
soc: rockchip: vendor storage support realloc

To rewrite the same id with the data size large than first alloc size,
it`s will write fail. This commit will support realloc new memory
for rewrite.

Change-Id: Icd53afd072328dc45f1faae033471c5069664f05
Signed-off-by: Zhaoyifeng <zyf@rock-chips.com>
7 years agoarm64: dts: rockchip: use dwmmc for rk3366
Zorro Liu [Wed, 12 Jul 2017 02:39:47 +0000 (10:39 +0800)]
arm64: dts: rockchip: use dwmmc for rk3366

Change-Id: I3ecadd51e34545af61a1bfcc54ee0d6f045c40fa
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
7 years agodrm/rockchip: vop: fliter interlace mode
Mark Yao [Fri, 7 Jul 2017 08:23:50 +0000 (16:23 +0800)]
drm/rockchip: vop: fliter interlace mode

rk3288 and rk3368 are not support interlace mode

Change-Id: I5b6c155095285a5ae6e574efba122b56ddb1a112
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agopower: rk818-charger: fix usb charger undetected
William Wu [Fri, 7 Jul 2017 01:53:00 +0000 (09:53 +0800)]
power: rk818-charger: fix usb charger undetected

On some platforms (e.g. rk3399), we use extcon notify
framework to receive USB charger notifier from USB PHY
driver. Generally, the USB PHY driver uses a work to check
vbus status and the USB charger type every 2 seconds,
this polling mechanism may cause USB charger undetected
if we plug in/out USB charger quickly.

A typical error case is:
1. Plug in an USB DCP Adapter.
   - USB PHY driver sends notifier to rk818-charger
2. Plug out the USB Adapter, and plug in again immediately
   - rk818 detects plug out irq, and turns off charging
   - USB PHY driver schedule work doesn't detect the plug
     out/in operations, and doesn't send usb charger notifier

Fortunately, rk818 can detect plug in irq, so let's check
the USB charger type in rk818 plug in irq handler.

Change-Id: Iee45769c8a98c709da2dbfa514198ab0f648fd20
Signed-off-by: William Wu <william.wu@rock-chips.com>
7 years agoUPSTREAM: drm: introduce pipe color correction properties
Lionel Landwerlin [Fri, 26 Feb 2016 17:05:00 +0000 (17:05 +0000)]
UPSTREAM: drm: introduce pipe color correction properties

Patch based on a previous series by Shashank Sharma.

This introduces optional properties to enable color correction at the
pipe level. It relies on 3 transformations applied to every pixels
displayed. First a lookup into a degamma table, then a multiplication
of the rgb components by a 3x3 matrix and finally another lookup into
a gamma table.

The following properties can be added to a pipe :
  - DEGAMMA_LUT : blob containing degamma LUT
  - DEGAMMA_LUT_SIZE : number of elements in DEGAMMA_LUT
  - CTM : transformation matrix applied after the degamma LUT
  - GAMMA_LUT : blob containing gamma LUT
  - GAMMA_LUT_SIZE : number of elements in GAMMA_LUT

DEGAMMA_LUT_SIZE and GAMMA_LUT_SIZE are read only properties, set by
the driver to tell userspace applications what sizes should be the
lookup tables in DEGAMMA_LUT and GAMMA_LUT.

A helper is also provided so legacy gamma correction is redirected
through these new properties.

v2: Register LUT size properties as range

v3: Fix round in drm_color_lut_get_value() helper
    More docs on how degamma/gamma properties are used

v4: Update contributors

v5: Rename CTM_MATRIX property to CTM (Doh!)
    Add legacy gamma_set atomic helper
    Describe CTM/LUT acronyms in the kernel doc

v6: Fix missing blob unref in drm_atomic_helper_crtc_reset

Signed-off-by: Kumar, Kiran S <kiran.s.kumar@intel.com>
Signed-off-by: Kausal Malladi <kausalmalladi@gmail.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Acked-by: Rob Bradford <robert.bradford@intel.com>
[danvet: CrOS maintainers are also happy with the userspacde side:
https://codereview.chromium.org/1182063002/ ]
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1456506302-640-4-git-send-email-lionel.g.landwerlin@intel.com
(cherry picked from commit 5488dc16fde74595a40c5d20ae52d978313f0b4e)

Change-Id: I8952fa72998b669cf6d8a7e120a72ffb225b1ba1
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoUPSTREAM: GPU-DRM: Delete unnecessary checks before drm_property_unreference_blob()
Markus Elfring [Fri, 6 Nov 2015 11:03:46 +0000 (12:03 +0100)]
UPSTREAM: GPU-DRM: Delete unnecessary checks before drm_property_unreference_blob()

The drm_property_unreference_blob() function tests whether its argument
is NULL and then returns immediately.
Thus the tests around the calls are not needed.

This issue was detected by using the Coccinelle software.

Link: http://patchwork.freedesktop.org/patch/msgid/563C8B3E.405@users.sourceforge.net
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 5f911905054a64cf8c7871fddd33f4af74f07a17)

Change-Id: I599721227294c7cde5fd4f2ef6d5a97212b61b77
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
7 years agoARM: dts: rockchip: fix rk3288-android fiq-debugger irq
Huang, Tao [Fri, 7 Jul 2017 11:01:06 +0000 (19:01 +0800)]
ARM: dts: rockchip: fix rk3288-android fiq-debugger irq

153 is arm pmu irq.

Change-Id: I18c00eb0cb10646b1b73535837ac26af196a3b51
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
7 years agoARM: dts: rk3288-evb: enable hs200 mode
Steven Chen [Thu, 6 Jul 2017 07:49:40 +0000 (15:49 +0800)]
ARM: dts: rk3288-evb: enable hs200 mode

Change-Id: I2a805198e2441a33f721a2b7167c99a180f1fc21
Signed-off-by: Steven Chen <cw@rock-chips.com>
7 years agork_fiq_debugger: reset and init uart, if uart is abnormal
Huibin Hong [Tue, 4 Jul 2017 07:26:21 +0000 (15:26 +0800)]
rk_fiq_debugger: reset and init uart, if uart is abnormal

Change-Id: Idaa5d3d9ecd03325f3412a5b9e9b95eae20b0a22
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
7 years agoarm64: dts: rockchip: fix the memory size of PX5 Evaluation board
Andy Yan [Fri, 7 Apr 2017 08:19:29 +0000 (16:19 +0800)]
arm64: dts: rockchip: fix the memory size of PX5 Evaluation board

Commit 122682b2abb6 ("arm64: dts: rockchip: Add PX5 Evaluation board")
sets the memory size to 2 GB, but this board only has 1 GB DRAM, so change
it to the correct value here.

Fixes: 122682b2abb6 ("arm64: dts: rockchip: Add PX5 Evaluation board")
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry-picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
 commit 2f513bd9eac1a2642b40387d4f89c3987641e59b)

Change-Id: If6a64fa0eab3d76b90f122e63d30c1d7940b0a57
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
7 years agoarm64: dts: rockchip: add sdmmc support for px5-evb
Shawn Lin [Thu, 22 Sep 2016 04:02:18 +0000 (12:02 +0800)]
arm64: dts: rockchip: add sdmmc support for px5-evb

px5-evb has one sdmmc slot, so we could support sdmmc.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry-picked from git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
 commit 41a603b9337c412e5902091f5343f803b36b9995)

Change-Id: I3f4edbeefb39516d814d54b6583e2ada5505ab75
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>