Commit Graph

112 Commits

Author SHA1 Message Date
Soumya Managoli
1622b6d883 ASoC: codecs: Allow register write via debugfs
Add support for QTI regmap debugfs register write
access on wcd937x codec.

Change-Id: I04e3d98ec308c5cbf9f140c6fcfb1ab5fbe5fd50
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2023-01-18 19:55:11 -08:00
Vangala, Amarnath
6dbdc5bea3 ASOC: codecs: clear the interrupt ack registers for wcd937x
Clear the wcd937x interrupt ack registers in post_irq_handler.
This is needed for wcd937x, as regmap_irq is not clearing
the ack registers after the ack bits are set.

Change-Id: I105a4b423a0d01ff1bd3239e0f2d42294557ff10
Signed-off-by: Vangala, Amarnath <quic_avangala@quicinc.com>
2022-11-02 02:38:23 -07:00
Soumya Managoli
ee00c83a92 audio-kernel: Bring up changes for bengal
Enable audio driver compilation for bengal.

Change-Id: I1ce7f0356fe70bc59c7caa6d333ad380d1e725ff
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
2022-09-29 16:50:51 +05:30
Vatsal Bucha
77ac79f6c7 asoc: codec: add range check to avoid overflow
Add range check for ucontrol value to avoid array
overflow.

Change-Id: I7b699519bec6f605e5ca5ece8f67badbefc7a094
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2021-03-15 21:53:06 -07:00
Laxminath Kasam
7962130af8 audio-kernel: Fix compile error on wcd
Fix compile error on wcd codec.

Change-Id: I65a3db216234ab798f8a85dd2401ac605b09f7f0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-22 13:21:44 +05:30
Laxminath Kasam
6a7bb13614 soc: swr-mstr-ctrl: Update SWR_TX to receive port params from slave
Update swr_tx slave port config to use slave provided port params
and remove slave port static tables.

Change-Id: Icfedf1229a88432e80c2294e13f2ccc3949417c5
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-12-18 14:40:06 +05:30
Jyotirmoi Sarma
a3d8911945 audio-kernel: asoc : Upgrade asoc to support 5.10 kernel
Change-Id: Ia54112cfbde418d66b9314d4ba731928aa057558
Signed-off-by: Jyotirmoi Sarma <jyosarma@codeaurora.org>
2020-12-08 08:49:44 -08:00
Vatsal Bucha
625753df87 ASoC: codec: Change name for enum defined for callback between wcd and bolero
Add enum names defined for callback between wcd and bolero in
separate file and include that file in order to have same enum
across wcd and bolero.

Change-Id: I808c2ad3de37655c1ba2b8e096def60703ced7f2
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-09-09 20:26:36 -07:00
Laxminath Kasam
070b18585e asoc: wcd937x: Update slvdevpath after connect_port in powerup
As ADC and MIXER dapm widgets powerup sequence in soc-dapm
got re-ordered, need update same in codec driver to handle
calls to soundwire.

Change-Id: Ibc99d21e29f9e9d7195b4ba8d4c995c46d6aef6f
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-08-20 20:25:41 +05:30
Vangala, Amarnath
60eaa6b160 asoc: wcd937x: Add support to clear ack registers
WCD937x codec requires clear registers to be written '1' and
'0' for clearing interrupts. Enable clear_ack flag in regmap
irq chip structure for wcd937x.

Change-Id: I0a2e4fc85fe6dca75885b5300840669afeabc80c
Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
2020-08-04 16:14:51 +05:30
Vangala, Amarnath
83efb2ee63 asoc: wcd937x: add dummy widgets to codec input and outputs
With multicodec approach, codec widgets are added much earlier during sound
card registration than aux codec approach. The connections between bolero and wcd938x
are done via device tree at a later point. DAPM does power checkup for codec widgets
before the codec-codec path is connected. This results in wcd937x dapm inputs/output
to be considered as endpoints, which results in playback/record failure once after
bootup. Hence, add dummy output/input widgets to wcd937x dapm inputs/output which are not
codec endpoints.

