Commit Graph

603028 Commits

Author SHA1 Message Date
shengfei Xu
5256a970bf regulator: rk808: fix the enable_val of rk816
The bitmask value must equal enable_val, then the regulator can
be enabled with the regulator output at the predefined voltage.

Change-Id: Ieadac80c04f3826b364d6fd9fa2e3c956f79b6c4
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-28 11:31:22 +08:00
Adam Thomson
a17856c5e7 UPSTREAM: device property: Add function to search for named child of device
For device nodes in both DT and ACPI, it possible to have named
child nodes which contain properties (an existing example being
gpio-leds). This adds a function to find a named child node for
a device which can be used by drivers for property retrieval.

For DT data node name matching, of_node_cmp() and similar functions
are made available outside of CONFIG_OF block so the new function
can reference these for DT and non-DT builds.

For ACPI data node name matching, a helper function is also added
which returns false if CONFIG_ACPI is not set, otherwise it
performs a string comparison on the data node name. This avoids
using the acpi_data_node struct for non CONFIG_ACPI builds,
which would otherwise cause a build failure.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Acked-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
commit 613e97218c)

BUG=chrome-os-partner:54440
TEST=Boot on kevin

Change-Id: Ide996e72bd1a290da4bd31233046da4cd2fc71f7
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/365263
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-24 18:40:10 +08:00
Andy Shevchenko
02eac3ee40 UPSTREAM: lib/string: introduce match_string() helper
Occasionally we have to search for an occurrence of a string in an array
of strings.  Make a simple helper for that purpose.

BUG=chromium:622499
TEST=Build image with match_string() enabled

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: David Airlie <airlied@linux.ie>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 56b060814e)
Signed-off-by: Guenter Roeck <groeck@chromium.org>

Change-Id: I6075bb868e3578caa33561c85f4be57f4ea94cc2
Reviewed-on: https://chromium-review.googlesource.com/355210
Commit-Ready: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-08-24 18:39:04 +08:00
shengfei Xu
c56195feba ARM: dts: rockchip: add rk816 node for rk3126-evb
Change-Id: I93d1d2c6115448cc6d12f87dd268b1f9fd9a0444
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-24 14:20:10 +08:00
shengfei Xu
206964ccd4 arm64: rockchip_linux_defconfig: enable suspend mode config
Change-Id: I00af7bf7964059ca7a459b116789726a045d68a1
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-24 14:04:33 +08:00
shengfei Xu
1b4c461c5b arm64: rockchip_linux_defconfig: enable SIP interface
Change-Id: Ic35a841e04ca84631d440ef5b09d2406a546e345
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-24 14:04:28 +08:00
Sandy Huang
1e23e1f0b2 clk: rockchip: rk3128: add clk gate for PCLK_MIPIPHY
Change-Id: Icf55c315edc9514a23d00433ffe56c864ad7f3d8
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2017-08-24 11:31:50 +08:00
shengfei Xu
f6cd885bf2 regulator: rk808: add support for get_mode/set_mode/set_suspend_mode on regulators
The regulators support mode switching, so add support for
these ops to those types of regulators

Change-Id: Ia2d052aed85988c10137ecc5681867bed2d44c24
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-23 20:38:30 +08:00
shengfei Xu
8516153ecb regulator: rk808: fix regulator operations table to the bucks for rk816
the patch fixes the following BUG:
[    2.249731] PC is at regulator_map_voltage_linear+0x78/0x16c
[    2.255413] LR is at regulator_map_voltage_linear+0x68/0x16c
[    2.261092] pc : [<c042c1a8>]    lr : [<c042c198>]    psr: 60000013
[    2.261092] sp : ef0a5a08  ip : 00000000  fp : c0c34368
[    2.272578] r10: 000b71b0  r9 : c120394c  r8 : 000b71b0
[    2.277817] r7 : 000b71b0  r6 : ee85b800  r5 : 000b71b0  r4 : ee85b800
[    2.284357] r3 : 00000000  r2 : dc8ba64d  r1 : 60000013  r0 : 00000021
[    2.290899] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[    2.298047] Control: 10c5387d  Table: 6000406a  DAC: 00000051

Change-Id: I4a0d773f7847e7af14d1850e2250671a216b0c86
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-23 20:37:15 +08:00
shengfei Xu
e7edb8f017 rtc: rk808: check the rtc is available for rk816
Change-Id: I383c08cd5ad7cb282c0ec0aa12e9e84c9df52ba3
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-23 20:35:50 +08:00
zain wang
0e601b1acb drm/rockchip: use suspend_late matching the resume_early
Sometimes, we would abort suspend work before it finished.
In this case, suspend work would try to resume the part suspended
by correspond resume functions.
But the suspend/resume functions are not matched in rockchip.
When the suspend work is aborted, it would ignored resuming this
part due to can't find correspond resume functions.
So, let's use suspend_late instead of suspend.

