[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <49EC8775.8060609@compulab.co.il>
Date: Mon, 20 Apr 2009 17:32:21 +0300
From: Mike Rapoport <mike@...pulab.co.il>
To: Liam Girdwood <lrg@...mlogic.co.uk>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC: LKML <linux-kernel@...r.kernel.org>
Subject: [RFD] voltage/current regulator consumer interface
Hi,
Recently there was a brief discussion on linux-arm-kernel list [1] about
controlling voltage regulator state in cases when there is no consumer device
for a particular regulator.
I have some thoughts but I'd like to know people opinion before I start
implementation.
Problem
-------
The regulator framework API provides ability to control the state of
voltage/current regulators from within the kernel. Usually the regulator
supplies power to a device and device driver or some hooks to the platform code
from the device driver manipulate the regulator state. However, the regulator
framework does not have userspace ABI that allows regulator state modifications.
Lack of this ABI prevents fine-grained control for power consumption of devices
such as GPS trancievers and GSM modems. Moreover, in SoC based systems it is
possible to switch on/off power to entire subsystem when it is not used.
Possible solutions
------------------
- Add a platform_driver similar to drivers/regulator/virtual.c that will expose
writable attributes to sysfs thus allowing userspace to control regulator state.
It is the most simple and straight forward solution. However, I have several
questions and I cannot answer them myself:
Should the driver handle single or several supplies at once?
If the driver handles single supply isn't it a waste of memory to have a
platform_device per supply?
If the driver handles several supplies how to define attributes per-supply?
What attributes will be exposed? Would it be simple 'state' that can be
enabled or disabled? Or the entire set of micorvolts/microamps etc?
- Extend regulator framework so that regulator_consumer_supply entities will
gain their own representation in sysfs. Depending on machine constraints the
supply attributes can be either read-only or writable. I haven't dedicated much
thought to it, so a cannot state any pros and cons.
Any feedback is appreciated.
--
[1] http://lists.arm.linux.org.uk/lurker/message/20090413.125359.613f85ad.en.html
--
Sincerely yours,
Mike.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists