Skip to content

Commit f1d6588

Browse files
dtorarndb
authored andcommitted
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 <[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 917195d commit f1d6588

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

arch/arm/mach-pxa/devices.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,10 @@ struct platform_device pxa27x_device_pwm1 = {
629629
};
630630
#endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
631631

632+
const struct software_node pxa2xx_gpiochip_node = {
633+
.name = "gpio-pxa",
634+
};
635+
632636
struct resource pxa_resource_gpio[] = {
633637
{
634638
.start = 0x40e00000,

arch/arm/mach-pxa/devices.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ extern struct platform_device pxa_device_asoc_ssp4;
5353

5454
extern struct platform_device pxa25x_device_gpio;
5555
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;
5858

5959
void __init pxa_register_device(struct platform_device *dev, void *data);
6060
void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata);

arch/arm/mach-pxa/gumstix.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -100,26 +100,22 @@ static void __init gumstix_mmc_init(void)
100100
#endif
101101

102102
#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+
{ }
112109
};
113110

114-
static struct platform_device gumstix_gpio_vbus = {
111+
static const struct platform_device_info gumstix_gpio_vbus_info __initconst = {
115112
.name = "gpio-vbus",
116-
.id = -1,
113+
.id = PLATFORM_DEVID_NONE,
117114
};
118115

119116
static void __init gumstix_udc_init(void)
120117
{
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);
123119
}
124120
#else
125121
static void gumstix_udc_init(void)

arch/arm/mach-pxa/pxa25x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ static int __init pxa25x_init(void)
239239
register_syscore_ops(&pxa2xx_mfp_syscore_ops);
240240

241241
if (!of_have_populated_dt()) {
242+
software_node_register(&pxa2xx_gpiochip_node);
242243
pxa2xx_set_dmac_info(&pxa25x_dma_pdata);
243244
ret = platform_add_devices(pxa25x_devices,
244245
ARRAY_SIZE(pxa25x_devices));

0 commit comments

Comments
 (0)