From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 0/4] Allow OHCI/EHCI drivers to override more hub operations
Date: Wed, 16 Apr 2014 15:16:51 +0200 [thread overview]
Message-ID: <1397654215-23699-1-git-send-email-laurent.pinchart@ideasonboard.com> (raw)
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 and ohci_hub_status_data functions by saving
the struct hc_driver hub_control and hub_status_data values to a variables
right after calling ohci_init_driver. This vtable-like implementation can be
optimized by exporting the ohci_hub_control and ohci_hub_status_data functions
and calling them directly. As the ohci-pxa27x driver needs to override hub
control operations as well I've decided to export the functions.
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 note 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.
Changes compared to v2:
- Export ohci_hub_status_data()
- Call ohci_hub_status_data() directly from ohci-at91 and ohci-s3c2410
Changes compared to v1:
- Export ehci_hub_control()
- Call ehci_hub_control() directly from ehci-tegra
- Call ohci_hub_control() directly from ohci-at91
Laurent Pinchart (4):
USB: OHCI: Export the OHCI hub control and status_data functions
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 | 11 +----
drivers/usb/host/ohci-hub.c | 8 ++--
drivers/usb/host/ohci-pxa27x.c | 67 +++++++++++++++++++++++++++++++
drivers/usb/host/ohci-s3c2410.c | 13 ++----
drivers/usb/host/ohci.h | 3 ++
9 files changed, 133 insertions(+), 81 deletions(-)
--
Regards,
Laurent Pinchart
next reply other threads:[~2014-04-16 13:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 13:16 Laurent Pinchart [this message]
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
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=1397654215-23699-1-git-send-email-laurent.pinchart@ideasonboard.com \
--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