summaryrefslogtreecommitdiff
path: root/arch/arm/mach-ep93xx/edb93xx.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2023-12-01 14:20:35 +0100
committerMark Brown <broonie@kernel.org>2023-12-01 16:59:21 +0000
commit42d1178d223ba9498c1ed40a5fc243a43d35ec97 (patch)
tree28d8504fdbb1314b65368b223f94ff91cc14519b /arch/arm/mach-ep93xx/edb93xx.c
parent194ef700d4e255686173a03b65e15cac637cc15a (diff)
ASoC: cs4271: Convert to GPIO descriptors
This converts the Cirrus CS4271 ASoC codec driver to use GPIO descriptors. It turns out that there are two in-kernel users of the platform data passing mechanism so these are switched over as well. One locally defined GPIO "gpio_disabled" is declared in the state struct but completely unused in the driver, so we delete it. Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20231201-descriptors-sound-cirrus-v2-6-ee9f9d4655eb@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'arch/arm/mach-ep93xx/edb93xx.c')
-rw-r--r--arch/arm/mach-ep93xx/edb93xx.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 4b90899a66e9..dbdb822a0100 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -88,7 +88,7 @@ static void __init edb93xx_register_i2c(void)
* EDB93xx SPI peripheral handling
*************************************************************************/
static struct cs4271_platform_data edb93xx_cs4271_data = {
- .gpio_nreset = -EINVAL, /* filled in later */
+ /* Intentionally left blank */
};
static struct spi_board_info edb93xx_spi_board_info[] __initdata = {
@@ -114,14 +114,38 @@ static struct ep93xx_spi_info edb93xx_spi_info __initdata = {
/* Intentionally left blank */
};
+static struct gpiod_lookup_table edb93xx_cs4272_edb9301_gpio_table = {
+ .dev_id = "spi0.0", /* CS0 on SPI0 */
+ .table = {
+ GPIO_LOOKUP("A", 1, "reset", GPIO_ACTIVE_LOW),
+ { },
+ },
+};
+
+static struct gpiod_lookup_table edb93xx_cs4272_edb9302_gpio_table = {
+ .dev_id = "spi0.0", /* CS0 on SPI0 */
+ .table = {
+ GPIO_LOOKUP("H", 2, "reset", GPIO_ACTIVE_LOW),
+ { },
+ },
+};
+
+static struct gpiod_lookup_table edb93xx_cs4272_edb9315_gpio_table = {
+ .dev_id = "spi0.0", /* CS0 on SPI0 */
+ .table = {
+ GPIO_LOOKUP("B", 6, "reset", GPIO_ACTIVE_LOW),
+ { },
+ },
+};
+
static void __init edb93xx_register_spi(void)
{
if (machine_is_edb9301() || machine_is_edb9302())
- edb93xx_cs4271_data.gpio_nreset = EP93XX_GPIO_LINE_EGPIO1;
+ gpiod_add_lookup_table(&edb93xx_cs4272_edb9301_gpio_table);
else if (machine_is_edb9302a() || machine_is_edb9307a())
- edb93xx_cs4271_data.gpio_nreset = EP93XX_GPIO_LINE_H(2);
+ gpiod_add_lookup_table(&edb93xx_cs4272_edb9302_gpio_table);
else if (machine_is_edb9315a())
- edb93xx_cs4271_data.gpio_nreset = EP93XX_GPIO_LINE_EGPIO14;
+ gpiod_add_lookup_table(&edb93xx_cs4272_edb9315_gpio_table);
gpiod_add_lookup_table(&edb93xx_spi_cs_gpio_table);
ep93xx_register_spi(&edb93xx_spi_info, edb93xx_spi_board_info,