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: consolidate GPIO chip platform data

The platform data for the GPIO controllers for the boards using non-DT
setup is the same between PXA25x (gumstix) and PXA27x (Spitz) devices.
Move it into devices.c to consolidate code. It will help with conversion
to software nodes/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-3-dmitry.torokhov@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Dmitry Torokhov and committed by
Arnd Bergmann
917195d6 78ab3d35

+15 -13
+13
arch/arm/mach-pxa/devices.c
··· 7 7 #include <linux/clk-provider.h> 8 8 #include <linux/dma-mapping.h> 9 9 #include <linux/dmaengine.h> 10 + #include <linux/gpio-pxa.h> 10 11 #include <linux/platform_data/i2c-pxa.h> 11 12 #include <linux/soc/pxa/cpu.h> 12 13 ··· 18 17 #include <linux/platform_data/usb-ohci-pxa27x.h> 19 18 #include <linux/platform_data/mmp_dma.h> 20 19 20 + #include "mfp-pxa2xx.h" 21 21 #include "regs-ost.h" 22 22 #include "reset.h" 23 23 #include "devices.h" ··· 652 650 }, 653 651 }; 654 652 653 + static struct pxa_gpio_platform_data pxa2xx_gpio_info = { 654 + .irq_base = PXA_GPIO_TO_IRQ(0), 655 + .gpio_set_wake = gpio_set_wake, 656 + }; 657 + 655 658 struct platform_device pxa25x_device_gpio = { 656 659 .name = "pxa25x-gpio", 657 660 .id = -1, 658 661 .num_resources = ARRAY_SIZE(pxa_resource_gpio), 659 662 .resource = pxa_resource_gpio, 663 + .dev = { 664 + .platform_data = &pxa2xx_gpio_info, 665 + }, 660 666 }; 661 667 662 668 struct platform_device pxa27x_device_gpio = { ··· 672 662 .id = -1, 673 663 .num_resources = ARRAY_SIZE(pxa_resource_gpio), 674 664 .resource = pxa_resource_gpio, 665 + .dev = { 666 + .platform_data = &pxa2xx_gpio_info, 667 + }, 675 668 }; 676 669 677 670 static struct resource pxa_dma_resource[] = {
+1 -6
arch/arm/mach-pxa/pxa25x.c
··· 178 178 pxa25x_get_clk_frequency_khz(1); 179 179 } 180 180 181 - static struct pxa_gpio_platform_data pxa25x_gpio_info __initdata = { 182 - .irq_base = PXA_GPIO_TO_IRQ(0), 183 - .gpio_set_wake = gpio_set_wake, 184 - }; 185 - 186 181 static struct platform_device *pxa25x_devices[] __initdata = { 182 + &pxa25x_device_gpio, 187 183 &pxa25x_device_udc, 188 184 &pxa_device_pmu, 189 185 &pxa_device_i2s, ··· 240 244 241 245 if (!of_have_populated_dt()) { 242 246 pxa2xx_set_dmac_info(&pxa25x_dma_pdata); 243 - pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info); 244 247 ret = platform_add_devices(pxa25x_devices, 245 248 ARRAY_SIZE(pxa25x_devices)); 246 249 }
+1 -7
arch/arm/mach-pxa/pxa27x.c
··· 276 276 pxa_register_device(&pxa27x_device_i2c_power, info); 277 277 } 278 278 279 - static struct pxa_gpio_platform_data pxa27x_gpio_info __initdata = { 280 - .irq_base = PXA_GPIO_TO_IRQ(0), 281 - .gpio_set_wake = gpio_set_wake, 282 - }; 283 - 284 279 static struct platform_device *devices[] __initdata = { 280 + &pxa27x_device_gpio, 285 281 &pxa27x_device_udc, 286 282 &pxa_device_pmu, 287 283 &pxa_device_i2s, ··· 341 345 register_syscore_ops(&pxa2xx_mfp_syscore_ops); 342 346 343 347 if (!of_have_populated_dt()) { 344 - pxa_register_device(&pxa27x_device_gpio, 345 - &pxa27x_gpio_info); 346 348 pxa2xx_set_dmac_info(&pxa27x_dma_pdata); 347 349 ret = platform_add_devices(devices, 348 350 ARRAY_SIZE(devices));