diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-12-12 15:46:56 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-23 18:15:29 +0100 |
commit | c100eacc25c5b59a5d68f7b0590c295cb398e934 (patch) | |
tree | f39acd1bd5df7595d35c7ed338c91f48709097b5 /arch/arm/mach-at91/at91rm9200_devices.c | |
parent | b25bb1f0726bf81aa1af52bd1eca63b51c907bcf (diff) | |
download | barebox-c100eacc25c5b59a5d68f7b0590c295cb398e934.tar.gz barebox-c100eacc25c5b59a5d68f7b0590c295cb398e934.tar.xz |
at91: add at91_udc resource
this device controller is present on rm9200/9260/9g20/9261/9g10/9263
the 9g45 use an other IP
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-at91/at91rm9200_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_devices.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index bd7d3f05e4..8c198464bc 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c @@ -42,6 +42,27 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) {} #endif +/* -------------------------------------------------------------------- + * USB Device (Gadget) + * -------------------------------------------------------------------- */ + +#ifdef CONFIG_USB_GADGET_DRIVER_AT91 +void __init at91_add_device_udc(struct at91_udc_data *data) +{ + if (data->vbus_pin > 0) { + at91_set_gpio_input(data->vbus_pin, 0); + at91_set_deglitch(data->vbus_pin, 1); + } + + if (data->pullup_pin > 0) + at91_set_gpio_output(data->pullup_pin, 0); + + add_generic_device("at91_udc", -1, NULL, AT91RM9200_BASE_UDP, SZ_16K, + IORESOURCE_MEM, data); +} +#else +void __init at91_add_device_udc(struct at91_udc_data *data) {} +#endif /* -------------------------------------------------------------------- * Ethernet |