summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8960.c
AgeCommit message (Collapse)Author
2016-09-29Merge remote-tracking branches 'asoc/topic/tpa6130a2', 'asoc/topic/ux500', ↵Mark Brown
'asoc/topic/wm8960', 'asoc/topic/wm8962' and 'asoc/topic/wm8991' into asoc-next
2016-09-28ASoC: wm8960: remove usage of obsoleted TLV-related macroTakashi Sakamoto
TLV_DB_RANGE_HEAD macro was obsoleted by commit bf1d1c9b6179 ("ALSA: tlv: add DECLARE_TLV_DB_RANGE()"). This commit removes usage of the macro, with the obsoleting macro renamed to SNDRV_CTL_TLVD_DECLARE_DB_RANGE(). Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01ASoC: constify snd_soc_codec_driver structuresJulia Lawall
Check for snd_soc_codec_driver structures that are only passed to snd_soc_register_codec or memcpy (2nd arg), for which the corresponding parameters are declared const. Declare as const snd_soc_codec_driver structures that have these properties. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r disable optional_qualifier@ identifier i; position p; @@ static struct snd_soc_codec_driver i@p = { ... }; @ok@ identifier r.i; expression e1,e2,e3; position p; @@ ( snd_soc_register_codec(e1,&i@p,e2,e3) | memcpy(e1,&i@p,e2) ) @bad@ position p != {r.p,ok.p}; identifier r.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct snd_soc_codec_driver i = { ... }; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-10Merge remote-tracking branches 'asoc/fix/rt5659', 'asoc/fix/sigmadsp', ↵Mark Brown
'asoc/fix/simple', 'asoc/fix/wm5110' and 'asoc/fix/wm8960' into asoc-linus
2016-01-22ASoC: wm8960: Fix WM8960_SYSCLK_PLL modeStuart Henderson
With the introduction of WM8960_SYSCLK_AUTO mode, WM8960_SYSCLK_PLL mode was made unusable. Ensure we're not PLL mode before trying to use MCLK. Fixes: 3176bf2d7ccd ("ASoC: wm8960: update pll and clock setting function") Signed-off-by: Stuart Henderson <stuart.henderson@cirrus.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-22ASoC: wm8960: Fix input boost mixer left/right namingStuart Henderson
INBMIX1 controls LINPUTs and INBMIX2 controls RINPUTs, so fix the naming accordingly. Signed-off-by: Stuart Henderson <stuart.henderson@cirrus.com> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-11Merge remote-tracking branch 'asoc/topic/wm8960' into asoc-nextMark Brown
2016-01-08ASoC: wm8960: boost switch should be closed when using L/RINPUT1Zidan Wang
L/RINPUT1 can line to Left/Right Boost Mixer through boost switch. If boost switch is open, there will be no voice when using L/RINPUT1. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-08ASoC: wm8960: add DAC mono mix kcontrolZidan Wang
In normal operation, the left and right channel digital audio data is converted to analogue in two separate DACs. There is a mono-mix mode where the two audio channels are mixed together digitally and then converted to analogue using only one DAC, while the other DAC is switched off. The mono-mix signal can be selected to appear on both analogue output channels. The mono mix is automatically attenuated by 6dB to prevent clipping. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-24ASoC: wm8960: add kcontrol to select ADC data outputZidan Wang
add kcontrol to select ADC data output. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-25Merge remote-tracking branches 'asoc/fix/rt5677', 'asoc/fix/st', ↵Mark Brown
'asoc/fix/sun4i-codec', 'asoc/fix/topology', 'asoc/fix/wm8960' and 'asoc/fix/wm8962' into asoc-linus
2015-11-03ASoC: wm8960: Fix the Input PGA Mute switchJongHo Kim
Change the xinvert value from 0 to 1 on the "Capture Switch" control WM8960 datasheet is shown as follows: Bit 7 at 00h and 01h register address 1 : Enable Mute, 0 : Disable Mute Signed-off-by: JongHo Kim <furmuwon@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-26Merge remote-tracking branches 'asoc/topic/wm8904', 'asoc/topic/wm8955' and ↵Mark Brown
'asoc/topic/wm8960' into asoc-next
2015-10-22ASoC: wm8960: harmless underflow in wm8960_put_deemph()Dan Carpenter
We should only accept "deemph" values of zero and one, but by mistake we accept negatives as well. It's harmless but let's clean it up anyway. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23Merge remote-tracking branches 'asoc/fix/wm8960' and 'asoc/fix/wm8962' into ↵Mark Brown
asoc-linus
2015-09-19ASoC: wm8960: correct the max register value of mic boost pgaZidan Wang
the max register value of mic boost pga should be 3. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-11ASoC: wm8960: correct gain value for input PGA and add microphone PGAZidan Wang
The input PGAs have a gain range from -17.25dB to +30dB in 0.75dB steps. The boost stage can provide additional gain. For line inputs, -12dB to +6dB gain is available on the boost mixer. For micphone inputs, it can provide up to +29dB additional gain from the microphone PGA. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-11ASoC: wm8960: correct the min gain value of some PGAZidan Wang
The min gain is the corresponding gain value when the register value is 0 instead of 1, just correct it. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/wm8741', 'asoc/topic/wm8753', ↵Mark Brown
'asoc/topic/wm8904', 'asoc/topic/wm8960' and 'asoc/topic/wm8983' into asoc-next
2015-08-11ASoC: wm8960: update pll and clock setting functionZidan Wang
Add sysclk auto mode. When it's sysclk auto mode, if the MCLK is available for clock configure, using MCLK to provide sysclk directly, otherwise, search a available pll out frequcncy and set pll. Configure clock in hw_params may cause problems when using bypass style paths without hw_params in machine driver getting called. So add configure clock to set_bias_level. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-22Merge tag 'asoc-v4.2' into asoc-nextMark Brown
ASoC: Updates for v4.2 The big thing this release has been Liam's addition of topology support to the core. We've also seen quite a bit of driver work and the continuation of Lars' refactoring for component support. - Support for loading ASoC topology maps from firmware, intended to be used to allow self-describing DSP firmware images to be built which can map controls added by the DSP to userspace without the kernel needing to know about individual DSP firmwares. - Lots of refactoring to avoid direct access to snd_soc_codec where it's not needed supporting future refactoring. - Big refactoring and cleanup serieses for the Wolfson ADSP and TI TAS2552 drivers. - Support for TI TAS571x power amplifiers. - Support for Qualcomm APQ8016 and ZTE ZX296702 SoCs. - Support for x86 systems with RT5650 and Qualcomm Storm. # gpg: Signature made Mon 08 Jun 2015 18:48:37 BST using RSA key ID 5D5487D0 # gpg: Oops: keyid_from_fingerprint: no pubkey # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" # gpg: aka "Mark Brown <broonie@debian.org>" # gpg: aka "Mark Brown <broonie@kernel.org>" # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" # gpg: aka "Mark Brown <broonie@linaro.org>" # gpg: aka "Mark Brown <Mark.Brown@linaro.org>"
2015-06-22Merge remote-tracking branches 'asoc/fix/wm8737', 'asoc/fix/wm8903', ↵Mark Brown
'asoc/fix/wm8955' and 'asoc/fix/wm8960' into asoc-linus
2015-06-12ASoC: wm8960: the enum of "DAC Polarity" should be wm8960_enum[1]Zidan Wang
the enum of "DAC Polarity" should be wm8960_enum[1]. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-06-05Merge remote-tracking branches 'asoc/topic/topology', 'asoc/topic/twl6040', ↵Mark Brown
'asoc/topic/wm5100', 'asoc/topic/wm8741' and 'asoc/topic/wm8960' into asoc-next
2015-06-05Merge remote-tracking branch 'asoc/topic/dapm' into asoc-nextMark Brown
2015-06-01ASoC: wm8960: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen
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.bias_level with snd_soc_codec_get_bias_level() and replace all other 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>
2015-05-12ASoC: wm8960: add 32 bit word length supportZidan Wang
According to referance manual, right justify mode can't support 32 bit word length. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-12ASoC: wm8960: Let wm8960 driver configure its bit clock and frame clockZidan Wang
wm8960 codec driver missing configure its bit clock and frame clock for codec master mode, so add support for it. It will calculate a appropriate frequency dividing ratio according to the system clock, bit clock and frame clock, then set the corresponding registers. Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-12ASoC: wm8960: fix "RINPUT3" audio route errorZidan Wang
It should be "RINPUT3" instead of "LINPUT3" route to "Right Input Mixer". Signed-off-by: Zidan Wang <zidan.wang@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-04-27ASoC: Move bias level update to the coreLars-Peter Clausen
All drivers have the same line at the end of the set_bias_level callback to update the bias_level state. Move this update into snd_soc_dapm_force_bias_level() and remove them from the drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-10ASoC: wm8960: Fix wrong value references for boolean kctlTakashi Iwai
The correct values referred by a boolean control are value.integer.value[], not value.enumerated.item[]. The former is long while the latter is int, so it's even incompatible on 64bit architectures. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org>
2015-02-04Merge remote-tracking branches 'asoc/topic/wm8960', 'asoc/topic/wm8988' and ↵Mark Brown
'asoc/topic/xtfpga' into asoc-next
2015-01-14ASoC: wm8960: Let wm8960 codec driver manage its own MCLKZidan Wang
When we want to use wm8960 codec, we should enable its MCLK in machine driver. It's reasonable for wm8960 codec driver to manage its own MCLK. When current bias_level is SND_SOC_BIAS_ON, it is preparing for a transition away from ON. In this case, disable the codec mclk. When current bias_level is not SND_SOC_BIAS_ON, it preparing for a transition to ON. In this case, enable the codec mclk. Signed-off-by: Zidan Wang <b50113@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-06ASoC: wm8960: Fix capture sample rate from 11250 to 11025Zidan Wang
wm8960 codec can't support sample rate 11250, it must be 11025. Signed-off-by: Zidan Wang <b50113@freescale.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2014-11-27ASoC: wm8960: Move register initialisation to I2C driver probe()Zidan Wang
We must ensure that the clocking configuration is valid as rapidly as possible. And do software reset before the others registers updates, or the registers will be reset to the default state. Signed-off-by: Zidan Wang <b50113@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-24ASoC: wm8960: Cleanup manual bias level transitionsLars-Peter Clausen
Set the CODEC driver's suspend_bias_off flag rather than manually going to SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes the code a bit shorter and cleaner. Since the ASoC core now takes care of setting the bias level to SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually anymore either. The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe() can also be removed as the core will automatically do this after the CODEC has been probed. 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>
2014-11-21ASoC: wm8960: Add device tree supportZidan Wang
Document the device tree binding for the WM8960 codec, and modify the driver to extract the platform data from device tree, if present. Signed-off-by: Zidan Wang <b50113@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-08-04Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/width', ↵Mark Brown
'asoc/topic/wm0010', 'asoc/topic/wm8904' and 'asoc/topic/wm8962' into asoc-next
2014-07-31ASoC: wm8960: Convert to params_width()Mark Brown
The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2014-07-22ASoC: Move card field form platform/codec to componentLars-Peter Clausen
Both the snd_soc_codec and snd_soc_platform struct do have a pointer to the parent card and both handle this pointer in mostly the same way. This patch moves the card field to the component level which will allow further code consolidation between platforms and CODECS. Since there are only a handful of users of the snd_soc_codec struct's card field (and none of the snd_soc_platform's) these are update in this patch as well, which allows it to be removed from the snd_soc_codec struct. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen
For CODEC controls snd_kcontrol_chip() currently returns a pointer to the CODEC that registered the control. With the upcoming consolidation of platform and CODEC controls this will change. Prepare for this by introducing the snd_soc_kcontrol_codec() helper function that will hide the implementation details of how the CODEC for a control can be obtained. This will allow us to change this easily in the future. The patch also updates all CODEC drivers to use the new helper function. 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>
2014-03-11ASoC: codec: Simplify ASoC probe code.Xiubo Li
For some CODEC drivers like who act as the MFDs children are ignored by this patch. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-22Merge remote-tracking branch 'asoc/topic/wm8960' into asoc-nextMark Brown
2013-08-18ASoC: wm8960: Fix PLL register writesMike Dyer
Bit 9 of PLL2,3 and 4 is reserved as '0'. The 24bit fractional part should be split across each register in 8bit chunks. Signed-off-by: Mike Dyer <mike.dyer@md-soft.co.uk> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-08-14ASoC: wm8960: Fix ADC volume bitsMa Haijun
Signed-off-by: Ma Haijun <mahaijuns@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-04-12Merge remote-tracking branch 'asoc/topic/wm8960' into asoc-nextMark Brown
2013-03-04ASoC: wm8960: Add input boost volume controlMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-01ASoC: wm8960: Fix ADC power bitsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-01ASoC: wm8960: Correct register 0 and 1 defaultsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>