Commit Graph

75 Commits

Author SHA1 Message Date
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
Meng Wang
578740db71 asoc: wcd937x: Disable EN_CUR_DET bit for receiver noise
Disable EN_CUR_DET to fix receiver noise as per hw team
recommendation.

Change-Id: Icbeea920d02279ff845072e54be1c449db7bd2da
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-03-20 17:24:22 -07:00
Vatsal Bucha
13faf538b3 ASoC: wcd937x: Fix playback stop issue after SSR/PDR on special hs
If we start playback on special hs after record is done and perform
SSR/PDR then playback gets paused. This happens because ANA_TX_DIV2_CLK
which needs to be enabled for special hs gets disabled after record
is stopped. Maintain a count for ANA_DIV2_CLK to enable/disable it
as required.

Change-Id: Ic73475c83cb16e3c014f35b8d46ee22d2e7a2efd
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-03-20 15:44:14 +08:00
Vatsal Bucha
7aa2f97f60 ASoC: wcd937x: Enable surge protection for talos
Enable surge protection feature for talos.

Change-Id: If1a5e4d60a80f288825ee0e39645166f0cb9446f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-02-20 18:58:34 +08:00
Linux Build Service Account
62c4ce4766 Merge "asoc: wcd937x: Clear Buck disable flag in PMU even if already up" 2019-01-28 11:11:22 -08:00
Tanya Dixit
2e838e52fe asoc: codecs: Add support for setting ear gain ctl
Add support for setting EAR PA gain directly using
mixer control.

Change-Id: Ifd9e31ed45d10b5ea0f9cf546806ef78ece9e181
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-01-21 21:11:55 -08:00
Vatsal Bucha
5141b172ce ASoC: wcd937x: Enable and disable HPH OCP at PA to avoid CnP
Enable HPHR and HPHL OCP after PA enable and disable it
before PA disable to avoid CnP issues at teardown.

Change-Id: Ic08a8862a7fb4f40ecc6060de6aa1eadc11f1c0f
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-01-22 13:11:17 +08:00
Vatsal Bucha
1ca5d397ba ASoC: wcd937x: Fix CnP when compander is disabled
Pop noise is observed at teardown when compander
is disabled. Allow proper delay after PA disable
to resolve the pop.

Change-Id: I15efa08f28bc1dd32e39b3ca1311b1e417199fd3
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-01-22 11:10:28 +08:00
Ramprasad Katkam
b7fc921d89 asoc: wcd937x: Clear Buck disable flag in PMU even if already up
Buck disable flag, which is used to indicate if suspend can disable
the buck, is not cleared during powerup if it is already enabled.
This causes suspend to disable buck even during active usecase.
Clear the buck disable flag when returning due to already enable.

Change-Id: I5118b66492dff27965a587e1bc6b916d5c26b9fb
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-01-21 18:48:17 -08:00
Linux Build Service Account
706d3a9a51 Merge "asoc: wcd937x: stop mbhc during ssr down" 2019-01-08 05:32:00 -08:00
Linux Build Service Account
4c11ba0a0f Merge "asoc: wcd937x: Fix register names and properties" 2019-01-06 20:27:03 -08:00
Linux Build Service Account
0c6654ade2 Merge "ASoC: wcd937x: Enable watchdog interrupt" 2019-01-06 06:32:26 -08:00
Ramprasad Katkam
a2958a6205 asoc: wcd937x: stop mbhc during ssr down
Stop mbhc operations during ssr down to cancel
any pending detection sequences.

Change-Id: I6aa8c61c2cc74fc08adf57c58673acaa753ac322
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-01-03 09:45:54 +08:00
Tanya Dixit
46ec0f2835 asoc: wcd937x: Fix register names and properties
Update the register names and default values to
be same as the software document of codec.

CRs-Fixed: 2334177
Change-Id: Iec3ce76dceb44cef64c1f38a6cd75cb40ee2a539
Signed-off-by: Tanya Dixit <tdixit@codeaurora.org>
2019-01-02 16:54:41 +08:00
Vatsal Bucha
beccfad9b6 ASoC: wcd937x: Enable watchdog interrupt
Handle PDM watchdog interrupt. Enable watchdog
before analog PA is enabled and disable it
after analog PA is disabled so as to prevent false alarms.

CRs-Fixed: 2336526
Change-Id: I3c16a9dcd0f4f84bf8ad0bfde9560330c143cdf9
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-01-02 16:20:07 +08:00
Vatsal Bucha
1793ff07cb asoc: wcd937x: Change voltage for micbias depending on dt value
MICBIAS is always set to 1.8V. Change this voltage
depending on dt value for respective micbias.

Change-Id: I8eb1e71ae0256423bfd0bcc8ba2cd6bcc4a5ee61
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-01-02 15:57:20 +08:00
Meng Wang
11a25cf657 asoc: update relative header files
Move all relative header files to include folder.

Change-Id: Ic61a61a88823b4749dbe8c1f680d08201a3b4a48
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-18 10:50:27 +08:00
Ramprasad Katkam
b6dda1e6be asoc: wcd937x: use swr device wakeup api
Use device wakeup api exposed by soundwire to
vote and unvote for soundwire master for mbhc
operations.

Change-Id: Id83c8d3fb2eb351133790f69af56e4981bcac543
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-12-11 13:40:57 +08:00
Meng Wang
43bbb87652 asoc: Update file header to GPL-2.0-only
Update file header to GPL-2.0-only.

