summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs42l56.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: cs42l56: replace codec to componentKuninori Morimoto2018-02-121-80/+78Star
| | | | | | | | | | | | | | Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs42l56: Improve two size determinations in cs42l56_i2c_probe()Markus Elfring2017-11-271-5/+2Star
| | | | | | | | | | | Replace the specification of two data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs42l56: Delete an error message for a failed memory allocation in ↵Markus Elfring2017-11-271-4/+2Star
| | | | | | | | | | | cs42l56_i2c_probe() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs42l56: Fix misuse of regmap_update_bitsFlorian Vaussard2016-12-051-4/+8
| | | | | | | | | | | | | | | | | | | | Using regmap_update_bits(..., mask, 1) with 'mask' following (1 << k) and k greater than 0 is wrong. Indeed, _regmap_update_bits will perform (mask & 1), which results in 0 if LSB of mask is 0. Thus the call regmap_update_bits(..., mask, 1) is in reality equivalent to regmap_update_bits(..., mask, 0). In such a case, the correct use is regmap_update_bits(..., mask, mask). This driver is performing such a mistake with the CS42L56_AIN*_REF_MASK masks, which equal 0x10, 0x20, 0x40 and 0x80. Fix the driver to make it consistent with the API. Please note that this change is untested, as I do not have this piece of hardware. Testers are welcome! Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch> Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs42l56: Make ID registers volatile and remove cache bypassCharles Keepax2016-10-251-6/+0Star
| | | | | | | | | | | Rather than manually enabling cache bypass when reading the ID registers simply remove the default which will cause the first read to go to the hardware. The old code worked this is simply the more standard way to implement this. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codec duplicated callback function goes to component on cs42l56Kuninori Morimoto2016-08-081-7/+8
| | | | | | | | | | 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>
* ASoC: cs42l56: Use IS_ENABLED() instead of checking for built-in or moduleJavier Martinez Canillas2016-04-261-1/+1
| | | | | | | | The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either built-in or as a module, use that macro instead of open coding the same. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5086', ↵Mark Brown2015-08-301-12/+9Star
|\ \ | | | | | | | | | 'asoc/topic/tegra', 'asoc/topic/tlv' and 'asoc/topic/topology' into asoc-next
| | * ASoC: cs42l56: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGELars-Peter Clausen2015-08-051-12/+9Star
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD() that it automatically calculates the number of items in the TLV and is hence less prone to manual error. Generate using the following coccinelle script // <smpl> @@ declarer name DECLARE_TLV_DB_RANGE; identifier tlv; constant x; @@ -unsigned int tlv[] = { - TLV_DB_RANGE_HEAD(x), +DECLARE_TLV_DB_RANGE(tlv, ... -}; +); // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. | Merge remote-tracking branches 'asoc/topic/cs42l56', 'asoc/topic/cs42l73', ↵Mark Brown2015-08-301-46/+1Star
|\ \| | | | | | | | | | 'asoc/topic/cs4349' and 'asoc/topic/da732x' into asoc-next
| * | ASoC: cs42l56: Use case range at appropriate placeAxel Lin2015-08-141-46/+1Star
| |/ | | | | | | | | | | | | | | | | | | | | The readable registers are in continuous range: 0x01 ~ 0x2e. Use case range syntax makes the code shorter with better readability when we have a large number of continuous switch cases. No functional change with this patch. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. | Merge remote-tracking branches 'asoc/topic/const', 'asoc/topic/cs35l32', ↵Mark Brown2015-08-301-1/+1
|\ \| | | | | | | | | | 'asoc/topic/cs4265' and 'asoc/topic/cs42l52' into asoc-next
| * | ASoC: Constify snd_soc_dai_ops variablesAxel Lin2015-07-151-1/+1
| |/ | | | | | | | | | | | | | | The snd_soc_dai_ops variables are not modified after initialization in these drivers, so make them const. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-07-151-1/+0Star
|/ | | | | | | | 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>
* ASoC: cs42l56: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen2015-06-011-2/+2
| | | | | | | | | | | 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: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: Move bias level update to the coreLars-Peter Clausen2015-04-271-1/+0Star
| | | | | | | | | 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>
* ASoC: cs42l56: Constify struct regmap_config and snd_soc_codec_driverKrzysztof Kozlowski2015-01-051-2/+2
| | | | | | | | | | | The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Make struct snd_soc_codec_driver const as well (snd_soc_register_codec() accepts pointer to const). Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: cs42l56: Cleanup manual bias level transitionsLars-Peter Clausen2014-09-091-19/+1Star
| | | | | | | | | | | | | | | | | | 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: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: cs42l56: Remove unneeded regulator_bulk_free call in cs42l56_removeAxel Lin2014-08-281-3/+0Star
| | | | | | | | | The regulator_bulk_free() call is not required because current code is using devm_regulator_bulk_get(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: cs42l56: use true/false returns for bool functionsBrian Austin2014-08-281-2/+2
| | | | | | | Return true or false instead of 1 and 0 Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
*-. Merge remote-tracking branches 'asoc/topic/cs4265', 'asoc/topic/cs42l56', ↵Mark Brown2014-08-041-19/+45
|\ \ | | | | | | | | | 'asoc/topic/cs42xx8', 'asoc/topic/cx20442' and 'asoc/topic/davinci' into asoc-next
| | * ASoC: cs42l56: Move ADC/PCM Swap to DAPMBrian Austin2014-07-081-19/+45
| |/ | | | | | | | | | | | | The Swap controls for ADC/PCM paths should be in the DAPM domain. Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: Fix SOC_DOUBLE_R_SX_TLV volume mixer argumentsBrian Austin2014-07-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | Remove unnecessary bit shifts. Correct min value to match datasheet. Num steps = number of steps between min and max. Reported-by: Ryan Harvey <ryan.harvey@cirrus.com> Signed-off-by: Ryan Harvey <ryan.harvey@cirrus.com> Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: cs42l56: Fix stereo channel register assignment for Headphone and ↵Brian Austin2014-07-171-2/+2
|/ | | | | | | | | | | LineOut volume mixers Stereo Headphone and LineOut volume mixers are now attached to HPA+HPB, LOA+LOB. Reported-by: Ryan Harvey <ryan.harvey@cirrus.com> Signed-off-by: Ryan Harvey <ryan.harvey@cirrus.com> Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: cs42l56: Fix new value argument in snd_soc_update_bits callsAxel Lin2014-06-011-39/+31Star
| | | | | | | | | The new value argument needs proper shift to match the mask bit fields. Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Brian Austin <brian.austin@cirrus.com> Acked-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: Add support for CS42L56 CODECBrian Austin2014-05-061-0/+1427
This patch adds support for the Cirrus Logic Low Power Stereo I2C CODEC Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@linaro.org>