summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs35l45.c
AgeCommit message (Collapse)AuthorFilesLines
2023-09-11ASoC: cs35l45: Add AMP Enable Switch controlVlad Karpovich1-1/+6
The "AMP Enable Switch" is useful in systems with multiple amplifiers connected to the same audio bus but not all of them are needed for all use cases. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230831162042.471801-4-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11ASoC: cs35l45: Connect DSP to the monitoring signalsVlad Karpovich1-6/+27
Link VMON, IMON, TEMPMON, VDD_BSTMON and VDD_BATTMON to DSP1. The CSPL firmware uses them for the speaker calibration and monitoring. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230831162042.471801-3-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11ASoC: cs35l45: Analog PCM Volume and Amplifier Mode controlsVlad Karpovich1-0/+148
Adds "Analog PCM Volume" control with supported values 0 = 10dB,1 = 13dB,2 = 16dB and 3 = 19dB. The amplifier can operate either in Speaker Mode or Receiver Mode as configured by the user. Speaker Mode has four gain options to support maximum amplifier output amplitude for loud speaker application. Receiver Mode has further optimized noise performance while maintaining sufficient output to support phone receiver application. While configured in Receiver Mode, the analog PCM Volume control is disabled and the analog gain is fixed to 1dB. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230831162042.471801-2-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-09-11ASoC: cs35l45: Checks index of cs35l45_irqs[]Ricardo Rivera-Matos1-1/+4
Checks the index computed by the virq offset before printing the error condition in cs35l45_spk_safe_err() handler. Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com> Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230831162042.471801-1-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-29ASoC: cs35l45: Rename DACPCM1 Source controlVlad Karpovich1-4/+4
Rename control to "DACPCM Source" for backward compatibility with previous implementation. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com Link: https://lore.kernel.org/r/20230828170525.335671-5-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-29ASoC: cs35l45: Fix "Dead assigment" warningVlad Karpovich1-1/+1
Value stored to 'ret' is never read. Remove it. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com Link: https://lore.kernel.org/r/20230828170525.335671-2-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org
2023-08-29ASoC: cs35l45: Add support for Chip ID 0x35A460Vlad Karpovich1-0/+1
The 0x35A460 chip is a different variant of the cs35l45. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com Link: https://lore.kernel.org/r/20230828170525.335671-1-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org
2023-05-25ASoC: cs35l45: Relicense to GPL onlyCharles Keepax1-2/+2
Cirrus never intended to upstream dual licensed code, convert to GPL only. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Reviewed-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230510092534.3919120-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-21ASoC: cs35l45: Hibernation supportVlad.Karpovich1-0/+80
Adds support for a low-power Hibernation State. Add support for a low-power hibernation state for the DSP. In this state the DSP RAM contents are maintained, such that firmware does not need to be re-downloaded, but the rest of the chip's register state is lost. Entry to this state is achieved via the register interface (either by an external driver using the control port, or the programmable DSP). Exit from this state is triggered by activity on device GPIO pins, intended SPI transaction, or I2C transaction with intended slave address. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/167933511185.26.10641185496218226278@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-21ASoC: cs35l45: DSP SupportVlad.Karpovich1-12/+379
The CS35L45 digital core incorporates one programmable DSP block, capable of running a wide range of audio enhancement and speaker and battery protection functions. Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/167933510679.26.5992985447093367768@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-21ASoC: cs35l45: IRQ supportVlad.Karpovich1-2/+109
Adds IRQ handlers Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/167933510218.26.11092784685990338045@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-21ASoC: cs35l45: Support for GPIO pins configuration.Vlad.Karpovich1-0/+56
Adds device tree configuration for cs35l45 GPIOs Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230315154722.3911463-1-vkarpovi@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-02-15ASoC: cs35l45: Remove separate namespace for tablesCharles Keepax1-1/+0
Now tables isn't a separate module, definitely no need to have a separate namespace for it. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230215105818.3315925-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-14ASoC: cs35l45: Add endianness flag in snd_soc_component_driverCharles Keepax1-0/+2
The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. Fixes: 0d463d016000 ("ASoC: cs35l45: Add driver for Cirrus Logic CS35L45 Smart Amp") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220614131022.778057-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-06-06ASoC: cs35l45: Make cs35l45_remove() return voidUwe Kleine-König1-3/+1
cs35l45_remove() always returns zero. Make it return no value which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c driver remove callbacks is ignored anyway. This prepares making i2c remove callbacks return void, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220520173349.774366-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-04ASoC: cs35l45: Enable BOOSTRichard Fitzgerald1-4/+0
Do not disable the boost converter during probe. The silicon contains functional default tunings so the boost converter can be left at the chip default enabled state. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220504134458.283780-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-11ASoC: cs35l45: Make exports namespacedRichard Fitzgerald1-3/+4
Use the new EXPORT_SYMBOL_NS_GPL() for exports from the set of drivers for cs35l45. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220411165929.1302333-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-05ASoC: cs35l45: Add driver for Cirrus Logic CS35L45 Smart AmpJames Schulman1-0/+693
The CS35L45 is a 15 V Boosted Mono Class D Amplifier with DSP Speaker Protection and Adaptive Battery Management. This initial driver provides standard non-boosted audio operation without the DSP. Signed-off-by: James Schulman <james.schulman@cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220405135419.1230088-6-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>