Commit Graph

117 Commits

Author SHA1 Message Date
saisai.chang 0a9f0ec9c5 audio: fix audio coverity [1/1]
PD#SWPL-134417

Problem:
coverity

Solution:
fix coverity

Verify:
coverity script scan cannot find these problem

Change-Id: I95e25f313644cf94ad80948a348fcfaf94078183
Signed-off-by: saisai.chang <saisai.chang@amlogic.com>
2023-10-24 15:41:56 +08:00
Wenjie Qiao 166c4405be hdmitx: unify audio setting parameters [1/1]
PD#SWPL-140396

Problem:
There are two methods for hdmitx audio setting:
hdmitx_notify_callback_a() and old API
hdmitx_ext_set/get_i2s_mask().
This may make concurrency issue.

Solution:
Unify the audio parameters setting with callback

Verify:
sc2-ah212

Test:
DRM-TX-33

Change-Id: I0c1dd19b66d783290008a83428141dd2a427ea01
Signed-off-by: Wenjie Qiao <wenjie.qiao@amlogic.com>
2023-10-18 19:27:58 +08:00
Jianxiong Pan 1f6599c5fd zapper: rename CONFIG_AMLOGIC_ZAPPER_CUT_C1A. [1/1]
PD#SWPL-140594

Problem:
rename CONFIG_AMLOGIC_ZAPPER_C1A.

Solution:
CONFIG_AMLOGIC_ZAPPER_CUT_C1A.

Verify:
build pass.

Test:
run on s1a board normally.

Change-Id: I3a8ab8d81af2c4d14b51c117ac16d75f3980adac
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
2023-10-09 20:08:39 +08:00
jiebing chen 6600d85625 Audio: when power off, disable hifipll clk [1/1]
PD#SWPL-136744

Problem:
hifipll not disable when power off

Solution:
when power off, disable hifipll clk

Verify:
use txhd2

Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
Change-Id: Ida793f3a43f118d356a8b8d199aba3e9f2de4f16
2023-09-20 20:40:21 +08:00
qing.zhang a79a07d119 audio: fix L/R inversion issue [1/1]
PD#SWPL-138879

Problem:
loopback recording the L/R data are inverted.

Solution:
Fix the loopback FS invert setting.

Verify:
SC2

Change-Id: I0f4c47b9a5b3bfe194e92dab9524eb7ae0d5baea
Signed-off-by: qing.zhang <qing.zhang@amlogic.com>
2023-09-13 23:10:08 +08:00
jian zhou 64b99a1e20 Audio: fix vad kthread_stop failed [1/1]
PD#SWPL-138326

Problem:
vad kthread_stop failed.
root cause: thread loop entry sleep when kthread_stop.

Solution:
check kthread stop flag when entry sleep.

Verify:
t5m

Change-Id: I8fad35177e35bee98a12ada986e698b123e8bb03
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
2023-09-13 16:24:11 +08:00
zongdong.jiao 6853e053c5 hdmitx: optimize the audio setting flow [1/1]
PD#SWPL-132354
PD#OTT-43684

Problem:
when the audio hw sample freq changes, the audio sample packets
still keep send out. Compared with 3rd devices, there will stop
the sample packets, only keep the ACR send out.

Solution:
Optimize the audio setting flow
disable ACR in PREPARE
finial enable ACR
sync the aud_src_if and aud_output_ch variables
when prepare, add the temporary CT_PREPARE

Verify:
sc2

Change-Id: Ic3a589fd16124e3036d93b766d84f600bf9cb811
Signed-off-by: zongdong.jiao <zongdong.jiao@amlogic.com>
2023-09-12 11:20:20 +08:00
Zhe Wang 84f924d8c3 audio: optimize spdif mute interface [2/3]
PD#SWPL-137289

Problem:
some AVR with pop noise when spdif out is set to mute

Solution:
On TV platform, mute spdif out with soft mute register

Verify:
T5M

