During ADSP subsystem restart, all slimbus read/write would fail
as the bus is not available. Avoid codec read/write, until the
slimbus master in ADSP is up.
Change-Id: Iec1933d2625c1cd3dd700b2b3e2ffc7eae64880b
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Codec reset gpio configuration needs to be updated
before slimbus master component is initialized otherwise
codec cannot be enumerated on the bus. Add a new platform
device driver to update the codec reset gpio configuration
to valid state (output, drive-strength) before slimbus
is initialized.
CRs-Fixed: 968161
Change-Id: I7227212e6b846d58196718255aa4b0923352d120
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Update codec driver in compliance with the codec device bring up
and tear down,
Also include the critical fixes in codec driver fixed.
Change-Id: I7a468a40f18315fe8a065f13b05e7410a8d54b4c
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
This change fixes codec HW issues, Slimbus master capability issue
and codec NACK issues caused due to SIDO buck going down abruptly.
Change-Id: I74e94630b2ba4c132d66315ceee5127e05f284c6
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Add support for wcd9335 version 2.0 and update the
register defaults accordingly based on the version.
Change-Id: I33038c1643b83ecd593891688c0ddf4a556b92ee
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
There are few use cases where apps goes down to suspend
but codec should be in active state. Core driver will not
have knowledge of these usescases and hence move suspend and
resume hooks to codec driver.
Change-Id: If5614dd13f24a80d18f53f194c7be1c5b967a003
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Modify the codec power down sequence as below
1. Disable regulators.
2. Pull down codec reset GPIO.
3. Wait for 60 msec for codec to stabilise.
Change-Id: I410482561d99365395eea6ec94347e91507fe03a
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Use efuse register values, to differentiate between
wcd9326 and wcd9335 codecs.
Change-Id: I68e7ae5eb1717dccd0af975670ac3644304996b9
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
Modify codec, wsa and core drivers to maintain the power states
and configure the tasha codec and wsa hardware to low power mode
to reduce the power consumption during suspend.
Change-Id: I245c7ee154d0840b8036a99df374fc9392000585
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
When no audio use-cases are active, codec digital core
can be put into power collapse to reduce the power consumption
during codec stand-by. Add support to put core into power
collapse and remove out of the collapse when audio use-cases
are triggered.
Change-Id: Ib72b72239712d1b20542950f05b698647edcb9fa
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Sivasri Kumar Vanka <sivasri@codeaurora.org>
Change sequence of enabling flyback on wcd9335 as per hardware
requirement for flyback to work properly in audio usecase.
Change-Id: I48c24665afc4cb6527cc225ec3fecbc5f883a17d
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add changes in wcd core driver to support slimbus bulk register
writes API that sends multiple register writes with
one descriptor.
Change-Id: I27fd179f14e03e955f2847e3d2c4249852c14af2
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add support to detect the wcd9335 codec version and
define macros for wcd9335 1.0 and 1.1 so that codec
driver can use these macros to update the register
configuration.
Change-Id: Ibb497bfb857addb9c7e8db37828c0096979d2c3c
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Changes in machine driver to support wcd external
codec tasha. Add dailinks for tasha.
Change-Id: I6d56affc676d04156fe9763c4957a15060692fc0
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
For msm owned master ports, the configuration is done by a separate
driver and hence the master port related API's provided by slimslave are
not used. Remove the unused API's.
Change-Id: I3f6b4ffccce7533250e211441d2f383dc96c8655
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
It is possible that interrupt register addresses
are different depending on the version of the WCD
codec. Currently IRQ driver assumes that these
addresses are same across codecs. Add condition
to check the WCD codec version and update the
interrupt registers accordingly so that IRQ driver
can access the correct set of registers for interrupt
processing.
Change-Id: I65308cd865517b363cbce01c9fe57d5e13373aea
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
WCD9335 Audio Codec has two clock sources MCLK and RCO.
The clock source that gets enabled will depend on the audio
use-case that needs to be run and also proper sequencing
need to be followed when switching b/w these two clock sources.
Add WCD resource manager driver to handle the enablement of
the clock source and their switching.
Change-Id: Iacbdcfdccd0d1a2d33a0019c4d89a20639a20384
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
WCD9335 Audio Codec has Class-H controller on ear,
headphone paths. This controller adjusts the PA supply
by analysing the PCM audio samples. Add driver to
program Class-H Controller on Ear, Headphone paths.
Change-Id: I6c7ccbe4b515369cae3935b94f4ea202342280e0
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add codec driver for WCD9335 audio codec. This driver
is an ALSA-compliant and constructs the internal codec
audio paths with DAPM widgets and controls. Provides the
controls to the upper layers to enable and configure
audio paths.
Change-Id: I1c5ec2a7c775153ee6722832cb3a76298979d7f4
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Currently, there is a debugfs entry defined for peeking one register
at a time. Add another debugfs entry to dump all SLIMBUS slave
register.
Change-Id: Iddf056d68afd3699d9d8d8eef83bd98d03e61fac
Signed-off-by: Patrick Lai <plai@codeaurora.org>
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Slimbus clock can be scaled for high bandwidth requirements, add API to
support voting for slimbus clock so that individual codec drivers can
use this API.
CRs-fixed: 735296
Change-Id: I5be78b9ce5d0e2b241cecdba5f7ee672d8211461
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
MAD (Microphone Activity Detection) block on the codec can use
different Digital MIC (DMIC) clock rate as compared to regular audio
recording use cases. Add support to configure DMIC clock rate specific
to MAD which will be used by codec drivers whenever MAD is active.
CRs-fixed: 692015
Change-Id: Ife73a407c8d1a2d16b9b89df4979395a575f96c2
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Add changes for high performance audio playback on headset
for better audio quality during 192KHz/24bit audio playback.
CRs-Fixed: 706322
Change-Id: Ie79293f24114d5d81a610186d24b44b1550dae9c
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Parse the pinctrl nodes from the dtsi file for the slimbus
based codecs.
Change-Id: I5f03bbeaad608ae0966395e8170ec8a6e64d9bb0
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
on wcd9306, we have dtsi entry to register interrupts
from 0 to 28. But Tapan codec has num_irq initialised
to 31 causing irq_init to fail.
Correct the macro for TAPAN_NUM_IRQS to resolve the
issue.
Change-Id: Ieadc3fee5c7524e31d1697b23e30665a00564516
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
With new sound cards possible to connect over SLIMBUS,
add SLIMBUS as primary BE dai.
Change-Id: I6ebb3744a539f3409caad0565f7a80e6f531cc07
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Add register changes as per flatfile for rev 2.0
and maintain backward compatible.
Change-Id: I0060c4369ae66e624ea9d181048449d4e0cdf4f2
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
LAB feature is used in listen to capture PCM data once
the keyword is detected. To get the PCM from codec Apps
processor will enable the Slim master channel. PCM data
can be acquired from this master channel which is further
connected to MAD Tx port in codec. This change implements
and exports API to enable the Slim master channel on Apps
side.
Change-Id: Ibac20acc9e1c5c1afe2833c76de894aaf6b1d646
Signed-off-by: Venkat Sudhir <vsudhir@codeaurora.org>
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
8916 supports external audio codec (tapan) over I2C\I2S.
Add suport for tapan audio codec and also add pinctrl support
for codec reset GPIO.
Change-Id: I3f2820139c644bd993c17e12e27f7a54f58f692e
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Increase codec max regulators count by one as wcd9330 codec has
stereo speakers and require an additional on-demand supply.
Change-Id: Ie01b233d555a925687fa5c99363664206cf1b197
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Update wcd9330 codec register default values based on
the version (v1.0 or v2.0) that is detected.
Change-Id: I55d9b3a240a9a9c3ca9a33d96ccb99dca83a2e02
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
WCD9330 codec hardware has two versions v1.0 and v2.0.
Add support to detect the codec version.
Change-Id: Icd5fbbccc57642bb686593ebacec3dd1fa0b5392
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
When SLIMBUS data channel is to be torn down, CODEC driver
waits for channel removal interrupt from SLIMBUS slave device
with 1 second timeout as measure to prevent system from lock
down in case channel removal interrupt never arrive due to
known reason. When ADSP SSR happen, SLIMBUS would be reset
hence data channel will be gone inherently. Waiting for 1
second will only prolong SSR recovery latency. Update to
avoid the delay after SSR.
Change-Id: Ic6a94ddd1150ba143f4dd33aac1785d7d2ee7653
CRs-fixed: 653504
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Slimbus supports ability to write upto 16 bytes to the same register as
one transaction on the bus through REPEAT_CHANGE_VALUE slimbus message.
Add support to write codec register with multiple values using
REPEAT_CHANGE_VALUE. Not all sizes from 1 to 16 are supported by such a
message, add support in driver to be able to write all sizes from 1 to
16 by splitting the register writes of unsupported sizes into multiple
writes of supported sizes.
Change-Id: I33fdd983068bc10f65523b2a95f1d7741fa6c486
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
Current code does not check if the indexes of array
codec_dai being accessed is within the maximum
number of codec dais for a particular codec. The change
adds this check and ensures that indexes outside the
bounds of array are not accessed.
CRs-Fixed: 628865
Change-Id: Ibf81f91b35e43feddc6b03a1239b4d12e04a95da
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
Add support to detect wcd9330 audio codec by reading the chip
version registers and also update the codec reset control
registers based on the codec type detected.
Change-Id: Ida69413a0e423e9311229200edfbf6f56d4c2759
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Add codec driver for WCD9330 audio codec. This driver
is an ALSA-compliant and constructs the internal codec
audio paths with DAPM widgets and controls. Provides the
controls to the upper layers to enable and configure
audio paths.
Change-Id: If0832f3dd7dc671d7a61a43a7a8683106ad84973
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>