summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/simple-amplifier.c
AgeCommit message (Collapse)Author
2026-07-03Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c ↵Uwe Kleine-König (The Capable Hub)
files) Replace the #include of <linux/mod_devicetable.h> by the more specific <linux/device-id/*.h> where applicable. For most cases the include can be dropped completely, only a few drivers need one or two headers added. Acked-by: Danilo Krummrich <dakr@kernel.org> Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/1a3f2007c5c5dcf555c09a4035ce3ae8ef1b6c49.1782808461.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
2026-05-18ASoC: simple-amplifier: Update author and copyrightHerve Codina
After reworking the simple-amplifier driver and adding support for gpio-audio-amp in the driver, add myself as the author of the gpio-audio-amp part of the driver and add a related copyright. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-17-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: gpio-audio-amp: Add support for gain-labelsHerve Codina
The possible gain values can be described using labels instead of gain values in dB. Those different labels are attached to a gpio values using the gain-labels property. Using the gain-labels description is mutually exclusive with gain-ranges description used to describe the relationship between gpios values and gain values. Handle the gain-labels description and the related kcontrol. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-16-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: gpio-audio-amp: Add support for gain-rangesHerve Codina
The mapping between physical gain values and gpio values can be expressed using ranges described in the gain-ranges property. This gain-ranges property is an array of ranges. Each range in the array is defined by the first point and last point in the range. Those points are a pair of values, the gpios value and the related gain (dB) value. With that, a given range defines N possible items (from the first point gpios value to the last point gpios value) in order to set a gain from the first point gain value to the last point gain value. Handle this description and the related kcontrol. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-15-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: gpio-audio-amp: Add support for basic gainHerve Codina
Several gpios can be used to control the amplifier gain. Add basic support for those gpios. This basic support doesn't include any mapping between the GPIOs value and the physical gain value (dB). The support for this kind of mapping will be added later on. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-14-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: gpio-audio-amp: Add support for bypass gpioHerve Codina
A gpio can be used to control the amplifier bypass feature. Add support for this bypass gpio in the same way as it has been done for the mute gpio. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-13-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: gpio-audio-amp: Add support for mute gpioHerve Codina
A gpio can be used to control the amplifier mute feature. Add support for this mute gpio. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-12-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: gpio-audio-amp: Add support for extra power suppliesHerve Codina
The gpio-audio-amp devices can use additional power supplies: - vddio, - vdda1, - vdda2 Add support for those additional power supplies. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-11-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: Introduce support for gpio-audio-ampHerve Codina
Improve the simple-amplifier introducing preliminary support for gpio-audio-amp. Those amplifiers are amplifiers driven by gpios. This support introduction doesn't handle any GPIO yet but introduces the compatible strings and the related DAPM table. Two gpio-audio-amp are available: A mono and a stereo version. The mono version has only one audio channel and gpio settings impact features such as the gain or mute of this sole channel. The stereo version has two channels (left and right). Gpio settings impact both channels in the same manner and at the same time. For instance, the gain setting set the gain of both channels as well as the mute setting mutes both channels. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-10-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: Remove DAPM widgets and routes from the ASoC ↵Herve Codina
component driver The simple-amplifier set the DAPM wigets and routes table in the ASoC component driver. This is perfectly fine when the component has well known DAPM tables. The simple-amplifier is going to handle several kind of components based on the driver compatible string. The DAPM table will not be the same for all components supported by the driver. In order to have different DAPM table based on matching compatible strings, move those tables from the ASoC component driver to the device compatible string matching data. Add those DAPM widgets and routes dynamically during the ASoC component probe operation. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-9-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: Use 'simple_amp' variable name instead of 'priv'Herve Codina
The simple-amplifier driver use 'priv' as variable name for its private data (struct simple_amp). With the support for gpio-audio-amp, more functions and data structures will be added. Those future additions will add more complexity in data manipulation and will make the 'priv' term error prone. In order to clearly identify the struct simple_amp private data, use 'simple_amp' as variable name when this structure is involved. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-8-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: Rename drv_event() functionHerve Codina
The drv_event() is used to handle power events related to the DRV item. Later, with the support for gpio-audio-amp, this function will be also used to handle power events related to the PGA item. Also, more functions will be added in the driver and it is a common usage to prefix functions based on the driver name. Rename the drv_event() function to simple_amp_power_event() to follow common usage and get rid of the 'drv' term. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-7-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: Remove CONFIG_OF flag and of_match_ptr()Herve Codina
The simple-amplifier Use CONFIG_OF flag for its of_device_id table and of_match_ptr() when it assigns the table in the driver declaration. This is no more needed. Drop them. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-6-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: Add missing headersHerve Codina
The simple-amplifier driver is a platform device driver. Add missing include files related to this kind of driver. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-5-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2026-05-18ASoC: simple-amplifier: Remove DRV_NAME defined valueHerve Codina
DRV_NAME is defined and used only in the simple-amplifier driver declaration. Remove the useless defined and use directly the value in the driver declaration itself. Signed-off-by: Herve Codina <herve.codina@bootlin.com> Link: https://patch.msgid.link/20260513081702.317117-4-herve.codina@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-12-20ASoC: codecs: simple-amplifier: Use dev_err_probe() helperKuninori Morimoto
Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/20211214020843.2225831-8-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 463Thomas Gleixner
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of version 2 of the gnu general public license as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses the full gnu general public license is included in this distribution in the file called copying extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Enrico Weigelt <info@metux.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081202.258730266@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18ASoC: simple-amplifier: Make gpio property optionalMylène Josserand
Some amplifier may not have a GPIO to control the power, but instead simply rely on the regulator to power up and down the amplifier. In order to support those setups, let's make the GPIO optional. Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-11-23ASoC: simple-amplifier: add VCC regulator widgetVasily Khoruzhick
Amplifier may have assosicated regulator, so add a widget for it and appropriate route. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27ASoC: simple-amplifer: add simple-amplifier compatibleJerome Brunet
Add simple-audio-amplifier to the list of available compatible Suggested-by: Nicolò Veronese <nicveronese@gmail.com> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-06-27ASoC: simple-amplifier: rename dio2125 to simple-ampliferJerome Brunet
The dio2125 is simple enough that we can make it a generic component. Just rename and sed the dio2125 amplifier driver to simple_amplifier. Suggested-by: Nicolò Veronese <nicveronese@gmail.com> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>