hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/mach-pxa/eseries.c
....@@ -14,6 +14,7 @@
1414 #include <linux/kernel.h>
1515 #include <linux/init.h>
1616 #include <linux/clk-provider.h>
17
+#include <linux/gpio/machine.h>
1718 #include <linux/gpio.h>
1819 #include <linux/delay.h>
1920 #include <linux/platform_device.h>
....@@ -22,7 +23,6 @@
2223 #include <linux/mfd/t7l66xb.h>
2324 #include <linux/mtd/rawnand.h>
2425 #include <linux/mtd/partitions.h>
25
-#include <linux/usb/gpio_vbus.h>
2626 #include <linux/memblock.h>
2727
2828 #include <video/w100fb.h>
....@@ -51,18 +51,20 @@
5151 memblock_add(0xa0000000, SZ_64M);
5252 }
5353
54
-struct gpio_vbus_mach_info e7xx_udc_info = {
55
- .gpio_vbus = GPIO_E7XX_USB_DISC,
56
- .gpio_pullup = GPIO_E7XX_USB_PULLUP,
57
- .gpio_pullup_inverted = 1
54
+static struct gpiod_lookup_table e7xx_gpio_vbus_gpiod_table __maybe_unused = {
55
+ .dev_id = "gpio-vbus",
56
+ .table = {
57
+ GPIO_LOOKUP("gpio-pxa", GPIO_E7XX_USB_DISC,
58
+ "vbus", GPIO_ACTIVE_HIGH),
59
+ GPIO_LOOKUP("gpio-pxa", GPIO_E7XX_USB_PULLUP,
60
+ "pullup", GPIO_ACTIVE_LOW),
61
+ { },
62
+ },
5863 };
5964
6065 static struct platform_device e7xx_gpio_vbus __maybe_unused = {
6166 .name = "gpio-vbus",
6267 .id = -1,
63
- .dev = {
64
- .platform_data = &e7xx_udc_info,
65
- },
6668 };
6769
6870 struct pxaficp_platform_data e7xx_ficp_platform_data = {
....@@ -165,6 +167,7 @@
165167 pxa_set_stuart_info(NULL);
166168 eseries_register_clks();
167169 eseries_get_tmio_gpios();
170
+ gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
168171 platform_add_devices(ARRAY_AND_SIZE(e330_devices));
169172 }
170173
....@@ -216,6 +219,7 @@
216219 pxa_set_stuart_info(NULL);
217220 eseries_register_clks();
218221 eseries_get_tmio_gpios();
222
+ gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
219223 platform_add_devices(ARRAY_AND_SIZE(e350_devices));
220224 }
221225
....@@ -340,6 +344,7 @@
340344 eseries_register_clks();
341345 eseries_get_tmio_gpios();
342346 pxa_set_fb_info(NULL, &e400_pxafb_mach_info);
347
+ gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
343348 platform_add_devices(ARRAY_AND_SIZE(e400_devices));
344349 }
345350
....@@ -534,6 +539,7 @@
534539 clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name,
535540 "UDCCLK", &pxa25x_device_udc.dev),
536541 eseries_get_tmio_gpios();
542
+ gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
537543 platform_add_devices(ARRAY_AND_SIZE(e740_devices));
538544 pxa_set_ac97_info(NULL);
539545 pxa_set_ficp_info(&e7xx_ficp_platform_data);
....@@ -733,6 +739,7 @@
733739 clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name,
734740 "GPIO11_CLK", NULL),
735741 eseries_get_tmio_gpios();
742
+ gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table);
736743 platform_add_devices(ARRAY_AND_SIZE(e750_devices));
737744 pxa_set_ac97_info(NULL);
738745 pxa_set_ficp_info(&e7xx_ficp_platform_data);
....@@ -888,18 +895,20 @@
888895
889896 /* --------------------------- UDC definitions --------------------------- */
890897
891
-static struct gpio_vbus_mach_info e800_udc_info = {
892
- .gpio_vbus = GPIO_E800_USB_DISC,
893
- .gpio_pullup = GPIO_E800_USB_PULLUP,
894
- .gpio_pullup_inverted = 1
898
+static struct gpiod_lookup_table e800_gpio_vbus_gpiod_table = {
899
+ .dev_id = "gpio-vbus",
900
+ .table = {
901
+ GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_DISC,
902
+ "vbus", GPIO_ACTIVE_HIGH),
903
+ GPIO_LOOKUP("gpio-pxa", GPIO_E800_USB_PULLUP,
904
+ "pullup", GPIO_ACTIVE_LOW),
905
+ { },
906
+ },
895907 };
896908
897909 static struct platform_device e800_gpio_vbus = {
898910 .name = "gpio-vbus",
899911 .id = -1,
900
- .dev = {
901
- .platform_data = &e800_udc_info,
902
- },
903912 };
904913
905914
....@@ -949,6 +958,7 @@
949958 clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name,
950959 "GPIO11_CLK", NULL),
951960 eseries_get_tmio_gpios();
961
+ gpiod_add_lookup_table(&e800_gpio_vbus_gpiod_table);
952962 platform_add_devices(ARRAY_AND_SIZE(e800_devices));
953963 pxa_set_ac97_info(NULL);
954964 }