Re: sysfs and power management

From: Onkalo Samu
Date: Mon Nov 01 2010 - 06:42:57 EST


On Sun, 2010-10-31 at 15:25 +0100, ext Greg KH wrote:

> >
> > What I would like to do is:
> >
> > Control sensors operating mode and regulators based on the userspace
> > activity. If no-one is interested about the sensor, it can be turned
> > totally off including its operating power via regulator framework.
> >
> > So far the only accepted interface for the small sensor seems to be
> > sysfs. I tried use misc device but it was not accepted.
>
> Look at the drivers/staging/iio/ subsystem. It is working on a
> framework that you can use through a character device (I think) to
> properly manage your drivers in this manner.
>
> Try working with those developers as I think it is what you are looking
> for here.
>

I took a look to that. It seems that iio is more or less sysfs based.
There are ring buffers and event device which are chardev based
but still the data outside ring buffer and the control is sysfs based.

By getting open and close from sysfs would be nice from the driver
point of view. However, I understand that this is just overhead for
majority of the cases.

Regards,
Samu


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/