linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: xilinx-ams: Fix num_channels for PS channels
@ 2022-01-19 11:45 Michael Tretter
  2022-01-30 12:30 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Tretter @ 2022-01-19 11:45 UTC (permalink / raw)
  To: linux-iio, anand.ashok.dumbre, jic23; +Cc: linux-arm-kernel, m.tretter, kernel

The IIO channels of the PS are not provided in the sysfs even if the
ams_ps is enabled in the device tree. The reason is that the channels of
the PS are not added to the overall number of IIO channels.

The line somehow got lost between v11 and v12 of the patch series.

Add the number of ams_ps_channels to the number of channels to correctly
register all channels.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")
---
 drivers/iio/adc/xilinx-ams.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c
index 8343c5f74121..ede968efb77f 100644
--- a/drivers/iio/adc/xilinx-ams.c
+++ b/drivers/iio/adc/xilinx-ams.c
@@ -1224,6 +1224,7 @@ static int ams_init_module(struct iio_dev *indio_dev,
 
 		/* add PS channels to iio device channels */
 		memcpy(channels, ams_ps_channels, sizeof(ams_ps_channels));
+		num_channels += ARRAY_SIZE(ams_ps_channels);
 	} else if (fwnode_property_match_string(fwnode, "compatible",
 						"xlnx,zynqmp-ams-pl") == 0) {
 		ams->pl_base = fwnode_iomap(fwnode, 0);
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] iio: adc: xilinx-ams: Fix num_channels for PS channels
  2022-01-19 11:45 [PATCH] iio: adc: xilinx-ams: Fix num_channels for PS channels Michael Tretter
@ 2022-01-30 12:30 ` Jonathan Cameron
  2022-01-30 12:44   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Cameron @ 2022-01-30 12:30 UTC (permalink / raw)
  To: Michael Tretter; +Cc: linux-iio, anand.ashok.dumbre, linux-arm-kernel, kernel

On Wed, 19 Jan 2022 12:45:13 +0100
Michael Tretter <m.tretter@pengutronix.de> wrote:

> The IIO channels of the PS are not provided in the sysfs even if the
> ams_ps is enabled in the device tree. The reason is that the channels of
> the PS are not added to the overall number of IIO channels.
> 
> The line somehow got lost between v11 and v12 of the patch series.
> 
> Add the number of ams_ps_channels to the number of channels to correctly
> register all channels.
> 
> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")
Applied to the fixes togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/xilinx-ams.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c
> index 8343c5f74121..ede968efb77f 100644
> --- a/drivers/iio/adc/xilinx-ams.c
> +++ b/drivers/iio/adc/xilinx-ams.c
> @@ -1224,6 +1224,7 @@ static int ams_init_module(struct iio_dev *indio_dev,
>  
>  		/* add PS channels to iio device channels */
>  		memcpy(channels, ams_ps_channels, sizeof(ams_ps_channels));
> +		num_channels += ARRAY_SIZE(ams_ps_channels);
>  	} else if (fwnode_property_match_string(fwnode, "compatible",
>  						"xlnx,zynqmp-ams-pl") == 0) {
>  		ams->pl_base = fwnode_iomap(fwnode, 0);


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] iio: adc: xilinx-ams: Fix num_channels for PS channels
  2022-01-30 12:30 ` Jonathan Cameron
@ 2022-01-30 12:44   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2022-01-30 12:44 UTC (permalink / raw)
  To: Michael Tretter; +Cc: linux-iio, anand.ashok.dumbre, linux-arm-kernel, kernel

On Sun, 30 Jan 2022 12:30:25 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Wed, 19 Jan 2022 12:45:13 +0100
> Michael Tretter <m.tretter@pengutronix.de> wrote:
> 
> > The IIO channels of the PS are not provided in the sysfs even if the
> > ams_ps is enabled in the device tree. The reason is that the channels of
> > the PS are not added to the overall number of IIO channels.
> > 
> > The line somehow got lost between v11 and v12 of the patch series.
> > 
> > Add the number of ams_ps_channels to the number of channels to correctly
> > register all channels.
> > 
> > Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
> > Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver")  
> Applied to the fixes togreg branch of iio.git.
> 
Actually change of plan . I'll just pick up the v2 fixes set from
Robert as otherwise I'll loose track of where we are with these.

Thanks,

Jonathan

> Thanks,
> 
> Jonathan
> 
> > ---
> >  drivers/iio/adc/xilinx-ams.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/iio/adc/xilinx-ams.c b/drivers/iio/adc/xilinx-ams.c
> > index 8343c5f74121..ede968efb77f 100644
> > --- a/drivers/iio/adc/xilinx-ams.c
> > +++ b/drivers/iio/adc/xilinx-ams.c
> > @@ -1224,6 +1224,7 @@ static int ams_init_module(struct iio_dev *indio_dev,
> >  
> >  		/* add PS channels to iio device channels */
> >  		memcpy(channels, ams_ps_channels, sizeof(ams_ps_channels));
> > +		num_channels += ARRAY_SIZE(ams_ps_channels);
> >  	} else if (fwnode_property_match_string(fwnode, "compatible",
> >  						"xlnx,zynqmp-ams-pl") == 0) {
> >  		ams->pl_base = fwnode_iomap(fwnode, 0);  
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-01-30 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 11:45 [PATCH] iio: adc: xilinx-ams: Fix num_channels for PS channels Michael Tretter
2022-01-30 12:30 ` Jonathan Cameron
2022-01-30 12:44   ` 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).