Skip to content

Commit 917195d

Browse files
dtorarndb
authored andcommitted
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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 78ab3d3 commit 917195d

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

arch/arm/mach-pxa/devices.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/clk-provider.h>
88
#include <linux/dma-mapping.h>
99
#include <linux/dmaengine.h>
10+
#include <linux/gpio-pxa.h>
1011
#include <linux/platform_data/i2c-pxa.h>
1112
#include <linux/soc/pxa/cpu.h>
1213

@@ -17,6 +18,7 @@
1718
#include <linux/platform_data/usb-ohci-pxa27x.h>
1819
#include <linux/platform_data/mmp_dma.h>
1920

21+
#include "mfp-pxa2xx.h"
2022
#include "regs-ost.h"
2123
#include "reset.h"
2224
#include "devices.h"
@@ -650,18 +652,29 @@ struct resource pxa_resource_gpio[] = {
650652
},
651653
};
652654

655+
static struct pxa_gpio_platform_data pxa2xx_gpio_info = {
656+
.irq_base = PXA_GPIO_TO_IRQ(0),
657+
.gpio_set_wake = gpio_set_wake,
658+
};
659+
653660
struct platform_device pxa25x_device_gpio = {
654661
.name = "pxa25x-gpio",
655662
.id = -1,
656663
.num_resources = ARRAY_SIZE(pxa_resource_gpio),
657664
.resource = pxa_resource_gpio,
665+
.dev = {
666+
.platform_data = &pxa2xx_gpio_info,
667+
},
658668
};
659669

660670
struct platform_device pxa27x_device_gpio = {
661671
.name = "pxa27x-gpio",
662672
.id = -1,
663673
.num_resources = ARRAY_SIZE(pxa_resource_gpio),
664674
.resource = pxa_resource_gpio,
675+
.dev = {
676+
.platform_data = &pxa2xx_gpio_info,
677+
},
665678
};
666679

667680
static struct resource pxa_dma_resource[] = {

arch/arm/mach-pxa/pxa25x.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,8 @@ void __init pxa25x_map_io(void)
178178
pxa25x_get_clk_frequency_khz(1);
179179
}
180180

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-
186181
static struct platform_device *pxa25x_devices[] __initdata = {
182+
&pxa25x_device_gpio,
187183
&pxa25x_device_udc,
188184
&pxa_device_pmu,
189185
&pxa_device_i2s,
@@ -244,7 +240,6 @@ static int __init pxa25x_init(void)
244240

245241
if (!of_have_populated_dt()) {
246242
pxa2xx_set_dmac_info(&pxa25x_dma_pdata);
247-
pxa_register_device(&pxa25x_device_gpio, &pxa25x_gpio_info);
248243
ret = platform_add_devices(pxa25x_devices,
249244
ARRAY_SIZE(pxa25x_devices));
250245
}

arch/arm/mach-pxa/pxa27x.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,8 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
276276
pxa_register_device(&pxa27x_device_i2c_power, info);
277277
}
278278

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-
284279
static struct platform_device *devices[] __initdata = {
280+
&pxa27x_device_gpio,
285281
&pxa27x_device_udc,
286282
&pxa_device_pmu,
287283
&pxa_device_i2s,
@@ -345,8 +341,6 @@ static int __init pxa27x_init(void)
345341
register_syscore_ops(&pxa2xx_mfp_syscore_ops);
346342

347343
if (!of_have_populated_dt()) {
348-
pxa_register_device(&pxa27x_device_gpio,
349-
&pxa27x_gpio_info);
350344
pxa2xx_set_dmac_info(&pxa27x_dma_pdata);
351345
ret = platform_add_devices(devices,
352346
ARRAY_SIZE(devices));

0 commit comments

Comments
 (0)