linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: qcom-spmi-adc5: Add ADC5_AMUX_THM[24]_100K_PU to rev2 channel list
@ 2018-08-10 19:47 Matthias Kaehlcke
  2018-08-19 16:54 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Kaehlcke @ 2018-08-10 19:47 UTC (permalink / raw)
  To: Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler,
	Siddartha Mohanadoss
  Cc: linux-iio, linux-kernel, Douglas Anderson, Matthias Kaehlcke

Add ADC5_AMUX_THM2_100K_PU and ADC5_AMUX_THM4_100K_PU to the list of
rev2 ADC channels.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 drivers/iio/adc/qcom-spmi-adc5.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c
index a4299417f3de..1f9298a5c83d 100644
--- a/drivers/iio/adc/qcom-spmi-adc5.c
+++ b/drivers/iio/adc/qcom-spmi-adc5.c
@@ -491,8 +491,12 @@ static const struct adc5_channels adc5_chans_rev2[ADC5_MAX_CHANNEL] = {
 					SCALE_HW_CALIB_PMIC_THERM)
 	[ADC5_AMUX_THM1_100K_PU] = ADC5_CHAN_TEMP("amux_thm1_100k_pu", 1,
 					SCALE_HW_CALIB_THERM_100K_PULLUP)
+	[ADC5_AMUX_THM2_100K_PU] = ADC5_CHAN_TEMP("amux_thm2_100k_pu", 1,
+					SCALE_HW_CALIB_THERM_100K_PULLUP)
 	[ADC5_AMUX_THM3_100K_PU] = ADC5_CHAN_TEMP("amux_thm3_100k_pu", 1,
 					SCALE_HW_CALIB_THERM_100K_PULLUP)