Change-Id: I7304f7963704de7e870fbd4e76ebe1e0066f18c1
Signed-off-by: zain wang <wzz@rock-chips.com>
2017-08-23 20:30:30 +08:00
Jung Zhao
283fd1016a video: rockchip: vpu: add reset lock
if someone call iommu translate during vpu_reset,
it may cause core dump. add reset lock to avoid
this situation.

Change-Id: Ia58eb106525a2f97d07b69c23cc4ef1b4d4cf151
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-08-23 10:16:07 +08:00
Jerry Xu
8e735ebf01 drm/rockchip: dw-mipi-dsi: use positive check for N{H, V}SYNC
Fixes: I1e5773b926c("use positive check for N{H, V}SYNC")

Change-Id: Id0b5ccc5a6b8d10f0c19b071b5fb928faf375704
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
2017-08-23 09:45:15 +08:00
shengfei Xu
b10bee7fb0 ARM: dts: rockchip: fix i2c base address error for rk312x
Change-Id: I06890c7a050b71a6bf1aca7692d9b3f1dd219332
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-23 09:41:36 +08:00
shengfei Xu
6956eab221 ARM: dts: rockchip: add backlight node for rk3126-evb
Change-Id: I6af6f4a47bc100b25fac2f3487eea46d07366a50
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-08-23 09:40:38 +08:00
Mark Yao
695bb4ec18 drm/rockchip: vop: fix display abnormal on mode changed
Bcsh r2y/y2r need be updated when mode changed, otherwise
would cause display abnormal.

Change-Id: Ida63da3dfb856948ca9f87880d2adc6aba1e9141
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-23 09:35:09 +08:00
zzc
13bfd439d8 net: wireless: rockchip_wlan: enable WL_VIRTUAL_APSTA
enable WL_VIRTUAL_APSTA to support concurrent AP and station mode

Change-Id: I217ad4af7989f79aadaf03da08d07d5076ae5834
Signed-off-by: zzc <zzc@rock-chips.com>
2017-08-22 18:08:42 +08:00
Joseph Chen
991cab4fc2 power: rk818-battery: add IRQF_ONESHOT for irq request
Change-Id: I1c049337d07d35148cfde37d91682b3799042e8c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-22 14:10:03 +08:00
Joseph Chen
2ea6f7bb7a power: rk818-battery: dump hotdie status
Change-Id: I9de0410b2e3e436801ee27ae59c984df58cc4bc8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-22 14:09:46 +08:00
Joseph Chen
a85656d090 power: rk818-battery: fix full charge sm_linek error
on the situation that: charger is connected and fuel gauge gives
state 'CC or CV', but actually battery is discharging from 100%
to 99%. At this moment we may treat this as normal full charging
by mistake, so we must add current judgement to avoid that.

Change-Id: I7b6692c17dc053fd96bd42df05c3f7763728bba2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-22 14:09:37 +08:00
Frank Wang
1ed00de5a9 ARM: dts: rockchip: add reserved-memory for trust on rk3229-echo board
This patch reserved 14M memory zone for OPTEE side on rk3229-echo board.

Change-Id: I46de3f7163dc14361d41476daf44957184f43e89
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-08-22 12:08:50 +08:00
WeiYong Bi
5b291d8cd7 drm/panel: simple: call panel_simple_unprepare() when shutdown
Change-Id: Ic1b18b91bd8becd9cc0002c44777153a6b50fd8a
Signed-off-by: WeiYong Bi <bivvy.bi@rock-chips.com>
2017-08-22 12:08:04 +08:00
Wyon Bi
3dff861292 Documentation: dt-bindings: simple-panel: update DSI panel example
Change-Id: I35e3ca0d696044587e676c952d3035ac0090dcdc
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2017-08-22 12:07:24 +08:00
Wyon Bi
9c0ea1f779 arm64: dts: rockchip: rk3399-sapphire-excavator: correct eDP panel node
Change-Id: If252cfa786c8018ba07807387b69493de46c7173
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2017-08-22 12:07:14 +08:00
Wyon Bi
dd25e35e08 drm: bridge: analogix: Avoid timeout warnings in analogix_dp_config_video()
[   23.527279] rockchip-dp ff970000.edp: Timeout of video streamclk ok
[   23.527325] rockchip-dp ff970000.edp: unable to config video

Change-Id: Ie2239c2dd773e4cb41f86b46b98367a07a751ff1
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2017-08-22 12:06:45 +08:00
Huibin Hong
6891be86bb spi: rockchip: configure CTRLR1 according to size and data frame
CTRLR1 is number of data frames.
When data frame is 8 bit, CTRLR1 is len-1.
When data frame is 16 bit, CTRLR1 is (len/2)-1.

