It may be that many amplifiers have a long startup delay.
If the playback is too early before the amplifier is
turned on and stable, it may cause loss of audio data.
Therefore, we need to delay playback according to
different amplifier performance.
Change-Id: I7d54f89217df560a68c080e82313eb2399d44b0a
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
This reverts commit 234d421421.
We do not use coherent_pool=0 anymore.
Change-Id: I3b05f15955c8f4b156cf8a4dfd8c0977e33a24b9
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
If coherent_pool size is zero, kernel will panic when arm_dma_free.
It seems kernel do not like without atomic_pool, so keep this pool
as small as possible.
Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = deb70000
[00000004] *pgd=1e571835, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] PREEMPT SMP THUMB2
Modules linked in:
CPU: 2 PID: 674 Comm: sh Not tainted 4.4.138 #187
Hardware name: Generic DT based system
task: deb89540 task.stack: df37a000
PC is at addr_in_gen_pool+0x10/0x3c
LR is at addr_in_gen_pool+0xf/0x3c
pc : [<c0154b24>] lr : [<c0154b23>] psr: 00000033
sp : df37be80 ip : df37a07c fp : 000686ec
r10: debc6f48 r9 : 1e406000 r8 : 00000000
r7 : e091d000 r6 : e091d000 r5 : e091efff r4 : 00000000
r3 : 00000001 r2 : deb89540 r1 : e091d000 r0 : 00000000
[<c0154b24>] (addr_in_gen_pool) from [<c0064a55>] (arch_free_from_atomic_pool+0x19/0x54)
[<c0064a55>] (arch_free_from_atomic_pool) from [<c0064ae3>] (__arm_dma_free+0x53/0xb0)
[<c0064ae3>] (__arm_dma_free) from [<c0064b61>] (arm_dma_free+0xf/0x12)
[<c0064b61>] (arm_dma_free) from [<c017f1a7>] (serial8250_release_dma+0x71/0xd2)
[<c017f1a7>] (serial8250_release_dma) from [<c017dda1>] (serial8250_do_shutdown+0x23/0x98)
[<c017dda1>] (serial8250_do_shutdown) from [<c017ad6b>] (uart_shutdown+0x87/0xba)
[<c017ad6b>] (uart_shutdown) from [<c017b543>] (uart_close+0x8b/0x116)
[<c017b543>] (uart_close) from [<c0174539>] (tty_release+0x20d/0x318)
[<c0174539>] (tty_release) from [<c00db5af>] (__fput+0x8b/0x120)
[<c00db5af>] (__fput) from [<c007b83b>] (task_work_run+0x6b/0x7c)
[<c007b83b>] (task_work_run) from [<c005f551>] (do_work_pending+0x65/0x66)
[<c005f551>] (do_work_pending) from [<c005d301>] (slow_work_pending+0x9/0x18)
Change-Id: If3fc962e4e936132fee021f5e6932cdabfd5ffda
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
The "arm,no-tick-in-suspend" property was introduced to note
implementations where the system counter does not quite follow the ARM
specification that it "must be implemented in an always-on power
domain".
Particularly, RK3399's counter stops ticking when we switch from the
24MHz clock to the 32KHz clock in low-power suspend, so let's mark it as
such.
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit e6186820a7)
Change-Id: Ib1d54426c985235ba0a383012a6e4437a9fae80c
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Tree-wide replacement was done by commit 2ef7d5f342 (ARM, ARM64:
dts: drop "arm,amba-bus" in favor of "simple-bus"), but we have some
new users of "arm,amba-bus" at Linux 4.7-rc1. Eliminate them now.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Chanho Min <chanho.min@lge.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
(cherry picked from commit 15b7cc78f0)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Conflicts:
arch/arm64/boot/dts/lg/lg1312.dtsi
Change-Id: I249c73ade56946fa0548b9f36889abaa7e77d3df
This patch updates the dynamic-power-coefficient for big cluster on
rk3399 SoCs.
The dynamic power consumption of the CPU is proportional to the square of
the Voltage (V) and the clock frequency (f). The coefficient is used to
calculate the dynamic power as below -
Pdyn = dynamic-power-coefficient * V^2 * f
Where Voltage is in uV, frequency is in MHz.
As the following is the tested data on rk3399's big cluster.
frequency(MHz) Voltage(V) Current(mA) Dynamic-power-coefficient
24 0.8 15
48 0.8 23 ~417
96 0.8 40 ~443
216 0.8 82 ~438
312 0.8 115 ~430
408 0.8 150 ~455
So the dynamic-power-coefficient average value is about 436.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Conflicts:
arch/arm64/boot/dts/rockchip/rk3399.dtsi
Change-Id: I05a573eb7e0a74301f35fdeb2517f7fe3be9b8fb
Provide the dynamic power coefficient of the big and little CPU
clusters. These numbers are currently in use on the Samsung Chromebook
Plus ("Kevin").
The power allocator thermal governor doesn't know how to do anything if
it doesn't get power parameters from its cooling devices (in this case,
CPUfreq). So this effectively enables the power-allocator governor.
Signed-off-by: Brian Norris <briannorris@chromium.org>
[set the property in each core node]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(Cherry-picked from f4697bd702)
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Conflicts:
arch/arm64/boot/dts/rockchip/rk3399.dtsi
Change-Id: I8899a2224fe6cbf6e6f874006bf115eee62b7041
Patch reorder some codes to sync with upstream codes
Change-Id: Iba1971dcee9b5cfb25b62e8bfa2135f0576398e9
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Clean up the init code and move the creation of factor clocks to the
appropriate positions coming from the clock architecture diagrams.
This also unifies the artificial separation of the hclk_vcodec etc clocks
again.
We do keep the separate definition of some watchdog and usb480m pseudo
clocks for now, as they're not real factor clocks from the clock-tree
but placeholders for fixes to come (usb480m gets supplied by the
missing driver for the new usbphy type and the watchdog-gate is sitting
somewhere else together which we cannot model currently).
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 36714529f8)
Change-Id: I43b579b4d0b16b191e220a1748b6d11c7a30b4be
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
rockchip_clk_register_ddrclk should not return NULL when failing
to call clk_register, otherwise rockchip_clk_register_branches
prints "unknown clock type". The actual case is that it's a known
clock type but we fail to register it, which may makes user confuse
the reason of failure. And the pr_err here is pointless as
rockchip_clk_register_branches will also print the similar message.
Change-Id: Id09f496979ab839d04b5ec4cf5c623fde9215440
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 4a262b14c5)
camera: rockchip: add sensor ioctl and max gain.
1. add RK_VIDIOC_SENSOR_CONFIGINFO;
2. add RK_VIDIOC_SENSOR_REG_ACCESS;
3. add max_exp_gain_h/max_exp_gain_l;
camera: rockchip: merge isp11: rockchip: v0.1.7
isp11: rockchip: v0.1.7
1. Direct config isp lsc table size in cifisp_lsc_config.
Because active_lsc_width is not same with isp register
after isp reset.
2. Support separate config sensor gain and shutter time
for some sensor which gain and shutter isn't valid at
the same time. for example ov2710.
ov4689:v0.1.0;
ov2710:v0.1.1;
imx323:v0.1.0;
camera: rockchip: Support v4l2 subdev api
ov2710: v0.1.2
ov4689: v0.1.1
imx323: v0.1.2
camera: rockchip: add lock for stream/aec
hold reg in AEC will affect stream reg, if asynchronous.
camera: rockchip: fix sensor timing
if fps changed, vts changed, update to timing.
camera: rockchip: support set flip api
camera: rockchip: support get flip api
camera: rockchip: fix release bug
should be free pdata at the end
camera: rockchip: imx323
fix s_fmt failed for imx323 v0.1.2;
camera: rockchip: fix s_frame_interval failed
fix s_frame_interval failed when frame interval is match
active config frame interval.
camera: rockchip: imx,aptina,ov
Check xxx_camera_module_init return value in PLTFRM_CIFCAM_ATTACH
camera: rockchip: release sensor if init fail
camera: rockchip: imx,aptina,ov
support mirror/flip conifg in dts for imx323/ov4689
camera: rockchip: add s_frame_interval/g_frame_interval
camera: rockchip: ov, aptina, imx
add s_frame_interval/g_frame_interval
camera: rockchip: imx,ov,aptina
1.imx,ov: fix g_timing error if s_frame_interval before stream_on,
because vts_cur is update in stream_on;
2.aptina: fix compile error;
camera: rockchip: imx,ov,aptina
1. fix calc vts wrong in xxx_camera_module_s_stream
Change-Id: I5a6e75f2ce3c50d69c51af9792232c60b6982128
Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
clk_testout1 and clk_testout2 are used for camera handling, so add their ids.
Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 25fb42b1cf)
Change-Id: I8000e84264b032835cc3d11a6810264967f4248e
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
we use SCLK_TESTCLKOUT1 and SCLK_TESTCLKOUT2 for camera, so add those ids.
Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit f22e4359cd)
Change-Id: Ibbdb8e9dabd8c955ef3745c0f49c20f4c763e870
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Export the dclk_vop_frac out, so we can set the dclk_vop as the
child of dclk_vop_frac, and then we can start to take use of
the fractional dividers.
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 7b0f9e357a)
Change-Id: I08686f8ecbcfb5de7bc99aadd314f6e35ac22995
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Export the dclk_vop_frac out, so we can set the dclk_vop as the
child of dclk_vop_frac, and then we can start to take use of
the fractional dividers.
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit e33075db73)
Change-Id: I3d47c6aecc338de45b48414f0d0327c17e6d2b15
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Currently the fractional divider clock time can't handle the
CLK_SET_RATE_PARENT flag. This is because, unlike normal dividers,
there is no clk_divider_bestdiv() function to try speeding up the parent
to see if it helps things.
Eventually someone could try to figure out how to make fractional
dividers able to use CLK_SET_RATE_PARENT, but until they do let's not
confuse the common clock framework (and anyone using it) by setting the
flag.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 29edeccb44)
Change-Id: Ic7fa067ed80767c937dd9c8506d2d1e86ee1c93a
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
We need to get the accurate 533.25MHz for the DP display.
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 5c1c63f634)
Change-Id: Ib945c80451d52081683488fe410c5200622fb1c3
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Usually, the 800MHz and 1GHz are supplied for CPLL and NPLL in the RK3399.
But dues to the carelessly copying from RK3036 when the RK3399 bringing up,
the refdiv == 6, it will increase the lock time, and it is not an optimal
configuration.
Let's fix them for the lock time and jitter are lower:
800 MHz:
- FVCO == 2.4 GHz, revdiv == 1.
1 GHz:
- FVCO == 3 GHz, revdiv == 1.
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 1dfbec3905)
Change-Id: I725e8cb542afa7caf7cbb5ff6f747f65d48c5ced
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
The PMU Cortex M0 on rk3399 is intended to be used for things like
DDRFreq transitions, suspend/resume, and other things that are the
purview of ARM Trusted Firmware and not the kernel. As such, the
kernel shouldn't be messing with the clocks. Add CLK_IGNORE_UNUSED to
these clocks.
Without this change, the following was observed on a Chromebook with a
rk3399 (using not-yet-upstream ARM Trusted Firmware code and
not-yet-upstream kernel code based on kernel-4.4):
1. We init the clock framework.
2. We start up "DDRFreq", which causes ATF to occasionally fire up the
M0 for transitions. Each time ATF fires up the M0 it will turn on
these clocks and each time it is done it will turn them off.
3. We finally get to the the part of the kernel that calls
clk_disable_unused() and we disables the clocks.
You can see the race above. Basically everything is fine as long as
ARM Trusted Firmware isn't starting up the M0 at exactly the same time
that the kernel is disabling unused clocks. ...but if the race
happens then we go boom.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 60aadea57e)
Change-Id: I2a78c74edc9bc5d5b4f26224ebdb34eb83afb022
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
We need this rate to generate 100, 200, and 228.57MHz from the same
PLL. 228.57MHz is useful for a pixel clock when the VPLL is used for
an external display.
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
(cherry picked from commit 4ee3fd4abe)
Change-Id: I118c877882d694b358697470225d8d94cb1271b5
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
There is a bit of headphone pop during power on, we
need to increase delay time (200us per loop step).
It looks fine that it may take 200us*128=25.6ms here.
Change-Id: Idbc5b235fd55c26cd71f4693cce98fccce60368f
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
rk3326 and other platform power management implementation
Change-Id: I34b9c773cfee1e684e833cdbcf687ac54cd8d88a
Signed-off-by: Zhang Yunlong <dalon.zhang@rock-chips.com>