Replace platform dependent code in drivers/usb/gadget/pxa2xx_udc.c
with function calls and create these functions in asm/arch-pxa/udc.h.
Patch against linux-2.6.19-rc6
Signed-off-by: Milan Svoboda <[EMAIL PROTECTED]>
---
diff -uprN -X orig/Documentation/dontdiff orig/drivers/usb/gadget/pxa2xx_udc.c
usb_device_step/drivers/usb/gadget/pxa2xx_udc.c
--- orig/drivers/usb/gadget/pxa2xx_udc.c 2006-11-27 12:27:20.000000000
+0000
+++ usb_device_step/drivers/usb/gadget/pxa2xx_udc.c 2006-11-28
09:34:15.000000000 +0000
@@ -2545,15 +2545,13 @@ static int __init pxa2xx_udc_probe(struc
dev->dev = &pdev->dev;
dev->mach = pdev->dev.platform_data;
if (dev->mach->gpio_vbus) {
- vbus_irq = IRQ_GPIO(dev->mach->gpio_vbus & GPIO_MD_MASK_NR);
- pxa_gpio_mode((dev->mach->gpio_vbus & GPIO_MD_MASK_NR)
- | GPIO_IN);
+ pxa_gpio_init_vbus(dev->mach->gpio_vbus);
+ vbus_irq = pxa_gpio_to_irq(dev->mach->gpio_vbus);
set_irq_type(vbus_irq, IRQT_BOTHEDGE);
} else
vbus_irq = 0;
if (dev->mach->gpio_pullup)
- pxa_gpio_mode((dev->mach->gpio_pullup & GPIO_MD_MASK_NR)
- | GPIO_OUT | GPIO_DFLT_LOW);
+ pxa_gpio_init_pullup(dev->mach->gpio_pullup);
init_timer(&dev->timer);
dev->timer.function = udc_watchdog;
diff -uprN -X orig/Documentation/dontdiff orig/include/asm-arm/arch-pxa/udc.h
usb_device_step/include/asm-arm/arch-pxa/udc.h
--- orig/include/asm-arm/arch-pxa/udc.h 2006-11-28 09:34:44.000000000 +0000
+++ usb_device_step/include/asm-arm/arch-pxa/udc.h 2006-11-28
09:31:03.000000000 +0000
@@ -24,6 +24,21 @@ struct pxa2xx_udc_mach_info {
extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info);
+static inline int pxa_gpio_to_irq(unsigned gpio)
+{
+ return IRQ_GPIO(gpio & GPIO_MD_MASK_NR);
+}
+
+static inline void pxa_gpio_init_vbus(unsigned gpio)
+{
+ pxa_gpio_mode((gpio & GPIO_MD_MASK_NR) | GPIO_IN);
+}
+
+static inline void pxa_gpio_init_pullup(unsigned gpio)
+{
+ pxa_gpio_mode((gpio & GPIO_MD_MASK_NR) | GPIO_OUT | GPIO_DFLT_LOW);
+}
+
static inline int pxa_gpio_get(unsigned gpio)
{
return (GPLR(gpio) & GPIO_bit(gpio)) != 0;
@@ -38,4 +53,3 @@ static inline void pxa_gpio_set(unsigned
else
GPCR(gpio) = mask;
}
-
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel