Patchwork [U-Boot,v2,3/7] pxa27x_udc: remove call to unimplemented set_GPIO_mode()

login
register
mail settings
Submitter Mike Dunn
Date April 11, 2013, 12:45 a.m.
Message ID <1365641128-15812-4-git-send-email-mikedunn@newsguy.com>
Download mbox | patch
Permalink /patch/235525/
State Superseded
Delegated to: Marek Vasut
Headers show

Comments

Mike Dunn - April 11, 2013, 12:45 a.m.
If CONFIG_USB_DEV_PULLUP_GPIO is defined, a link error occurs because the
set_GPIO_mode() helper function is not implemented.  This function doesn't do
much except make the code a little more readable, so I just manually coded its
equivalent and removed the prototype from the header file.  It is invoked no
where else in the code.

While I was at it, I noticed that two other function prototypes in the same
header file are also neither implemented nor invoked anywhere, so I removed them
as well.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
---
 arch/arm/include/asm/arch-pxa/hardware.h |   11 -----------
 drivers/usb/gadget/pxa27x_udc.c          |    4 +++-
 2 files changed, 3 insertions(+), 12 deletions(-)
Marek Vasut - April 11, 2013, 7:16 p.m.
Dear Mike Dunn,

> If CONFIG_USB_DEV_PULLUP_GPIO is defined, a link error occurs because the
> set_GPIO_mode() helper function is not implemented.  This function doesn't
> do much except make the code a little more readable, so I just manually
> coded its equivalent and removed the prototype from the header file.  It
> is invoked no where else in the code.
> 
> While I was at it, I noticed that two other function prototypes in the same
> header file are also neither implemented nor invoked anywhere, so I removed
> them as well.
> 
> Signed-off-by: Mike Dunn <mikedunn@newsguy.com>

Reviewed-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

Patch

diff --git a/arch/arm/include/asm/arch-pxa/hardware.h b/arch/arm/include/asm/arch-pxa/hardware.h
index 44b800f..2397bce 100644
--- a/arch/arm/include/asm/arch-pxa/hardware.h
+++ b/arch/arm/include/asm/arch-pxa/hardware.h
@@ -77,17 +77,6 @@ 
 #define GPIO_FALLING_EDGE	1
 #define GPIO_RISING_EDGE	2
 #define GPIO_BOTH_EDGES		3
-extern void set_GPIO_IRQ_edge( int gpio_nr, int edge_mask );
-
-/*
- * Handy routine to set GPIO alternate functions
- */
-extern void set_GPIO_mode( int gpio_mode );
-
-/*
- * return current lclk frequency in units of 10kHz
- */
-extern unsigned int get_lclk_frequency_10khz(void);
 
 #endif
 
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 4c00081..71cc0f2 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -610,7 +610,9 @@  void udc_connect(void)
 
 #ifdef CONFIG_USB_DEV_PULLUP_GPIO
 	/* Turn on the USB connection by enabling the pullup resistor */
-	set_GPIO_mode(CONFIG_USB_DEV_PULLUP_GPIO | GPIO_OUT);
+	writel(readl(GPDR(CONFIG_USB_DEV_PULLUP_GPIO))
+		     | GPIO_bit(CONFIG_USB_DEV_PULLUP_GPIO),
+	       GPDR(CONFIG_USB_DEV_PULLUP_GPIO));
 	writel(GPIO_bit(CONFIG_USB_DEV_PULLUP_GPIO), GPSR(CONFIG_USB_DEV_PULLUP_GPIO));
 #else
 	/* Host port 2 transceiver D+ pull up enable */