[PATCH 3/3] pch_udc: Specifies GPI port number at configuration.

From: Tomoya MORINAGA
Date: Fri Feb 03 2012 - 02:07:06 EST


Problem:
The GPIO ports used for detecting VBUS may be different
on each platform.
This should be easily modifiable.

Solution:
In configuration, GPI port number is specified.

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@xxxxxxxxx>
---
drivers/usb/gadget/Kconfig | 12 ++++++++++++
drivers/usb/gadget/pch_udc.c | 2 +-
2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 23a4473..cd0ec15 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -491,6 +491,18 @@ config USB_EG20T
ML7213/ML7831 is companion chip for Intel Atom E6xx series.
ML7213/ML7831 is completely compatible for Intel EG20T PCH.

+config USB_VBUS_GPIO_PORT
+ int "GPIO pin used for detecting VBUS"
+ depends on USB_EG20T
+ default "-1"
+ help
+ Enter the GPIO port number used for detecting VBUS state.
+ If not used, specify -1(default).
+
+ If not used, this driver does not support USB suspend state.
+ If the GPIO port number that VBUS is not connected to is specified,
+ the USB device may not work.
+
config USB_CI13XXX_MSM
tristate "MIPS USB CI13xxx for MSM"
depends on ARCH_MSM
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index 942fe92..44a86fc 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -18,7 +18,7 @@
#include <linux/gpio.h>

/* GPIO port for VBUS detecting */
-static int vbus_gpio_port = -1; /* GPIO port number (-1:Not used) */
+static int vbus_gpio_port = CONFIG_USB_VBUS_GPIO_PORT;

#define PCH_VBUS_PERIOD 3000 /* VBUS polling period (msec) */
#define PCH_VBUS_INTERVAL 10 /* VBUS polling interval (msec) */
--
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/