* [PATCH 1/4] ARM: s3c: crag6410-module: convert GPIO lookup tables to property entries
2026-10-27 21:29 [PATCH 0/4] ARM: s3c: crag6410-module: software node conversion and cleanups Dmitry Torokhov
@ 2026-10-27 21:29 ` Dmitry Torokhov
2026-10-27 21:29 ` [PATCH 2/4] ARM: s3c: crag6410: drop unused CODEC_GPIO_BASE Dmitry Torokhov
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Dmitry Torokhov @ 2026-10-27 21:29 UTC (permalink / raw)
To: Krzysztof Kozlowski, Peter Griffin, Alim Akhtar, Russell King,
Linus Walleij, Bartosz Golaszewski, Charles Keepax, Mark Brown,
Lee Jones, Arnd Bergmann
Cc: Krzysztof Kozlowski, patches, linux-arm-kernel,
linux-samsung-soc, linux-kernel
Static property entries support defining GPIOs and are more similar to
device tree properties, without being prone to losing the association
between device and lookup table due to device name changes. Convert the
extension module definitions to use software nodes and property entries
instead of GPIO lookup tables.
This also fixes lookup failures introduced during the transition to GPIO
descriptors, where the GPIO controller label was incorrectly specified
as "GPION" instead of matching the chip name, corrects the LDO enable
GPIO lookup name for WM5102 to match what the driver requests, and
drops the custom device name for WM8958 that was only needed for the
old lookup table and broke matching against regulator consumer supplies.
Fixes: cb15d8e6cbe8 ("ASoC: codec: arizona: Convert to use GPIO descriptors")
Fixes: 729f02ec02ae ("ASoC: wm8996: Convert to GPIO descriptors")
Fixes: 8563cfe39ba5 ("ASoC: wm5100: Convert to GPIO descriptors")
Fixes: 0119b2a24eb5 ("ASoC: wm2200: Convert to GPIO descriptors")
Fixes: b53d47775651 ("ASoC: wm0010: Convert to GPIO descriptors")
Fixes: 7676e667c841 ("ARM: s3c64xx: Tidy up handling of regulator GPIO lookups")
Fixes: 1d2f46814d20 ("regulator: wm8994: Pass descriptor instead of GPIO number")
Fixes: e1739e86f0cb ("regulator: arizona-ldo1: Look up a descriptor and pass to the core")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
arch/arm/mach-s3c/mach-crag6410-module.c | 196 ++++++++++++++++---------------
1 file changed, 102 insertions(+), 94 deletions(-)
diff --git a/arch/arm/mach-s3c/mach-crag6410-module.c b/arch/arm/mach-s3c/mach-crag6410-module.c
index 14b0f9cc103e..471a1ea967e6 100644
--- a/arch/arm/mach-s3c/mach-crag6410-module.c
+++ b/arch/arm/mach-s3c/mach-crag6410-module.c
@@ -10,6 +10,8 @@
#include <linux/i2c.h>
#include <linux/spi/spi.h>
#include <linux/gpio/machine.h>
+#include <linux/gpio/property.h>
+#include <linux/property.h>
#include <linux/mfd/wm831x/irq.h>
#include <linux/mfd/wm831x/gpio.h>
@@ -32,14 +34,15 @@
#include "crag6410.h"
-static struct gpiod_lookup_table wm0010_gpiod_table = {
- .dev_id = "spi0.0", /* SPI device name */
- .table = {
- /* Active high for Glenfarclas Rev 2 */
- GPIO_LOOKUP("GPION", 6,
- "reset", GPIO_ACTIVE_HIGH),
- { },
- },
+static const struct property_entry wm0010_properties[] = {
+ /* Active high for Glenfarclas Rev 2 */
+ PROPERTY_ENTRY_GPIO("reset-gpios",
+ SAMSUNG_GPIO_NODE('N'), 6, GPIO_ACTIVE_HIGH),
+ { }
+};
+
+static const struct software_node wm0010_swnode = {
+ .properties = wm0010_properties,
};
static struct wm0010_pdata wm0010_pdata = {
@@ -54,7 +57,8 @@ static struct spi_board_info wm1253_devs[] = {
.chip_select = 0,
.mode = SPI_MODE_0,
.irq = S3C_EINT(4),
- .platform_data = &wm0010_pdata,
+ .platform_data = &wm0010_pdata,
+ .swnode = &wm0010_swnode,
},
};
@@ -66,19 +70,23 @@ static struct spi_board_info balblair_devs[] = {
.chip_select = 0,
.mode = SPI_MODE_0,
.irq = S3C_EINT(4),
- .platform_data = &wm0010_pdata,
+ .platform_data = &wm0010_pdata,
+ .swnode = &wm0010_swnode,
},
};
-static struct gpiod_lookup_table wm5100_gpiod_table = {
- .dev_id = "1-001a", /* Device 001a on I2C bus 1 */
- .table = {
- GPIO_LOOKUP("GPION", 7,
- "wlf,ldo1ena", GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("wm5100", 3,
- "hp-pol", GPIO_ACTIVE_HIGH),
- { },
- },
+static const struct software_node wm5100_swnode;
+
+static const struct property_entry wm5100_properties[] = {
+ PROPERTY_ENTRY_GPIO("wlf,ldo1ena-gpios",
+ SAMSUNG_GPIO_NODE('N'), 7, GPIO_ACTIVE_HIGH),
+ PROPERTY_ENTRY_GPIO("hp-pol-gpios",
+ &wm5100_swnode, 3, GPIO_ACTIVE_HIGH),
+ { }
+};
+
+static const struct software_node wm5100_swnode = {
+ .properties = wm5100_properties,
};
static struct wm5100_pdata wm5100_pdata = {
@@ -127,13 +135,14 @@ static struct wm8996_retune_mobile_config wm8996_retune[] = {
},
};
-static struct gpiod_lookup_table wm8996_gpiod_table = {
- .dev_id = "1-001a", /* Device 001a on I2C bus 1 */
- .table = {
- GPIO_LOOKUP("GPION", 7,
- "wlf,ldo1ena", GPIO_ACTIVE_HIGH),
- { },
- },
+static const struct property_entry wm8996_properties[] = {
+ PROPERTY_ENTRY_GPIO("wlf,ldo1ena-gpios",
+ SAMSUNG_GPIO_NODE('N'), 7, GPIO_ACTIVE_HIGH),
+ { }
+};
+
+static const struct software_node wm8996_swnode = {
+ .properties = wm8996_properties,
};
static struct wm8996_pdata wm8996_pdata __initdata = {
@@ -176,6 +185,7 @@ static const struct i2c_board_info wm1254_devs[] = {
{ I2C_BOARD_INFO("wm8996", 0x1a),
.platform_data = &wm8996_pdata,
.irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
+ .swnode = &wm8996_swnode,
},
{ I2C_BOARD_INFO("wm9081", 0x6c),
.platform_data = &wm9081_pdata, },
@@ -185,6 +195,7 @@ static const struct i2c_board_info wm1255_devs[] = {
{ I2C_BOARD_INFO("wm5100", 0x1a),
.platform_data = &wm5100_pdata,
.irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
+ .swnode = &wm5100_swnode,
},
{ I2C_BOARD_INFO("wm9081", 0x6c),
.platform_data = &wm9081_pdata, },
@@ -217,22 +228,23 @@ static struct wm8994_pdata wm8994_pdata = {
},
};
+static const struct property_entry wm8994_properties[] = {
+ PROPERTY_ENTRY_GPIO("wlf,ldo1ena-gpios",
+ SAMSUNG_GPIO_NODE('N'), 6, GPIO_ACTIVE_HIGH),
+ PROPERTY_ENTRY_GPIO("wlf,ldo2ena-gpios",
+ SAMSUNG_GPIO_NODE('N'), 4, GPIO_ACTIVE_HIGH),
+ { }
+};
+
+static const struct software_node wm8994_swnode = {
+ .properties = wm8994_properties,
+};
+
static const struct i2c_board_info wm1277_devs[] = {
{ I2C_BOARD_INFO("wm8958", 0x1a), /* WM8958 is the superset */
.platform_data = &wm8994_pdata,
.irq = GLENFARCLAS_PMIC_IRQ_BASE + WM831X_IRQ_GPIO_2,
- .dev_name = "wm8958",
- },
-};
-
-static struct gpiod_lookup_table wm8994_gpiod_table = {
- .dev_id = "i2c-wm8958", /* I2C device name */
- .table = {
- GPIO_LOOKUP("GPION", 6,
- "wlf,ldo1ena", GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("GPION", 4,
- "wlf,ldo2ena", GPIO_ACTIVE_HIGH),
- { },
+ .swnode = &wm8994_swnode,
},
};
@@ -246,6 +258,20 @@ static struct arizona_pdata wm5102_reva_pdata = {
},
};
+static const struct software_node wm5102_reva_swnode;
+
+static const struct property_entry wm5102_reva_properties[] = {
+ PROPERTY_ENTRY_GPIO("wlf,ldoena-gpios",
+ SAMSUNG_GPIO_NODE('N'), 7, GPIO_ACTIVE_HIGH),
+ PROPERTY_ENTRY_GPIO("wlf,micd-pol-gpios",
+ &wm5102_reva_swnode, 4, GPIO_ACTIVE_HIGH),
+ { }
+};
+
+static const struct software_node wm5102_reva_swnode = {
+ .properties = wm5102_reva_properties,
+};
+
static struct spi_board_info wm5102_reva_spi_devs[] = {
[0] = {
.modalias = "wm5102",
@@ -255,18 +281,8 @@ static struct spi_board_info wm5102_reva_spi_devs[] = {
.mode = SPI_MODE_0,
.irq = GLENFARCLAS_PMIC_IRQ_BASE +
WM831X_IRQ_GPIO_2,
- .platform_data = &wm5102_reva_pdata,
- },
-};
-
-static struct gpiod_lookup_table wm5102_reva_gpiod_table = {
- .dev_id = "spi0.1", /* SPI device name */
- .table = {
- GPIO_LOOKUP("GPION", 7,
- "wlf,ldoena", GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("arizona", 4,
- "wlf,micd-pol", GPIO_ACTIVE_HIGH),
- { },
+ .platform_data = &wm5102_reva_pdata,
+ .swnode = &wm5102_reva_swnode,
},
};
@@ -279,6 +295,20 @@ static struct arizona_pdata wm5102_pdata = {
},
};
+static const struct software_node wm5102_swnode;
+
+static const struct property_entry wm5102_properties[] = {
+ PROPERTY_ENTRY_GPIO("wlf,ldoena-gpios",
+ SAMSUNG_GPIO_NODE('N'), 7, GPIO_ACTIVE_HIGH),
+ PROPERTY_ENTRY_GPIO("wlf,micd-pol-gpios",
+ &wm5102_swnode, 2, GPIO_ACTIVE_HIGH),
+ { }
+};
+
+static const struct software_node wm5102_swnode = {
+ .properties = wm5102_properties,
+};
+
static struct spi_board_info wm5102_spi_devs[] = {
[0] = {
.modalias = "wm5102",
@@ -288,18 +318,8 @@ static struct spi_board_info wm5102_spi_devs[] = {
.mode = SPI_MODE_0,
.irq = GLENFARCLAS_PMIC_IRQ_BASE +
WM831X_IRQ_GPIO_2,
- .platform_data = &wm5102_pdata,
- },
-};
-
-static struct gpiod_lookup_table wm5102_gpiod_table = {
- .dev_id = "spi0.1", /* SPI device name */
- .table = {
- GPIO_LOOKUP("GPION", 7,
- "wlf,ldo1ena", GPIO_ACTIVE_HIGH),
- GPIO_LOOKUP("arizona", 2,
- "wlf,micd-pol", GPIO_ACTIVE_HIGH),
- { },
+ .platform_data = &wm5102_pdata,
+ .swnode = &wm5102_swnode,
},
};
@@ -312,7 +332,8 @@ static struct spi_board_info wm5110_spi_devs[] = {
.mode = SPI_MODE_0,
.irq = GLENFARCLAS_PMIC_IRQ_BASE +
WM831X_IRQ_GPIO_2,
- .platform_data = &wm5102_reva_pdata,
+ .platform_data = &wm5102_reva_pdata,
+ .swnode = &wm5102_reva_swnode,
},
};
@@ -327,18 +348,21 @@ static struct wm2200_pdata wm2200_pdata = {
},
};
-static struct gpiod_lookup_table wm2200_gpiod_table = {
- .dev_id = "1-003a", /* Device 003a on I2C bus 1 */
- .table = {
- GPIO_LOOKUP("GPION", 7,
- "wlf,ldo1ena", GPIO_ACTIVE_HIGH),
- { },
- },
+static const struct property_entry wm2200_properties[] = {
+ PROPERTY_ENTRY_GPIO("wlf,ldo1ena-gpios",
+ SAMSUNG_GPIO_NODE('N'), 7, GPIO_ACTIVE_HIGH),
+ { }
+};
+
+static const struct software_node wm2200_swnode = {
+ .properties = wm2200_properties,
};
static const struct i2c_board_info wm2200_i2c[] = {
{ I2C_BOARD_INFO("wm2200", 0x3a),
- .platform_data = &wm2200_pdata, },
+ .platform_data = &wm2200_pdata,
+ .swnode = &wm2200_swnode,
+ },
};
static const struct {
@@ -349,8 +373,6 @@ static const struct {
int num_i2c_devs;
const struct spi_board_info *spi_devs;
int num_spi_devs;
-
- struct gpiod_lookup_table *gpiod_table;
} gf_mods[] = {
{ .id = 0x01, .rev = 0xff, .name = "1250-EV1 Springbank" },
{ .id = 0x02, .rev = 0xff, .name = "1251-EV1 Jura" },
@@ -371,36 +393,29 @@ static const struct {
{ .id = 0x21, .rev = 0xff, .name = "1275-EV1 Mortlach" },
{ .id = 0x25, .rev = 0xff, .name = "1274-EV1 Glencadam" },
{ .id = 0x31, .rev = 0xff, .name = "1253-EV1 Tomatin",
- .spi_devs = wm1253_devs, .num_spi_devs = ARRAY_SIZE(wm1253_devs),
- .gpiod_table = &wm0010_gpiod_table },
+ .spi_devs = wm1253_devs, .num_spi_devs = ARRAY_SIZE(wm1253_devs) },
{ .id = 0x32, .rev = 0xff, .name = "XXXX-EV1 Caol Illa" },
{ .id = 0x33, .rev = 0xff, .name = "XXXX-EV1 Oban" },
{ .id = 0x34, .rev = 0xff, .name = "WM0010-6320-CS42 Balblair",
.spi_devs = balblair_devs,
.num_spi_devs = ARRAY_SIZE(balblair_devs) },
{ .id = 0x39, .rev = 0xff, .name = "1254-EV1 Dallas Dhu",
- .i2c_devs = wm1254_devs, .num_i2c_devs = ARRAY_SIZE(wm1254_devs),
- .gpiod_table = &wm8996_gpiod_table },
+ .i2c_devs = wm1254_devs, .num_i2c_devs = ARRAY_SIZE(wm1254_devs) },
{ .id = 0x3a, .rev = 0xff, .name = "1259-EV1 Tobermory",
.i2c_devs = wm1259_devs, .num_i2c_devs = ARRAY_SIZE(wm1259_devs) },
{ .id = 0x3b, .rev = 0xff, .name = "1255-EV1 Kilchoman",
- .i2c_devs = wm1255_devs, .num_i2c_devs = ARRAY_SIZE(wm1255_devs),
- .gpiod_table = &wm5100_gpiod_table },
+ .i2c_devs = wm1255_devs, .num_i2c_devs = ARRAY_SIZE(wm1255_devs) },
{ .id = 0x3c, .rev = 0xff, .name = "1273-EV1 Longmorn" },
{ .id = 0x3d, .rev = 0xff, .name = "1277-EV1 Littlemill",
- .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs),
- .gpiod_table = &wm8994_gpiod_table },
+ .i2c_devs = wm1277_devs, .num_i2c_devs = ARRAY_SIZE(wm1277_devs) },
{ .id = 0x3e, .rev = 0, .name = "WM5102-6271-EV1-CS127 Amrut",
.spi_devs = wm5102_reva_spi_devs,
- .num_spi_devs = ARRAY_SIZE(wm5102_reva_spi_devs),
- .gpiod_table = &wm5102_reva_gpiod_table },
+ .num_spi_devs = ARRAY_SIZE(wm5102_reva_spi_devs) },
{ .id = 0x3e, .rev = -1, .name = "WM5102-6271-EV1-CS127 Amrut",
.spi_devs = wm5102_spi_devs,
- .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs),
- .gpiod_table = &wm5102_gpiod_table },
+ .num_spi_devs = ARRAY_SIZE(wm5102_spi_devs) },
{ .id = 0x3f, .rev = -1, .name = "WM2200-6271-CS90-M-REV1",
- .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c),
- .gpiod_table = &wm2200_gpiod_table },
+ .i2c_devs = wm2200_i2c, .num_i2c_devs = ARRAY_SIZE(wm2200_i2c) },
};
static int wlf_gf_module_probe(struct i2c_client *i2c)
@@ -420,10 +435,6 @@ static int wlf_gf_module_probe(struct i2c_client *i2c)
rev == gf_mods[i].rev))
break;
- gpiod_add_lookup_table(&wm5102_reva_gpiod_table);
- gpiod_add_lookup_table(&wm5102_gpiod_table);
- gpiod_add_lookup_table(&wm8994_gpiod_table);
-
if (i < ARRAY_SIZE(gf_mods)) {
dev_info(&i2c->dev, "%s revision %d\n",
gf_mods[i].name, rev + 1);
@@ -436,9 +447,6 @@ static int wlf_gf_module_probe(struct i2c_client *i2c)
spi_register_board_info(gf_mods[i].spi_devs,
gf_mods[i].num_spi_devs);
-
- if (gf_mods[i].gpiod_table)
- gpiod_add_lookup_table(gf_mods[i].gpiod_table);
} else {
dev_warn(&i2c->dev, "Unknown module ID 0x%x revision %d\n",
id, rev + 1);
--
2.56.0.307.g5fe7bd680c-goog
^ permalink raw reply [flat|nested] 5+ messages in thread