+	[ADC5_AMUX_THM4_100K_PU] = ADC5_CHAN_TEMP("amux_thm4_100k_pu", 1,
+					SCALE_HW_CALIB_THERM_100K_PULLUP)
 	[ADC5_AMUX_THM5_100K_PU] = ADC5_CHAN_TEMP("amux_thm5_100k_pu", 1,
 					SCALE_HW_CALIB_THERM_100K_PULLUP)
 	[ADC5_XO_THERM_100K_PU]	= ADC5_CHAN_TEMP("xo_therm_100k_pu", 1,
-- 
2.18.0.597.ga71716f1ad-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: qcom-spmi-adc5: Add ADC5_AMUX_THM[24]_100K_PU to rev2 channel list
  2018-08-10 19:47 [PATCH] iio: adc: qcom-spmi-adc5: Add ADC5_AMUX_THM[24]_100K_PU to rev2 channel list Matthias Kaehlcke
@ 2018-08-19 16:54 ` Jonathan Cameron
  2018-08-24 22:14   ` Matthias Kaehlcke
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2018-08-19 16:54 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Hartmut Knaack, Peter Meerwald-Stadler, Siddartha Mohanadoss,
	linux-iio, linux-kernel, Douglas Anderson

On Fri, 10 Aug 2018 12:47:02 -0700
Matthias Kaehlcke <mka@chromium.org> wrote:

> Add ADC5_AMUX_THM2_100K_PU and ADC5_AMUX_THM4_100K_PU to the list of
> rev2 ADC channels.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
This is fine and applied to the togreg branch of iio.git.
Pushed out as testing to let the autobuilders play with it.

However, I took a quick look and can't immediately see what prevents us
specifying channels in DT that don't have these definitions in the driver.

Should we have a check for that as at least superficially it seems like
a bad idea!

Jonathan

> ---
>  drivers/iio/adc/qcom-spmi-adc5.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c
> index a4299417f3de..1f9298a5c83d 100644
> --- a/drivers/iio/adc/qcom-spmi-adc5.c
> +++ b/drivers/iio/adc/qcom-spmi-adc5.c
> @@ -491,8 +491,12 @@ static const struct adc5_channels adc5_chans_rev2[ADC5_MAX_CHANNEL] = {
>  					SCALE_HW_CALIB_PMIC_THERM)
>  	[ADC5_AMUX_THM1_100K_PU] = ADC5_CHAN_TEMP("amux_thm1_100k_pu", 1,
>  					SCALE_HW_CALIB_THERM_100K_PULLUP)
> +	[ADC5_AMUX_THM2_100K_PU] = ADC5_CHAN_TEMP("amux_thm2_100k_pu", 1,
> +					SCALE_HW_CALIB_THERM_100K_PULLUP)
>  	[ADC5_AMUX_THM3_100K_PU] = ADC5_CHAN_TEMP("amux_thm3_100k_pu", 1,
>  					SCALE_HW_CALIB_THERM_100K_PULLUP)
> +	[ADC5_AMUX_THM4_100K_PU] = ADC5_CHAN_TEMP("amux_thm4_100k_pu", 1,
> +					SCALE_HW_CALIB_THERM_100K_PULLUP)
>  	[ADC5_AMUX_THM5_100K_PU] = ADC5_CHAN_TEMP("amux_thm5_100k_pu", 1,
>  					SCALE_HW_CALIB_THERM_100K_PULLUP)
>  	[ADC5_XO_THERM_100K_PU]	= ADC5_CHAN_TEMP("xo_therm_100k_pu", 1,


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: qcom-spmi-adc5: Add ADC5_AMUX_THM[24]_100K_PU to rev2 channel list
  2018-08-19 16:54 ` Jonathan Cameron
@ 2018-08-24 22:14   ` Matthias Kaehlcke
  2018-08-25  8:09     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Kaehlcke @ 2018-08-24 22:14 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Peter Meerwald-Stadler, Siddartha Mohanadoss,
	linux-iio, linux-kernel, Douglas Anderson

On Sun, Aug 19, 2018 at 05:54:52PM +0100, Jonathan Cameron wrote:
> On Fri, 10 Aug 2018 12:47:02 -0700
> Matthias Kaehlcke <mka@chromium.org> wrote:
> 
> > Add ADC5_AMUX_THM2_100K_PU and ADC5_AMUX_THM4_100K_PU to the list of
> > rev2 ADC channels.
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> This is fine and applied to the togreg branch of iio.git.
> Pushed out as testing to let the autobuilders play with it.

Thanks!

> However, I took a quick look and can't immediately see what prevents us
> specifying channels in DT that don't have these definitions in the driver.

Indeed, the DT could just specify an arbitrary value.

> Should we have a check for that as at least superficially it seems like
> a bad idea!

It seems there isn't a single contiguous range, but a very superficial
check could at least verify that the value isn't larger than CHAN_MAX
or check a few sub-ranges.

> > ---
> >  drivers/iio/adc/qcom-spmi-adc5.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c
> > index a4299417f3de..1f9298a5c83d 100644
> > --- a/drivers/iio/adc/qcom-spmi-adc5.c
> > +++ b/drivers/iio/adc/qcom-spmi-adc5.c
> > @@ -491,8 +491,12 @@ static const struct adc5_channels adc5_chans_rev2[ADC5_MAX_CHANNEL] = {
> >  					SCALE_HW_CALIB_PMIC_THERM)
> >  	[ADC5_AMUX_THM1_100K_PU] = ADC5_CHAN_TEMP("amux_thm1_100k_pu", 1,
> >  					SCALE_HW_CALIB_THERM_100K_PULLUP)
> > +	[ADC5_AMUX_THM2_100K_PU] = ADC5_CHAN_TEMP("amux_thm2_100k_pu", 1,
> > +					SCALE_HW_CALIB_THERM_100K_PULLUP)
> >  	[ADC5_AMUX_THM3_100K_PU] = ADC5_CHAN_TEMP("amux_thm3_100k_pu", 1,
> >  					SCALE_HW_CALIB_THERM_100K_PULLUP)
> > +	[ADC5_AMUX_THM4_100K_PU] = ADC5_CHAN_TEMP("amux_thm4_100k_pu", 1,
> > +					SCALE_HW_CALIB_THERM_100K_PULLUP)
> >  	[ADC5_AMUX_THM5_100K_PU] = ADC5_CHAN_TEMP("amux_thm5_100k_pu", 1,
> >  					SCALE_HW_CALIB_THERM_100K_PULLUP)
> >  	[ADC5_XO_THERM_100K_PU]	= ADC5_CHAN_TEMP("xo_therm_100k_pu", 1,
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: adc: qcom-spmi-adc5: Add ADC5_AMUX_THM[24]_100K_PU to rev2 channel list
  2018-08-24 22:14   ` Matthias Kaehlcke
@ 2018-08-25  8:09     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2018-08-25  8:09 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: Hartmut Knaack, Peter Meerwald-Stadler, Siddartha Mohanadoss,
	linux-iio, linux-kernel, Douglas Anderson

On Fri, 24 Aug 2018 15:14:39 -0700
Matthias Kaehlcke <mka@chromium.org> wrote:

> On Sun, Aug 19, 2018 at 05:54:52PM +0100, Jonathan Cameron wrote:
> > On Fri, 10 Aug 2018 12:47:02 -0700
> > Matthias Kaehlcke <mka@chromium.org> wrote:
> >   
> > > Add ADC5_AMUX_THM2_100K_PU and ADC5_AMUX_THM4_100K_PU to the list of
> > > rev2 ADC channels.
> > > 
> > > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>  
> > This is fine and applied to the togreg branch of iio.git.
> > Pushed out as testing to let the autobuilders play with it.  
> 
> Thanks!
> 
> > However, I took a quick look and can't immediately see what prevents us
> > specifying channels in DT that don't have these definitions in the driver.  
> 
> Indeed, the DT could just specify an arbitrary value.
> 
> > Should we have a check for that as at least superficially it seems like
> > a bad idea!  
> 
> It seems there isn't a single contiguous range, but a very superficial
> check could at least verify that the value isn't larger than CHAN_MAX
> or check a few sub-ranges.

Given other entries will be zeroed, just check for something not being 0?

> 
> > > ---
> > >  drivers/iio/adc/qcom-spmi-adc5.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c
> > > index a4299417f3de..1f9298a5c83d 100644
> > > --- a/drivers/iio/adc/qcom-spmi-adc5.c
> > > +++ b/drivers/iio/adc/qcom-spmi-adc5.c
> > > @@ -491,8 +491,12 @@ static const struct adc5_channels adc5_chans_rev2[ADC5_MAX_CHANNEL] = {
> > >  					SCALE_HW_CALIB_PMIC_THERM)
> > >  	[ADC5_AMUX_THM1_100K_PU] = ADC5_CHAN_TEMP("amux_thm1_100k_pu", 1,
> > >  					SCALE_HW_CALIB_THERM_100K_PULLUP)
> > > +	[ADC5_AMUX_THM2_100K_PU] = ADC5_CHAN_TEMP("amux_thm2_100k_pu", 1,
> > > +					SCALE_HW_CALIB_THERM_100K_PULLUP)
> > >  	[ADC5_AMUX_THM3_100K_PU] = ADC5_CHAN_TEMP("amux_thm3_100k_pu", 1,
> > >  					SCALE_HW_CALIB_THERM_100K_PULLUP)
> > > +	[ADC5_AMUX_THM4_100K_PU] = ADC5_CHAN_TEMP("amux_thm4_100k_pu", 1,
> > > +					SCALE_HW_CALIB_THERM_100K_PULLUP)
> > >  	[ADC5_AMUX_THM5_100K_PU] = ADC5_CHAN_TEMP("amux_thm5_100k_pu", 1,
> > >  					SCALE_HW_CALIB_THERM_100K_PULLUP)
> > >  	[ADC5_XO_THERM_100K_PU]	= ADC5_CHAN_TEMP("xo_therm_100k_pu", 1,  
> >   


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-25  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10 19:47 [PATCH] iio: adc: qcom-spmi-adc5: Add ADC5_AMUX_THM[24]_100K_PU to rev2 channel list Matthias Kaehlcke
2018-08-19 16:54 ` Jonathan Cameron
2018-08-24 22:14   ` Matthias Kaehlcke
2018-08-25  8:09     ` Jonathan Cameron

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).