Commit Graph

121 Commits

Author SHA1 Message Date
Karthikeyan Mani
b44e4551b1 asoc: codecs: bolero: Do not return error for unused gpio
If soundwire gpio is not used, then no need to return
error if not able to get gpio data.

Change-Id: I97705b49d3b01f99b7a4e91190a15ffb211d32f2
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-09-09 23:08:07 -07:00
Laxminath Kasam
f8adb5f3c3 asoc: codecs: bolero: Update mixing path and channel mask for RX path
RX_CDC_DMA_RX0/1/2/3 ports  drives RX0/RX1, RX2/RX3, RX4 and RX5
channels on bolero rx-macro. Update channel mask
as per these mapping and return to channel map
accordingly.

Change-Id: I2e66e601b5137ebc513527827332bbb7cde0acb3
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-09-09 10:47:49 +05:30
qctecmdr
96ea26f502 Merge "asoc: codecs: bolero: load hph filter coefficients" 2019-09-04 03:16:16 -07:00
Laxminath Kasam
52ae6581d7 asoc: codecs: bolero: Fix L/R swap issue on bolero RX
Left and right channel content can get swapped
in new cdc_dma interface.

DMA interfaces underrun results in Channels being swapped.

This issue is a side effect current SW setup for RX path:
  1.  HLOS Setup WCD Analog Path, Bolero CODEC.
      CODEC would drive Fs to LPASS DMAs requesting for PCM samples.
  2.  DSP setup RX Buffers in Memory :
  3.  DSP Configures RD DMAs and DMA RXTX CODEC interface
      (Enable CODEC DMA interface buffer and
       Enable DMA LPASS_RXTX_LPAIF_RDDMA_CTL0.ENABLE
       and LPASS_RXTX_LPAIF_RDDMA_CODEC_INTF0.ENABLE
    If CODEC Fs, aligns with DMA interface being enabled
    there is an underrun as DMA interface pingpong buffer is empty.
    This results in channels being swapped.

Proposed work around while keeping current SW setup order.
Provide a workaround to Keep Fs disabled  until DMAs and
CODEC DMA interface are enabled and HW could  prefetch all buffers.
SW would keep existing setup order:
  1.  HLOS Setup WCD Analog Path, Bolero CODEC.
      CODEC would drive Fs to LPASS DMAs requesting for PCM samples.
  2.  DSP setup RX Buffers in Memory :
  3.  DSP Configures DMAs and DMA CODEC interface
      (Enable CODEC DMA interface buffer and
       Enable DMA LPASS_RXTX_LPAIF_RDDMA_CTL0.ENABLE
       and LPASS_RXTX_LPAIF_RDDMA_CODEC_INTF0.ENABLE)
  4.  Enable Fs Set #LPASS_RX_CDC_RX0_RX_PATH_CTL. CLK_EN to ONE

Change-Id: I7916667f5d857464cc7d77b51da307ab234cc7bb
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-08-28 19:08:02 +05:30
qctecmdr
efdfdf2782 Merge "ASoC: bolero: check for port validation before configuration" 2019-08-25 03:14:53 -07:00
Karthikeyan Mani
75ea1b8ade asoc: codecs: bolero: load hph filter coefficients
On hph playback usecase with compander enabled, load
hph filter coefficients to better center gain errors.

Change-Id: I3ce50d6e7b9a10255df8084adb0566d8bf9b47c7
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-08-22 15:09:49 -07:00
qctecmdr
ab0a45b0db Merge "soc: swr: avoid SSR state when switching between 44.1 and 48k family" 2019-08-20 00:02:12 -07:00
Sudheer Papothi
c0f75b7727 ASoC: bolero: check for port validation before configuration
Check for valid port before mux configuration.

Change-Id: Iaa32925f0c23305a2a3cedd0e476372aac380e0c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-08-19 22:52:56 +05:30
Ramprasad Katkam
2e85a54634 soc: swr: avoid SSR state when switching between 44.1 and 48k family
Avoid SSR state, and do only clock-stop-resume to reset master  when
switching between 44.1 and 48k to avoid redundant re-enumeration.

Change-Id: Iaa955c4ceb75f30c68106468676ddb2551537de4
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-08-12 01:31:48 -07:00
Aditya Bavanari
50ef13eca6 asoc: codecs: Fix LPI TLMM GPIO invalid access issue
Runtime suspend gets called multiple times during SSR
scenarios leading to clock count mismatch. Add logic
to prevent this in all macros and pinctrl lpi driver.

Change-Id: I380631c1db8cd7d94a8909affd8c96c87f24817c
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-08-09 15:14:43 +05:30
qctecmdr
330f03de80 Merge "asoc: bolero: force bolero runtime suspend during adsp ssr" 2019-07-06 08:48:33 -07:00
Meng Wang
bf1fe8fbad asoc: bolero: force bolero runtime suspend during adsp ssr
During adsp SSR, bolero runtime suspend is not called and
hw vote clks are not reset. Force bolero runtime suspend
during adsp SSR to avoid kernel panic.

Change-Id: Iff5983ef07f77ecc7f3f344948c013906b4bad60
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-07-02 08:26:55 +08:00
Karthikeyan Mani
c14c27a7c6 asoc: codecs: bolero: add compander soft reset event
Add compander soft reset event that can be requested
from a slave codec to reset at power down to reduce
click and pop noise.

Change-Id: I2f6ff182e258e02979166b0e76b6a1d439b1cf87
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-06-21 14:14:47 -07:00
qctecmdr
1dffa77438 Merge "asoc: bolero: reset all clks after SSR/PDR" 2019-06-17 21:04:15 -07:00
qctecmdr
45b4733d63 Merge "asoc: codecs: defer probe if soundwire pin is not ready" 2019-06-17 20:25:32 -07:00
Karthikeyan Mani
326536d1d6 asoc: codecs: defer probe if soundwire pin is not ready
Defer codec macro probes if soundwire pins are not
ready to be accessed yet during boot up.

Change-Id: I20173e49043a076d73cdbb811863afbff87d4a3b
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-06-11 17:48:35 -07:00
Karthikeyan Mani
3bd80a59b2 asoc: codecs: add support to disable soundwire devices
Add changes to support disabling of soundwire devices
so that soundwire pins can be freed for other purposes
if needed.

Change-Id: Iae14d43c2c3d5380347be4c3b443c209b2612a97
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-06-10 17:14:36 -07:00
Meng Wang
8ef0cc2ed4 asoc: bolero: reset all clks after SSR/PDR
After SSR/PDR, the lpass clocks will be in off state. Force restart
clocks after SSR/PDR, if enabled before SSR/PDR, to reenable the clocks.

Change-Id: I3d850d92bdc6324aa7a64a83a9066f388a85c7f7
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-06-06 08:45:19 +08:00
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
Karthikeyan Mani
c141ca9e3d asoc: codecs: bolero: Reset power mode register at teardown
Reset the compander power mode register to default
value upon teardown sequence, so that at next startup
use case it has proper power value.

Change-Id: I851e8a62a910d7018ac74e93abee47a615b3e50c
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-13 14:43:41 -07:00
qctecmdr
23baae7456 Merge "asoc: Fix aux path noise issue" 2019-04-17 04:37:36 -07:00
Laxminath Kasam
1a4dd6d9ac asoc: Fix aux path noise issue
Observing noise on aux path playback.
Update sequences on digital side and
swr port params as per latest HW sequence
recommendation.

Change-Id: Ic07ec35b091985ef0146957ceca830bd1162e7ec
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-04-12 11:27:09 +05:30
Sudheer Papothi
7601cc6db6 ASoC: Bolero: Vote for LPASS HW core during register access
Vote for LPASS HW core in soundwire clock request before
soundwire register access to avoid LPASS going to sleep.

Change-Id: I1e54ece19130cf6bd63fbf75a8a0716856c3b73e
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2019-04-10 12:45:29 -07:00
Vidyakumar Athota
5d45f4c865 asoc: codecs: bolero: add clk resource manager driver
Add Bolero clock resource manager driver to handle/manage
bolero clocks for all the concurrency usecases like record
+ voice activation.

Change-Id: I970a05d96fc9060b44bfe670d465f0b9d72cc53b
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2019-04-05 08:00:03 -07:00
Karthikeyan Mani
01f1ba49be asoc: codecs: bolero: enable gpio and clk in right sequence
Enable soundwire gpio before enabling soundwire clock
so that bus clash does not happen when interrupts are
received.

Change-Id: I40983b8837373f1ea7ac8fa6add7c56225ff0592
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-03-01 19:17:12 -08:00
Vatsal Bucha
8bcc97c618 ASoC: rx-macro: Enable hph idle detect feature
Headset Idle detect feature powers off PAs when
there is no signal. Add widget to enable
this feature for headset path.

Change-Id: I4c88057b347e40317578b5eb014053c17d196b85
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-02-20 19:20:12 +08:00
Ramprasad Katkam
452772abf9 asoc: bolero: Do not disable mclk in widget power down upon enable failure
If mclk enable is failed during mclk widget power up event, it would
still send a power down event for the widget during disable, which could
disable the mclk voted by other client like soundwire. Do not disable
mclk during power down if enable is failed during power up.

Change-Id: If782b34f9ef414501590ed8cf681bbe58f1dda76
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-01-22 12:51:39 +08:00
Linux Build Service Account
a0b8337922 Merge "asoc: bolero: Call swr device down before setting ssr down" 2019-01-08 05:31:57 -08:00
Linux Build Service Account
e7d0905375 Merge "soc: swr-mstr: Reset swr only during init or ssr" 2019-01-08 05:31:56 -08:00
Ramprasad Katkam
5ee54aee41 asoc: bolero: Call swr device down before setting ssr down
Invoke swr device down callback to set soundwire master
to reset state before setting ssr down flag. This is to
ensure master is reset to proper state after ssr/pdr.

Change-Id: Ifb5548f603ac03b772006314f4723c0ac0176928
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-01-02 01:37:06 -08:00
Ramprasad Katkam
a4c747b6d5 soc: swr-mstr: Reset swr only during init or ssr
Reset swr only during init or ssr-pdr scenarios.
Do not reset swr during clock stop, which would
result in bad state of master and cause error
interrupts.

Change-Id: I88e071921409a5b5797aeedb8e7cb57cb5d5bb9a
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-01-02 17:31:14 +08:00
Vatsal Bucha
39ead2c1e8 ASoC: bolero: Remove unwanted logs at bootup
Correct name of widgets for tx macro from
TX SWR_MIC to TX SWR_DMIC. Also assign codec pointer
to rx_priv before calling rx_macro_init_bcl_pmic_reg.

Change-Id: I268d79413c53bcd2d8e7a391859b71b7a7e3f64e
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-01-02 17:16:23 +08:00
Vatsal Bucha
c2d6c22d1d asoc: bolero: Add routing for rx echo reference
Add mixer control and routing to enable echo reference
for rx_macro.

Change-Id: Ic1095eaa8024f2cb61722609daae94bc645b263b
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2019-01-02 17:13:18 +08:00
Linux Build Service Account
50840ecb1b Merge "asoc: update relative header files" 2018-12-18 11:22:16 -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
Sudheer Papothi
a3e969d6f0 ASoC: bolero: Add support to retrieve soundwire port configuration
Add support to get the platform specific soundwire port configuration
for soundwire master ports.

Change-Id: Ie1d32a77d534f6c3f397936b85c025b14d01f321
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
2018-12-17 14:30:55 -08:00
Linux Build Service Account
31611c4d92 Merge "ASoC: codecs: bolero: Fix playback issue over RX1" 2018-12-12 08:52:06 -08:00
Laxminath Kasam
c21e98a1a4 asoc: codecs: bolero: Update hph_pwr enum value same as class-H options
Update hph_pwr enum value for LOHIFI as per
class-H power options to maintain consistent naming.

Change-Id: Ib7deb8d84bd1163a933d06ae92a51cb29b76e3c8
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-12-11 00:10:35 -08:00
Vatsal Bucha
1a96a61236 ASoC: codecs: bolero: Fix playback issue over RX1
Mono playback over RX1 is not happening due to
incorrect channel mask sent to AFE. Update
channel mask for RX to enable playback.

Change-Id: I06eeb565149c635ddbcce39f4260f67b80474335
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
2018-12-10 23:51:51 -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
Linux Build Service Account
e83932585b Merge "Asoc: codec: Fix compilation errors for sdmsteppe target" 2018-11-21 20:45:52 -08:00
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
Md Mansoor Ahmed
26d8bddff4 Asoc: codec: Fix compilation errors for sdmsteppe target
Fix compilation errors for sdmsteppe target.

Change-Id: I511bfd5271d04b455e46a101c47ea1535681dcca
Signed-off-by: Md Mansoor Ahmed <mansoor@codeaurora.org>
2018-11-20 11:07:28 +05:30
Laxminath Kasam
d3ffb3368b asoc: codecs: bolero: Disable HD2 on RX macro
HD2 canceller on analog codec is performing
better and enabling HD2 block on rx macro side
as well impacting THD+N spec. As per HW
recommendation, disable HD2 on digital bolero
rx macro by default. Mixer control option is
provided if required to enable it in future for
any requirements.

CRs-Fixed: 2343436
Change-Id: Ic1696ff9a6dea22a3c2a6071708267e2a024a4c7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2018-11-15 15:01:09 +05:30
Linux Build Service Account
3de80a4abd Merge "asoc: codecs: Add new class-H driver for wcd937x" 2018-11-14 23:15:18 -08:00