Change-Id: I22c30a301c655d1fce66a7f4b6c7510d0729b945
Signed-off-by: Zhe Wang <Zhe.Wang@amlogic.com>
2023-08-22 06:09:20 -07:00
jian zhou a874810a65 audio: fix arc pop and there is speaker audio when switch earc mode [1/1]
PD#SWPL-127860

Problem:
1. arc pop when switch speaker and AVR
2. there is speaker audio when switch earc mode

Solution:
1. switch to force mode for consume data when switch earc mode
2. unmute earc tx when the starem is running
3. don't send disconnect msg when switch earc mode

Verify:
t5m

Change-Id: I2d31656fbaeb3c8837ef883517524fba50e9c0c1
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
2023-08-22 04:23:55 -07:00
qing.zhang 95fe04ccce Audio: kernel log [1/1]
PD#SWPL-134941

Problem:
1. log print to much when dtv in

Solution:
1. change to pr_debug

Verify:
txhd2

Change-Id: I823c9ed0d893737821e768a37a72c8175c3bc8f4
Signed-off-by: qing.zhang <qing.zhang@amlogic.com>
2023-08-17 06:14:58 -07:00
qing.zhang ed90a2b58e Audio: kernel support features for s1a [1/1]
PD#SWPL-134941

Problem:
1. can't adjust volume in userspace
2. cvbs out and hdmitx with tdma
3. suspend
4. codec crash

Solution:
1. change i2shdmi source
2. change samesoure
3. suspend control
4. delay t9015 analog
5. enable efuse for build in modules

Verify:
use s1a

Change-Id: Ieffdc7a4bda09ca9846589b9d71beeb8699e49c2
Signed-off-by: qing.zhang <qing.zhang@amlogic.com>
2023-08-17 06:14:48 -07:00
jian zhou 3f7a084a5b audio: earc reg mute function [1/1]
PD#SWPL-136641

Problem:
earc reg mute function

Solution:
earc reg mute function

Verify:
t5m

Change-Id: Ic57a4762928b87665320a346c3f26ea985920b34
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
2023-08-15 22:08:56 -07:00
Jianxiong Pan b75016a67d zapper: remove c1a relate code. [1/1]
PD#SWPL-126879

Problem:
memory optimization.

Solution:
remove c1a relate code.

Verify:
s1a.

Test:
run on s1a board normally.

Change-Id: Idbd24a529666278295724f26d10f1a720877ca6a
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
2023-08-15 20:09:03 -07:00
qing.zhang 391506fdad audio: fix I2S in L/R inversion issue [1/1]
PD#SWPL-134880

Problem:
I2S recording the L/R data are inverted.

Solution:
Fix the TDMIN FS invert setting.

Verify:
A113X.

Change-Id: I397b829f8727a6976f2f252345ecdb385c152c11
Signed-off-by: qing.zhang <qing.zhang@amlogic.com>
2023-08-15 04:19:56 -07:00
jian zhou e330e43cde Audio: c3 audio bringup [1/1]
PD#SWPL-83864

Problem:
Audio bringup for c3

Solution:
Audio bringup for c3

Verify:
AW419-C308L

Change-Id: I4484b13603dbfa316a551d68c1a2208f6f68e874
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
2023-08-15 04:19:46 -07:00
shaohui.sheng 2f023dfc43 audio: A4/A5 power on audio output noise [1/1]
PD#SWPL-131815

Problem:
1.AED resume has not restore the AED parameters such as volume gain、
slew count、mute、Clip、mixer、EQ、DRC、DC cut and ND.
2.resample can not work when power domain reset

Solution:
1.need restore AED parameters when suspend/resume,
once the audio power domain is reset.
2.need restore the resample parameters.

Verify:
A4

Change-Id: I4cbf0a70293fbc5e38a3bcd19aa048d3fbcea514
Signed-off-by: shaohui.sheng <shaohui.sheng@amlogic.com>
2023-08-15 04:19:25 -07:00
qing.zhang 65e68835db clk: s1a: audio base function [1/1]
PD#SWPL-133041

