Commit Graph

609040 Commits

Author SHA1 Message Date
Dingqiang Lin
4f7c7cdaef Documentation: bindings: add DT documentation for rkflash driver
Change-Id: I88c079435e6d1623eedc7317438fca9bf3f21759
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-05-23 09:26:14 +08:00
Dingqiang Lin
d66b1d9e6a soc: rockchip: add flash vendor storage support
Change-Id: I0261e652161e6a20a4d988c4ddfd7f186ad2200e
Signed-off-by: Dingqiang Lin <jon.lin@rock-chips.com>
2018-05-23 09:26:14 +08:00
Huibin Hong
69a8ff2ffa soc: rockchip: rk_fiq_debugger: remove debug_port_init of uart putc and flush
If uart is busy all the time, which may call debug_port_init and
reset uart, but this can't clear the USR busy status. The LCR can't be
writed if UART is busy.UART can't be reinited ok.

This issue is tested by open and close wifi, and start logcat.
A lot of android log is outputed by uart,uart is always busy,maybe it
triggers reinit process, and cause the issue.

It is unnecessary to call debug_port_init, because we have make sure
uart is ok all the time.

Change-Id: I1ef06e2a913d7045e86fe75a48a152c04e7e96a7
Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
2018-05-22 16:49:19 +08:00
Caesar Wang
a9010d53ff arm64: dts: rockchip: with GPT for rk3326-linux bootargs
The linux platform used the GPT for update image, and the new
tools(v2.55) had fixed the bug before.

Change-Id: I200d98170d538098c4e3472a22398a4ecc15270e
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2018-05-22 16:18:49 +08:00
Ziyuan Xu
ee9369d235 pwm: gpio: reivse something according from the upstream
-sort include files alphabetically
-drop DRV_NAME
-fix type definition of some variables
-only support one gpio per node
-fixup gpio output value polarity

The PWM_POLARITY_NORMAL(=0) means a high signal for the duration of the
duty-cycle, thus rectify the output value in pwm_on&off.

Usually, the pwm output should be a low signal before the first-timeuse.
Because of the probe function set the gpio output value to GPIOD_OUT_LOW
within devm_gpiod_get_index, we have been forced to set the flag of
gpios with ACTIVE_HIGH.

-fixup reverse the output signal at an inappropriate moment

In one case, someone set the value of duty_cycle as the same as the
period while the pwm output is enable, the off_time will be set to zero.
However the original implementation still to set the pwm output to a low
signal, it causes the output is not a **real** high signal. As the
result,
the output duty cycle is almost 97 percent.

Change-Id: I449fc96938ccaeb7bdfaf90e237eeb9f5c4e6de6
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2018-05-22 14:45:10 +08:00
Ziyuan Xu
2c43cafb74 Documentation: dt: pwm-gpio: fix a bad sample
Refer to the proposal of https://patchwork.kernel.org/patch/7492201/ to
fixup the sample.

Change-Id: Ia81c631fcdb2893cbec3f12b828162bc090b99cd
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
2018-05-22 14:45:10 +08:00
Olliver Schinagl
db7279d29f FROMLIST: pwm: gpio: Add a generic gpio based PWM driver
This patch adds a bit-banging gpio PWM driver. It makes use of hrtimers,
to allow nano-second resolution, though it obviously strongly depends on
the switching speed of the gpio pins, hrtimer and system load.

Each pwm node can have 1 or more "pwm-gpio" entries, which will be
treated as pwm's as part of a pwm chip.