Change-Id: I8589f9a33261531eaad74e8f12ef1825fa90a014
Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
2020-07-28 18:26:56 +05:30
Vangala, Amarnath
d6f2eaa495 asoc: machine driver and bring up changes for holi.
add machine driver for holi.
compile wsa881x analog driver for holi.
compile wcd937x and wcd938x drivers for holi.

Change-Id: Icba23cc4b1dd40f7dec6f16bb67a6fae26317f80
Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
2020-07-22 15:55:25 +05:30
Vatsal Bucha
298c198b37 ASoC: wcd937x: Add mixer ctl for TX CH power level
Add mixer ctl for tx channel power level.

CRs-Fixed: 2703598
Change-Id: Iecb0dfe491afaface4c4dd1995aa13c7efd9df82
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-06-16 09:24:02 +05:30
Prasad Kumpatla
924c7d027c asoc: codecs: Add default case for switch.
Add default case for switch to avoid the
Null pointer dereference for the map and num_ports
variable in for loop.

Change-Id: I59c9dc6e5396bcb409876378c811143da1c81551
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
2020-05-12 23:41:45 -07:00
Prasad Kumpatla
bd2c17661b asoc: codecs: Add delay to eliminate playback pause post SSR on hs
Add delay in post ssr to eliminate playback pause on euro headset.On
post ssr hs detected as hp due to where pa become on before the completion
of wcd_correct_swch_plug workqueue which lead to detect plug_type
as hp.

Change-Id: Ie114fcd0458d9f5edebeee087c90600c3b0c3da2
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
2020-04-29 23:26:14 -07:00
qctecmdr
184a32dbe4 Merge "ASoC: wcd937x: Fix headset record pop during SSR" 2020-04-29 22:27:54 -07:00
qctecmdr
e63542d6b7 Merge "asoc: codecs: Set EAR compander if mixer ctl set" 2020-04-26 23:42:50 -07:00
qctecmdr
b221915dc1 Merge "ASoC: wcd938x: Enable digital clk for tx0 if micbias enabled" 2020-04-26 23:42:49 -07:00
Laxminath Kasam
101e71693d asoc: wcd937x: Update retry logic for SWR logical addr
Update retry logic for SWR logical address during SSR.

Change-Id: Ifa5cdec751a271c09a8b6340009ec0e862ffb326
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-04-20 11:32:20 -07:00
Vatsal Bucha
fb63ca16cc ASoC: wcd938x: Enable digital clk for tx0 if micbias enabled
Mute is observed in amic record sometimes in concurrency with
sva. This is because if record is over tx0 then digital clk
is not enabled. Enable clk after enabling micbias to resolve mute.

Change-Id: Iba3aa4fade0ac5889218eaee2c5d2c4bd4431d50
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-19 08:25:30 -07:00
Laxminath Kasam
2e025248a2 asoc: codecs: Set EAR compander if mixer ctl set
Enable compander based on mixer ctl set for ear path.

Change-Id: Ie6287469f1baa9dba239d369bd5a29ed8e44522f
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2020-04-19 08:11:52 -07:00
Vatsal Bucha
6b4f250e7b ASoC: wcd937x: Fix headset record pop during SSR
Pop is heard with special headset with silence record
during SSR. Resolve pop by allowing sufficient time for
wcd937x_reset post SSR and again initialize registers
post SSR.

Change-Id: I80e70a98a72b247dca878673a30651647b676659
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-16 23:48:16 -07:00
Aditya Bavanari
ee6367c560 asoc: Add support for rouleur codec in machine driver
Add rouleur codec support in bengal machine driver
to create codec entry and invoke mbhc hs detect
functions for respective codecs. Correct the logic
for headset detection pull up current and
volatile registers for digital part of rouleur codec.

Change-Id: I22545dc796c215c1501e883796546c97d8ca8698
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2020-04-16 01:17:00 -07:00
Vatsal Bucha
71e95c67ea ASoC: wcd938x: Fix headset detection during SSR/PDR
Headset is corrected as lineout during SSR/PDR. This is
because adc voltage is not measured correctly due to SSR state.
Enable flag deinit_in_progress during SSR down to check if
device is not reported and disable it after device up.

