Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1427570
| From | Heiko Stübner <heiko@sntech.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy |
| Date | 2016-06-21 12:30 +0200 |
| Message-ID | <rMqam-3Th-31@gated-at.bofh.it> (permalink) |
| References | <rKRy1-ov-5@gated-at.bofh.it> <rLZWy-45v-19@gated-at.bofh.it> <rMoUW-3cQ-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Frank, Am Dienstag, 21. Juni 2016, 15:52:45 schrieb Frank Wang: > On 2016/6/20 12:56, Guenter Roeck wrote: > > On Sun, Jun 19, 2016 at 8:32 PM, Frank Wang <frank.wang@rock-chips.com> wrote: > >>> Turns out my problem was one of terminology. Using "suspend" and > >>> "resume" to me suggested the common use of suspend and resume > >>> functions. That is not the case here. After mentally replacing > >>> "suspend" with "power_off" and "resume" with "power_on", you are > >>> right, no problem exists. Sorry for the noise. > >>> > >>> Maybe it would be useful to replace "resume" with "power_on" and > >>> "suspend" with "power_off" in the function and variable names to > >>> reduce confusion and misunderstandings. > >>> > >>> Thanks, > >>> Guenter > >> > >> Well, it does have a bits confusion, however, the phy-port always just > >> goes > >> to suspend and resume mode (Not power off and power on) in a fact. So > >> must > >> it be renamed? > > > > Other phy drivers name the functions _power_off and _power_on and > > avoid the confusion. The callbacks are named .power_off and .power_on, > > which gives a clear indication of its intended purpose. Other drivers > > implementing suspend/resume (such as the omap usb phy driver) tie > > those functions not into the power_off/power_on callbacks, but into > > the driver's suspend/resume callbacks. At least the omap driver has > > separate power management functions. > > > > Do the functions _have_ to be renamed ? Surely not. But, if the > > functions are really suspend/resume functions and not > > power_off/power_on functions, maybe they should tie to the > > suspend/resume functions and not register themselves as > > power_off/power_on functions ? > > As Guenter mentioned above, I doped out two solutions, one is that keep > current process but renaming *_resume/*_suspend to > *_power_on/*_power_off; in a way, naming stuff "power_off", "power_on" actually matches. For one, the phy-block goes from unusable to usable by usb-devices and also will power-on a phy-supply regulator (often named vcc_host* on Rockchip boards) from the phy- core. > another is that do not assign power_on/power_off > functions for phy_ops at phy creating time, then, shorten > _SCHEDULE_DELAY_ delay time less that 10 Seconds, and the phy-port > suspend/resume mechanism depend on _sm_work_ completely. Which in turn would mean that we would always depend on a fully controllable phy block. Right now it seems, rk3036, rk3228, rk3368 (probably forgot some) have the same type of phy, but with at least the unplug-detection missing. In its current form the driver can very well support those (later on) by simply working statically (only acting on phy_power callbacks and not going to suspend on its own). Also having the work running in 10-second intervall seems wasteful. > > So which is the better way from your view? or would you like to give > other unique perceptions please? As obvious from the above, I would prefer just renaming the functions :-) Heiko
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v6 0/2] Add a new Rockchip usb2 phy driver Frank Wang <frank.wang@rock-chips.com> - 2016-06-17 04:20 +0200
[PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Frank Wang <frank.wang@rock-chips.com> - 2016-06-17 04:20 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Guenter Roeck <linux@roeck-us.net> - 2016-06-17 07:10 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Frank Wang <frank.wang@rock-chips.com> - 2016-06-17 08:50 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Guenter Roeck <linux@roeck-us.net> - 2016-06-17 15:30 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Frank Wang <frank.wang@rock-chips.com> - 2016-06-20 03:40 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Guenter Roeck <groeck@google.com> - 2016-06-20 05:10 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Frank Wang <frank.wang@rock-chips.com> - 2016-06-20 05:40 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Guenter Roeck <groeck@google.com> - 2016-06-20 07:30 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Frank Wang <frank.wang@rock-chips.com> - 2016-06-21 10:10 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Frank Wang <frank.wang@rock-chips.com> - 2016-06-21 11:30 +0200
Re: [PATCH v6 2/2] phy: rockchip-inno-usb2: add a new driver for Rockchip usb2phy Heiko Stübner <heiko@sntech.de> - 2016-06-21 12:30 +0200
[PATCH v6 1/2] Documentation: bindings: add DT documentation for Rockchip USB2PHY Frank Wang <frank.wang@rock-chips.com> - 2016-06-17 04:20 +0200
csiph-web