On Sunday, September 23, 2012, Peter Stuge wrote: > Rafael J. Wysocki wrote: > > > Is there already an API for power domains there? What does it look like? > > > > Yes, there is, as it turns out. :-) > > > > Please see drivers/base/power/domain.c and include/linux/pm_domain.h. > > > > Of course, this only covers a limited set of use cases at the moment, but I > > think it's better to extend the existing code to cover more of them than to > > add new code of similar functionality. > > > > There is no user space interface right now, because there was no demand and > > because it is not clear what should be exposed and how. > > For context I maintain libusb. There was a fork some time ago and Red > Hat promoting the fork along with random propaganda made many distros > all silently switch to libusbx, but libusb is still around and > continues being developed. > > For starters I would like an API that sets a power domain on or off. Unfortunately, in general doing that from user space at random time for some domains may render the system unusable, so I don't think we can provide such an interface. > I think that would be the simplest API, and maybe a good place to > start. There is definitely room for more complex API as well, getting > into various policies and so on, but to begin with just on/off is > fine IMO. > > As I mentioned before in the thread I have no preference whatsoever > for what the API is, but I do want something that can give back a > useful error in case of failure. I'm not sure if sysfs can do that. It can in general, but that depends on the use case. That's why I'm generally a bit cautious about user space interfaces. Thanks, Rafael -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html