From 5ea5e14ba2919ce14bd7d8f5f6f202b04e502517 Mon Sep 17 00:00:00 2001 From: Robert Hodaszi Date: Mon, 23 May 2011 14:28:03 +0200 Subject: merge: merged changes from 2.6.28 Conflicts: gpio Special handling of PORT A gpios is lost. Some code has been ported but it must be fixed. Signed-off-by: Hector Palacios Signed-off-by: Robert Hodaszi --- drivers/usb/gadget/Kconfig | 15 +++++++++++++++ drivers/usb/gadget/gadget_chips.h | 11 ++++++++++- drivers/usb/gadget/s3c2443_udc.c | 16 ++++++++-------- drivers/usb/gadget/s3c2443_udc.h | 8 +++++--- 4 files changed, 38 insertions(+), 12 deletions(-) (limited to 'drivers/usb') diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 5b6b913d66b6..b38438fd8c75 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -316,6 +316,21 @@ config USB_IMX default USB_GADGET select USB_GADGET_SELECTED +config USB_GADGET_S3C2443 + boolean "S3C2443 USB Device Controller" + depends on S3C2443_USB_PHY_UDC + select USB_GADGET_SELECTED + help + Samsung's S3C2443 with an integrated full speed USB 2.0 device + controller. + +config USB_S3C2443 + tristate + depends on USB_GADGET_S3C2443 + default USB_GADGET + select USB_GADGET_SELECTED + select USB_GADGET_DUALSPEED + config USB_GADGET_S3C2410 boolean "S3C2410 USB Device Controller" depends on ARCH_S3C2410 diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index 9820bf0955f1..e24979a096a6 100644 --- a/drivers/usb/gadget/gadget_chips.h +++ b/drivers/usb/gadget/gadget_chips.h @@ -120,6 +120,13 @@ #define gadget_is_fsl_qe(g) 0 #endif +/* Samsung S3C2443 UDC */ +#ifdef CONFIG_USB_GADGET_S3C2443 +#define gadget_is_s3c2443(g) !strcmp("s3c2443_udc", (g)->name) +#else +#define gadget_is_s3c2443(g) 0 +#endif + #ifdef CONFIG_USB_GADGET_CI13XXX #define gadget_is_ci13xxx(g) (!strcmp("ci13xxx_udc", (g)->name)) #else @@ -207,7 +214,9 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget) else if (gadget_is_s3c_hsotg(gadget)) return 0x26; else if (gadget_is_arcotg(gadget)) - return 0x26; + return 0x27; + else if (gadget_is_s3c2443(gadget)) + return 0x28; return -ENOENT; } diff --git a/drivers/usb/gadget/s3c2443_udc.c b/drivers/usb/gadget/s3c2443_udc.c index 3eaf7d14f84a..8c3d28479399 100644 --- a/drivers/usb/gadget/s3c2443_udc.c +++ b/drivers/usb/gadget/s3c2443_udc.c @@ -371,10 +371,10 @@ static inline int s3c2443_udc_vbus_state(struct s3c24xx_udc *udc) unsigned long iocfg; /* @XXX: Do we really need to change to INPUT first? */ - iocfg = s3c2410_gpio_getcfg(info->vbus_pin); - s3c2410_gpio_cfgpin(info->vbus_pin, S3C2410_GPIO_INPUT); + iocfg = s3c_gpio_getcfg(info->vbus_pin); + s3c_gpio_cfgpin(info->vbus_pin, S3C2410_GPIO_INPUT); retval = s3c2410_gpio_getpin(info->vbus_pin); - s3c2410_gpio_cfgpin(info->vbus_pin, iocfg); + s3c_gpio_cfgpin(info->vbus_pin, iocfg); if (info->vbus_pin_inverted) retval = !retval; @@ -660,7 +660,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) info = udc->mach_info; - iocfg = s3c2410_gpio_getcfg(info->vbus_pin); + iocfg = s3c_gpio_getcfg(info->vbus_pin); s3c2410_gpio_cfgpin(info->vbus_pin, S3C2410_GPIO_INPUT); state = s3c2410_gpio_getpin(info->vbus_pin); s3c2410_gpio_cfgpin(info->vbus_pin, iocfg); @@ -1330,7 +1330,7 @@ static irqreturn_t s3c24xx_udc_vbus_irq(int irq, void *_udc) info = udc->mach_info; /* Some cpus cannot read from an line configured to IRQ! */ - cfg = s3c2410_gpio_getcfg(info->vbus_pin); + cfg = s3c_gpio_getcfg(info->vbus_pin); s3c2410_gpio_cfgpin(info->vbus_pin, S3C2410_GPIO_INPUT); value = s3c2410_gpio_getpin(info->vbus_pin); s3c2410_gpio_cfgpin(info->vbus_pin, cfg); @@ -2369,7 +2369,7 @@ static const struct usb_gadget_ops s3c_udc_ops = { static void nop_release(struct device *dev) { - pk_dbg("%s %s\n", __FUNCTION__, dev->bus_id); + pk_dbg("%s %s\n", __FUNCTION__, dev->init_name); } /* @@ -2386,7 +2386,7 @@ static struct s3c24xx_udc memory = { .ep0 = &memory.ep[0].ep, .name = DRIVER_NAME, .dev = { - .bus_id = "gadget", + .init_name = "gadget", .release = nop_release, }, }, @@ -2587,7 +2587,7 @@ static int s3c24xx_udc_probe(struct platform_device *pdev) pk_dbg("IRQ %i for the UDC\n", IRQ_USBD); if (mach_info && mach_info->vbus_pin > 0) { - udc->irq_vbus = s3c2410_gpio_getirq(mach_info->vbus_pin); + udc->irq_vbus = gpio_to_irq(mach_info->vbus_pin); retval = request_irq(udc->irq_vbus, s3c24xx_udc_vbus_irq, IRQF_DISABLED | IRQF_SHARED | diff --git a/drivers/usb/gadget/s3c2443_udc.h b/drivers/usb/gadget/s3c2443_udc.h index f22985128cff..2c1c13549ada 100644 --- a/drivers/usb/gadget/s3c2443_udc.h +++ b/drivers/usb/gadget/s3c2443_udc.h @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -48,14 +49,15 @@ #include #include #include -#include +#include +#include #include #include -#include -#include +#include +#include #include #include #include -- cgit v1.2.3