linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio:adc:ti-ads124s08: Fix start stop conversion command
@ 2021-01-21 19:14 Dan Murphy
  2021-01-21 19:14 ` [PATCH 2/2] iio:adc:ti-ads124s08: Fix packet read from the ADC Dan Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Murphy @ 2021-01-21 19:14 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, lars, pmeerw, linux-kernel, Dan Murphy

Fix start and stop conversion commands.  The proper command is not be
sent.

Fixes: ("e717f8c6dfec iio: adc: Add the TI ads124s08 ADC code")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/iio/adc/ti-ads124s08.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c
index b4a128b19188..f05d4e0e1c9d 100644
--- a/drivers/iio/adc/ti-ads124s08.c
+++ b/drivers/iio/adc/ti-ads124s08.c
@@ -237,7 +237,7 @@ static int ads124s_read_raw(struct iio_dev *indio_dev,
 			goto out;
 		}
 
-		ret = ads124s_write_cmd(indio_dev, ADS124S08_START_CONV);
+		ret = ads124s_write_cmd(indio_dev, ADS124S08_CMD_START);
 		if (ret) {
 			dev_err(&priv->spi->dev, "Start conversions failed\n");
 			goto out;
@@ -251,7 +251,7 @@ static int ads124s_read_raw(struct iio_dev *indio_dev,
 
 		*val = ret;
 
-		ret = ads124s_write_cmd(indio_dev, ADS124S08_STOP_CONV);
+		ret = ads124s_write_cmd(indio_dev, ADS124S08_CMD_STOP);
 		if (ret) {
 			dev_err(&priv->spi->dev, "Stop conversions failed\n");
 			goto out;
-- 
2.29.2


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

* [PATCH 2/2] iio:adc:ti-ads124s08: Fix packet read from the ADC
  2021-01-21 19:14 [PATCH 1/2] iio:adc:ti-ads124s08: Fix start stop conversion command Dan Murphy
@ 2021-01-21 19:14 ` Dan Murphy
  2021-01-24 15:12   ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Murphy @ 2021-01-21 19:14 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, lars, pmeerw, linux-kernel, Dan Murphy

Fix the spi_transfer array in the reading of the data from the ADC.

Fixes: ("e717f8c6dfec iio: adc: Add the TI ads124s08 ADC code")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/iio/adc/ti-ads124s08.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c
index f05d4e0e1c9d..023d81c7e8da 100644
--- a/drivers/iio/adc/ti-ads124s08.c
+++ b/drivers/iio/adc/ti-ads124s08.c
@@ -201,12 +201,10 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan)
 	struct spi_transfer t[] = {
 		{
 			.tx_buf = &priv->data[0],
-			.len = 4,
-			.cs_change = 1,
 		}, {
-			.tx_buf = &priv->data[1],
 			.rx_buf = &priv->data[1],
 			.len = 4,
+			.cs_change = 1,
 		},
 	};
 
-- 
2.29.2


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

* Re: [PATCH 2/2] iio:adc:ti-ads124s08: Fix packet read from the ADC
  2021-01-21 19:14 ` [PATCH 2/2] iio:adc:ti-ads124s08: Fix packet read from the ADC Dan Murphy
@ 2021-01-24 15:12   ` Jonathan Cameron
  2021-01-28 14:07     ` Dan Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2021-01-24 15:12 UTC (permalink / raw)
  To: Dan Murphy; +Cc: linux-iio, lars, pmeerw, linux-kernel

On Thu, 21 Jan 2021 13:14:31 -0600
Dan Murphy <dmurphy@ti.com> wrote:

> Fix the spi_transfer array in the reading of the data from the ADC.
> 
> Fixes: ("e717f8c6dfec iio: adc: Add the TI ads124s08 ADC code")
> Signed-off-by: Dan Murphy <dmurphy@ti.com>

I'm not really following the changes below..

> ---
>  drivers/iio/adc/ti-ads124s08.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c
> index f05d4e0e1c9d..023d81c7e8da 100644
> --- a/drivers/iio/adc/ti-ads124s08.c
> +++ b/drivers/iio/adc/ti-ads124s08.c
> @@ -201,12 +201,10 @@ static int ads124s_read(struct iio_dev *indio_dev, unsigned int chan)
>  	struct spi_transfer t[] = {
>  		{
>  			.tx_buf = &priv->data[0],
> -			.len = 4,
> -			.cs_change = 1,

We should still need to provide a length for this transfer.

>  		}, {
> -			.tx_buf = &priv->data[1],
>  			.rx_buf = &priv->data[1],
>  			.len = 4,
> +			.cs_change = 1,

That's unusual... cs_change being set on the last transfer means
the opposite of what it does for earlier transfers.

https://elixir.bootlin.com/linux/latest/source/include/linux/spi/spi.h#L905

Or is the intent here to provide a performance hint that the device doesn't
care if the cs line goes inactive before stating a new set of transfers?
If so add a comment to say that perhaps.

>  		},
>  	};
>  


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

* Re: [PATCH 2/2] iio:adc:ti-ads124s08: Fix packet read from the ADC
  2021-01-24 15:12   ` Jonathan Cameron
@ 2021-01-28 14:07     ` Dan Murphy
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Murphy @ 2021-01-28 14:07 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, lars, pmeerw, linux-kernel

Jonathan

On 1/24/21 9:12 AM, Jonathan Cameron wrote:
> On Thu, 21 Jan 2021 13:14:31 -0600
> Dan Murphy <dmurphy@ti.com> wrote:
>
>> Fix the spi_transfer array in the reading of the data from the ADC.
>>
>> Fixes: ("e717f8c6dfec iio: adc: Add the TI ads124s08 ADC code")
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> I'm not really following the changes below..

I will have to dig into it deeper our HW team reported this.

Patch 1/2 is relevant and is not dependent on this patch

Dan


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

end of thread, other threads:[~2021-01-28 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 19:14 [PATCH 1/2] iio:adc:ti-ads124s08: Fix start stop conversion command Dan Murphy
2021-01-21 19:14 ` [PATCH 2/2] iio:adc:ti-ads124s08: Fix packet read from the ADC Dan Murphy
2021-01-24 15:12   ` Jonathan Cameron
2021-01-28 14:07     ` Dan Murphy

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