From 5f36e231e9dbffb5264612e5b5817ab574a5e5db Mon Sep 17 00:00:00 2001 From: Alexander Shishkin Date: Fri, 11 May 2012 17:25:47 +0300 Subject: usb: chipidea: add support for roles Add some generic code for roles and implement simple role switching based on ID pin state and/or a sysfs file. At this, we also rename the device to ci_hdrc, which is what it is. The "manual" switch is made into a sysfs file and not debugfs, because it might be useful even in non-debug context. For some boards, like sheevaplug, it seems to be the only way to switch roles without modifying the hardware, since the ID pin is always grounded. Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/udc.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'drivers/usb/chipidea/udc.h') diff --git a/drivers/usb/chipidea/udc.h b/drivers/usb/chipidea/udc.h index 82c9e3e..3a9e669 100644 --- a/drivers/usb/chipidea/udc.h +++ b/drivers/usb/chipidea/udc.h @@ -71,26 +71,16 @@ struct ci13xxx_req { }; #ifdef CONFIG_USB_CHIPIDEA_UDC -irqreturn_t udc_irq(int irq, void *data); -int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev, - void __iomem *regs, struct ci13xxx **_udc); -void udc_remove(struct ci13xxx *udc); + +int ci_hdrc_gadget_init(struct ci13xxx *ci); + #else -static inline irqreturn_t udc_irq(int irq, void *data) -{ - return IRQ_NONE; -} -static inline -int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev, - void __iomem *regs, struct ci13xxx **_udc) +static inline int ci_hdrc_gadget_init(struct ci13xxx *ci) { - return -ENODEV; + return -ENXIO; } -static inline void udc_remove(struct ci13xxx *udc) -{ -} #endif #endif /* __DRIVERS_USB_CHIPIDEA_UDC_H */ -- cgit v1.1