.. | .. |
---|
14 | 14 | #include <linux/kernel.h> |
---|
15 | 15 | #include <linux/init.h> |
---|
16 | 16 | #include <linux/clk-provider.h> |
---|
| 17 | +#include <linux/gpio/machine.h> |
---|
17 | 18 | #include <linux/gpio.h> |
---|
18 | 19 | #include <linux/delay.h> |
---|
19 | 20 | #include <linux/platform_device.h> |
---|
.. | .. |
---|
22 | 23 | #include <linux/mfd/t7l66xb.h> |
---|
23 | 24 | #include <linux/mtd/rawnand.h> |
---|
24 | 25 | #include <linux/mtd/partitions.h> |
---|
25 | | -#include <linux/usb/gpio_vbus.h> |
---|
26 | 26 | #include <linux/memblock.h> |
---|
27 | 27 | |
---|
28 | 28 | #include <video/w100fb.h> |
---|
.. | .. |
---|
51 | 51 | memblock_add(0xa0000000, SZ_64M); |
---|
52 | 52 | } |
---|
53 | 53 | |
---|
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 | + }, |
---|
58 | 63 | }; |
---|
59 | 64 | |
---|
60 | 65 | static struct platform_device e7xx_gpio_vbus __maybe_unused = { |
---|
61 | 66 | .name = "gpio-vbus", |
---|
62 | 67 | .id = -1, |
---|
63 | | - .dev = { |
---|
64 | | - .platform_data = &e7xx_udc_info, |
---|
65 | | - }, |
---|
66 | 68 | }; |
---|
67 | 69 | |
---|
68 | 70 | struct pxaficp_platform_data e7xx_ficp_platform_data = { |
---|
.. | .. |
---|
165 | 167 | pxa_set_stuart_info(NULL); |
---|
166 | 168 | eseries_register_clks(); |
---|
167 | 169 | eseries_get_tmio_gpios(); |
---|
| 170 | + gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table); |
---|
168 | 171 | platform_add_devices(ARRAY_AND_SIZE(e330_devices)); |
---|
169 | 172 | } |
---|
170 | 173 | |
---|
.. | .. |
---|
216 | 219 | pxa_set_stuart_info(NULL); |
---|
217 | 220 | eseries_register_clks(); |
---|
218 | 221 | eseries_get_tmio_gpios(); |
---|
| 222 | + gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table); |
---|
219 | 223 | platform_add_devices(ARRAY_AND_SIZE(e350_devices)); |
---|
220 | 224 | } |
---|
221 | 225 | |
---|
.. | .. |
---|
340 | 344 | eseries_register_clks(); |
---|
341 | 345 | eseries_get_tmio_gpios(); |
---|
342 | 346 | pxa_set_fb_info(NULL, &e400_pxafb_mach_info); |
---|
| 347 | + gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table); |
---|
343 | 348 | platform_add_devices(ARRAY_AND_SIZE(e400_devices)); |
---|
344 | 349 | } |
---|
345 | 350 | |
---|
.. | .. |
---|
534 | 539 | clk_add_alias("CLK_CK48M", e740_t7l66xb_device.name, |
---|
535 | 540 | "UDCCLK", &pxa25x_device_udc.dev), |
---|
536 | 541 | eseries_get_tmio_gpios(); |
---|
| 542 | + gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table); |
---|
537 | 543 | platform_add_devices(ARRAY_AND_SIZE(e740_devices)); |
---|
538 | 544 | pxa_set_ac97_info(NULL); |
---|
539 | 545 | pxa_set_ficp_info(&e7xx_ficp_platform_data); |
---|
.. | .. |
---|
733 | 739 | clk_add_alias("CLK_CK3P6MI", e750_tc6393xb_device.name, |
---|
734 | 740 | "GPIO11_CLK", NULL), |
---|
735 | 741 | eseries_get_tmio_gpios(); |
---|
| 742 | + gpiod_add_lookup_table(&e7xx_gpio_vbus_gpiod_table); |
---|
736 | 743 | platform_add_devices(ARRAY_AND_SIZE(e750_devices)); |
---|
737 | 744 | pxa_set_ac97_info(NULL); |
---|
738 | 745 | pxa_set_ficp_info(&e7xx_ficp_platform_data); |
---|
.. | .. |
---|
888 | 895 | |
---|
889 | 896 | /* --------------------------- UDC definitions --------------------------- */ |
---|
890 | 897 | |
---|
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 | + }, |
---|
895 | 907 | }; |
---|
896 | 908 | |
---|
897 | 909 | static struct platform_device e800_gpio_vbus = { |
---|
898 | 910 | .name = "gpio-vbus", |
---|
899 | 911 | .id = -1, |
---|
900 | | - .dev = { |
---|
901 | | - .platform_data = &e800_udc_info, |
---|
902 | | - }, |
---|
903 | 912 | }; |
---|
904 | 913 | |
---|
905 | 914 | |
---|
.. | .. |
---|
949 | 958 | clk_add_alias("CLK_CK3P6MI", e800_tc6393xb_device.name, |
---|
950 | 959 | "GPIO11_CLK", NULL), |
---|
951 | 960 | eseries_get_tmio_gpios(); |
---|
| 961 | + gpiod_add_lookup_table(&e800_gpio_vbus_gpiod_table); |
---|
952 | 962 | platform_add_devices(ARRAY_AND_SIZE(e800_devices)); |
---|
953 | 963 | pxa_set_ac97_info(NULL); |
---|
954 | 964 | } |
---|