diff options
Diffstat (limited to 'arch/arm/mach-sa1100')
| -rw-r--r-- | arch/arm/mach-sa1100/Kconfig | 5 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/assabet.c | 75 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/collie.c | 76 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/generic.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/generic.h | 3 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/h3600.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-sa1100/h3xxx.c | 71 |
7 files changed, 150 insertions, 84 deletions
diff --git a/arch/arm/mach-sa1100/Kconfig b/arch/arm/mach-sa1100/Kconfig index e23700e0d6c8..d50721e39641 100644 --- a/arch/arm/mach-sa1100/Kconfig +++ b/arch/arm/mach-sa1100/Kconfig @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only menuconfig ARCH_SA1100 - bool "SA11x0 Implementations" + bool "SA11x0 Implementations (DEPRECATED)" depends on ARCH_MULTI_V4 && !(ARCH_MULTI_V4T || ARCH_MULTI_V5) depends on !(ARCH_MOXART || ARCH_GEMINI) depends on ATAGS @@ -20,6 +20,9 @@ menuconfig ARCH_SA1100 help Support for StrongARM 11x0 based boards. + Support for these machines will go away in 2027, + unless there are any remaining users that speak up. + if ARCH_SA1100 config SA1100_ASSABET 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 466d755d5702..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.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.c b/arch/arm/mach-sa1100/generic.c index 99ff55e8131d..a995625ab1a0 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -6,7 +6,7 @@ * * Code common to all SA11x0 machines. */ -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <linux/gpio/machine.h> #include <linux/module.h> #include <linux/kernel.h> 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/h3600.c b/arch/arm/mach-sa1100/h3600.c index 1cfc0b1fa41c..59e9251a138e 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -8,7 +8,7 @@ #include <linux/init.h> #include <linux/kernel.h> -#include <linux/gpio.h> +#include <linux/gpio/legacy.h> #include <video/sa1100fb.h> diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c index d685f03f51f3..6f4c5d2be569 100644 --- a/arch/arm/mach-sa1100/h3xxx.c +++ b/arch/arm/mach-sa1100/h3xxx.c @@ -8,9 +8,12 @@ #include <linux/kernel.h> #include <linux/gpio/machine.h> -#include <linux/gpio.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 = { |
