codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The thermal warning IRQs for the speaker are requested in CODEC probe
but never freed. This patch frees them in CODEC remove.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The Arizona CODECs support several rates that do not have simple defines
in ALSA. This patch adds support for SNDRV_PCM_RATE_KNOT so that users
can open stream at these rates. As part of this we should always set
constraints in arizona_startup, currently we only set the constraints if
we already have a clock to limit rates to that family of sample rates.
This patch updates this to set a constraint of all rates supported by
the chip if we do not already know which family of rates to limit to.
Finally we also reduce the list of rates supported in the constraints to
only include those that are supported on current parts.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Specifying unstable coefficients for the low/high pass filters can have
a severe impact on the audio. This patchs adds a stability check on the
coefficients written to the low/high pass filter block to prevent this.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Specifying unstable coefficients for the EQ can have a severe impact on
the audio. This patchs adds a stability check on the coefficients
written to the EQ, for this it is necessary to merge the mode control
and the coefficients as some coefficients may only be unstable with a
certain mode setting so it is ideal if these are always updated in sync.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The WM5102 and WM8997 codecs have an internal dynamic clock booster.
When this booster is active, the DCVDD voltage must be increased.
If all the currently active audio paths can run with the root SYSCLK
we can disable the booster, allowing us to turn down DCVDD voltage
to save power.
Previously this was being done by having the booster enable bit set
as a side-effect of the LDO1 regulator driver, which is unexpected
behaviour of a regulator and not compatible with using an external
regulator. [Originally this was documented as a feature of the internal
LDO -- broonie]
This patch exports functions to handle the booster enable and
DCVDD voltage, with each relevant subsystem flagging whether it can
currently run without the booster. Note that these subsystems are
stateless and none of them are nestable, so there's no need for
reference counting, we only need a simple boolean for each subsystem
of whether their current condition could require the booster or will
allow us to turn the codec down to lower operating power.
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The dapm field of the snd_soc_codec struct is eventually going to be
removed, in preparation for this replace all manual access to codec->dapm
with snd_soc_codec_get_dapm().
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The Arizona codec drivers had an incorrect dB scaling for the
noise generator gain that started at 0dB and went upwards.
Actually the highest setting is 0dB.
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Save a bit of scheduling by coalescing all the output power up delays
into a single delay.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Give the output disable sequence a chance to fully complete, otherwise
there is a danger we may remove the clock before it is finished
resulting in a pop noise. The delay for each output must be cumulative
and these are coalesced into a single delay.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Different playback and capture bits-per-sample
are not supported on the AIFs
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
The macro's name is SOC_ENUM, not SOC_VALUE.
Fixes: e13dd8ce ("ASoC: wm8997: Replace usage deprecated MUX/ENUM macros")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
SOC_VALUE_ENUM, SND_SOC_DAPM_VALUE_MUX and SOC_DAPM_VALUE_ENUM are deprecated
and merely an alias for SOC_ENUM, SND_SOC_DAPM_MUX and SOC_DAPM_ENUM. Replace
the deprecated macros so we can eventually remove their definition.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Some thing Likes:
reproduce: make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
>> sound/soc/codecs/wm8997.c:1084:15: sparse: symbol \
'wm8997_get_regmap' was not declared. Should it be static?
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
As we can set the CODEC I/O while snd_soc_register_codec(), so the
calling of set_cache_io() from CODEC ASoC probe could be removed
entirely.
And then we can set the CODEC I/O in the device probe instead of
CODEC ASoC probe as earily as possible.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Now that all users have been converted to regmap and the config.reg_bits
and config.val_bits can be setted by each user through regmap core API.
So these two params are redundant here.
Since the only control type that left is SND_SOC_REGMAP, so remove it. Drop
the control params and add struct regmap *regmap to simplify the code.
Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
With the ongoing component-ization of the ASoC framework and the continuing
migration to using regmap for IO the control_data field of the snd_soc_codec
struct will eventually be removed. Prepare the wm5192, wm5110 and wm8997
drivers for this by using arizona->regmap instead of accessing the CODEC's
control_data field.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
... to make clear the meaning of the argument.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
The EQ coefficient binary controls overlapped with the volume controls
for the B4 and B5 volumes, which were controllable from either the
coefficient control or the volume control itself.
This patch adds controls for the mode and moves the coefficient control
to only cover the coefficients.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
When writing the patch write to the device asynchronously, allowing better
performance when used with a bus like SPI which supports this by
minimising the need to context switch back to the driver to get the
next bit of data.
Signed-off-by: Mark Brown <broonie@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
The wm8997 is a compact, high-performance audio hub CODEC with SLIMbus
interfacing, for smartphones, tablets and other portable audio devices
based on the Arizona platform.
This patch adds the wm8997 CODEC driver.
[Fixed some interface churn from bitrot due to the patch not going via
the MFD tree as expected -- broonie]
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>