Change-Id: I6fc4fff4149c36ba16aa668a960505504a5d811f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2020-04-01 09:54:12 -07:00
Sudheer Papothi
b2d648baf0 ASoC: wcd938x: Update soundwire master channel type
Update soundwire master channel type properly before sending to
soundwire master.

Change-Id: I459c6e8d1cc688c3e6e5a0369e095f0b12fbb7c6
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2020-02-07 14:35:00 +05:30
Ramlal Karra
3e2c37d273 asoc: codecs: Add unified SWR Tx mapping support
Add dynamic port enablement for wcd938x and
wcd937x targets to support unified swr tx port
mapping added as part of SWR 1.6 updates.

Change-Id: If0cf823dc51028fd5bd95f5a49ffe05998526be6
Signed-off-by: Ramlal Karra <rkarra@codeaurora.org>
2020-02-05 09:56:57 -08:00
Laxminath Kasam
ef20c8c2d5 asoc: wcd937x: Avoid clk disable at aux dac
Clock disable at aux dac event is not needed
as rx3 widget already disables it.

Change-Id: I67feec194cdae5c6d84efcde0a2931ba8f8440dd
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-12-06 14:48:29 +05:30
Laxminath Kasam
4696fffa8c asoc: Audio bringup changes for bengal
Update change for audio playback and record to work
on bengal target with wcd937x codec.

Change-Id: I2f781e2132b018995f30f4192efd08732196cd28
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-11-27 17:32:41 +05:30
qctecmdr
1afbf65af5 Merge "asoc: codecs: wcd937x: Update micbias pull up widgets" 2019-11-12 03:43:10 -08:00
Laxminath Kasam
2336053268 asoc: codecs: wcd937x: Update micbias pull up widgets
Add micbias pullup widgets required for VA usecase.

Change-Id: I3f2d0ce3d409297fb5e2bf0468258aaee9365293
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-11-05 17:22:07 +05:30
Vatsal Bucha
a9675d1a5d ASoC: wcd937x: Fix audio distortion issue during headset record
Audio is distorted during first 3 secs on headset record
while doing device switch from dmic to headset mic.
Disable BCS before slow insertion detection and enable it
afterwards to resolve the issue.

Change-Id: Icb18a0b5decb0c0bd9959bce7cced70a27566d41
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-11-01 03:15:36 -07:00
qctecmdr
26247b9b1c Merge "asoc: wcd937x: Fix compile error in wcd937x codec driver" 2019-10-16 23:32:44 -07:00
Laxminath Kasam
57e66c0251 asoc: wcd937x: Fix compile error in wcd937x codec driver
Update codec to component param for 4.19 kernel compatible.

Change-Id: Ia08283de4b01b45a6cd96c7f488f55bb0d4a5a53
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-10-12 23:31:17 +05:30
Laxminath Kasam
e6c06ae348 asoc: codecs: wcd937x: restore clear_ack setting for wcd937x
For wcd937x interrupts, need to set clear_ack explicitly
for regmap irq to clear the interrupt.

Change-Id: Ieffc20db0665fa82fe088337fbdf8b518191be3d
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-09-26 15:05:08 +05:30
qctecmdr
33de327759 Merge "asoc: codecs: wcd937x: Fix compile error" 2019-09-18 04:54:28 -07:00
Laxminath Kasam
2f151367ce asoc: codecs: wcd937x: Fix compile error
Use proper dev handle in print to avoid compile error.

Change-Id: Ieca116199ec4c86f2ee8c1698285fff0ecababbf
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-09-16 17:57:03 +05:30
Laxminath Kasam
5d8f357649 asoc: codecs: wcd937x: Update amic4 over adc3 recording
Update AMIC4 over adc3 for wcd9375 as per HW sequences.