Change-Id: Ibdb28eca3239a3a8503c947667117a9b0e9427b9
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
(cherry picked from https://patchwork.kernel.org/patch/7492201/)
2018-05-22 14:45:10 +08:00
Liang Chen
054d326294 arm64: dts: rockchip: adjust opp-table by pvtm for px30/rk3326
Change-Id: I0d72c313a484611ca20c0b39b21ce6d3ed85d7d4
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-05-22 09:45:44 +08:00
Liang Chen
e5a5cff62f PM / devfreq: rockchip: adjust opp-table by pvtm for dmc and gpu
Change-Id: Iec80dc04ddedbfe747dd7a9ff45e0b1a111728ac
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-05-22 09:45:43 +08:00
Liang Chen
d5ee3defbe soc: rockchip: opp_select: use the saved pvtm data for the same channel
Some modules will use the same pvtm channel to adjust opp-table, do not
calclate pvtm data twice for the same channel.

Change-Id: Ib8d765139821cfbdcc45bd60153d975fc80d48fa
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-05-22 09:45:25 +08:00
Sugar Zhang
2b987b28a8 ASoC: rockchip: i2s_tdm: add support for tdm mode
Change-Id: Id99c14a1f49796107186405b8b73bffcc49143e8
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
2018-05-21 18:37:06 +08:00
William Wu
5597d4ac85 FROMLIST: usb: dwc2: fix the incorrect bitmaps for the ports of multi_tt hub
The dwc2_get_ls_map() use ttport to reference into the
bitmap if we're on a multi_tt hub. But the bitmaps index
from 0 to (hub->maxchild - 1), while the ttport index from
1 to hub->maxchild. This will cause invalid memory access
when the number of ttport is hub->maxchild.

Without this patch, I can easily meet a Kernel panic issue
if connect a low-speed USB mouse with the max port of FE2.1
multi-tt hub (1a40:0201) on rk3288 platform.

Change-Id: I51c6fb53919e3ab186b95180c4fd6569e03cffee
Signed-off-by: William Wu <william.wu@rock-chips.com>
(am from https://patchwork.kernel.org/patch/10414533/)
2018-05-21 18:16:42 +08:00
Huang jianzhi
38160e8ac9 arm64: dts: rockchip: add new dts for rk3328 liantong box
Change-Id: Icb443a3b0d5117c6eed9e64b0321106a90813bb9
Signed-off-by: Huang jianzhi <jesse.huang@rock-chips.com>
2018-05-21 15:54:28 +08:00
Zhen Chen
b1111d30ea MALI: rockchip: upgrade bifrost DDK to r12p0-01rel0
in addition,
	resolve all the conflicts;
	rename all the configs and macros that have a same name in midgard/;
	adjust "platform specific code" for the change of interface
		to get GPU busy/idle time from "common part";

Change-Id: Iad3493c15c95653a1c72c5375f510e44c4535d0c
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-05-21 11:37:35 +08:00
Huang jianzhi
fda77a2530 ARM64: dts: rockchip: rk3328: add the pwm0 and pwm1 pull up pinctrl interface
Change-Id: I2e21318a5863a020f104872c803ff2250b84fd7d
Signed-off-by: Huang jianzhi <jesse.huang@rock-chips.com>
2018-05-21 11:01:03 +08:00
Elaine Zhang
66aa9cdc5b ARM64: dts: rockchip: rk3399: mark xin32k clk as fixed clk
Change-Id: Ia9e0af6242a20c62e4042afe4d99dedcfbeb753b
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-05-21 09:42:56 +08:00
Elaine Zhang
d42f8848b6 ARM64: dts: rockchip: rk3368: mark xin32k clk as fixed clk
Change-Id: I773b37449b67518e06102c950d34e55b778295db
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-05-21 09:41:31 +08:00
Elaine Zhang
9b3c02ff75 ARM64: dts: rockchip: rk3366: mark xin32k clk as fixed clk
Change-Id: Ic9a6167e389f39bc93fd6214b8fe07ef30dea7da
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-05-21 09:36:07 +08:00
Elaine Zhang
7b06728ef9 ARM64: dts: rockchip: rk3328: mark xin32k clk as fixed clk
Change-Id: I25ab72ba7af64b7031fb02d30d0cb5cb6798d692
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-05-21 09:36:07 +08:00
Elaine Zhang
ad49663a83 ARM: dts: rk322x: mark xin32k clk as fixed clk
Change-Id: I89a5f3f8a938b68d00b655a6e93160c865691c2c
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-05-21 09:36:06 +08:00
Elaine Zhang
f69d17a2ae ARM: dts: rk312x: mark xin32k clk as fixed clk
Change-Id: If5aa3acb02580eb7766ad118ddf189c218f7acac
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-05-21 09:36:06 +08:00
Elaine Zhang
128cff7b2b ARM: dts: rk3036: mark xin32k clk as fixed clk
Change-Id: I5bf0a64502a7dd7b36545437b1675bb896c97bce
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-05-21 09:36:06 +08:00
Elaine Zhang
d901f21180 ARM: dts: rk3288: mark xin32k clk as fixed clk
Change-Id: I1fc9c2f8213f6645659bd731546ca9cafd7d63d0
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
2018-05-21 09:36:05 +08:00
Stefan Brüns
ade6b9cc4e UPSTREAM: iio: light: vl6180: Correct ALS scale for non-default gain/integration time
The reported scale was only correct for the default settings of 100 ms
integration time and gain 1.

This aligns the reported scale with the behaviour of any other IIO driver
and the documented ABI, but may require userspace changes if someone uses
non-default settings.

Change-Id: I969d50d317f20d05d26db74d497dba790b5a7c25
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
(cherry picked from commit 3525d7cfb7)
2018-05-19 10:50:09 +08:00
Stefan Brüns
990f320ea5 UPSTREAM: iio: light: vl6180: Cleanup als_gain lookup, avoid register readback
Instead of manually iterating the array of allowed gain values, use
find_closest. Storing the current gain setting avoids accessing the
hardware on each query.

Change-Id: Ibd41d58d50c29fdf17609d0323d8d54bdf3109a7
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
(cherry picked from commit e794bf6751)
2018-05-19 10:50:04 +08:00
Stefan Brüns
78eebdc51c UPSTREAM: iio: light: vl6180: Avoid readback of integration time register
Instead of reading the value from the register on each query, store the
set value.

Change-Id: If7930543623f78abb67f33106c0c0a12d4e1ac33
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
(cherry picked from commit df698c0402)
2018-05-19 10:49:59 +08:00
Stefan Brüns
1941dc1d35 UPSTREAM: iio: light: vl6180: Move range check to integration time setter, cleanup
This improves code uniformity (range checks for als_gain are also done
in the setter). Also unmangle rounding and calculation of register value.

The calculated integration time it_ms is required in the next patch of
the series.

Change-Id: I5a315428927056b72899e303019d64f20ee34cbf
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
(cherry picked from commit 1e2ed3d0d2)
2018-05-19 10:49:52 +08:00
Manivannan Sadhasivam
1521879c60 UPSTREAM: iio:light: Add support for STMicro VL6180 sensor
This patch adds support for STMicro VL6180 - ALS, range and proximity sensor. Sensor is capable of measuring the light
intensity as well as object distance using TOF (Time of Flight) technology.

Change-Id: I5ad6d2c2a93d5906aebfda6cb2cff332bc7c2462
Signed-off-by: Manivannan Sadhasivam <manivannanece23@gmail.com>
Signed-off-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
(cherry picked from commit 5e7f47e495)
2018-05-19 10:49:43 +08:00
Zorro Liu
cad27e4b13 arm: dts: rockchip: remove lane-rate and mipi_dsi_num defined of rk3288-th804 board
Change-Id: Ic987f8d95e188579813e15b1622ac9f2f998b33b
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2018-05-18 18:04:51 +08:00
Zheng Yang
bb9bdab32f phy/rockchip: inno-hdmi: round rk3328 recalc frac rate by 1000Hz
For pixel clock is rounded by 1000Hz, the recalcated clock rate
of fractional frame rate mode, such 59.94/29.97/23.97Hz, is need
to take the 1000Hz rounding. Otherwise it will not find the pre-pll
settings when powering up phy.

Change-Id: I0f02bbede9314d57d97c539cd995eb0f67295cfd
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
2018-05-18 17:53:53 +08:00
Shunqing Chen
1df09ca4e1 power: cw201x: add power_supply property for CTS.
Change-Id: Ia342ef45a4e936be3e9ba200b41cfabfcbe5f927
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-05-18 16:33:59 +08:00
Shunqing Chen
91b9c4cb57 power: bq25700: add power_supply property for CTS.
Change-Id: I1b496dc8b3c4c53e54f40e07801cda419f654dfd
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-05-18 16:19:26 +08:00
YouMin Chen
3dd9af3221 arm64: dts: rockchip: px30: modify dram default timing
Set the default value for pd_idle,sr_idle and standby_idle.

Change-Id: Idfa2d62229fd8ec1ab48c2506a6b5ba3da080a49
Signed-off-by: YouMin Chen <cym@rock-chips.com>
2018-05-18 15:56:49 +08:00
xiaoyao
4da5a60340 net: wifi: The rtl8189fs is sdio interface, so fix this error
Change-Id: Ia34c96d95d639063470d2a37df25466dfa54cec8
Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
2018-05-18 14:42:47 +08:00
Zhou weixin
46c5f780b1 arm64: dts: rockchip: px30-android: remove system/vendor verify
Change-Id: I878e876c167e1a0292c46cff8fd1652747ff0d0a
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
2018-05-17 19:08:35 +08:00
Xing Zheng
2cd194ee98 arm64: dts: rockchip: add some properties for RK3308 EVB
This patch add rockchip,card-name, and add rockchip,codec-hp-det
if with acodec for vad-sound.

Change-Id: Ib81651f9b52933f24257a42e977a5382da745df8
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 18:25:37 +08:00
Xing Zheng
943ff31da1 arm64: dts: rockchip: using multicodec for RK3308 EVB
If we need to extend custom audio features, using multicodec
is much more convenient than limited simple-card.

Change-Id: I784e38d33ded9a7dd9c253595611f343a4dcd566
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 18:25:26 +08:00
Xing Zheng
a40cd969de arm64: dts: rk3308: enable mclk calibration for i2s_8ch
Change-Id: I16db1649523cc2132664c5f00c3bf8246a2d8800
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 18:22:53 +08:00
Xing Zheng
d0b882b30f ASoC: rockchip: i2s-tdm: add rockchip,mclk-calibrate
Change-Id: I55d668a0ce634970c398f5ff27b474f69173a057
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 18:22:34 +08:00
Xing Zheng
f9b136f50b ASoC: rockchip: i2s-tdm: add support calibrate mclk src
Usually, there are 2 groups of sample rates on audio system:
a) 8000/16000/32000/48000/64000/96000/192000
b) 11025/22050/44100/88200/176400

