All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] iio: adc: ti-ads8344: improve the driver
@ 2020-04-15 21:22 Alexandre Belloni
  2020-04-15 21:22 ` [PATCH 1/3] iio: adc: ti-ads8344: properly byte swap value Alexandre Belloni
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Alexandre Belloni @ 2020-04-15 21:22 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Gregory CLEMENT, linux-iio, linux-kernel, Alexandre Belloni

Hello,

This series improves the ads8344 driver.

The first patch is fix and can be backported.

The second patch removes the dubious ____cacheline_aligned

The last one is improving power consumption by shutting down the ADC
while it is not used.

Alexandre Belloni (3):
  iio: adc: ti-ads8344: properly byte swap value
  iio: adc: ti-ads8344: remove tx_buf from driver data
  iio: adc: ti-ads8344: optimize consumption

 drivers/iio/adc/ti-ads8344.c | 33 ++++++++++++++++-----------------
 1 file changed, 16 insertions(+), 17 deletions(-)

-- 
2.25.2


^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [PATCH 1/3] iio: adc: ti-ads8344: properly byte swap value
@ 2020-04-16  7:10 kbuild test robot
  0 siblings, 0 replies; 17+ messages in thread
From: kbuild test robot @ 2020-04-16  7:10 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3946 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200415212257.161238-2-alexandre.belloni@bootlin.com>
References: <20200415212257.161238-2-alexandre.belloni@bootlin.com>
TO: Alexandre Belloni <alexandre.belloni@bootlin.com>
TO: Jonathan Cameron <jic23@kernel.org>
CC: Hartmut Knaack <knaack.h@gmx.de>
CC: "Lars-Peter Clausen" <lars@metafoo.de>
CC: "Peter Meerwald-Stadler" <pmeerw@pmeerw.net>
CC: Gregory CLEMENT <gregory.clement@bootlin.com>
CC: linux-iio(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: Alexandre Belloni <alexandre.belloni@bootlin.com>

Hi Alexandre,

I love your patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on v5.7-rc1 next-20200415]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Alexandre-Belloni/iio-adc-ti-ads8344-improve-the-driver/20200416-073357
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> drivers/iio/adc/ti-ads8344.c:96:36: warning: The code contains unhandled character(s) (character code=194). Neither unicode nor extended ascii is supported. [syntaxError]
    return buf[0] << 9 | buf[1] << 1 | buf[2] >> 7;
                                      ^

# https://github.com/0day-ci/linux/commit/f4710fdd10c9cf84bd09d8b295a435b371800bd0
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout f4710fdd10c9cf84bd09d8b295a435b371800bd0
vim +96 drivers/iio/adc/ti-ads8344.c

8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  72  
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  73  static int ads8344_adc_conversion(struct ads8344 *adc, int channel,
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  74  				  bool differential)
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  75  {
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  76  	struct spi_device *spi = adc->spi;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  77  	int ret;
f4710fdd10c9cf Alexandre Belloni 2020-04-15  78  	u8 buf[3];
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  79  
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  80  	adc->tx_buf = ADS8344_START;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  81  	if (!differential)
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  82  		adc->tx_buf |= ADS8344_SINGLE_END;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  83  	adc->tx_buf |= ADS8344_CHANNEL(channel);
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  84  	adc->tx_buf |= ADS8344_CLOCK_INTERNAL;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  85  
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  86  	ret = spi_write(spi, &adc->tx_buf, 1);
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  87  	if (ret)
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  88  		return ret;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  89  
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  90  	udelay(9);
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  91  
f4710fdd10c9cf Alexandre Belloni 2020-04-15  92  	ret = spi_read(spi, buf, sizeof(buf));
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  93  	if (ret)
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  94  		return ret;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  95  
f4710fdd10c9cf Alexandre Belloni 2020-04-15 @96  	return buf[0] << 9 | buf[1] << 1 | buf[2] >> 7;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  97  }
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  98  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: [PATCH 1/3] iio: adc: ti-ads8344: properly byte swap value
@ 2020-04-16 20:16 kbuild test robot
  0 siblings, 0 replies; 17+ messages in thread
From: kbuild test robot @ 2020-04-16 20:16 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4121 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200415212257.161238-2-alexandre.belloni@bootlin.com>
References: <20200415212257.161238-2-alexandre.belloni@bootlin.com>
TO: Alexandre Belloni <alexandre.belloni@bootlin.com>
TO: Jonathan Cameron <jic23@kernel.org>
CC: Hartmut Knaack <knaack.h@gmx.de>
CC: "Lars-Peter Clausen" <lars@metafoo.de>
CC: "Peter Meerwald-Stadler" <pmeerw@pmeerw.net>
CC: Gregory CLEMENT <gregory.clement@bootlin.com>
CC: linux-iio(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: Alexandre Belloni <alexandre.belloni@bootlin.com>

Hi Alexandre,

I love your patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on v5.7-rc1 next-20200416]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Alexandre-Belloni/iio-adc-ti-ads8344-improve-the-driver/20200416-073357
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-191-gc51a0382-dirty
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
:::::: branch date: 21 hours ago
:::::: commit date: 21 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/iio/adc/ti-ads8344.c:96:43: sparse: sparse: No right hand side of '|'-expression
   drivers/iio/adc/ti-ads8344.c:96:43: sparse: sparse: Expected ; at end of statement
   drivers/iio/adc/ti-ads8344.c:96:43: sparse: sparse: got �

# https://github.com/0day-ci/linux/commit/f4710fdd10c9cf84bd09d8b295a435b371800bd0
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout f4710fdd10c9cf84bd09d8b295a435b371800bd0
vim +96 drivers/iio/adc/ti-ads8344.c

8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  72  
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  73  static int ads8344_adc_conversion(struct ads8344 *adc, int channel,
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  74  				  bool differential)
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  75  {
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  76  	struct spi_device *spi = adc->spi;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  77  	int ret;
f4710fdd10c9cf Alexandre Belloni 2020-04-15  78  	u8 buf[3];
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  79  
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  80  	adc->tx_buf = ADS8344_START;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  81  	if (!differential)
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  82  		adc->tx_buf |= ADS8344_SINGLE_END;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  83  	adc->tx_buf |= ADS8344_CHANNEL(channel);
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  84  	adc->tx_buf |= ADS8344_CLOCK_INTERNAL;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  85  
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  86  	ret = spi_write(spi, &adc->tx_buf, 1);
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  87  	if (ret)
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  88  		return ret;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  89  
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  90  	udelay(9);
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  91  
f4710fdd10c9cf Alexandre Belloni 2020-04-15  92  	ret = spi_read(spi, buf, sizeof(buf));
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  93  	if (ret)
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  94  		return ret;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  95  
f4710fdd10c9cf Alexandre Belloni 2020-04-15 @96  	return buf[0] << 9 | buf[1] << 1 | buf[2] >> 7;
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  97  }
8dd2d7c0fed778 Gregory CLEMENT   2019-04-12  98  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

end of thread, other threads:[~2020-04-21 12:24 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-15 21:22 [PATCH 0/3] iio: adc: ti-ads8344: improve the driver Alexandre Belloni
2020-04-15 21:22 ` [PATCH 1/3] iio: adc: ti-ads8344: properly byte swap value Alexandre Belloni
2020-04-16  6:22   ` kbuild test robot
2020-04-16  6:22     ` kbuild test robot
2020-04-16 20:50     ` Alexandre Belloni
2020-04-19  2:49       ` Philip Li
2020-04-19  2:49         ` Philip Li
2020-04-21  7:25         ` Xia, Hui
2020-04-21  7:25           ` Xia, Hui
2020-04-21 12:24           ` Alexandre Belloni
2020-04-16  6:29   ` Lars-Peter Clausen
2020-04-15 21:22 ` [PATCH 2/3] iio: adc: ti-ads8344: remove tx_buf from driver data Alexandre Belloni
2020-04-16  6:26   ` Lars-Peter Clausen
2020-04-17 10:24   ` Andy Shevchenko
2020-04-15 21:22 ` [PATCH 3/3] iio: adc: ti-ads8344: optimize consumption Alexandre Belloni
  -- strict thread matches above, loose matches on Subject: below --
2020-04-16  7:10 [PATCH 1/3] iio: adc: ti-ads8344: properly byte swap value kbuild test robot
2020-04-16 20:16 kbuild test robot

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.