summaryrefslogtreecommitdiff
path: root/sound/soc/codecs
AgeCommit message (Collapse)Author
2019-02-26Merge branch 'for-5.0' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.1
2019-02-22ASoC: wm_adsp: Improve logging messagesCharles Keepax
As the compressed stream implementation has acquired support for multiple DAI links and compressed streams it has become harder to interpret messages in the kernel log. Add additional macros to include the compressed DAI name in the log messages, allowing different streams to be easily disambiguated. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-22ASoC: wm_adsp: Add support for multiple compressed buffersStuart Henderson
Currently, only a single compressed stream is supported per firmware. Add support for multiple compressed streams on a single firmware, this allows additional features like completely independent trigger words or separate debug capture streams to be implemented. Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-22ASoC: wm_adsp: Refactor compress stream initialisationCharles Keepax
Make the code slightly clearer and prepare things for the addition of multiple compressed streams on a single DSP core. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-22ASoC: wm_adsp: Reorder some functions for improved clarityCharles Keepax
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-22ASoC: wm_adsp: Factor out stripping padding from ADSP dataCharles Keepax
In preparation for more refactoring add a helper function to strip the padding from ADSP data. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-22ASoC: cs35l36: Fix an IS_ERR() vs NULL checking bugDan Carpenter
The irq_get_irq_data() function doesn't return error pointers, it returns NULL. Fixes: 6ba9dd6c893b ("ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-20ASoC: wm_adsp: Allow compressed buffers in any memory regionAndrew Ford
Currently, compressed buffers can only be specified in the XM memory region. There is no reason to have such a restriction with the newer meta-data based way of specifying the buffers, so remove it. Signed-off-by: Andrew Ford <aford@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-20ASoC: wm_adsp: Update cached error state on triggerStuart Henderson
If a compressed stream is restarted after getting an error, the cached error value will still be used on the next pointer request, preventing the stream from starting. Resolve this by ensuring the error status is updated on trigger start. Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-19ASoC: codecs: pcm186x: Fix energysense SLEEP bitCodrin Ciubotariu
The ADCs are sleeping when the SLEEP bit is set and running when it's cleared, so the bit should be inverted. Tested on pcm1863. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Acked-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2019-02-19ASoC: codecs: pcm186x: fix wrong usage of DECLARE_TLV_DB_SCALE()Codrin Ciubotariu
According to DS, the gain is between -12 dB and 40 dB, with a 0.5 dB step. Tested on pcm1863. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Acked-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2019-02-19ASoC: adau1977: Add support for setting MICBIAS via DTBogdan Togorean
If platform_data is NULL add reading of optional adi,micbias property from DT. If adi,micbias is not set keep the default value for micbias. Signed-off-by: Bogdan Togorean <bogdan.togorean@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-19ASoC: wm8741: Make function 'wm8741_mute' staticWei Yongjun
Fixes the following sparse warning: sound/soc/codecs/wm8741.c:371:5: warning: symbol 'wm8741_mute' was not declared. Should it be static? Fixes: 36b1599340b5 ("ASoC: wm8741: Add digital mute callback") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18ASoC: cs35l36: Make some symbols staticWei Yongjun
Fixes the following sparse warnings: sound/soc/codecs/cs35l36.c:135:20: warning: symbol 'cs35l36_reg' was not declared. Should it be static? sound/soc/codecs/cs35l36.c:248:6: warning: symbol 'cs35l36_readable_reg' was not declared. Should it be static? sound/soc/codecs/cs35l36.c:398:6: warning: symbol 'cs35l36_precious_reg' was not declared. Should it be static? sound/soc/codecs/cs35l36.c:410:6: warning: symbol 'cs35l36_volatile_reg' was not declared. Should it be static? Fixes: 6ba9dd6c893b ("ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: James Schulman <james.schulman@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18ASoC: codecs: ad193x: Add support to disable on-chip PLLCodrin Ciubotariu
The on-chip PLL can be disabled if on the MCLKI pin we have an external clock at 512 x fs. This clock can be used as direct internal clock for ADCs or DACs. To support this, we add an extra clock id that can be configured using the set_sysclk() callback. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18ASoC: codecs: ad193x: Add runtime support for DSP_A and I2S modesCodrin Ciubotariu
The driver only supports DPS_A for DAC, which is configured at probe. This patch adds support for DSP_A and I2S modes by using the set_fmt() callback. A trivial break is also removed from a case's default branch. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18ASoC: codecs: ad193x: Fix frame polarity for DSP_A formatCodrin Ciubotariu
By default, the codec starts to interpret the left (first) channel on the falling edge (low polarity) of LRCLK. However, for DSP_A, the left channel needs to start on the rising edge of LRCLK. This patch fixes this channel swap by toggling the bit which selects the LRCLK polarity. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18ASoC: codecs: ad193x: Set constraint to always have 32 sample bitsCodrin Ciubotariu
DACs and ADCs on ad193x codecs require a 32 bit slot size. We should assure that no other size is used. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-18ASoC: codecs: ad193x: Remove capture support for codecs without ADCCodrin Ciubotariu
Some ad193x codecs don't have ADCs, so they have no capture capabilities. This way, we can use this driver in multicodec cards. Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-14ASoC: da7219: Update TDM usage to be more flexibleAdam Thomson
The previous implementatation was restrictive with regards to BCLK rates for slave mode where the driver would not allow rates the codec couldn't provide itself as clock master. The codec is able to automatically determine and handle whatever rate is provided so this restriction isn't necessary for slave mode. The code was also flawed with regards to setting of the frame offset as using rx_mask to explicitly set the offset has the knock on effect of impacting the min and max channels for the codec, in soc_pcm_hw_params() through the call to soc_pcm_codec_params_fixup(). With this update, the driver now only limits frame size if codec is clock master, and dynamically determines the BCLK offset relating to WCLK using the tx_mask for slot offset along with the slot width provided. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-14ASoC: da7219: Add support for master mode BCLK rate adjustmentAdam Thomson
Previously the driver would default the BCLK periods per WCLK to 64, to cover all possible non-TDM scenarios when the codec was DAI clock master. However some devices require a lower BCLK rate to operate correctly so with this in mind, this commit updates the code to be more dynamic, with BCLK rate now based on SR and word length provided to hw_params(). Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-13ASoC: cros_ec_codec: Make symbol 'cros_ec_dai' staticWei Yongjun
Fixes the following sparse warning: sound/soc/codecs/cros_ec_codec.c:209:27: warning: symbol 'cros_ec_dai' was not declared. Should it be static? Fixes: b291f42a3718 ("ASoC: cros_ec_codec: Add codec driver for Cros EC") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-13ASoC: cs35l36: Remove unused including <linux/version.h>YueHaibing
Remove including <linux/version.h> that don't need it. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-12tlv320aic32x4: delay i2c access by 1 ms after hardware resetPeter Seiderer
As stated in 'TLV320AIC3254 Application Reference Guide' ([1]): 3.2 Device Startup Lockout Times After the TLV320AIC3254 initializes through hardware reset at power-up or software reset, the internal registers initialize to default values. This initialization takes place within 1ms after pulling the RESET signal high. During this initialization phase, no register-read or register-write operation should be performed on ADC or DAC coefficient buffers. Also, no block within the codec should be powered up during the initialization phase. [1] http://www.ti.com/lit/an/slaa408a/slaa408a.pdf Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-11ASoC: wm8741: Set OSR mode in hw_params()Sergej Sawazki
For correct operation of the digital filtering and other processing on the WM8741, the user must ensure the correct value of OSR[1:0] is set at all times.[1] Hence, depending the selected sampling rate, set the OSR (over- sampling rate) mode in hw_params(). References: [1] "WM8741 Data Sheet" Signed-off-by: Sergej Sawazki <sergej@taudac.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-11ASoC: wm8741: Add digital mute callbackSergej Sawazki
Signed-off-by: Sergej Sawazki <sergej@taudac.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-11ASoC: hdac_hdmi: use devm_kzalloc for all structuresPierre-Louis Bossart
Loading/unloading modules exposes issues with memory allocation, which is a mix of devm_kzalloc and manual kzalloc. Move to devm_k routines everywhere to simplify all this. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-11ASoC: pcm3060: Add clock selectKirill Marinushkin
ADC and DAC can be clocked from separate or same sources CLK1 and CLK2. By default, ADC is clocked from CLK1, and DAC - from CLK2. This commits allows sound cards to selest a proper clock source during `hw_params()` via `snd_soc_dai_set_sysclk()`. It makes possible to have a single clock source for both ADC and DAC. Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-11ASoC: pcm3060: Add soft reset on probeKirill Marinushkin
Softly reset registers values on module probe Signed-off-by: Kirill Marinushkin <kmarinushkin@birdec.tech> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08ASoC: msm8916-wcd-digital: convert license header to SPDXJohan Hovold
Convert the GPLv2-only license header to SPDX. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08ASoC: msm8916-wcd-analog: add missing license informationJohan Hovold
Add the missing license and copyright information which never made it into the analog driver when the original driver was split in two as part of the review process. Link: https://lkml.kernel.org/r/1465582725-30183-3-git-send-email-srinivas.kandagatla@linaro.org Fixes: 585e881e5b9e ("ASoC: codecs: Add msm8916-wcd analog codec") Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08ASoC: regulator notifier registration should be managedGuennadi Liakhovetski
Regulator notifiers, that were registered during codec driver probing, must be unregistered during driver release, or device managed versions have to be used. This patch fixes codec drivers, that weren't explicitly unregistering notifiers and simplifies those, that did that manually. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08ASoC: codecs: jz4725b: Remove unnecessary const qualifierNathan Chancellor
Clang warns: sound/soc/codecs/jz4725b.c:177:14: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] static const SOC_VALUE_ENUM_SINGLE_DECL(jz4725b_codec_adc_src_enum, ^ include/sound/soc.h:356:2: note: expanded from macro 'SOC_VALUE_ENUM_SINGLE_DECL' SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) ^ include/sound/soc.h:353:2: note: expanded from macro 'SOC_VALUE_ENUM_DOUBLE_DECL' const struct soc_enum name = SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, \ ^ As it points out, SOC_VALUE_ENUM_DOUBLE_DECL has the const attribute in its definition so remove it here. Fixes: e9d97b05a80f ("ASoC: codecs: Add jz4725b-codec driver") Link: https://github.com/ClangBuiltLinux/linux/issues/354 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-08ASoC: cs35l36: Add support for Cirrus CS35L36 AmplifierJames Schulman
Add driver support for Cirrus Logic CS35L36 boosted speaker amplifier Signed-off-by: James Schulman <james.schulman@cirrus.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07ASoC: codecs: jz4725b: Use C++ style comments in headerPaul Cercueil
Change the header comment to use C++ style, so that it looks more consistent with the rest of ASoC. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07ASoC: codecs: Kconfig: Show knob, and depend on MIPS || COMPILE_TESTPaul Cercueil
Show the knob to enable or disable the jz4740-codec driver, add a proper description, and add a dependency on MIPS || COMPILE_TEST, as this driver is only useful on MIPS. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07ASoC: codecs: jz4740: Add support for devicetreePaul Cercueil
Add support for probing the driver from devicetree. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07ASoC: codecs: jz4740: Use SPDX license notifierPaul Cercueil
Add license information as a standard SPDX license notifier instead of custom text. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07ASoC: codecs: jz4725b: fix spelling mistake "Deemphatize" -> "Deemphasize"Colin Ian King
There is a spelling mistake in the SOC_SINGLE control name. Fix this. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-07ASoC: wcd9335: fix semicolon.cocci warningskbuild test robot
sound/soc/codecs/wcd-clsh-v2.c:545:2-3: Unneeded semicolon sound/soc/codecs/wcd-clsh-v2.c:211:2-3: Unneeded semicolon sound/soc/codecs/wcd-clsh-v2.c:250:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: cc2e324d39b2 ("ASoC: wcd9335: add CLASS-H Controller support") CC: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06ASoC: codecs: Add jz4725b-codec driverPaul Cercueil
Add jz4725b-codec driver to support the internal CODEC found in the JZ4725B SoC from Ingenic. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06Merge branch 'asoc-5.0' into asoc-5.1 for dapm tableMark Brown
2019-02-06ASoC: ssm2602: switch to SPDX identifierMarco Felsch
Drop old license header and switch to SPDX-License-Identifier. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06ASoC: wcd9335: remove some unnecessary NULL checksDan Carpenter
These are arrays, not pointers, and they can't be NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-06ASoC: ssm2602: Fix ADC powerup sequencingPhilipp Zabel
According to the ssm2603 data sheet (control register sequencing), the digital core should be activated only after all necessary bits in the power register are enabled, and a delay determined by the decoupling capacitor on the VMID pin has passed. If the digital core is activated too early, or even before the ADC is powered up, audible artifacts appear at the beginning of the recorded signal. The digital core is also needed for playback, so when recording starts it may already be enabled. This means we cannot get the power sequence correct when we want to be able to start recording after playback. As a workaround put the MIC mute switch into the DAPM routes. This way we can keep the recording disabled until the MIC Bias has settled and thus get rid of audible artifacts. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> m.felsch@pengutronix.de: adapt commit message m.felsch@pengutronix.de: drop of configuration as mentioned by Mark: https://patchwork.kernel.org/patch/10407449/ Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-04ASoC: ak4118: fix missing headerClément Péron
This driver use the gpio consumer interface. Add the header as it's needed. Signed-off-by: Clément Péron <peron.clem@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-02ASoC: arizona: Add channel numbers to AIFsCharles Keepax
Set the channel number on each AIF widget to allow unused channels not to be powered up across AIFs. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-29ASoC: cros_ec_codec: Add codec driver for Cros ECCheng-Yi Chiang
Add a codec driver to control ChromeOS EC codec. Use EC Host command to enable/disable I2S recording and control other configurations. Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-29Merge tag 'v5.0-rc4' into asoc-5.1Mark Brown
Linux 5.0-rc4
2019-01-29ASoC: wcd9335: Fix missing slimbus dependencyMark Brown
Signed-off-by: Mark Brown <broonie@kernel.org>