linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomoya MORINAGA <tomoya.rohm@gmail.com>
To: Felipe Balbi <balbi@ti.com>, Greg Kroah-Hartman <gregkh@suse.de>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: qi.wang@intel.com, yong.y.wang@intel.com, joel.clark@intel.com,
	kok.howg.ewe@intel.com, Tomoya MORINAGA <tomoya.rohm@gmail.com>
Subject: [PATCH 3/3] pch_udc: Specifies GPI port number at configuration.
Date: Fri,  3 Feb 2012 16:14:19 +0900	[thread overview]
Message-ID: <1328253259-9343-3-git-send-email-tomoya.rohm@gmail.com> (raw)
In-Reply-To: <1328253259-9343-1-git-send-email-tomoya.rohm@gmail.com>

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@gmail.com>
---
 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


  parent reply	other threads:[~2012-02-03  7:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03  7:14 [PATCH 1/3] pch_udc: Detecting VBUS through GPIO Tomoya MORINAGA
2012-02-03  7:14 ` [PATCH 2/3] pch_udc: Detecting VBUS through GPIO with interrupt Tomoya MORINAGA
2012-02-09  7:58   ` Felipe Balbi
2012-02-09  7:59   ` Felipe Balbi
2012-02-03  7:14 ` Tomoya MORINAGA [this message]
2012-02-03 10:50   ` [PATCH 3/3] pch_udc: Specifies GPI port number at configuration Sergei Shtylyov
2012-02-09  7:56     ` Felipe Balbi
2012-02-21  0:27     ` Tomoya MORINAGA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328253259-9343-3-git-send-email-tomoya.rohm@gmail.com \
    --to=tomoya.rohm@gmail.com \
    --cc=balbi@ti.com \
    --cc=gregkh@suse.de \
    --cc=joel.clark@intel.com \
    --cc=kok.howg.ewe@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=qi.wang@intel.com \
    --cc=yong.y.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).