public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: zhangfei <zhangfei.gao@linaro.org>
Cc: <balbi@ti.com>, Kishon Vijay Abraham I <kishon@ti.com>,
	<mark.rutland@arm.com>, Peter Chen <peter.chen@freescale.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	"dan . zhao" <dan.zhao@hisilicon.com>,
	Wangbinghui <wangbinghui@hisilicon.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-usb@vger.kernel.org>,
	Roger Quadros <rogerq@ti.com>
Subject: Re: [PATCH v4 4/4] phy: add phy-hi6220-usb
Date: Wed, 25 Feb 2015 10:32:04 -0600	[thread overview]
Message-ID: <20150225163204.GA11136@saruman.tx.rr.com> (raw)
In-Reply-To: <54EDCE04.3040404@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 2230 bytes --]

On Wed, Feb 25, 2015 at 09:28:36PM +0800, zhangfei wrote:
> >>>>>>>>+static void hi6220_detect_work(struct work_struct *work)
> >>>>>>>>+{
> >>>>>>>>+	struct hi6220_priv *priv =
> >>>>>>>>+		container_of(work, struct hi6220_priv, work.work);
> >>>>>>>>+	int gpio_id, gpio_vbus;
> >>>>>>>>+	enum usb_otg_state state;
> >>>>>>>>+
> >>>>>>>>+	if (!gpio_is_valid(priv->gpio_id) || !gpio_is_valid(priv->gpio_vbus))
> >>>>>>>>+		return;
> >>>>>>>>+
> >>>>>>>>+	gpio_id = gpio_get_value_cansleep(priv->gpio_id);
> >>>>>>>>+	gpio_vbus = gpio_get_value_cansleep(priv->gpio_vbus);
> >>>>>>>
> >>>>>>>looks like this should be using extcon
> >>>>>>Not used extcon before.
> >>>>>>However, we need gpio_vbus interrupt.
> >>>>>>Checked phy-tahvo.c and phy-omap-otg.c, not find extcon related with
> >>>>>>interrupt.
> >>>>>>Will investigate tomorrow.
> >>>>>
> >>>>>drivers/extcon/extcon-gpio.c
> >>>>I think there is no need to use extcon, gpio is clear enough.
> >>>>extcon-gpio.c even do not support dt.
> >>>
> >>>well, add DT. The whole idea of free software is that we improve on
> >>>things we already have. EXTCON is *the* API to handle such things.
> >>
> >>I think I am still not understanding extcon-gpio, not sure why need
> >>use this API here.
> >
> >because extcon is the API to use for external connectors. The same way
> >you use regulator framework to control that single GPIO tied to an
> >enable signal of a fixed regulator, you use extcon when you need to read
> >that gpio signal tied to id pin of the USB connector.
> >
> >>Here two gpio requires, one gpio as interrupt, in the interrupt
> >>handler, we detect the gpio status judging the otg status.
> >>extcon-gpio.c use the interrupt, then can we also use the gpio
> >>interrupt.  Using extcon-gpio is used for saving gpio_request?
> >
> >extcon is used to hide gpio_request from dwc2. dwc2 only knows about
> >extcon, not gpios. extcon will request the gpio and use it as interrupt
> >source. When an IRQ fires, it will read the gpio state and decide if it
> >should broadcast a message to tell dwc2 to become host or peripheral.
> 
> Thanks for the kind education, understand now.

hey, no problem ;-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-02-25 16:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  7:37 [PATCH v4 0/4] add usb support for hi6220 Zhangfei Gao
2015-02-12  7:37 ` [PATCH v4 1/4] Documentation: dt-bindings: add dt binding info for hi6220 dwc2 Zhangfei Gao
2015-02-12  7:37 ` [PATCH v4 2/4] Documentation: dt-bindings: add dt binding info for hi6220 Zhangfei Gao
2015-02-12  7:37 ` [PATCH v4 3/4] usb: dwc2: platform: add hi6220 support Zhangfei Gao
2015-02-12  7:37 ` [PATCH v4 4/4] phy: add phy-hi6220-usb Zhangfei Gao
2015-02-18  5:35   ` Kishon Vijay Abraham I
2015-02-18  5:44     ` zhangfei
2015-02-18 14:35       ` Felipe Balbi
2015-02-20  3:07         ` zhangfei
2015-02-20  4:38           ` Felipe Balbi
2015-02-20 10:27             ` zhangfei
2015-02-20 14:41   ` Felipe Balbi
2015-02-20 15:44     ` zhangfei
2015-02-20 16:06       ` Felipe Balbi
2015-02-21 15:03         ` zhangfei
2015-02-21 16:21           ` Felipe Balbi
2015-02-22  3:10             ` zhangfei
2015-02-23 15:36               ` Felipe Balbi
2015-02-25 13:28                 ` zhangfei
2015-02-25 16:32                   ` Felipe Balbi [this message]
2015-02-24 10:13               ` Roger Quadros
2015-02-26  8:48                 ` zhangfei
2015-02-26  9:36                   ` Roger Quadros
2015-02-27  2:07                   ` Peter Chen

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=20150225163204.GA11136@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=dan.zhao@hisilicon.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peter.chen@freescale.com \
    --cc=rogerq@ti.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=wangbinghui@hisilicon.com \
    --cc=zhangfei.gao@linaro.org \
    /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