Problem:
1. sound card install

Solution:
1. modify the clk source
2. use hifi/hifi1
3. use 256 fifi depth

Verify:
s1a_bg201

Change-Id: I04211dfdde8ad73f667258407aa1c35dd5bc10f5
Signed-off-by: qing.zhang <qing.zhang@amlogic.com>
2023-08-15 10:36:51 +08:00
wei huang 5146a48668 audio: Move pcm trigger to component for tdm [1/1]
PD#SWPL-133400

Problem:
For kernel version 5.15,the open source code change
sequence of closing ALSA device.It close CPU DAI first
and then close codec DAI. It will cause pop noise.
And there is also hardware issue for pop noise.

Solution:
1.Change this sequenceZ.Close codec DAI first and then
close CPU DAI.
2.Fix this hardware issue by mute.
3.Increase gain step.

Verify:
Test on board T5M. It works well now.

Change-Id: Ie86e395e92d62ae5ba08b16e145b679730964a63
Signed-off-by: wei huang <wei.huang@amlogic.com>
2023-08-14 01:58:49 -07:00
qing.zhang 4457fb8451 audio: pdm clk issue for lower/normal power [1/1]
PD#SWPL-128467

Problem:
1. when suspend && resume, the dclk sometimes not change to hifi

Solution:
add set parent instead of write reg directly

Verify:
t5m

Change-Id: I62509c2d71a4d3710e9f9fd9359c78397d0e8461
Signed-off-by: qing.zhang <qing.zhang@amlogic.com>
2023-08-09 04:28:43 -07:00
shu.wang 03f62161d9 A1: Fixed SPDIF interface initialization error [1/1]
PD#SWPL-131727

Problem:
The current driver can't adapt to the A1 only input spdif interface.

Solution:
1.Add "only_capture" configuration item for A1 spdif.
2.Modified that the output parameters are no longer
read from DTS when "only_capture" is configured.

Verify:
A1-A113L-T404

Change-Id: I62a022ba3a6df77c8822de1b137416ac1dc1a77a
Signed-off-by: shu.wang <shu.wang@amlogic.com>
2023-08-07 04:18:36 -07:00
che song f6e16796ef audio: add tdm mute for alsa underrun [1/1]
PD#SWPL-132592

Problem:
audio pop noise when alsa underrun

Solution:
add tdm mute for alsa underrun

Verify:
am31a6-T950S

Signed-off-by: che.song <che.song@amlogic.com>
Change-Id: I4f7cbcdb649bbe0d716428744bafcd00d21072a4
2023-08-07 02:18:38 -07:00
shu.wang 0dc4e70502 A1: Fixed TDM can't be recorded by ACODEC [1/1]
PD#SWPL-131864

Problem:
Currently A1 TMD cannot record sound through ACODEC.

Solution:
Modify A1 TDMIN register configuration.

Verify:
A1-A113L-T404

Change-Id: I131c8aa518ecce6f46454ffa3cd454f10f65801b
Signed-off-by: shu.wang <shu.wang@amlogic.com>
2023-08-06 03:58:41 -07:00
jian zhou 7da670fcc2 audio: enable arcin dynamic [1/1]
PD#SWPL-134590

Problem:
enable arcin dynamic

Solution:
enable arcin dynamic

Verify:
sc2

Change-Id: I5b247309f99740a0fd1f30aa95bd048a64a6d437
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
2023-08-04 16:18:34 -07:00
Zhe Wang 1a8d699b7d audio: fixed audio volume gap when STR [1/2]
PD#SWPL-132440

Problem:
The speaker become louder after suspend and resume

Solution:
1) store user setting before suspending
2) improve the digital extra gain of DAC

Verify:
TXHD2

Change-Id: I1320233e0af3d6ef22e541cc32e3d15e3842f3c1
Signed-off-by: Zhe Wang <Zhe.Wang@amlogic.com>
2023-08-01 20:29:16 +08:00
qing.zhang 90043d7215 Audio: vad str mode issue [1/1]
PD#SWPL-132441

Problem:
when str mode with vad, the kernel panic may happen

Solution:
1. use spinlock for vad status change
2. use vmalloc instead of kzalloc
3. add toddr control when VAD buffer change

Verify:
use t5m

Change-Id: Iefbae217608a2b46d94ffb62c3cdd185c0eb8e9a
Signed-off-by: qing.zhang <qing.zhang@amlogic.com>
2023-08-01 02:28:37 -07:00
wei huang 393f730fc5 audio: TV standby wake up, speaker has pop noise [1/1]
PD#SWPL-128734

Problem:
When enter or quit STR, the signal will change from one
high level to zero directly. So it causes this issue.

Solution:
1) When enter or quit STR, do fade out or fade in process.
2) disable to toggle SDZ check
3) add trigger control to do soft mute/unmute

Verify:
Test on board T5M. It works well now

Change-Id: If0e59aeb092538ae5e71e5c8846e4af57a18bdf1
Signed-off-by: wei huang <wei.huang@amlogic.com>
2023-07-25 05:57:40 -07:00
jiebing chen 0f1fe592f2 Audio: disable audio clk and hifipll when enter into suspend [1/1]
PD#SWPL-130775

Problem:
hifipll not work when disable fix pll, need reinit

Solution:
disable audio clk and hifipll when enter into suspend

Verify:
use Txhd2

Change-Id: I6881915cf6f03637243d31348fc67d4f9a81ac34
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-07-24 05:08:17 -07:00
jian zhou 619db45c45 audio: merge eARC tx related fix to reference [1/1]
PD#SWPL-132243

Problem:
merge eARC tx related fix to reference

Solution:
TV-82137 mute arc before stop spdif
TV-81075 clear dmac status when earc is idle1
TV-83914 add hold bus and arc fade out
TV-85602 mute arc when ss_free and mute/unmute only at arc enable
TV-86164 fix earc crash, use delayed_work instead of work_struct
TV-86092 send disconnect msg when earc is idle1
TV-85119 mute arc when set earc mode
SWPL-107425 free fddr need to clear the same source flag

Verify:
t5m

Change-Id: I55864a41624b24d7846205da5d1b18f084e6203e
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
2023-07-21 08:23:29 -07:00
qing.zhang 48ef4980f2 audio: platform HDMI2 ARC connect some AVR [1/1]
PD#SWPL-128804

Problem:
1. platform HDMI2 ARC connect some AVR(YAMAHA RX-V4A),
can't resume after suspend;the tx_resume_work_func wake up early,
the eARC has not resume to restore clk for hw write

Solution:
1. use the resume when callback

Verify:
verify by t5m

Change-Id: I54656557d56a77988911aa4d8647a8874aec8872
Signed-off-by: qing.zhang <qing.zhang@amlogic.com>
2023-07-20 15:04:47 -07:00
jiebing chen 525cb466ae Audio: kernel support playback adjust volume [1/1]
PD#SWPL-129800

Problem:
can't adjust volume in userspace

Solution:
kernel support playback adjust volume

Verify:
use txhd2

Change-Id: I060f45c2c0de4f7e37f203c36c4c6c212c4ccd2b
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-07-13 15:07:42 -07:00
jiebing chen 2a6c95ba57 Audio: optimization audio soc and codecs for sa1 [1/1]
PD#SWPL-120885

Problem:
optimization audio driver code

Solution:
optimization audio soc and codecs for sa1

Verify:
use Tx3

Change-Id: Ica12e9ec308e9cd51c7646e795398960d1381b83
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-07-13 05:14:08 -07:00
shaohui.sheng db824409de audio: acm8625 AMP driver [1/1]
PD#SWPL-126821

Problem:
The acm8625 AMP code is missing
and the acm8625 codec cannot be used properly

Solution:
Supplement to write acm8625 AMP driver
and acm8625 codec can be used normally

Verify:
I check the compilation success myself

Change-Id: I025970f1cfcc5fb1e880cd8d558a37798d6fa9a5
Signed-off-by: shaohui.sheng <shaohui.sheng@amlogic.com>
2023-07-11 03:09:11 -07:00
jiebing chen cb744a181f Audio: support hdmirx audio for txhd2 [1/1]
PD#SWPL-131198

Problem:
support hdmirx audio for txhd2

Solution:
support hdmirx audio for txhd2

Verify:
use txhd2

Change-Id: I489c27dadf58592daf4c7a9f5bd2afbc767b4de7
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-07-10 07:55:15 -07:00
Jianxiong Pan 0ed09afab1 zapper: module ko change to builtin. [1/1]
PD#SWPL-126879

Problem:
zapper memory optimization.

Solution:
ko change to builtin.

Verify:
t215.

Change-Id: I2f43e50ad4042132624e70079fcab094707a5ffe
Signed-off-by: Jianxiong Pan <jianxiong.pan@amlogic.com>
2023-07-09 15:07:54 -07:00
Qianggui Song 6403737bed zapper: Memory optimizations after txhd2 merge trunk [1/1]
PD#SWPL-130072

Problem:
Zapper size increase after txhd2 merge back to trunk

Solution:
optimize some code and add macro to reduce size
module: pinctrl, clk-measure, adc, audio, tvin, dtv_demod
ddr_port_desc, and amvecm

Verify:
Zapper

Change-Id: I0c781a657811cf664ffdbb4d9c18060e9b39554e
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
2023-07-05 03:10:39 -07:00
jiebing chen 86578a3286 Audio: optimize arc performance for txhd2 [1/1]
PD#SWPL-128248

Problem:
1,arc performance test
2,change pr_info to pr_debug

Solution:
optimize arc performance for txhd2

Verify:
use txhd2

Change-Id: I44fe6ff4843142e9e5dd5e5e6db5a2135b9913dd
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-06-29 10:40:50 +08:00
jiebing chen 27baf9a3cf Audio: audio enable EQDRC [1/1]
PD#SWPL-125834

Problem:
audio enable EQDRC

Solution:
audio enable EQDRC

Verify:
use txhd2

Change-Id: I65863f1ea34c7abbd79691630181aae0e68d0faf
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-06-29 10:38:53 +08:00
jiebing chen d87daddf94 Audio: resample KASAN failed [1/1]
PD#SWPL-128098

Problem:
resample KASAN failed

Solution:
change manual allocation

Verify:
use txhd2

Change-Id: I5db9109b6cb25f2b083c84cc4f57bf2d341ce7af
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-06-29 10:38:53 +08:00
jiebing chen 97e393eb00 Audio: the speaker has "po" noise when bootlogo displayed [1/1]
PD#SWPL-127490

Problem:
the speaker has "po" noise when bootlogo displayed

Solution:
when audio dac init, mute spk pa

Verify:
use txhd2

Change-Id: I641252c2ceccdd11cfcb99d0eedf5d71899a6d38
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-06-29 10:38:53 +08:00
jiebing chen ef491d8dc4 Audio: bring up audio acodec and arc [1/1]
PD#SWPL-125829

Problem:
bring up audio acodec and arc

Solution:
bring up audio acodec and arc

Verify:
use txhd2

Change-Id: I8df3e6c6a14165881cb8757ca240b2d524484921
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-06-29 10:34:03 +08:00
jiebing chen 440fb802d2 Audio: bringup txhd2 audio [1/1]
PD#SWPL-124883

Problem:
bringup txhd2 audio

Solution:
bringup txhd2 audio

Verify:
use txhd2

Change-Id: I63bcd61778cb7f89ad44bf01854d93d163c77630
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-06-29 10:34:01 +08:00
jiebing chen d55a717e7d Audio: bringup txhd2 arc [1/1]
PD#SWPL-124886

