mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jan Kiszka <jan.kiszka@siemens.com>
Cc: linux-iio@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sascha Weisenberger <sascha.weisenberger@siemens.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Rob Herring <robh@kernel.org>, Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102
Date: Sun, 7 May 2017 12:19:22 +0100	[thread overview]
Message-ID: <8006a81e-6b5a-dce0-0780-67f3059a1d37@kernel.org> (raw)
In-Reply-To: <1494016323.30052.44.camel@linux.intel.com>

On 05/05/17 21:32, Andy Shevchenko wrote:
> On Fri, 2017-05-05 at 22:09 +0200, Jan Kiszka wrote:
>> On 2017-05-05 20:52, Jonathan Cameron wrote:
>>> On 05/05/17 11:39, Jan Kiszka wrote:
>>>> On 2017-05-05 11:54, Andy Shevchenko wrote:
>>>>> On Fri, 2017-05-05 at 08:31 +0200, Jan Kiszka wrote:
> 
>>>>>> +			if (st->reg)
>>>>>> +				*val =
>>>>>> regulator_get_voltage(st->reg) 
>>>>>> / 1000;
>>>>>> +			else
>>>>>> +				*val = st->va_millivolt;
>>>>>> +
>>>>>
>>>>> Another way is to not just hard code the value, but create a
>>>>> fixed
>>>>> voltage regulator out of it. In this case you will have one way
>>>>> to get
>>>>> its value.
>>>>
>>>> That's a good idea.
>>>
>>> Agreed. Make sure to cc Mark Brown though as I'll need an ack from
>>> him
>>> to have a fixed reg hiding in here.
>>
>> After diving deeper, it not longer appears to be a good idea:
>>
>> - pulls in a non-obvious requirement for CONFIG_REGULATOR on platforms
>>   that otherwise do not need it
> 
> Why is it a problem?
It seems unlikely this is the first ever case of needing proper
regulator support on ACPI platforms.  Mark/Liam, an precedents that you
know of?
> 
>> - requires complex life-cycle management so that the fixed regulator
>> is
>>   instantiated on the first device creation and removed with the last
>>   one
> 
> Who cares if you register more than one?
> 
>> We better go with the static value assignment.
>>
>> I'll move that regulator_get_voltage into the probing function which
>> will simplify things further (va_millivolt will carry the value for
>> both
>> cases).
> 
> Yes, it would be the way, if system has it's fixed.
> 
> But in this case you need to threat regulator as optional if we are
> going to enable/disable them for PM.
> 

  reply	other threads:[~2017-05-07 21:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  6:31 Jan Kiszka
2017-05-05  9:40 ` Mika Westerberg
2017-05-05 10:23   ` Jan Kiszka
2017-05-05 10:40     ` Mika Westerberg
2017-05-05 18:50       ` Jonathan Cameron
2017-05-05  9:54 ` Andy Shevchenko
2017-05-05 10:39   ` Jan Kiszka
2017-05-05 18:52     ` Jonathan Cameron
2017-05-05 20:09       ` Jan Kiszka
2017-05-05 20:32         ` Andy Shevchenko
2017-05-07 11:19           ` Jonathan Cameron [this message]
2017-05-05 18:55 ` Jonathan Cameron
2017-05-05 19:09   ` Andy Shevchenko
2017-05-07 11:17     ` Jonathan Cameron

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=8006a81e-6b5a-dce0-0780-67f3059a1d37@kernel.org \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=jan.kiszka@siemens.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh@kernel.org \
    --cc=sascha.weisenberger@siemens.com \
    /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

all inboxes | Powered by JetHome®