summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs4349.c
AgeCommit message (Collapse)Author
2021-01-21ASoC: cs*: sync parameter naming (rate/sample_bits)Kuninori Morimoto
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>
2020-07-16ASoC: codecs: cs*: merge .digital_mute() into .mute_stream()Kuninori Morimoto
snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/87r1tlwiwe.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-15ASoC: cs4349: Use PM ops 'cs4349_runtime_pm'YueHaibing
sound/soc/codecs/cs4349.c:358:32: warning: cs4349_runtime_pm defined but not used [-Wunused-const-variable=] cs4349_runtime_pm ops already defined, it seems we should enable it. Reported-by: Hulk Robot <hulkci@huawei.com> Fixes: e40da86 ("ASoC: cs4349: Add support for Cirrus Logic CS4349") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20190815090157.70036-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner
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: cs4349: replace codec to componentKuninori Morimoto
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>
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal
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>
2016-08-08ASoC: codec duplicated callback function goes to component on cs4349Kuninori Morimoto
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>
2015-08-25ASoC: cs4349: fix platform_no_drv_owner.cocci warningskbuild test robot
sound/soc/codecs/cs4349.c:389:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci CC: Tim Howe <tim.howe@cirrus.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-22ASoC: cs4349: Fix up setting PWR_DWN bitAxel Lin
The PWR_DWN is Bit 7, so current code does not set the PWR_DWN bit. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-22ASoC: cs4349: Remove unneeded NULL test for cs4349->reset_gpioAxel Lin
It's safe to call gpiod_set_value_cansleep() with NULL desc. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: cs4349: include gpio/consumer.hakpm@linux-foundation.org
s390 allmodconfig: sound/soc/codecs/cs4349.c: In function 'cs4349_i2c_probe': sound/soc/codecs/cs4349.c:300: error: implicit declaration of function 'devm_gpiod_get_optional' sound/soc/codecs/cs4349.c:301: error: 'GPIOD_OUT_LOW' undeclared (first use in this function) sound/soc/codecs/cs4349.c:301: error: (Each undeclared identifier is reported only once sound/soc/codecs/cs4349.c:301: error: for each function it appears in.) sound/soc/codecs/cs4349.c:306: error: implicit declaration of function 'gpiod_set_value_cansleep' Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: cs4349: Drop platform data supportAxel Lin
The struct cs4349_platform_data should be defined in a public header in include/sound/ rather than in sound/soc/codecs folder. In additional, the platform data support is not properly handled in this driver so remove it now. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: cs4349: Set .writeable_reg for cs4349_regmapAxel Lin
The first valid register index is 1 rather than 0, and the CS4349_CHIPID is readonly. So set .writeable_reg to avoid writing to these registers. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: cs4349: Fix setting digital interface formatAxel Lin
Mode Control - Register 02h Digital Interface Format (DIF[2:0]) Bits 6-4 DIF2 DIF1 DIF0 Description 0 0 0 Left-Justified, up to 24-bit data 0 0 1 I²S, up to 24-bit data 0 1 0 Right-Justified, 16-bit data 0 1 1 Right-Justified, 24-bit data 1 0 0 TDM slot 0 1 0 1 TDM slot 1 1 1 0 TDM slot 2 1 1 1 TDM slot 3 The DIF_MASK is 0x70, so current code does not correctly set the DIFx setting. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: cs4349: Don't use rtd->codecLars-Peter Clausen
rtd->codec does not necessarily point to the CODEC instance for which the callback was called (e.g. for CODEC<->CODEC or multi-CODEC links). Use dai->codec instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: cs4349: Fix suspend/resumeLars-Peter Clausen
dev_get_drvdata() will not return the snd_soc_runtime to which this CODEC is attached, so the current code will result in undefined behavior. To fix this just use regmap_update_bits(cs4349->regmap, ...) directly instead of snd_soc_update_bits(rtd->codec, ...). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-18ASoC: cs4349: Constify cs4349_regmapAxel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Tim Howe <tim.howe@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-18ASoC: cs4349: Fix max_register setting for cs4349_regmapAxel Lin
The max_register should be the maximum valid register index rather than number of registers. Also remove unused defines. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Tim Howe <tim.howe@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: cs4349: Add support for Cirrus Logic CS4349Tim Howe
Signed-off-by: Tim Howe <tim.howe@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>