summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs53l30.c
AgeCommit message (Collapse)AuthorFilesLines
2021-01-21ASoC: cs*: sync parameter naming (rate/sample_bits)Kuninori Morimoto1-1/+1
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/871remolg1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-5/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-12ASoC: cs53l30: replace codec to componentKuninori Morimoto1-30/+27
Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 1 -> .idle_bias_on = 0 .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>
2017-09-01Merge remote-tracking branches 'asoc/topic/cs43130', 'asoc/topic/cs53l30', ↵Mark Brown1-10/+5
'asoc/topic/cygnus' and 'asoc/topic/davinci' into asoc-next
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal1-1/+1
Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: cs53l30: Remove unneeded gpiod NULL checkFabio Estevam1-10/+5
The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-06-13ASoC: cs53l30: Constify hw_constraintsTakashi Iwai1-1/+1
snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-05ASoC: cs53l30: Set .of_match_table to OF device ID tableJavier Martinez Canillas1-0/+1
The driver has an OF device ID table but the struct i2c_driver .of_match_table field is not set. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-29Merge remote-tracking branches 'asoc/topic/cs35l30', 'asoc/topic/cs42l73', ↵Mark Brown1-4/+4
'asoc/topic/cs53l30' and 'asoc/topic/da7213' into asoc-next
2016-08-08ASoC: codec duplicated callback function goes to component on cs53l30Kuninori Morimoto1-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>
2016-08-08ASoC: cs53l30: Do not ignore errors if mclk is specifiedNicolin Chen1-2/+2
When the clock is specified, there could be other errors besides the EPROBE_DEFER so don't ignore them. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: cs53l30: Constify cs53l30_mclk_coeffs and cs53l30_mclkx_coeffs tablesAxel Lin1-2/+2
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: cs53l30: Constify cs53l30_mclk_coeffs and cs53l30_mclkx_coeffs tablesAxel Lin1-2/+2
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-21ASoC: cs53l30: Fix bit shift issue of TDM modeNicolin Chen1-2/+6
The TDM mode using PCM format now has two-bit right shift due to the format configuration in the driver. According to Figure 4-13 in the CS53L30 datasheet, using ASP_SCLK_INV = 0 and SHIFT_LEFT = 1 should be the correct combination to create one-bit right shift for the DSP type A format. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-21ASoC: cs53l30: Fix a bug for TDM slot location validationNicolin Chen1-2/+2
The maximum slot number of CS53L30 is 4 while it should support the situation that's less than 4 channels based on the rx_mask. So when the driver validates the last slot location, it should check the last active slot instead of always the 4th one. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-23ASoC: cs53l30: Add MUTE pin control support via GPIONicolin Chen1-0/+30
The codec chip has a physical MUTE pin to let users control it via GPIO. So this patch add a mute control support to the driver. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-18ASoC: cs53l30: Set idle_bias_off trueNicolin Chen1-0/+1
The driver is using the set_bias_level to control the power on and off so it should get SND_SOC_BIAS_OFF in order to proceed normal powering sequences. This patch enables the idle_bias_off option so the DAPM core will set the bias level to SND_SOC_BIAS_OFF instead of stopping at SND_SOC_BIAS_STANDBY. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-18ASoC: cs53l30: Fix non static symbol warningsWei Yongjun1-3/+3
Fixes the following sparse warnings: sound/soc/codecs/cs53l30.c:182:20: warning: symbol 'input1_sel_values' was not declared. Should it be static? sound/soc/codecs/cs53l30.c:202:20: warning: symbol 'input2_sel_values' was not declared. Should it be static? sound/soc/codecs/cs53l30.c:734:20: warning: symbol 'cs53l30_src_rates' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13ASoC: cs53l30: Correct clock inversion checkNicolin Chen1-1/+7
SND_SOC_DAIFMT_IB_NF = 0x3 (11b) | SND_SOC_DAIFMT_IB_IF = 0x4 (100b) creates a mask 0x7 (111b) which also includes SND_SOC_DAIFMT_NB_IF = 0x2 (10b). So this patch uses the traditional way to check the clock inversion. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-13ASoC: cs53l30: include gpio/consumer.hArnd Bergmann1-0/+1
When GPIOLIB is disabled, we don't see the declarations from gpio/consumer.h, so we have to include the header explicitly to avoid this build error: sound/soc/codecs/cs53l30.c: In function 'cs53l30_i2c_probe': sound/soc/codecs/cs53l30.c:931:24: error: implicit declaration of function 'devm_gpiod_get_optional' [-Werror=implicit-function-declaration] cs53l30->reset_gpio = devm_gpiod_get_optional(dev, reset, ^~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs53l30.c:932:13: error: 'GPIOD_OUT_LOW' undeclared (first use in this function) GPIOD_OUT_LOW); ^~~~~~~~~~~~~ sound/soc/codecs/cs53l30.c:932:13: note: each undeclared identifier is reported only once for each function it appears in sound/soc/codecs/cs53l30.c:939:3: error: implicit declaration of function 'gpiod_set_value_cansleep' [-Werror=implicit-function-declaration] gpiod_set_value_cansleep(cs53l30->reset_gpio, 1); Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02ASoC: cs53l30: Check return value of regcache_sync()Nicolin Chen1-1/+5
Regcache_sync() might fail. So this patch adds a return value Check for it. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-02ASoC: cs53l30: Rename the volume controls for preamplifierNicolin Chen1-2/+2
Volume controls should end with 'Volume', so this patch renames them for ADC preamplifier. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-30ASoC: cs53l30: Add codec driver support for Cirrus CS53L30Nicolin Chen1-0/+1097
CS53L30 is a Quad-Channel ADC from Cirrus Logic with an I2S/TDM DAI. So this patch adds a codec driver for CS53L30 that includes 4-channel 24-bit recording and TDM mode supports. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>