If the platform provides two suitable multiples of the
PLLs(e.g VPLL0@1179648000, VPLL1@903168000 on RK3308),
we can switch the mclk src to VPLL0 if sample rate
belongs a) group, otherwise, switch the mclk src to
VPLL1. Also, we need to ensure that the numerator of
fractional division is equal to 1. And we need to set
a suitable reference frequency for the parent of mclk:

group a) is 192000*256=49152000Hz
group b) is 176400*256=45158400Hz

The following is the calibrated i2s_8ch_2 on RK3308 EVB:
========
// VPLL0=1179648000Hz, VPLL1=903168000Hz
// @8000Hz, root is VPLL0,mclk=2048000Hz, FRAC division, numerator is 1
ff5001f0:  00000417 00010018 00000013 00000000
// @11025Hz, root is VPLL1,mclk=2822400Hz, FRAC division, numerator is 1
ff5001f0:  00000513 00010010 00000013 00000000
// @16000Hz, root is VPLL0,mclk=4096000Hz, FRAC division, numerator is 1
ff5001f0:  00000417 0001000c 00000013 00000000
// @22050Hz, root is VPLL1,mclk=5644800Hz, FRAC division, numerator is 1
ff5001f0:  00000513 00010008 00000013 00000000
// @32000Hz, root is VPLL0, mclk=8192000Hz, FRAC division, numerator is 1
ff5001f0:  00000417 00010006 00000013 00000000
// @44100Hz, root is VPLL1, mclk=11289600Hz, Integer division direclty
ff5001f0:  0000014f 00010006 00000013 00000000
// @48000Hz, root is VPLL0, mclk=12288000Hz, Integer division direclty
ff5001f0:  0000005f 00010006 00000013 00000000
// @64000Hz, root is VPLL0, mclk=16384000Hz, Integer division direclty
ff5001f0:  00000047 00010006 00000013 00000000
// @88200Hz, root is VPLL1 mclk=22579200Hz, Integer division direclty
ff5001f0:  00000127 00010006 00000013 00000000
// @96000Hz, root is VPLL0, mclk=24576000Hz, Integer division direclty
ff5001f0:  0000002f 00010006 00000013 00000000
// @176400Hz, root is VPLL1, mclk=45158400Hz, Integer division direclty
ff5001f0:  00000113 00010006 00000013 00000000
// @192000Hz, root is VPLL0, mclk=49152000Hz, Integer division direclty
ff5001f0:  00000017 00010006 00000013 00000000
========

