Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1636720
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 |
| Date | 2017-05-05 22:40 +0200 |
| Message-ID | <tDSb7-6HT-3@gated-at.bofh.it> (permalink) |
| References | <tDF4d-6re-3@gated-at.bofh.it> <tDIbM-8pT-5@gated-at.bofh.it> <tDIOu-vu-17@gated-at.bofh.it> <tDQCm-5yw-33@gated-at.bofh.it> <tDRRM-6Av-23@gated-at.bofh.it> |
| Organization | Intel Finland Oy |
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? > - 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. -- Andy Shevchenko <andriy.shevchenko@linux.intel.com> Intel Finland Oy
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-05 08:40 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-05 11:50 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-05 12:30 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-05-05 12:50 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jonathan Cameron <jic23@kernel.org> - 2017-05-05 21:00 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-05 12:00 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-05 12:40 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jonathan Cameron <jic23@kernel.org> - 2017-05-05 21:00 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jan Kiszka <jan.kiszka@siemens.com> - 2017-05-05 22:20 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-05 22:40 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jonathan Cameron <jic23@kernel.org> - 2017-05-08 00:00 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jonathan Cameron <jic23@kernel.org> - 2017-05-05 21:00 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-05 21:10 +0200
Re: [PATCH v3] iio: adc: Add support for TI ADC108S102 and ADC128S102 Jonathan Cameron <jic23@kernel.org> - 2017-05-08 00:00 +0200
csiph-web