linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Roger Quadros <rogerq@ti.com>, Andy Green <andy.green@linaro.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-omap@vger.kernel.org, keshava_mgowda@ti.com,
	linux-usb@vger.kernel.org, balbi@ti.com
Subject: Re: [RFC PATCH 1/5] drivers : introduce device_path api
Date: Thu, 29 Nov 2012 10:05:19 +0800	[thread overview]
Message-ID: <CACVXFVN6Dh5pwB_Pg2f0_N2iDU4oyCDusFWLMHRJmajnhDOpKQ@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1211281134240.2192-100000@iolanthe.rowland.org>

On Thu, Nov 29, 2012 at 12:43 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Wed, 28 Nov 2012, Roger Quadros wrote:
>
>> > board file:
>> >
>> >     static struct regulator myreg = {
>> >         .name = "mydevice-regulator",
>> >     };
>> >
>> >     static struct device_asset mydevice_assets[] = {
>> >         {
>> >             .name = "mydevice-regulator",
>> >             .handler = regulator_default_asset_handler,
>> >         },
>> >         { }
>> >     };
>> >
>> >     static struct platform_device mydevice = {
>> >     ...
>> >         .dev = {
>> >             .assets = mydevice_assets,
>> >         },
>> >     ...
>> >     };
>> >
>>
>> From Pandaboard's point of view, is mydevice supposed to be referring to
>> ehci-omap, LAN95xx or something else?
>
> ehci-omap.0.
>
>> Strictly speaking, the regulator doesn't belongs neither to ehci-omap
>> nor LAN95xx. It belongs to a power domain on the board. And user should
>> have control to switch it OFF when required without hampering operation
>> of ehci-omap, so that the other USB ports are still usable.
>
> That is the one disadvantage of the approach we are discussing.
>
> But what API would you use to give the user this control?  Neither the
> GPIO nor the regulator has a struct device, so you can't use sysfs
> directly.  And even if you could, it would probably be a bad idea
> because the user might turn off power to the LAN95xx while the chip was
> being used.

After Tianyu introduced the power power on/off mechanism, sometimes
one port power need to be switched off/on. Embedded system is more
power sensitive than PC, sounds we have no reason to reject applying
the mechanism on embedded world(non ACPI). Looks better to associate
the power domain thing(regulator, clock, ...) with one usb port device in
this USB problem.

>
> The natural answer is to associate the regulator with the USB port that
> the LAN95xx is connected to, so that the new port-power mechanism could
> provide the control you want.  Then how should that association be set
> up?

As I suggested in below link, the association can be set up easily with one
structure of 'struct port_power_domain'.

         http://www.spinics.net/lists/linux-omap/msg83158.html

>
> Lei Ming provided a partial answer, but his suggestion is tied to USB.

If we want to set up the association between usb port and power domain,
usb knowledge is required, at least bus info and port topology are needed.

One difficulty is the fact that the device(such as usb port) is independent
with the 'power domain', for example, the device isn't created(ports of the
root hub is created after ehci-omap probe, and port device of non-root
hub may depend on powering on the power domain) when defining the regulator
things, so could we figure out one general way in theory to describe the
associated device with the 'power domain'? Andy has tried the wildcard dev
path, and port topology string is introduced in my suggestion, looks both
are not general.

I admit the suggestion is partial because we still have not a general abstract
on 'power domain' in this problem, and once it is ready, the solution might be
in a shape at least for USB. In PC world, ACPI might do sort of something of
the 'power domain'

Maybe we need to create a new thread on this discussion and make more
guys involved(PM/USB/driver core/OMAP/....). I will study the problem further,
and hope I can post something for starting the discussion later.

> It would be better to have a more general approach.  So far nobody has

Yes, I agree. IMO, my suggestion is still in the direction to being general,
because a general 'power domain' concept is introduced in it, for example
the 'struct power_domain' is associated with 'struct port_power_domain'.

I understand the same 'power domain' concept should be applied to other
device or bus too, and the power associated with this device can be switched off
sometimes too for saving power consumption. But still looks specific
device/subsystem knowledge is required to set up the association.

Alan, so could the above be your concern on a more general approach?
Or you hope a more general way(such as, do it in driver core or dev PM core)
to associate the 'power domain' with one device(for example, usb port in
the LAN95xx problem) too? Or other things?


