linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Alan Stern
	<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Cc: Lan Tianyu <tianyu.lan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Sarah Sharp
	<sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Oliver Neukum <oneukum-l3A5Bk7waGM@public.gmane.org>,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [RFC PATCH 0/5] USB: prepare for support port power off on non-ACPI device
Date: Sun,  2 Dec 2012 23:01:02 +0800	[thread overview]
Message-ID: <1354460467-28006-1-git-send-email-tom.leiming@gmail.com> (raw)

Hi,

This patch set trys to prepare for support of usb port power
off mechanism on non-ACPI devices. The port power off mechasnism
has been discussed for some time[1][2], and support for ACPI
devices has been in shape:

	- usb port device is introduced
	- port connect type is introduced and set via ACPI
	- usb root port power can be switched on/off via ACPI

The above has been merged to upstream, and Tianyu is pushing
patches[3] to enable auto port power feature.

So it is time to discuss how to support it for non-ACPI usb
devices, and there are many embedded system in which some of
usb devices are hardwired(often self-powered) into board, such as,
beagle board, pandaboard, Arndaleboard, etc. So powering on/off
these devices may involve platform dependent way, just like
ACPI power control is used in Tianyu's patch. 

This patch set introduces power controller to hide the power
switch implementation detail to usb subsytem, in theroy it can
be used to other devices and subsystem, and the power controller
instance is stored as device's resource. So the power controller
can be used to power on/off the power supply from the usb port,
and makes support of port power off possible on non-ACPI devices.

Associating power controller with one device(such as usb port)
which providing power logically is not an easy thing, because
platform dependent knowledge(port topology, hardware power domain
on the port, ...) has to be applied and the usb port device isn't
a platform device and it is created during hub probe(). So looks
there is no general approach to do it. This patchset introduces
one global device ADD/DEL notifier in driver core, so when a new
device is added, one match function in platform code is called to
check if the device can be associated with the power controller.
This patchset implements the match function on OMAP4 based Pandaboard,
and defines the power controller to control power for lan95xx hub
and ethernet device.

Another idea of associating power controller with port device
is by introducing usb port driver, and move all this port power
control stuff from platform code to port driver, which is just
what I think of and looks doable. I'd like to get some feedback
about which one is better, then I can do it in next cycle.

Also the two things on Pandaboard have been done at the same time:

	- powering on the two devices can be delayed to the ehci-omap
	root hub probing.

	- the regulatores which are used for these two hardwired and
	self-powered devices are moved out from ehci-omap driver

In fact, Andy Green has been working[4][5] on the above two things,
but which isn't the main purpose of these patches, and they might be
seen as byproduct of the patchset. Inevitably, there are some overlap
between Andy's work and this patchset, hope we can compare, discuss
and figure out the perfect solution.

 arch/arm/mach-omap2/board-omap4panda.c |   99 +++++++++++++++++++++++++++-
 drivers/base/core.c                    |   21 ++++++
 drivers/base/power/Makefile            |    1 +
 drivers/base/power/power_controller.c  |  110 ++++++++++++++++++++++++++++++++
 drivers/usb/core/hub.c                 |   31 ++++++++-
 drivers/usb/host/ehci-omap.c           |   36 -----------
 include/linux/device.h                 |   13 ++++
 include/linux/power_controller.h       |   48 ++++++++++++++
 include/linux/usb/port.h               |   16 +++++
 kernel/power/Kconfig                   |    6 ++
 10 files changed, 339 insertions(+), 42 deletions(-)

Thanks,
--
Ming Lei


[1], http://marc.info/?t=134818354900003&r=1&w=2
[2], http://marc.info/?t=134303384500003&r=1&w=2
[3], http://marc.info/?l=linux-usb&m=135314427413307&w=2
[4], http://marc.info/?t=135393394700003&r=1&w=2
[5], http://www.spinics.net/lists/linux-omap/msg83191.html


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2012-12-02 15:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-02 15:01 Ming Lei [this message]
2012-12-02 15:01 ` [RFC PATCH 1/5] Device Power: introduce power controller Ming Lei
     [not found]   ` <1354460467-28006-2-git-send-email-tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-02 16:02     ` Andy Green
2012-12-03  3:00       ` Ming Lei
2012-12-05 16:49         ` Roger Quadros
2012-12-06  1:27           ` Ming Lei
2012-12-06  3:46             ` Jassi Brar
2012-12-06 13:18               ` Ming Lei
     [not found]                 ` <CACVXFVMKYAANsNJKBZ90ThaJ7KNOTzpyvARGnNcHsVVczxyO4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-06 14:50                   ` Jassi Brar
2012-12-02 15:01 ` [RFC PATCH 2/5] driver core: introduce global device ADD/DEL notifier Ming Lei
2012-12-02 16:13   ` Andy Green
2012-12-03  3:13     ` Ming Lei
     [not found] ` <1354460467-28006-1-git-send-email-tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-02 15:01   ` [RFC PATCH 3/5] USB: hub: apply power controller on usb port Ming Lei
2012-12-02 15:01 ` [RFC PATCH 4/5] arm: omap2: support port power on lan95xx devices Ming Lei
     [not found]   ` <1354460467-28006-5-git-send-email-tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-02 16:37     ` Andy Green
2012-12-03  4:11       ` Ming Lei
2012-12-03  4:52         ` Andy Green
2012-12-03 17:09           ` Alan Stern
2012-12-04  3:06             ` Ming Lei
2012-12-04  3:40             ` Andy Green
2012-12-04 17:10               ` Alan Stern
2012-12-05  7:32                 ` Andy Green
2012-12-05 16:42                   ` Alan Stern
2012-12-06  0:05                     ` Andy Green
2012-12-06 15:25                       ` Alan Stern
     [not found]                 ` <Pine.LNX.4.44L0.1212041150430.1800-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-12-06  1:00                   ` Rafael J. Wysocki
2012-12-04 18:14               ` Sarah Sharp
2012-12-05  7:33                 ` Andy Green
2012-12-04  2:39           ` Ming Lei
     [not found]             ` <CACVXFVO-Xktswog9Zx16zo-pmx9fTh0F3BYC-3q6Zn2SPCqdGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-04  4:02               ` Andy Green
2012-12-05 17:16   ` Tony Lindgren
2012-12-02 15:01 ` [RFC PATCH 5/5] usb: omap ehci: remove all regulator control from ehci omap Ming Lei

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=1354460467-28006-1-git-send-email-tom.leiming@gmail.com \
    --to=tom.leiming-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oneukum-l3A5Bk7waGM@public.gmane.org \
    --cc=rjw-KKrjLPT3xs0@public.gmane.org \
    --cc=sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
    --cc=tianyu.lan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).