linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Kosin <jkosin@beta.intcomgrp.com>
To: Mike Rapoport <mike@compulab.co.il>
Cc: linux-kernel@vger.kernel.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [RFD] voltage/current regulator consumer interface
Date: Tue, 21 Apr 2009 10:31:34 -0400	[thread overview]
Message-ID: <49EDD8C6.7030204@beta.intcomgrp.com> (raw)
In-Reply-To: <49EDD2A7.9090300@compulab.co.il>

[-- Attachment #1: Type: text/plain, Size: 3077 bytes --]

Mike Rapoport wrote:
> James Kosin wrote:
>> Mike Rapoport wrote:
>>> James Kosin wrote:
>>>> Mike Rapoport wrote:
>>>>> 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.
>>>>>
>>>> I'd also ask the question, Why?
>>>> If exposing to user space it leaves the possibility of damaging hardware
>>>> or completely frying a board.
>>> Suppose you have a handheld device with GPS transceiver. You would like to give
>>> user the ability to switch the transceiver on and off.
>>>
>> Then the GPS drivers should be made aware and let the drivers handle the
>> on/off interface.  If a user is allowed to turn interfaces on/off at
>> will with this then drivers could suffer from (shock)...  ie: you could
>> turn off your hard-drive in a middle of a write by the driver corrupting
>> data, if handled in the driver it could finish the write before turning
>> off the drive.  I know this is a far stretch from a GPS were the device
>> is only READ only.
> 
> The point is there's no GPS driver... GPS transceivers are usually connected to
> a serial line and the applications access the GPS data through ttySX. The case
> when there is a kernel driver for device connected to a regulator is completely
> different. It is then the driver responsibility to decide when to power on/off
> the device.
> 
>> I do agree it could be useful, but we need to be careful on how much
>> control the user has over the drivers and system.  To an extreme, a user
>> could be able to turn off CPU cores outside of the drivers control
>> causing serious pipeline hazards that would need to be handled at the
>> driver level.  This would not be an issue for GPS were the data is read
>> only and the missing data is really not that important to the system
>> operation and continued use.
>>
>> James
>>
> 
Ok.  You have a valid point.

What about a GPS driver that can use the RS232 interface as the
transport.  Much like the IDE over Parallel Port in older kernels did.
This way the driver would still be responsible and not have to
completely expose the regulator control.

James


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 258 bytes --]

  reply	other threads:[~2009-04-21 14:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ct38K-3Fq-11@gated-at.bofh.it>
2009-04-20 15:38 ` [RFD] voltage/current regulator consumer interface James Kosin
2009-04-21  6:07   ` Mike Rapoport
2009-04-21 13:25     ` James Kosin
2009-04-21 14:05       ` Mike Rapoport
2009-04-21 14:31         ` James Kosin [this message]
2009-04-25  8:19         ` Pavel Machek
2009-04-25  9:04           ` Mark Brown
2009-04-27 13:47             ` James Kosin
2009-04-27 14:21               ` Mark Brown
2009-04-21 14:30       ` Mark Brown
2009-04-21 10:05   ` Mark Brown
     [not found] ` <ct38K-3Fq-9@gated-at.bofh.it>
     [not found]   ` <ctmXD-1yA-3@gated-at.bofh.it>
     [not found]     ` <ctnK4-2zP-11@gated-at.bofh.it>
     [not found]       ` <ctoG9-458-7@gated-at.bofh.it>
     [not found]         ` <ctoG9-458-5@gated-at.bofh.it>
     [not found]           ` <ctoPK-4y5-5@gated-at.bofh.it>
     [not found]             ` <ctoZv-4KN-23@gated-at.bofh.it>
     [not found]               ` <ctFxn-5OC-11@gated-at.bofh.it>
     [not found]                 ` <ctG0r-6HL-31@gated-at.bofh.it>
2009-04-22 14:31                   ` James Kosin
2009-04-22 14:49                     ` Alan Cox
2009-04-22 15:00                       ` James Kosin
2009-04-20 14:32 Mike Rapoport
2009-04-20 14:56 ` Mark Brown
2009-04-21 12:00   ` Mike Rapoport
2009-04-21 12:55     ` Mark Brown
2009-04-21 13:54       ` Mike Rapoport
2009-04-21 13:56         ` Mark Brown
2009-04-21 14:01           ` Mike Rapoport
2009-04-21 14:14             ` Mark Brown
2009-04-22  7:57               ` Mike Rapoport
2009-04-22  8:26                 ` Mark Brown

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=49EDD8C6.7030204@beta.intcomgrp.com \
    --to=jkosin@beta.intcomgrp.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=mike@compulab.co.il \
    /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).