Change-Id: Ic1542a3209a5fe73c937a5b36491ede4a451936d
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-10 14:49:34 +08:00
Meng Wang
15c825d077 ASoC: codec: Update codec driver to component driver
Some alsa API are removed in kernel-4.19 which would cause
codec driver compile failure. Update codec driver to fix it.

Change-Id: Ie358ec1863082166958059c179300b453d2a03ad
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-08 03:15:55 -08:00
Meng Wang
61af6849e9 ASoC: switch audio drivers to SPDX identifier
Switch audio drivers to SPDX identifier on msm-4.19.

Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-07 15:47:32 +08:00
Linux Build Service Account
164fffc986 Merge "asoc: codecs: wcd937x: Optimize HPH PA delays" 2018-11-22 20:08:59 -08:00
Laxminath Kasam
7c8ff05871 asoc: codecs: wcd937x: Optimize HPH PA delays
On headphone path, cold start output latency
is not met. Optimize delays during HPH DAC
and PA paths.

CRs-Fixed: 2338278
Change-Id: If96975d664fc655a4ac38a9d6ed88b6af61adfdf
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-21 14:41:00 +05:30
Laxminath Kasam
35849ccf24 asoc: codecs: Fix CnP on HPH turnon and turnoff
On headphone(HPH) path, CnP spec is not met.
Handle sequences for bolero and tanggu codecs
as per HW sequences. Disable vdd_buck during
system suspend when no usecase is active.

CRs-Fixed: 2343436
Change-Id: I62f89d829715f07885a97531fdcb2cc3ca0822ef
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-21 14:40:00 +05:30
Linux Build Service Account
3a0e91bf0c Merge "ASoC: wcd937x: Fix pop after PDR" 2018-11-20 19:53:17 -08:00
Vatsal Bucha
79da9fb84a ASoC: wcd937x: Fix pop after PDR
Pop is heard after PDR is triggered. This is
because while device down PA is still on.
Disable PA before SSR device down to prevent pop.

Change-Id: I6bfe3e731bdf60fba8fee90ab39c03a0512006ce
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2018-11-19 14:41:52 +05:30
Vatsal Bucha
204f59cd14 ASoC: wcd937x: Enable hph OCP
Update registers to enable OCP for HPHL and HPHR.

CRs-Fixed: 2321013
Change-Id: I51a872981ee2dc435757152b9122067944d13924
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2018-11-15 04:32:14 -08:00
Laxminath Kasam
7adc34e496 asoc: codecs: Add new class-H driver for wcd937x
Add new class-H driver with sequences to support
both class-H and class-AB modes on wcd937x variants.

Change-Id: Ie109f3d951af1e8a0079dd39ab2fe1e9883bd6c2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-13 13:15:59 +05:30
Laxminath Kasam
838f0b885f asoc: wcd937x: move export functions to new header
For export functions from wcd937x use separate
header as internal header is only supposed to be
used within wcd937x driver logic.

Change-Id: Ice373ff95f7166a2f968458b25223c582edc7fba
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-12 21:49:59 +05:30
Xiaojun Sang
80eb5ddfdd asoc: wcd937x: disable TX CH2 after power down
TX channel2 is not disabled after power down. It leads to
noise at the beginning of next recording on CH2.
Disable it after power down.

Change-Id: If12a84df52b9c8cd55de2bdcb91f950b054898b8
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2018-11-02 12:42:50 +08:00
Linux Build Service Account
f79c5c1f41 Merge "asoc: codecs: Add proper NULL checks and initialize variables" 2018-10-25 03:13:39 -07:00
Tanya Dixit
ab8eba8711 asoc: codecs: Add proper NULL checks and initialize variables
Add null checks and initialize unintialized variables in
wsa macro, wcd937x and wcd937x_slave drivers.

CRs-Fixed: 2328286
Change-Id: I76b8d262e42d2b06ece3a6ecba28ed26b13d4447
Signed-off-by: Tanya Dixit <tdixit@codeaurora.org>
2018-10-22 15:06:48 +05:30
Ramprasad Katkam
e23066df2a asoc: wcd937x: initialize micb lock mutex
Micb lock which is used to synchronize micbias
control api is not initialized causing spin lock
errors. Initialize the mutex to avoid the issue.

Change-Id: I580e52e1bd225c2d99bfba4657d80670296709a0
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2018-10-17 15:58:23 +05:30
Linux Build Service Account
ce49ef9363 Merge "asoc: wcd937x: Make vdd-buck as on-demand supply" 2018-10-08 23:04:34 -07:00
Linux Build Service Account
516aa8be7c Merge "asoc: wcd937x: Fix pop on headphone playback start" 2018-10-08 23:04:31 -07:00
Laxminath Kasam
248273c949 asoc: wcd937x: Fix pop on headphone playback start
Pop is observed on HPH playback start. Enable SWR port
config setup before HPH PA enable.

Change-Id: I2253be1c7e4d8df2bffd7bd0396ceb72a5018637
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-10-05 22:14:05 +05:30
Tanya Dixit
6c13f05fb4 asoc: wcd937x: Make vdd-buck as on-demand supply
Add widget and routing support for vdd-buck supply
as dynamic for all rx usecases.

Change-Id: I1e67e7e950e33a0d98900ee0b20e0dc818a7936d
Signed-off-by: Tanya Dixit <tdixit@codeaurora.org>
2018-10-05 18:36:18 +05:30
Linux Build Service Account
3933347f55 Merge "asoc: codecs: add ignore suspend for bolero and wcd937x widgets" 2018-10-04 07:46:54 -07:00