All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Roger Quadros <rogerq@ti.com>
Cc: <balbi@ti.com>, <tony@atomide.com>, <myungjoo.ham@samsung.com>,
	<cw00.choi@samsung.com>, <george.cherian@ti.com>,
	<nsekhar@ti.com>, <devicetree@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/5] extcon: usb: Introduce USB GPIO extcon driver. Fix DRA7 USB.
Date: Fri, 23 Jan 2015 10:19:09 -0600	[thread overview]
Message-ID: <20150123161909.GF8585@saruman.tx.rr.com> (raw)
In-Reply-To: <54C1F7C0.4020505@ti.com>

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

On Fri, Jan 23, 2015 at 09:26:56AM +0200, Roger Quadros wrote:
> Felipe,
> 
> On 22/01/15 22:29, Felipe Balbi wrote:
> > On Thu, Jan 22, 2015 at 04:57:56PM +0200, Roger Quadros wrote:
> >>
> >> On 22/01/15 15:32, Roger Quadros wrote:
> >>> Felipe,
> >>>
> >>> On 20/01/15 21:02, Felipe Balbi wrote:
> >>>> On Mon, Jan 19, 2015 at 07:52:17PM +0200, Roger Quadros wrote:
> >>>>> Hi,
> >>>>>
> >>>>> On DRA7 EVMs the USB ID pin is connected to a GPIO line. The USB drivers
> >>>>> (dwc3 + dwc3-omap) depend on extcon framework to get the USB cable state
> >>>>> (USB or USB-Host) to put the controller in the right mode.
> >>>>>
> >>>>> There were earlier attempts [1] to get this working by trying to patch up
> >>>>> the existing GPIO extcon driver.
> >>>>>
> >>>>> This series attemts to take a different approach by introducing a new
> >>>>> USB specific extcon driver to handle the USB ID GPIO pin and
> >>>>> interpret a right USB cable state.
> >>>>>
> >>>>> The reasoning to introduce this new driver is:
> >>>>> 1) The existing GPIO extcon driver doesn't understand USB cable states
> >>>>> and it can't handle more than one cable per instance.
> >>>>>    
> >>>>> For the USB case we need to handle at least 2 cable states.
> >>>>>     a) USB (attach/detach)
> >>>>>     b) USB-Host (attach/detach)
> >>>>> and could possible include more states like
> >>>>>     c) Fast-charger (attach/detach)
> >>>>>     d) Slow-charger (attach/detach)
> >>>>>     
> >>>>> 2) This USB specific driver can be easily updated in the future to
> >>>>> handle VBUS events, or charger detect events, in case it happens
> >>>>> to be available on GPIO for any platform.
> >>>>>
> >>>>> 3) The DT implementation is very easy. You just need one extcon node per USB
> >>>>> instead of one extcon node per cable state as in case of [1].
> >>>>>
> >>>>> 4) The cable state string doesn't need to be encoded in the device tree
> >>>>> as in case of [1].
> >>>>>
> >>>>> 5) With only ID event available, you can simulate a USB-peripheral attach
> >>>>> when USB-Host is detacted instead of hacking the USB driver to do the same.
> >>>>>
> >>>>> Tested on DRA7-evm and DRA72-evm.
> >>>>
> >>>> while at that, you might want to patch X15 too.
> >>>>
> >>> USB2 port is meant for peripheral use only. ID pin from USB port is not connected to GPIO.
> >>>
> >>
> >> OK answering myself here :).
> >> Peripheral mode doesn't work on x15-bb as the USB driver (dwc3-omap)
> >> doesn't set the mailbox correctly even when dwc3 node is set as otg = "peripheral".
> >>
> >> Looks like we need to implement usb-gpio-extcon for x15 even though ID is hard coded.
> > 
> > right, another option is to have dwc3-omap read the child's DTS to check
> > dr_mode and hardcode things based on that.
> > 
> I think that option is better as it doesn't require a GPIO line to be
> reserved for ID when USB is not meant for dual-role use.

yeah, let's implement that for 3.21.

-- 
balbi

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

WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: Roger Quadros <rogerq@ti.com>
Cc: balbi@ti.com, tony@atomide.com, myungjoo.ham@samsung.com,
	cw00.choi@samsung.com, george.cherian@ti.com, nsekhar@ti.com,
	devicetree@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/5] extcon: usb: Introduce USB GPIO extcon driver. Fix DRA7 USB.
Date: Fri, 23 Jan 2015 10:19:09 -0600	[thread overview]
Message-ID: <20150123161909.GF8585@saruman.tx.rr.com> (raw)
In-Reply-To: <54C1F7C0.4020505@ti.com>

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