Thanks,
-- 
Ming Lei

  reply	other threads:[~2012-11-29  2:05 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 12:45 [RFC PATCH 0/5] Device Paths introduced and applied to generic hub and panda Andy Green
2012-11-26 12:45 ` [RFC PATCH 1/5] drivers : introduce device_path api Andy Green
2012-11-26 19:12   ` Alan Stern
     [not found]     ` <Pine.LNX.4.44L0.1211261348310.2168-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-11-26 23:26       ` Andy Green
     [not found]   ` <20121126124534.18106.44137.stgit-Ak/hGR4SqtBG2qbu2SEcwgC/G2K4zDHf@public.gmane.org>
2012-11-26 19:16     ` Greg KH
     [not found]       ` <20121126191612.GA11239-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-11-26 23:28         ` Andy Green
2012-11-26 19:22   ` Greg KH
2012-11-26 19:27     ` Greg KH
2012-11-26 21:07     ` Alan Stern
2012-11-26 22:50       ` Greg KH
     [not found]       ` <Pine.LNX.4.44L0.1211261555400.2168-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-11-27  0:02         ` Andy Green
     [not found]           ` <50B40320.2020206-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-27 16:37             ` Alan Stern
2012-11-27 17:44               ` Andy Green
     [not found]                 ` <50B4FBE9.5080301-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-27 18:09                   ` Alan Stern
     [not found]                     ` <Pine.LNX.4.44L0.1211271253230.1489-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-11-27 19:22                       ` Andy Green
2012-11-27 20:10                         ` Alan Stern
     [not found]                           ` <Pine.LNX.4.44L0.1211271446430.1489-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-11-28  2:30                             ` Andy Green
     [not found]                         ` <50B51313.2060003-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-28 11:13                           ` Roger Quadros
2012-11-28 11:47                             ` Andy Green
2012-11-28 12:45                               ` Roger Quadros
2012-11-28 16:43                             ` Alan Stern
2012-11-29  2:05                               ` Ming Lei [this message]
2012-11-29 17:05                                 ` Alan Stern
2012-11-27  3:41       ` Ming Lei
2012-11-27 16:30         ` Alan Stern
     [not found]           ` <Pine.LNX.4.44L0.1211271119380.1489-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-11-27 17:02             ` Greg KH
2012-12-01  7:49               ` Jassi Brar
2012-12-01  8:37                 ` Andy Green
     [not found]                   ` <50B9C1B0.3080605-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-12-01 18:08                     ` Jassi Brar
     [not found]                 ` <CABb+yY3TC3z+jRU91KGX+FKLtJ3ZXUp55-wM_KjxiYuVZ+LL+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-05 14:09                   ` Roger Quadros
     [not found]                     ` <50BF55B3.1030205-l0cyMroinI0@public.gmane.org>
2012-12-06 14:34                       ` Jassi Brar
2012-12-10  9:48                         ` Roger Quadros
     [not found]                           ` <50C5B003.9060904-l0cyMroinI0@public.gmane.org>
2012-12-10 14:36                             ` Felipe Balbi
2012-12-11  9:12                           ` Jassi Brar
     [not found]                             ` <CABb+yY3u2QB0JqXrznDGHXqH3crkYk54whC0GTwkBHqjdEzhbg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-11 10:01                               ` Roger Quadros
     [not found]                                 ` <50C70495.40500-l0cyMroinI0@public.gmane.org>
2012-12-11 10:09                                   ` Felipe Balbi
2012-11-27 17:22           ` Ming Lei
2012-11-27 17:55             ` Andy Green
     [not found]               ` <50B4FE7D.9030505-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2012-11-27 23:06                 ` Ming Lei
2012-11-28  1:16                   ` Ming Lei
2012-11-26 23:47     ` Andy Green
     [not found] ` <20121126123427.18106.4112.stgit-Ak/hGR4SqtBG2qbu2SEcwgC/G2K4zDHf@public.gmane.org>
2012-11-26 12:45   ` [RFC PATCH 2/5] usb: omap ehci: remove all regulator control from ehci omap Andy Green
2012-11-26 12:45 ` [RFC PATCH 3/5] usb: hub: add device_path regulator control to generic hub Andy Green
2012-11-26 19:23   ` Greg KH
2012-11-26 12:45 ` [RFC PATCH 4/5] omap4: panda: add smsc95xx regulator and reset dependent on root hub Andy Green
2012-11-26 16:20   ` Roger Quadros
2012-11-27  0:17     ` Andy Green
2012-11-26 12:45 ` [RFC PATCH 5/5] config omap2plus add ehci bits Andy Green

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=CACVXFVN6Dh5pwB_Pg2f0_N2iDU4oyCDusFWLMHRJmajnhDOpKQ@mail.gmail.com \
    --to=tom.leiming@gmail.com \
    --cc=andy.green@linaro.org \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keshava_mgowda@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rogerq@ti.com \
    --cc=stern@rowland.harvard.edu \
    /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).