Change-Id: I40b7ebd382f60bdfdab902394637c107d90531db
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2017-08-22 12:04:41 +08:00
Jung Zhao
6d994f02ab video: rockchip: vpu: remove extra input fd map/unmap
remap input fd is unnecessarily now.

Change-Id: I288fa2bad67be37603d9dedd4291d90d8cd2e602
Signed-off-by: Jung Zhao <jung.zhao@rock-chips.com>
2017-08-21 14:34:21 +08:00
Finley Xiao
eabe4ce8c6 dt-bindings: Add resets for Rockchip pvtm
Change-Id: Ie58612db5f24b24b1abf9f18e728872e38a6e2fb
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-21 12:42:38 +08:00
Finley Xiao
fb293558a5 arm64: dts: rockchip: rk3399: add pvtm resets
Change-Id: I1250a5193bd44b164d62d918401e60c7c4d31c59
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-18 11:55:34 +08:00
Finley Xiao
d3887a3c7c soc: rockchip: pvtm: reset before get value
Change-Id: I3fd177f267acebb53cebc2516a423f0e9ebbee5e
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-18 11:55:27 +08:00
Xu Xuehui
0e0828558c net: wireless: rockchip_wlan: fix bcmdhd driver wowlan_triger error on android 6.0
stack backtrace:
[   11.444844] PC is at kfree+0xcc/0x250
[   11.445181] LR is at nl80211_set_wowlan+0x3e4/0x70c
[   11.445617] pc : [<ffffff80081a09e0>] lr : [<ffffff8008aa9414>] pstate: a0000145
[   11.446271] sp : ffffffc04308f7f0
[   11.446572] x29: ffffffc04308f7f0 x28: ffffffc06437f200
[   11.447061] x27: 0000000000000014 x26: 0000000000000000
[   11.447549] x25: ffffff80090b6000 x24: 0000000000000018
[   11.448036] x23: ffffffc072d00a40 x22: ffffff80090b6000
[   11.448522] x21: ffffff8008aa9414 x20: feeffffffffffffe
[   11.449008] x19: 0000000003ffffff x18: 0000000000000000
[   11.449494] x17: 0000007fb52815f4 x16: ffffff80088ee7ec
[   11.449981] x15: 0000000000000030 x14: 0000000000000014
[   11.450467] x13: 0000000000000005 x12: 0000000000000005
[   11.450953] x11: 0000000000000001 x10: 0000000000000001
[   11.451437] x9 : 0000000000000000 x8 : 0000000000000000
[   11.451922] x7 : 0000000000000000 x6 : ffffffc0437bb068
[   11.452408] x5 : 0000000000000040 x4 : 0000000000000000
[   11.452893] x3 : ffffffbebfffffc0 x2 : 0000000000000028
[   11.453380] x1 : 0000000000000000 x0 : 0000000000000000

Change-Id: Ibe1967413a35589a47a8ffe5e902f148afefa9ee
Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
2017-08-18 10:05:52 +08:00
Finley Xiao
ad8c4dfa3a MALI: rockchip: Add support to select voltage according to leakage
The greater leakage, the lower the OPP's voltage. In order to reduce
power consumption, it is necessary to adjust OPP's voltage according
to leakage.

Change-Id: I2bba04ac941cc6a0703b5208cb4e757ec2813bab
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-18 10:05:08 +08:00
Finley Xiao
848f3c8daf MALI: rockchip: Add support to select voltage according to pvtm value
At same voltage and frequency, the greater the PVTM value, the lower
the OPP's voltage. In order to reduce power consumption, it is necessary
to adjust OPP's voltage according to PVTM value.

Change-Id: Ifcac57fc965e3ea45523db2d9df19435479f6cee
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-18 10:03:56 +08:00
Finley Xiao
2f85547ee4 arm64: dts: rockchip: rk3399: add nvmem-cells property for gpu
Change-Id: If538d1f8085dc686a25563a9eb891b79565a1c8d
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-18 10:03:26 +08:00
Finley Xiao
a6d461bc7e arm64: dts: rockchip: rk3399: add gpu pvtm voltage table
stress test:
1. Antutu, use governor simpleondemand
2. Need for Speed, use governor simpleondemand
3. Glmark2, use userspace, scanning frequency