Problem:
bringup txhd2 arc

Solution:
bringup txhd2 arc

Verify:
use txhd2

Change-Id: Ife7138981c53f97bc7cf0414cfdf5ca38d5529d1
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-06-29 10:34:01 +08:00
jiebing chen ac966ed9c8 Audio: bringup txhd2 acodec [1/1]
PD#SWPL-125840

Problem:
bringup txhd2 acodec

Solution:
update amlogic acodec code from kernel-5.4

Verify:
use txhd2

Change-Id: I7956ff0fad23128e05352f8afbb5169d7f017582
Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
2023-06-29 10:34:00 +08:00
jiebing chen c100e8d5fe Audio: support pdm dclk 2.048M for 32k [1/1]
PD#SWPL-123541

Problem:
need support pdm dclk 2.048M for 32k

Solution:
support pdm dclk 2.048M for 32k

Verify:
use t3x

Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
Change-Id: Idef51bd1047f956fe1933f76c4af7c19d176a1fd
2023-06-15 22:55:18 -07:00
Zhe Wang 62578c56aa audio: fixed audio volume gap after STR [1/1]
PD#SWPL-126727

Problem:
after STR, audio volume changed

Solution:
In resume, audio AED master & channel volume
is set to default value. Only set master & channel
volume after platform start.

Verify:
t5m

Change-Id: Ic54782d1d456c5f864a7bf55b9b0d706d442f149
Signed-off-by: Zhe Wang <Zhe.Wang@amlogic.com>
2023-06-06 00:57:55 -07:00
shaohui.sheng 1bbef379af audio: Bring up the PA1 chip [1/1]
PD#SWPL-102916

Problem:
PA1 AMP chip lacks driver code, resulting in the inability
to carry out functional testing of AMP chip.

Solution:
Complete the driver code writing of PA1 chip, and then test
the basic function of PA1 and DSP function.

Verify:
Use the small board with PA1 chip and
AR309 socket board self-test

Change-Id: I420fbaca97584427b3969dac76e66acfbe9cf6d2
Signed-off-by: shaohui.sheng <shaohui.sheng@amlogic.com>
2023-06-04 21:08:19 -07:00
shaohui.sheng 46895867af Audio: Standby and wake up [1/1]
PD#SWPL-122847

Problem:
When the standby wake up scenario occur, the speaker
will sound at the same time as ARC

Solution:
Standby and wake up to restore the original state.

Verify:
Test on board T5M.

Change-Id: I6c2bb9b08f7a18a3055c279d068b975de75f3d92
Signed-off-by: shaohui.sheng <shaohui.sheng@amlogic.com>
2023-05-30 03:33:39 -07:00
jian zhou 603a57c9f3 audio: add earc rx enable flag [1/1]
PD#SWPL-123908

Problem:
add earc rx enable flag

Solution:
add earc rx enable flag

Verify:
s5

Change-Id: Ie452faccbbc9277bceeb53d7a06eb12773ed450a
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
2023-05-29 03:47:24 -07:00
jian zhou cb70f935ec audio: set earc timeout value as 550ms [1/1]
PD#SWPL-125525

Problem:
the earc timeout max is 550ms by spec,
the register default value is 500ms, thers will timeout for
some AVRs

Solution:
set earc timeout value as 550ms

Verify:
t7c

Change-Id: Ib552d6f078fece32744af2876d2211826ca9b268
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
2023-05-26 07:43:30 -07:00
jiebing chen f6a5ed4ade Audio: fix pcpd monitor crash [1/1]
PD#SWPL-124867

Problem:
{Android R}{T5M}{HDMI}the platform will crash and restart.

Solution:
If the dts regmap is not configured, return 0

Verify:
use t3x

Signed-off-by: jiebing chen <jiebing.chen@amlogic.com>
Change-Id: If4e9aeb0f75529a6effdd4eaea2bd6072aea8a3f
2023-05-24 20:06:41 -07:00