On Fri, Jan 23, 2015 at 09:26:56AM +0200, Roger Quadros wrote:
> Felipe,
> 
> On 22/01/15 22:29, Felipe Balbi wrote:
> > On Thu, Jan 22, 2015 at 04:57:56PM +0200, Roger Quadros wrote:
> >>
> >> On 22/01/15 15:32, Roger Quadros wrote:
> >>> Felipe,
> >>>
> >>> On 20/01/15 21:02, Felipe Balbi wrote:
> >>>> On Mon, Jan 19, 2015 at 07:52:17PM +0200, Roger Quadros wrote:
> >>>>> Hi,
> >>>>>
> >>>>> On DRA7 EVMs the USB ID pin is connected to a GPIO line. The USB drivers
> >>>>> (dwc3 + dwc3-omap) depend on extcon framework to get the USB cable state
> >>>>> (USB or USB-Host) to put the controller in the right mode.
> >>>>>
> >>>>> There were earlier attempts [1] to get this working by trying to patch up
> >>>>> the existing GPIO extcon driver.
> >>>>>
> >>>>> This series attemts to take a different approach by introducing a new
> >>>>> USB specific extcon driver to handle the USB ID GPIO pin and
> >>>>> interpret a right USB cable state.
> >>>>>
> >>>>> The reasoning to introduce this new driver is:
> >>>>> 1) The existing GPIO extcon driver doesn't understand USB cable states
> >>>>> and it can't handle more than one cable per instance.
> >>>>>    
> >>>>> For the USB case we need to handle at least 2 cable states.
> >>>>>     a) USB (attach/detach)
> >>>>>     b) USB-Host (attach/detach)
> >>>>> and could possible include more states like
> >>>>>     c) Fast-charger (attach/detach)
> >>>>>     d) Slow-charger (attach/detach)
> >>>>>     
> >>>>> 2) This USB specific driver can be easily updated in the future to
> >>>>> handle VBUS events, or charger detect events, in case it happens
> >>>>> to be available on GPIO for any platform.
> >>>>>
> >>>>> 3) The DT implementation is very easy. You just need one extcon node per USB
> >>>>> instead of one extcon node per cable state as in case of [1].
> >>>>>
> >>>>> 4) The cable state string doesn't need to be encoded in the device tree
> >>>>> as in case of [1].
> >>>>>
> >>>>> 5) With only ID event available, you can simulate a USB-peripheral attach
> >>>>> when USB-Host is detacted instead of hacking the USB driver to do the same.
> >>>>>
> >>>>> Tested on DRA7-evm and DRA72-evm.
> >>>>
> >>>> while at that, you might want to patch X15 too.
> >>>>
> >>> USB2 port is meant for peripheral use only. ID pin from USB port is not connected to GPIO.
> >>>
> >>
> >> OK answering myself here :).
> >> Peripheral mode doesn't work on x15-bb as the USB driver (dwc3-omap)
> >> doesn't set the mailbox correctly even when dwc3 node is set as otg = "peripheral".
> >>
> >> Looks like we need to implement usb-gpio-extcon for x15 even though ID is hard coded.
> > 
> > right, another option is to have dwc3-omap read the child's DTS to check
> > dr_mode and hardcode things based on that.
> > 
> I think that option is better as it doesn't require a GPIO line to be
> reserved for ID when USB is not meant for dual-role use.

yeah, let's implement that for 3.21.

-- 
balbi

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

  reply	other threads:[~2015-01-23 16:19 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 17:52 [PATCH 0/5] extcon: usb: Introduce USB GPIO extcon driver. Fix DRA7 USB Roger Quadros
2015-01-19 17:52 ` Roger Quadros
2015-01-19 17:52 ` [PATCH 1/5] extcon: gpio-usb: Introduce gpio usb extcon driver Roger Quadros
2015-01-19 17:52   ` Roger Quadros
2015-01-20 19:00   ` Felipe Balbi
2015-01-20 19:00     ` Felipe Balbi
2015-01-21  5:28   ` Chanwoo Choi
2015-01-21  5:28     ` Chanwoo Choi
2015-01-22 13:27     ` Roger Quadros
2015-01-22 13:27       ` Roger Quadros
2015-01-19 17:52 ` [PATCH 2/5] usb: extcon: Fix USB-Host cable name Roger Quadros
2015-01-19 17:52   ` Roger Quadros
2015-01-20 19:01   ` Felipe Balbi
2015-01-20 19:01     ` Felipe Balbi
2015-01-19 17:52 ` [PATCH 3/5] ARM: dts: dra7-evm: Add extcon nodes for USB Roger Quadros
2015-01-19 17:52   ` Roger Quadros
2015-01-20 19:02   ` Felipe Balbi
2015-01-20 19:02     ` Felipe Balbi
2015-01-19 17:52 ` [PATCH 4/5] ARM: dts: dra72-evm: " Roger Quadros
2015-01-19 17:52   ` Roger Quadros
2015-01-20 19:02   ` Felipe Balbi
2015-01-20 19:02     ` Felipe Balbi
2015-01-19 17:52 ` [PATCH 5/5] ARM: omap2plus_defconfig: Enable PCF857X and EXTCON_GPIO_USB Roger Quadros
2015-01-19 17:52   ` Roger Quadros
2015-01-19 18:45   ` Tony Lindgren
2015-01-19 19:38     ` Tony Lindgren
2015-01-20  9:26       ` Roger Quadros
2015-01-20  9:26         ` Roger Quadros
2015-01-20 19:02 ` [PATCH 0/5] extcon: usb: Introduce USB GPIO extcon driver. Fix DRA7 USB Felipe Balbi
2015-01-20 19:02   ` Felipe Balbi
2015-01-22 13:32   ` Roger Quadros
2015-01-22 13:32     ` Roger Quadros
2015-01-22 14:57     ` Roger Quadros
2015-01-22 14:57       ` Roger Quadros
2015-01-22 20:29       ` Felipe Balbi
2015-01-22 20:29         ` Felipe Balbi
2015-01-23  7:26         ` Roger Quadros
2015-01-23  7:26           ` Roger Quadros
2015-01-23 16:19           ` Felipe Balbi [this message]
2015-01-23 16:19             ` Felipe Balbi

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=20150123161909.GF8585@saruman.tx.rr.com \
    --to=balbi@ti.com \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=george.cherian@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=nsekhar@ti.com \
    --cc=rogerq@ti.com \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.