All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Michaelis <adam.michaelis@rockwellcollins.com>
To: linux-iio@vger.kernel.org
Cc: lars@metafoo.de, michael.hennerich@analog.com, jic23@kernel.org,
	knaack.h@gmx.de, pmeerw@pmeerw.net, robh+dt@kernel.org,
	mark.rutland@arm.com, charles-antoine.couret@essensium.com,
	devicetree@vger.kernel.org, brandon.maier@rockwellcollins.com,
	clayton.shotwell@rockwellcollins.com,
	Adam Michaelis <adam.michaelis@rockwellcollins.com>
Subject: [PATCH v3 5/5] iio: ad7949: Remove logic for config readback
Date: Mon, 13 May 2019 09:53:05 -0500	[thread overview]
Message-ID: <1557759185-167857-5-git-send-email-adam.michaelis@rockwellcollins.com> (raw)
In-Reply-To: <1557759185-167857-1-git-send-email-adam.michaelis@rockwellcollins.com>

The AD7949 has a feature to include the configuration register value
used to generate the ADC sample. This feature is configurable, but do
not see a good use case for it in the driver (neither did reviewing
maintainers), so removing the supporting logic in order to simplify the
driver.

Signed-off-by: Adam Michaelis <adam.michaelis@rockwellcollins.com>
---
	V3:
	- First version of series with this patch. Maintainers agreed
	that this capability of the hardware is not useful and should
	be dropped from driver.
---
 drivers/iio/adc/ad7949.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/drivers/iio/adc/ad7949.c b/drivers/iio/adc/ad7949.c
index d67033a008e5..bac16a2f7850 100644
--- a/drivers/iio/adc/ad7949.c
+++ b/drivers/iio/adc/ad7949.c
@@ -102,24 +102,6 @@ static void ad7949_set_bits_per_word(struct ad7949_adc_chip *ad7949_adc)
 		ad7949_adc->bits_per_word = 8;
 }
 
-static bool ad7949_spi_cfg_is_read_back(struct ad7949_adc_chip *ad7949_adc)
-{
-	if (!(ad7949_adc->cfg & AD7949_CFG_READBACK))
-		return true;
-
-	return false;
-}
-
-static int ad7949_message_len(struct ad7949_adc_chip *ad7949_adc)
-{
-	int tx_len = 2;
-
-	if (ad7949_spi_cfg_is_read_back(ad7949_adc))
-		tx_len += 2;
-
-	return tx_len;
-}
-
 static int ad7949_spi_write_cfg(struct ad7949_adc_chip *ad7949_adc, u16 val,
 				u16 mask)
 {
@@ -129,7 +111,7 @@ static int ad7949_spi_write_cfg(struct ad7949_adc_chip *ad7949_adc, u16 val,
 	struct spi_transfer tx[] = {
 		{
 			.tx_buf = &ad7949_adc->buffer,
-			.len = ad7949_message_len(ad7949_adc),
+			.len = 2,
 			.bits_per_word = ad7949_adc->bits_per_word,
 		}
 	};
@@ -197,7 +179,7 @@ static int ad7949_spi_read_channel(struct ad7949_adc_chip *ad7949_adc, int *val,
 	struct spi_transfer tx[] = {
 		{
 			.rx_buf = &ad7949_adc->buffer,
-			.len = ad7949_message_len(ad7949_adc),
+			.len = 2,
 			.bits_per_word = ad7949_adc->bits_per_word,
 		}
 	};
-- 
1.9.1

  parent reply	other threads:[~2019-05-13 14:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 14:53 [PATCH v3 1/5] iio: ad7949: Fix dummy read cycle placement Adam Michaelis
2019-05-13 14:53 ` [PATCH v3 2/5] iio: ad7949: Support internal Vref Adam Michaelis
2019-05-18  9:07   ` Jonathan Cameron
2019-05-23 12:12   ` Alexandru Ardelean
2019-05-23 12:51     ` Ardelean, Alexandru
2019-05-23 12:51       ` Ardelean, Alexandru
2019-05-13 14:53 ` [PATCH v3 3/5] dt-bindings: iio: ad7949: Add adi,reference-select Adam Michaelis
2019-05-14 18:23   ` Rob Herring
2019-05-14 18:23     ` Rob Herring
2019-05-18  9:07     ` Jonathan Cameron
2019-05-23 12:16       ` Alexandru Ardelean
2019-05-13 14:53 ` [PATCH v3 4/5] iio: ad7949: Fix SPI interfacing for 14-bit messages Adam Michaelis
2019-05-18  9:10   ` Jonathan Cameron
2019-05-23 12:39     ` Alexandru Ardelean
2019-05-13 14:53 ` Adam Michaelis [this message]
2019-05-18  9:19   ` [PATCH v3 5/5] iio: ad7949: Remove logic for config readback Jonathan Cameron
2019-05-18  9:36 ` [PATCH v3 1/5] iio: ad7949: Fix dummy read cycle placement Jonathan Cameron
2019-05-23 11:47 ` Alexandru Ardelean
2019-05-24 11:49   ` Couret Charles-Antoine

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=1557759185-167857-5-git-send-email-adam.michaelis@rockwellcollins.com \
    --to=adam.michaelis@rockwellcollins.com \
    --cc=brandon.maier@rockwellcollins.com \
    --cc=charles-antoine.couret@essensium.com \
    --cc=clayton.shotwell@rockwellcollins.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=michael.hennerich@analog.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.