Change-Id: Ibe27380e582b193d900b0d55da3567ce553c32df
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-18 10:03:13 +08:00
LinLongjian
c4f8d32e86 arm64: dts: rockchip: add bluetooth clk control on rk3399-sapphire-excavator
Change-Id: I60b7b67b676921a70a8a9f9705d8e58534885415
Signed-off-by: Longjian Lin <llj@rock-chips.com>
2017-08-17 20:50:21 -04:00
Zhangbin Tong
509d57bbcf arm64: dts: rockchip: rk3399-box: enable remote_support_psci
Change-Id: Icd60b10ebb65f1f181bc8ff916051c9e863809b9
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-08-17 18:25:34 +08:00
Zhangbin Tong
453afb9cb7 arm64: dts: rockchip: rk3368-r88: enable remote_support_psci
Change-Id: I1786e2e0c263df97d448df49cab605de412bd985
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-08-17 18:25:22 +08:00
Zhangbin Tong
2f87241254 arm64: dts: rockchip: rk3368-r88: update sleep mode config
Change-Id: I128041a3cff103655da3b2b3493c3326877259e3
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-08-17 18:25:09 +08:00
Zhangbin Tong
962eb69630 input: rc: support parser power key through the underlying firmware
Change-Id: If9ba76081eca80d2d210dd42307e727e673b8b8a
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-08-17 18:24:53 +08:00
Frank Wang
4e4550df7c ARM: dts: rockchip: tidy up rk3229 related dt
Pick out non-public dt nodes from dtsi and separately configure in dts.

Change-Id: I774f45e0b282fb1b783b5b175fa4ffc9ad904990
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-08-17 18:21:18 +08:00
Joseph Chen
208ce417cb mfd: rk808: add suspend and resume register setting for rk805
Because Buck3 don't have sleep state register, so we need a manual
switch: set BUCK3 suspend as Auto PWM mode and resume as FPWM mode.

This is for power saving in system suspend.

Change-Id: I67db458e650b6e85ed4267f0b0dcdb01dff4c635
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-17 12:04:07 +08:00
wlq
68f8d696e6 arm64: dts: rockchip: add dmc default config for rk3399
Change-Id: Iaeacb92a560743ff6dcf1f3977449004fa256992
Signed-off-by: Wu Liangqing <wlq@rock-chips.com>
2017-08-17 10:44:28 +08:00
Xu Xuehui
3de8752a4e net: wireless: rockchip_wlan: add network wakeup function for rtl8723bs
wifi driver open config such as below:

CONFIG_WOWLAN = y
CONFIG_GPIO_WAKEUP = y

Change-Id: I9bdb07e0210c68993bb638aa2ca403142e180c5f
Signed-off-by: Xu Xuehui <xxh@rock-chips.com>
2017-08-17 09:26:43 +08:00
Zhangbin Tong
210e0ef438 firmware: rockchip: add rc config interface
Change-Id: I3d769761f58c51fb366e99b62cf27a5974e511a1
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-08-16 18:32:11 +08:00
Frank Wang
b5bb4868b8 phy: rockchip-inno-usb2: put phy-port into suspend during probe
Let us put phy-port into suspend mode at initialization time for
saving power consumption, and usb controller will resume it during
probe time if needed.

Change-Id: Id3a66af8ff17612d54fbc80db087bf67eaee7726
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
2017-08-16 18:30:11 +08:00
Marek Szyprowski
3b4dbd5b83 UPSTREAM: dma-buf: add support for compat ioctl
Add compat ioctl support to dma-buf. This lets one to use DMA_BUF_IOCTL_SYNC
ioctl from 32bit application on 64bit kernel. Data structures for both 32
and 64bit modes are same, so there is no need for additional translation
layer.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1487683261-2655-1-git-send-email-m.szyprowski@samsung.com
(cherry picked from commit 888022c047)

Change-Id: I6e80fb34c3915f9b77be432947c8ddd1ecfd221f
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-15 18:43:45 +08:00
Mark Yao
5f98c9f6ff drm/rockchip: vop: set BCSH propetries default
Change-Id: Ib8ce044525cb611c8d6df2207c12fb51bb74460b
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-15 18:39:55 +08:00
Mark Yao
e268caad71 drm/rockchip: vop: add BCSH support for full vops
The full name of BCSH is Brightness, Contrast, Saturation and Hue.
BCSH is supported on all full vop designed.

Change-Id: I17bcd5a07b93b3c68aa892606f886bcd3a7673a0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-15 18:38:48 +08:00
Boris Brezillon
2272eb5d62 UPSTREAM: drm: Add TV connector states to drm_connector_state
Some generic TV connector properties are exposed in drm_mode_config, but
they are currently handled independently in each DRM encoder driver.

Extend the drm_connector_state to store TV related states, and modify the
drm_atomic_connector_{set,get}_property() helpers to fill the connector
state accordingly.

Each driver is then responsible for checking and applying the new config
in its ->atomic_mode_{check,set}() operations.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 299a16b163)

Change-Id: I50d7c79013235d75972b8cdd46cf89bbd9cf596d
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2017-08-15 18:38:28 +08:00