aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-19 16:18:39 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-19 16:18:39 -0500
commit59b8175c771040afcd4ad67022b0cc80c216b866 (patch)
tree4ef5935bee1e342716d49b9d4b99e3fa835526e6 /drivers/usb/gadget
parent920841d8d1d61bc12b43f95a579a5374f6d98f81 (diff)
parent3b0eb4a195a124567cd0dd6f700f8388def542c6 (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (117 commits) [ARM] 4058/2: iop32x: set ->broken_parity_status on n2100 onboard r8169 ports [ARM] 4140/1: AACI stability add ac97 timeout and retries [ARM] 4139/1: AACI record support [ARM] 4138/1: AACI: multiple channel support for IRQ handling [ARM] 4211/1: Provide a defconfig for ns9xxx [ARM] 4210/1: base for new machine type "NetSilicon NS9360" [ARM] 4222/1: S3C2443: Remove reference to missing S3C2443_PM [ARM] 4221/1: S3C2443: DMA support [ARM] 4220/1: S3C24XX: DMA system initialised from sysdev [ARM] 4219/1: S3C2443: DMA source definitions [ARM] 4218/1: S3C2412: fix CONFIG_CPU_S3C2412_ONLY wrt to S3C2443 [ARM] 4217/1: S3C24XX: remove the dma channel show at startup [ARM] 4090/2: avoid clash between PXA and SA1111 defines [ARM] 4216/1: add .gitignore entries for ARM specific files [ARM] 4214/2: S3C2410: Add Armzone QT2410 [ARM] 4215/1: s3c2410 usb device: per-platform vbus_draw [ARM] 4213/1: S3C2410 - Update definition of ADCTSC_XY_PST [ARM] 4098/1: ARM: rtc_lock only used with rtc_cmos [ARM] 4137/1: Add kexec support [ARM] 4201/1: SMP barriers pair needed for the secondary boot process ... Fix up conflict due to typedef removal in sound/arm/aaci.h
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/at91_udc.c4
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.c16
-rw-r--r--drivers/usb/gadget/pxa2xx_udc.h15
3 files changed, 9 insertions, 26 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 82369c4729b5..a4677802fb20 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -912,7 +912,7 @@ static void pullup(struct at91_udc *udc, int is_on)
912 at91_udp_write(udc, AT91_UDP_TXVC, 0); 912 at91_udp_write(udc, AT91_UDP_TXVC, 0);
913 if (cpu_is_at91rm9200()) 913 if (cpu_is_at91rm9200())
914 at91_set_gpio_value(udc->board.pullup_pin, 1); 914 at91_set_gpio_value(udc->board.pullup_pin, 1);
915 else if (cpu_is_at91sam9260()) { 915 else if (cpu_is_at91sam9260() || cpu_is_at91sam9263()) {
916 u32 txvc = at91_udp_read(udc, AT91_UDP_TXVC); 916 u32 txvc = at91_udp_read(udc, AT91_UDP_TXVC);
917 917
918 txvc |= AT91_UDP_TXVC_PUON; 918 txvc |= AT91_UDP_TXVC_PUON;
@@ -929,7 +929,7 @@ static void pullup(struct at91_udc *udc, int is_on)
929 at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); 929 at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);
930 if (cpu_is_at91rm9200()) 930 if (cpu_is_at91rm9200())
931 at91_set_gpio_value(udc->board.pullup_pin, 0); 931 at91_set_gpio_value(udc->board.pullup_pin, 0);
932 else if (cpu_is_at91sam9260()) { 932 else if (cpu_is_at91sam9260() || cpu_is_at91sam9263()) {
933 u32 txvc = at91_udp_read(udc, AT91_UDP_TXVC); 933 u32 txvc = at91_udp_read(udc, AT91_UDP_TXVC);
934 934
935 txvc &= ~AT91_UDP_TXVC_PUON; 935 txvc &= ~AT91_UDP_TXVC_PUON;
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c
index 27904a56494b..f01890dc8751 100644
--- a/drivers/usb/gadget/pxa2xx_udc.c
+++ b/drivers/usb/gadget/pxa2xx_udc.c
@@ -155,7 +155,7 @@ static int is_vbus_present(void)
155 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 155 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
156 156
157 if (mach->gpio_vbus) 157 if (mach->gpio_vbus)
158 return pxa_gpio_get(mach->gpio_vbus); 158 return udc_gpio_get(mach->gpio_vbus);
159 if (mach->udc_is_connected) 159 if (mach->udc_is_connected)
160 return mach->udc_is_connected(); 160 return mach->udc_is_connected();
161 return 1; 161 return 1;
@@ -167,7 +167,7 @@ static void pullup_off(void)
167 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 167 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
168 168
169 if (mach->gpio_pullup) 169 if (mach->gpio_pullup)
170 pxa_gpio_set(mach->gpio_pullup, 0); 170 udc_gpio_set(mach->gpio_pullup, 0);
171 else if (mach->udc_command) 171 else if (mach->udc_command)
172 mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT); 172 mach->udc_command(PXA2XX_UDC_CMD_DISCONNECT);
173} 173}
@@ -177,7 +177,7 @@ static void pullup_on(void)
177 struct pxa2xx_udc_mach_info *mach = the_controller->mach; 177 struct pxa2xx_udc_mach_info *mach = the_controller->mach;
178 178
179 if (mach->gpio_pullup) 179 if (mach->gpio_pullup)
180 pxa_gpio_set(mach->gpio_pullup, 1); 180 udc_gpio_set(mach->gpio_pullup, 1);
181 else if (mach->udc_command) 181 else if (mach->udc_command)
182 mach->udc_command(PXA2XX_UDC_CMD_CONNECT); 182 mach->udc_command(PXA2XX_UDC_CMD_CONNECT);
183} 183}
@@ -1755,7 +1755,7 @@ lubbock_vbus_irq(int irq, void *_dev)
1755static irqreturn_t udc_vbus_irq(int irq, void *_dev) 1755static irqreturn_t udc_vbus_irq(int irq, void *_dev)
1756{ 1756{
1757 struct pxa2xx_udc *dev = _dev; 1757 struct pxa2xx_udc *dev = _dev;
1758 int vbus = pxa_gpio_get(dev->mach->gpio_vbus); 1758 int vbus = udc_gpio_get(dev->mach->gpio_vbus);
1759 1759
1760 pxa2xx_udc_vbus_session(&dev->gadget, vbus); 1760 pxa2xx_udc_vbus_session(&dev->gadget, vbus);
1761 return IRQ_HANDLED; 1761 return IRQ_HANDLED;
@@ -2545,15 +2545,13 @@ static int __init pxa2xx_udc_probe(struct platform_device *pdev)
2545 dev->dev = &pdev->dev; 2545 dev->dev = &pdev->dev;
2546 dev->mach = pdev->dev.platform_data; 2546 dev->mach = pdev->dev.platform_data;
2547 if (dev->mach->gpio_vbus) { 2547 if (dev->mach->gpio_vbus) {
2548 vbus_irq = IRQ_GPIO(dev->mach->gpio_vbus & GPIO_MD_MASK_NR); 2548 udc_gpio_init_vbus(dev->mach->gpio_vbus);
2549 pxa_gpio_mode((dev->mach->gpio_vbus & GPIO_MD_MASK_NR) 2549 vbus_irq = udc_gpio_to_irq(dev->mach->gpio_vbus);
2550 | GPIO_IN);
2551 set_irq_type(vbus_irq, IRQT_BOTHEDGE); 2550 set_irq_type(vbus_irq, IRQT_BOTHEDGE);
2552 } else 2551 } else
2553 vbus_irq = 0; 2552 vbus_irq = 0;
2554 if (dev->mach->gpio_pullup) 2553 if (dev->mach->gpio_pullup)
2555 pxa_gpio_mode((dev->mach->gpio_pullup & GPIO_MD_MASK_NR) 2554 udc_gpio_init_pullup(dev->mach->gpio_pullup);
2556 | GPIO_OUT | GPIO_DFLT_LOW);
2557 2555
2558 init_timer(&dev->timer); 2556 init_timer(&dev->timer);
2559 dev->timer.function = udc_watchdog; 2557 dev->timer.function = udc_watchdog;
diff --git a/drivers/usb/gadget/pxa2xx_udc.h b/drivers/usb/gadget/pxa2xx_udc.h
index 8e598c8bf4e3..773e549aff3f 100644
--- a/drivers/usb/gadget/pxa2xx_udc.h
+++ b/drivers/usb/gadget/pxa2xx_udc.h
@@ -177,21 +177,6 @@ struct pxa2xx_udc {
177 177
178static struct pxa2xx_udc *the_controller; 178static struct pxa2xx_udc *the_controller;
179 179
180static inline int pxa_gpio_get(unsigned gpio)
181{
182 return (GPLR(gpio) & GPIO_bit(gpio)) != 0;
183}
184
185static inline void pxa_gpio_set(unsigned gpio, int is_on)
186{
187 int mask = GPIO_bit(gpio);
188
189 if (is_on)
190 GPSR(gpio) = mask;
191 else
192 GPCR(gpio) = mask;
193}
194
195/*-------------------------------------------------------------------------*/ 180/*-------------------------------------------------------------------------*/
196 181
197/* 182/*