Change-Id: Ie7c3713bee67d32cb7fba042848f52bcded8f4b0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-08-19 14:08:57 +05:30
qctecmdr
b7c31cad77 Merge "asoc: codecs: enable bcs port for headset record" 2019-08-02 06:47:40 -07:00
Karthikeyan Mani
ec3bb4045c asoc: codecs: enable bcs port for headset record
Enable button click suppression port to send mbhc
events over the port to reduce glitches caused
by button events or plug removal events on the
record path.

Change-Id: I3f913ab1287f06afe6b5fc95da626f7c78ab448f
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-07-25 10:46:25 -07:00
Vatsal Bucha
875812d385 ASoC: wcd937x: Fix spurious interrupts for wcd937x
Enabling watchdog interrupt during bind causes spurious
interrupts. Disable interrupts during bind and enable
during path setup to fix this. Also enable and
disable interrupt for ear pa for wcd938x.

Change-Id: I4a9526d7b0a63f5325cec6dfe7a4e302ae76fc40
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-23 11:42:10 +05:30
qctecmdr
c0029da107 Merge "ASoC: wcd937x: Disable hph OCP on talos" 2019-07-20 00:21:45 -07:00
Vatsal Bucha
cf5a58f117 ASoC: wcd937x: Disable hph OCP on talos
OCP is resulting in mute issues during audio playback.
Talos has surge protection enabled in hw. Thus
OCP can be disabled for talos.

Change-Id: I5a7fe54ae9e77af65dd9e017b4001f2fac3cfdd4
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-07-10 13:06:44 +05:30
Aditya Bavanari
d37e02049c asoc: codecs: Add variant entry support for wcd937x and wcd938x
Add variant entry support for wcd937x and wcd938x codecs to
differentiate between wcd9370/80 and wcd9375/85 variants.

Change-Id: Ife20d14462a0b0968e0458471af3823872592e10
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-07-08 18:34:57 +05:30
qctecmdr
34b7d3b2fd Merge "ASoC: hide bind/unbind in sysfs" 2019-05-21 20:33:23 -07:00
Xiaojun Sang
53cd13a1ab ASoC: hide bind/unbind in sysfs
Exposure of driver bind/unbind to userspace via sysfs may
lead to unexpected behavior.
Hide bind and unbind by driver attribute.

Change-Id: I20d6ee653bcc16af15d6368664aaf240c6645cd0
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-05-17 15:00:33 +08:00
Vatsal Bucha
72753620d0 ASoC: wcd937x: Fix invalid memory access in wcd937x_suspend
Invalid memory access happens in wcd937x_suspend if
component bind for slave fails. This is because
as part of component_unbind devres_release_group is called
which removes every node from list and frees corresponding memory.
This results in invalid memory access for wcd937x in wcd937x_suspend.
Do kfree and set drvdata to NULL if component_bind fails
to resolve the issue.

Change-Id: Ia26eb36fe8b92ac0491b03d0d4a2b8def415148b
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-05-10 00:42:20 -07:00
qctecmdr
280b241b40 Merge "ASoC: wcd937x: update micbias noise filter resistance" 2019-05-03 05:18:55 -07:00
Vatsal Bucha
eb7519911f ASoC: wcd937x: update micbias noise filter resistance
Update micbias noise filter resistance for better performance
during audio capture.

Change-Id: If80b967dd7f9bbf7e683c6da53a1aa93924c6877
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-04-16 15:20:39 +08:00
Vatsal Bucha
d76b6b3ceb ASoC: wcd937x: Fix mbhc detection failure after get logical address fails
Get Logical Address failure comes after SSR during rigorous testing.
This calls removal of swr master device attached. Once removal occurs
further headset insertion/removal does not get detected. Do not remove
swr master device attached to fix the issue.

Change-Id: Iac78b4a12ef296566d082e75ac8905f73d6b2a47
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-04-15 17:26:23 -07:00
qctecmdr
abca8128dd Merge "ASoC: wcd937x: Fix playback stop issue after SSR/PDR on special hs" 2019-04-06 23:14:37 -07:00