The frame_overrun flag is used to indicates
SOF number (current_frame) overrun in DSTS
and the target_frame over DSTS_SOFFN_LIMIT.
Clear the frame_overrun flag only if target_frame
below DSTS_SOFFN_LIMIT and current_frame less
than target_frame.
Change-Id: I91cf9001324a9bbbcc4bc28b335695d607fb69d4
Signed-off-by: William Wu <william.wu@rock-chips.com>
The default period size is only 64 frames, this
will cause usb audio playback with noise via
internal audio codec. This patch sets the period
size to (snd->rate / 10), and also sets the buffer
size to snd->rate.
Change-Id: I4a4eb1b4dd79aec65f5c44eacd8a2fa101dfbd1b
Signed-off-by: William Wu <william.wu@rock-chips.com>
The f_audio_disable() doesn't disable usb ep, and
this cause usb enumeration fail. So add usb ep
disable operation.
This patch also reinitializes the opts->bound flag
to false in f_audio_free(), and then it can setup
ALSA audio device again in f_audio_bind().
Change-Id: I7b10630f5085b1a03792bc4b9e7eabb02d2bd5a2
Signed-off-by: William Wu <william.wu@rock-chips.com>
Adds pm_runtime support for dwc2, so that power domain is
enabled only when there is a transaction going on to help
save power.
Change-Id: I318552774d20eeaed521ff179f99b2551ee24183
Signed-off-by: William Wu <william.wu@rock-chips.com>
Dues to the loading order of multiple sound cards is
not constant, we need to specify bluetooth pcm sound
as the slave card via 'rockchip,wait-card-locked'
property. It looks like this:
========
From
[ 1.180441] ALSA device list:
[ 1.180458] #0: rockchip,rk3308-pcm
[ 1.180467] #1: rockchip,rk3308-vad
To
[ 1.175590] ALSA device list:
[ 1.175606] #0: rockchip,rk3308-vad
[ 1.175614] #1: rockchip,rk3308-pcm
========
Change-Id: Ic4d7625ca3b06106a317a59defcc45bab190ae95
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Some times, we would like to specify the order of
loading sound card, and can use this property to
wait other sound cards are locked. Therefore, this
sound card with the property should be slave card.
Change-Id: I3dcd77a527ad902a5a3c00bcce2c81cf6e782549
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
Due to the PA CS8509 on rk3308 voice module startup time
is ~200ms, we need to hold it some times, avoid lossing
audio data during start playback.
Change-Id: I44ac3caa0ceddbe7720d8eb63179ae56baa168a9
Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
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>