public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/4] USB: ohci-pxa27x: Add support for external vbus regulators
Date: Wed, 16 Apr 2014 17:40:43 +0200	[thread overview]
Message-ID: <3809376.jpq2vXsk1Y@avalon> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1404161102020.1334-100000@iolanthe.rowland.org>

Hi Alan,

On Wednesday 16 April 2014 11:07:34 Alan Stern wrote:
> On Wed, 16 Apr 2014, Laurent Pinchart wrote:
> > Override the hub control operation to enable and disable external
> > regulators for the ports vbus power supply in response to clear/set
> > USB_PORT_FEAT_POWER requests.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> > @@ -417,6 +467,16 @@ int usb_hcd_pxa27x_probe (const struct hc_driver
> > *driver, struct platform_device> 
> >  	pxa_ohci->clk = usb_clk;
> >  	pxa_ohci->mmio_base = (void __iomem *)hcd->regs;
> > 
> > +	for (i = 0; i < 3; ++i) {
> > +		char name[6];
> > +
> > +		if (!(inf->flags & (ENABLE_PORT1 << i)))
> > +			continue;
> > +
> > +		sprintf(name, "vbus%u", i + 1);
> > +		pxa_ohci->vbus[i] = devm_regulator_get(&pdev->dev, name);
> > +	}
> > +
> > 
> >  	retval = pxa27x_start_hc(pxa_ohci, &pdev->dev);
> >  	if (retval < 0) {
> >  	
> >  		pr_debug("pxa27x_start_hc failed");
> > 
> > @@ -462,6 +522,10 @@ int usb_hcd_pxa27x_probe (const struct hc_driver
> > *driver, struct platform_device> 
> >  void usb_hcd_pxa27x_remove (struct usb_hcd *hcd, struct platform_device
> >  *pdev) {
> >  
> >  	struct pxa27x_ohci *pxa_ohci = to_pxa27x_ohci(hcd);
> > 
> > +	unsigned int i;
> > +
> > +	for (i = 0; i < 3; ++i)
> > +		pxa27x_ohci_set_vbus_power(pxa_ohci, i, false);
> > 
> >  	usb_remove_hcd(hcd);
> >  	pxa27x_stop_hc(pxa_ohci, &pdev->dev);
> 
> You probably should leave the port power enabled until after
> usb_remove_hcd() returns.  Apart from that,
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Good point, I'll fix that and submit v4. Thank you.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2014-04-16 15:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 13:16 [PATCH v3 0/4] Allow OHCI/EHCI drivers to override more hub operations Laurent Pinchart
2014-04-16 13:16 ` [PATCH v3 1/4] USB: OHCI: Export the OHCI hub control and status_data functions Laurent Pinchart
2014-04-16 13:16 ` [PATCH v3 2/4] USB: EHCI: Export the ehci_hub_control function Laurent Pinchart
2014-04-16 13:16 ` [PATCH v3 3/4] USB: ohci-pxa27x: Add support for external vbus regulators Laurent Pinchart
2014-04-16 15:07   ` Alan Stern
2014-04-16 15:40     ` Laurent Pinchart [this message]
2014-04-16 13:16 ` [PATCH v3 4/4] ARM: pxa: zeus: Replace OHCI init/exit functions with a regulator Laurent Pinchart
2014-04-16 15:01 ` [PATCH v3 0/4] Allow OHCI/EHCI drivers to override more hub operations Alan Stern

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=3809376.jpq2vXsk1Y@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.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