Change-Id: I6776f96e92790ba83a7d0f5caeeaf917dff5e5c5
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 18:21:52 +08:00
Xing Zheng
1f6bb2da54 ASoC: rockchip: i2s-tdm: set mclk tx/rx rate independently
By default the i2s-tdm supports asymmetric sample rate,
we just set mclk tx or rx during playback or capture.

Change-Id: I1a9786a64b956c68bb5ba8796d2742f5b142b124
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 18:20:49 +08:00
Xing Zheng
d343a4d86a ASoC: rockchip: multicodecs: using stream not clk_id
We need to using stream to know whether is playback
or capture in sys_clk.

Change-Id: If392c0bc6a6b7d9309ca8ee5b33945d42193792e
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 18:20:49 +08:00
Zorro Liu
d1fc73aa94 arm: configs: rockchip_defconfig: enable rk818 charger default
Change-Id: I77d10f15454111995bd27d7a9c40ef252a84ae71
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2018-05-17 17:00:17 +08:00
Zorro Liu
ca39545e9c arm: dts: rockchip: enable i2c3 for camera of rk3288-th804 board
Change-Id: I7f3a791d5c7f75c87a8c917309c7bbdddea19b80
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
2018-05-17 17:00:17 +08:00
Xing Zheng
bad07cca63 ASoC: rockchip: add rockchip,card-name property for multicodecs
Change-Id: I5b38d8f425348947a165079f6863c2f059242d50
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 14:17:30 +08:00
Xing Zheng
4ead0bc4a5 ASoC: rockchip: multicodecs: add parse sound card name
Change-Id: I14e1d79ef248d1348a164aa5f9b2fd251cc1a0a6
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 14:17:14 +08:00
Xing Zheng
b49399f76e ASoC: rockchip: add rockchip,codec-hp-det for multicodecs
Change-Id: I0fdf27207762122a30edc7c0373595f2ef0b597d
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 14:16:37 +08:00
Xing Zheng
bec79a02ce ASoC: rockchip: multicodecs: add codec_hp_det feature
This patch supports headphone jack for rockchip multi-
codec machine driver.

And we need to add CONFIG_SND_SOC_RK3308 macro to ensure
compile correct on other SoCs that are without rk3308
codec.

Change-Id: I80d2ca5e269aa62865bd6b9f2da9fc7736bce4c9
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 14:15:15 +08:00
Xing Zheng
1851402c8e ASoC: rk3308_codec: set hpdet_jack from machine driver
The hpdet_jack should be set from external machine
driver.

Change-Id: I5f7e154c084434fa730c2a9ff505bfaa4e404a5f
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 14:12:15 +08:00
Xing Zheng
6f1983d819 clk: rockchip: rk3308: Export clk id for i2s src clocks
Change-Id: I4ba557649a95513d6cfbdb2242a5abb3f3650a61
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
2018-05-17 14:08:33 +08:00