public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Allow OHCI drivers to override hub control operations
@ 2014-04-15 16:06 Laurent Pinchart
  2014-04-15 16:06 ` [PATCH v2 1/4] USB: OHCI: Export the ohci_hub_control function Laurent Pinchart
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Laurent Pinchart @ 2014-04-15 16:06 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

The PXA27x OHCI implementation doesn't perform automatic control of port power
supplies for all ports. While the PPS and LSDA bits of the HcRhPortStatus
register are implemented, only a subset of ports have an external power enable
pin controlled by the port status register. Other ports need their power supply
to be controlled manually.

In order to do so I've implemented manual regulator control in the ohci-pxa27x
driver. This requires overriding the default behaviour of the CLEAR_FEATURE
and SET_FEATURE requests for USB_PORT_FEAT_POWER with a custom hub control
operation. In turn this requires calling the currently static ohci_hub_control
function from the ohci-pxa27x driver.

The ohci-at91 and ohci-s3c2410 drivers already implement a similar feature,
and access the ohci_hub_control function by saving the struct hc_driver
hub_control value to a global variable right after calling ohci_init_driver.
This vtable-like implementation could be optimized by exporting the
ohci_hub_control function and calling it directly. As the ohci-pxa27x driver
needs to override hub control operations as well I've decided to export the
function.

For the sake of completeness I've also exported the ehci_hub_control function
and modified the ehci-tegra driver to call it directly.

As a side note regarding the ohci-at91 driver, the "atmel,vbus-gpio" DT
property should really have referenced a regulator instead of a GPIO. Fixing
this in a backward-compatible way would be messy :-(

Please not that I haven't been able to test the third and fourth patches due 
to lack of hardware. I've however tested a similar implementation for OHCI on
an out of tree PXA270 board.

Laurent Pinchart (4):
  USB: OHCI: Export the ohci_hub_control function
  USB: EHCI: Export the ehci_hub_control function
  USB: ohci-pxa27x: Add support for external vbus regulators
  ARM: pxa: zeus: Replace OHCI init/exit functions with a regulator

 arch/arm/mach-pxa/zeus.c        | 89 ++++++++++++++++++++++-------------------
 drivers/usb/host/ehci-hub.c     | 12 +-----
 drivers/usb/host/ehci-tegra.c   |  8 +---
 drivers/usb/host/ehci.h         |  3 ++
 drivers/usb/host/ohci-at91.c    |  6 +--
 drivers/usb/host/ohci-hub.c     |  4 +-
 drivers/usb/host/ohci-pxa27x.c  | 67 +++++++++++++++++++++++++++++++
 drivers/usb/host/ohci-s3c2410.c |  7 +---
 drivers/usb/host/ohci.h         |  2 +
 9 files changed, 128 insertions(+), 70 deletions(-)

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-04-15 23:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 16:06 [PATCH v2 0/4] Allow OHCI drivers to override hub control operations Laurent Pinchart
2014-04-15 16:06 ` [PATCH v2 1/4] USB: OHCI: Export the ohci_hub_control function Laurent Pinchart
2014-04-15 18:01   ` Alan Stern
2014-04-15 23:00     ` Laurent Pinchart
2014-04-15 16:06 ` [PATCH v2 2/4] USB: EHCI: Export the ehci_hub_control function Laurent Pinchart
2014-04-15 17:18   ` Stephen Warren
2014-04-15 17:57     ` Alan Stern
2014-04-15 16:06 ` [PATCH v2 3/4] USB: ohci-pxa27x: Add support for external vbus regulators Laurent Pinchart
2014-04-15 16:06 ` [PATCH v2 4/4] ARM: pxa: zeus: Replace OHCI init/exit functions with a regulator Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox