diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2026-07-24 19:09:04 +0200 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2026-07-24 19:09:04 +0200 |
| commit | 115abb2cd2d89b510666f5dece88a6f45b655e9c (patch) | |
| tree | c453f84792b2ade56a190cba8a23b8bafe1bbf49 | |
| parent | 2e00a93fbb4f7f2f713ae4900bd108f4f7413ff8 (diff) | |
| parent | ab1c3ab445b44d6b412bc4f7fad3db4f3857a80e (diff) | |
| download | linux-next-115abb2cd2d89b510666f5dece88a6f45b655e9c.tar.gz linux-next-115abb2cd2d89b510666f5dece88a6f45b655e9c.zip | |
Merge branch 'soc/arm' into for-next
* soc/arm:
ARM: sa1100: h3xxx: convert gpio-keys to use software nodes
ARM: sa1100: collie: convert gpio-keys to use software nodes
ARM: sa1100: assabet: convert gpio-keys to use software nodes
gpio: sa1100: register software node for GPIO controller
| -rw-r--r-- | arch/arm/mach-sa1100/assabet.c | 75 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/collie.c | 74 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/generic.h | 3 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/h3xxx.c | 69 | ||||
| -rw-r--r-- | drivers/gpio/gpio-sa1100.c | 10 |
5 files changed, 151 insertions, 80 deletions
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index 2b833aa0212b..b001f0b6a3fa 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c @@ -13,8 +13,10 @@ #include <linux/gpio/driver.h> #include <linux/gpio/gpio-reg.h> #include <linux/gpio/machine.h> -#include <linux/gpio_keys.h> +#include <linux/gpio/property.h> +#include <linux/input.h> #include <linux/ioport.h> +#include <linux/property.h> #include <linux/platform_data/sa11x0-serial.h> #include <linux/regulator/fixed.h> #include <linux/regulator/machine.h> @@ -467,28 +469,53 @@ static const struct gpio_led_platform_data assabet_leds_pdata __initconst = { .leds = assabet_leds, }; -static struct gpio_keys_button assabet_keys_buttons[] = { - { - .gpio = 0, - .irq = IRQ_GPIO0, - .desc = "gpio0", - .wakeup = 1, - .can_disable = 1, - .debounce_interval = 5, - }, { - .gpio = 1, - .irq = IRQ_GPIO1, - .desc = "gpio1", - .wakeup = 1, - .can_disable = 1, - .debounce_interval = 5, - }, +static const struct software_node assabet_gpio_keys_node = { + .name = "assabet-gpio-keys", +}; + +static const struct property_entry assabet_key0_props[] = { + PROPERTY_ENTRY_U32("linux,code", KEY_RESERVED), + PROPERTY_ENTRY_GPIO("gpios", &sa1100_gpiochip_node, + 0, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_STRING("label", "gpio0"), + PROPERTY_ENTRY_BOOL("wakeup-source"), + PROPERTY_ENTRY_BOOL("linux,can-disable"), + PROPERTY_ENTRY_U32("debounce-interval", 5), + { } +}; + +static const struct software_node assabet_key0_node = { + .parent = &assabet_gpio_keys_node, + .properties = assabet_key0_props, +}; + +static const struct property_entry assabet_key1_props[] = { + PROPERTY_ENTRY_U32("linux,code", KEY_RESERVED), + PROPERTY_ENTRY_GPIO("gpios", &sa1100_gpiochip_node, + 1, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_STRING("label", "gpio1"), + PROPERTY_ENTRY_BOOL("wakeup-source"), + PROPERTY_ENTRY_BOOL("linux,can-disable"), + PROPERTY_ENTRY_U32("debounce-interval", 5), + { } +}; + +static const struct software_node assabet_key1_node = { + .parent = &assabet_gpio_keys_node, + .properties = assabet_key1_props, +}; + +static const struct software_node * const assabet_gpio_keys_swnodes[] __initconst = { + &assabet_gpio_keys_node, + &assabet_key0_node, + &assabet_key1_node, + NULL }; -static const struct gpio_keys_platform_data assabet_keys_pdata = { - .buttons = assabet_keys_buttons, - .nbuttons = ARRAY_SIZE(assabet_keys_buttons), - .rep = 0, +static const struct platform_device_info assabet_gpio_keys_dev_info __initconst = { + .name = "gpio-keys", + .id = PLATFORM_DEVID_NONE, + .swnode = &assabet_gpio_keys_node, }; static struct gpiod_lookup_table assabet_uart1_gpio_table = { @@ -571,10 +598,8 @@ static void __init assabet_init(void) } - platform_device_register_resndata(NULL, "gpio-keys", 0, - NULL, 0, - &assabet_keys_pdata, - sizeof(assabet_keys_pdata)); + software_node_register_node_group(assabet_gpio_keys_swnodes); + platform_device_register_full(&assabet_gpio_keys_dev_info); gpiod_add_lookup_table(&assabet_leds_gpio_table); gpio_led_register_device(-1, &assabet_leds_pdata); diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index af9c68b2093e..d1931f51c900 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c @@ -27,10 +27,11 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <linux/timer.h> -#include <linux/gpio_keys.h> +#include <linux/gpio/property.h> #include <linux/input.h> #include <linux/gpio/legacy.h> #include <linux/gpio/machine.h> +#include <linux/property.h> #include <linux/power/gpio-charger.h> #include <video/sa1100fb.h> @@ -228,43 +229,57 @@ struct platform_device collie_locomo_device = { .resource = locomo_resources, }; -static struct gpio_keys_button collie_gpio_keys[] = { - { - .type = EV_PWR, - .code = KEY_RESERVED, - .gpio = COLLIE_GPIO_ON_KEY, - .desc = "On key", - .wakeup = 1, - .active_low = 1, - }, - { - .type = EV_PWR, - .code = KEY_WAKEUP, - .gpio = COLLIE_GPIO_WAKEUP, - .desc = "Sync", - .wakeup = 1, - .active_low = 1, - }, +static const struct software_node collie_gpio_keys_node = { + .name = "collie-gpio-keys", }; -static struct gpio_keys_platform_data collie_gpio_keys_data = { - .buttons = collie_gpio_keys, - .nbuttons = ARRAY_SIZE(collie_gpio_keys), +static const struct property_entry collie_on_key_props[] = { + PROPERTY_ENTRY_U32("linux,code", KEY_RESERVED), + PROPERTY_ENTRY_GPIO("gpios", &sa1100_gpiochip_node, + COLLIE_GPIO_ON_KEY, GPIO_ACTIVE_LOW), + PROPERTY_ENTRY_STRING("label", "On key"), + PROPERTY_ENTRY_U32("linux,input-type", EV_PWR), + PROPERTY_ENTRY_BOOL("wakeup-source"), + { } }; -static struct platform_device collie_gpio_keys_device = { - .name = "gpio-keys", - .id = -1, - .dev = { - .platform_data = &collie_gpio_keys_data, - }, +static const struct software_node collie_on_key_node = { + .parent = &collie_gpio_keys_node, + .properties = collie_on_key_props, +}; + +static const struct property_entry collie_wakeup_key_props[] = { + PROPERTY_ENTRY_U32("linux,code", KEY_WAKEUP), + PROPERTY_ENTRY_GPIO("gpios", &sa1100_gpiochip_node, + COLLIE_GPIO_WAKEUP, GPIO_ACTIVE_LOW), + PROPERTY_ENTRY_STRING("label", "Sync"), + PROPERTY_ENTRY_U32("linux,input-type", EV_PWR), + PROPERTY_ENTRY_BOOL("wakeup-source"), + { } +}; + +static const struct software_node collie_wakeup_key_node = { + .parent = &collie_gpio_keys_node, + .properties = collie_wakeup_key_props, +}; + +static const struct software_node * const collie_gpio_keys_swnodes[] __initconst = { + &collie_gpio_keys_node, + &collie_on_key_node, + &collie_wakeup_key_node, + NULL +}; + +static const struct platform_device_info collie_gpio_keys_dev_info __initconst = { + .name = "gpio-keys", + .id = PLATFORM_DEVID_NONE, + .swnode = &collie_gpio_keys_node, }; static struct platform_device *devices[] __initdata = { &collie_locomo_device, &colliescoop_device, &collie_power_device, - &collie_gpio_keys_device, }; static struct mtd_partition collie_partitions[] = { @@ -384,6 +399,9 @@ static void __init collie_init(void) printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); } + software_node_register_node_group(collie_gpio_keys_swnodes); + platform_device_register_full(&collie_gpio_keys_dev_info); + sa11x0_register_lcd(&collie_lcd_info); sa11x0_register_mtd(&collie_flash_data, collie_flash_resources, ARRAY_SIZE(collie_flash_resources)); diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index 5fe0d4fc0f8c..3cfe3b647711 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h @@ -48,6 +48,9 @@ int sa11xx_clk_init(void); struct gpiod_lookup_table; void sa11x0_register_pcmcia(int socket, struct gpiod_lookup_table *); +struct software_node; +extern const struct software_node sa1100_gpiochip_node; + struct fixed_voltage_config; struct regulator_consumer_supply; int sa11x0_register_fixed_regulator(int n, struct fixed_voltage_config *cfg, diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c index b8fc1953db9f..6f4c5d2be569 100644 --- a/arch/arm/mach-sa1100/h3xxx.c +++ b/arch/arm/mach-sa1100/h3xxx.c @@ -10,7 +10,10 @@ #include <linux/gpio/machine.h> #include <linux/gpio/legacy.h> #include <linux/gpio_keys.h> +#include <linux/gpio/property.h> +#include <linux/gpio/consumer.h> #include <linux/input.h> +#include <linux/property.h> #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> #include <linux/platform_data/gpio-htc-egpio.h> @@ -168,35 +171,48 @@ static struct platform_device h3xxx_egpio = { * GPIO keys */ -static struct gpio_keys_button h3xxx_button_table[] = { - { - .code = KEY_POWER, - .gpio = H3XXX_GPIO_PWR_BUTTON, - .desc = "Power Button", - .active_low = 1, - .type = EV_KEY, - .wakeup = 1, - }, { - .code = KEY_ENTER, - .gpio = H3XXX_GPIO_ACTION_BUTTON, - .active_low = 1, - .desc = "Action button", - .type = EV_KEY, - .wakeup = 0, - }, +static const struct software_node h3xxx_gpio_keys_node = { + .name = "h3xxx-gpio-keys", }; -static struct gpio_keys_platform_data h3xxx_keys_data = { - .buttons = h3xxx_button_table, - .nbuttons = ARRAY_SIZE(h3xxx_button_table), +static const struct property_entry h3xxx_power_key_props[] = { + PROPERTY_ENTRY_U32("linux,code", KEY_POWER), + PROPERTY_ENTRY_GPIO("gpios", &sa1100_gpiochip_node, + H3XXX_GPIO_PWR_BUTTON, GPIO_ACTIVE_LOW), + PROPERTY_ENTRY_STRING("label", "Power Button"), + PROPERTY_ENTRY_BOOL("wakeup-source"), + { } }; -static struct platform_device h3xxx_keys = { - .name = "gpio-keys", - .id = -1, - .dev = { - .platform_data = &h3xxx_keys_data, - }, +static const struct software_node h3xxx_power_key_node = { + .parent = &h3xxx_gpio_keys_node, + .properties = h3xxx_power_key_props, +}; + +static const struct property_entry h3xxx_action_key_props[] = { + PROPERTY_ENTRY_U32("linux,code", KEY_ENTER), + PROPERTY_ENTRY_GPIO("gpios", &sa1100_gpiochip_node, + H3XXX_GPIO_ACTION_BUTTON, GPIO_ACTIVE_LOW), + PROPERTY_ENTRY_STRING("label", "Action button"), + { } +}; + +static const struct software_node h3xxx_action_key_node = { + .parent = &h3xxx_gpio_keys_node, + .properties = h3xxx_action_key_props, +}; + +static const struct software_node * const h3xxx_gpio_keys_swnodes[] __initconst = { + &h3xxx_gpio_keys_node, + &h3xxx_power_key_node, + &h3xxx_action_key_node, + NULL +}; + +static const struct platform_device_info h3xxx_gpio_keys_dev_info __initconst = { + .name = "gpio-keys", + .id = PLATFORM_DEVID_NONE, + .swnode = &h3xxx_gpio_keys_node, }; static struct resource h3xxx_micro_resources[] = { @@ -214,7 +230,6 @@ struct platform_device h3xxx_micro_asic = { static struct platform_device *h3xxx_devices[] = { &h3xxx_egpio, - &h3xxx_keys, &h3xxx_micro_asic, }; @@ -240,6 +255,8 @@ void __init h3xxx_mach_init(void) sa1100_register_uart_fns(&h3xxx_port_fns); sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1); platform_add_devices(h3xxx_devices, ARRAY_SIZE(h3xxx_devices)); + software_node_register_node_group(h3xxx_gpio_keys_swnodes); + platform_device_register_full(&h3xxx_gpio_keys_dev_info); } static struct map_desc h3600_io_desc[] __initdata = { diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c index 1938ffa2f4f3..ffa73dd3b982 100644 --- a/drivers/gpio/gpio-sa1100.c +++ b/drivers/gpio/gpio-sa1100.c @@ -13,6 +13,11 @@ #include <mach/hardware.h> #include <mach/irqs.h> #include <mach/generic.h> +#include <linux/property.h> + +const struct software_node sa1100_gpiochip_node = { + .name = "sa1100-gpio", +}; struct sa1100_gpio_chip { struct gpio_chip chip; @@ -317,6 +322,7 @@ static const int sa1100_gpio_irqs[] __initconst = { void __init sa1100_init_gpio(void) { struct sa1100_gpio_chip *sgc = &sa1100_gpio_chip; + struct gpio_chip *gc = &sgc->chip; int i; /* clear all GPIO edge detects */ @@ -324,7 +330,9 @@ void __init sa1100_init_gpio(void) writel_relaxed(0, sgc->membase + R_GRER); writel_relaxed(-1, sgc->membase + R_GEDR); - gpiochip_add_data(&sa1100_gpio_chip.chip, NULL); + software_node_register(&sa1100_gpiochip_node); + gc->fwnode = software_node_fwnode(&sa1100_gpiochip_node); + gpiochip_add_data(gc, NULL); sa1100_gpio_irqdomain = irq_domain_create_simple(NULL, 28, IRQ_GPIO0, |
