Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ARM: pxa/gumstix: convert vbus gpio to use software nodes

Switch vbus gpios from using a custom GPIO lookup table to software
properties using PROPERTY_ENTRY_GPIO() constructs which closely mimic
device tree gpio properties.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240628180852.1738922-4-dmitry.torokhov@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Dmitry Torokhov and committed by
Arnd Bergmann
f1d6588a 917195d6

+16 -15
+4
arch/arm/mach-pxa/devices.c
··· 629 629 }; 630 630 #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ 631 631 632 + const struct software_node pxa2xx_gpiochip_node = { 633 + .name = "gpio-pxa", 634 + }; 635 + 632 636 struct resource pxa_resource_gpio[] = { 633 637 { 634 638 .start = 0x40e00000,
+2 -2
arch/arm/mach-pxa/devices.h
··· 53 53 54 54 extern struct platform_device pxa25x_device_gpio; 55 55 extern struct platform_device pxa27x_device_gpio; 56 - extern struct platform_device pxa3xx_device_gpio; 57 - extern struct platform_device pxa93x_device_gpio; 56 + 57 + extern const struct software_node pxa2xx_gpiochip_node; 58 58 59 59 void __init pxa_register_device(struct platform_device *dev, void *data); 60 60 void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata);
+9 -13
arch/arm/mach-pxa/gumstix.c
··· 100 100 #endif 101 101 102 102 #ifdef CONFIG_USB_PXA25X 103 - static struct gpiod_lookup_table gumstix_gpio_vbus_gpiod_table = { 104 - .dev_id = "gpio-vbus", 105 - .table = { 106 - GPIO_LOOKUP("gpio-pxa", GPIO_GUMSTIX_USB_GPIOn, 107 - "vbus", GPIO_ACTIVE_HIGH), 108 - GPIO_LOOKUP("gpio-pxa", GPIO_GUMSTIX_USB_GPIOx, 109 - "pullup", GPIO_ACTIVE_HIGH), 110 - { }, 111 - }, 103 + static const struct property_entry spitz_mci_props[] __initconst = { 104 + PROPERTY_ENTRY_GPIO("vbus-gpios", &pxa2xx_gpiochip_node, 105 + GPIO_GUMSTIX_USB_GPIOn, GPIO_ACTIVE_HIGH), 106 + PROPERTY_ENTRY_GPIO("pullup-gpios", &pxa2xx_gpiochip_node, 107 + GPIO_GUMSTIX_USB_GPIOx, GPIO_ACTIVE_HIGH), 108 + { } 112 109 }; 113 110 114 - static struct platform_device gumstix_gpio_vbus = { 111 + static const struct platform_device_info gumstix_gpio_vbus_info __initconst = { 115 112 .name = "gpio-vbus", 116 - .id = -1, 113 + .id = PLATFORM_DEVID_NONE, 117 114 }; 118 115 119 116 static void __init gumstix_udc_init(void) 120 117 { 121 - gpiod_add_lookup_table(&gumstix_gpio_vbus_gpiod_table); 122 - platform_device_register(&gumstix_gpio_vbus); 118 + platform_device_register_full(&gumstix_gpio_vbus_info); 123 119 } 124 120 #else 125 121 static void gumstix_udc_init(void)
+1
arch/arm/mach-pxa/pxa25x.c
··· 239 239 register_syscore_ops(&pxa2xx_mfp_syscore_ops); 240 240 241 241 if (!of_have_populated_dt()) { 242 + software_node_register(&pxa2xx_gpiochip_node); 242 243 pxa2xx_set_dmac_info(&pxa25x_dma_pdata); 243 244 ret = platform_add_devices(pxa25x_devices, 244 245 ARRAY_SIZE(pxa25x_devices));