Commit Graph

12 Commits

Author SHA1 Message Date
Jonathan Cameron 26aa12ef64 iio: adc: ti-ads8688: Fix alignment of buffer in iio_push_to_buffers_with_timestamp()
[ Upstream commit 61fa5dfa5f52806f5ce37a0ba5712c271eb22f98 ]

Add __aligned(8) to ensure the buffer passed to
iio_push_to_buffers_with_timestamp() is suitable for the naturally
aligned timestamp that will be inserted.

Fixes: f214ff521f ("iio: ti-ads8688: Update buffer allocation for timestamps")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210613152301.571002-5-jic23@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:53:43 +02:00
Thomas Gleixner d2912cb15b treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-19 17:09:55 +02:00
Greg Kroah-Hartman 083a685c2e First set of IIO fixes for the 5.2 cycle.
* ads124
   - Avoid a buffer overrun when setting an array to 0.
 * ads8688
   - Don't use the pollfunc timestamp as it isn't set and would be wrong
     anyway for a device that does sampling on demand.
 * ds4422
   - Fix masking on register used for chip verification. Wrong address
     was being read.
 * mpu6050
   - Fix the fifo layout for ICM20602 to avoid underreading and hence failure
     to move on to the next record in the fifo.
 * NPCM ADC
   - Make sure there is actually a valid regulator before reading its voltage.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAlzhFEARHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0FojNMg//SCVSRt1KmsRDNdtCyUtgrs2BMISBQ5zP
 XpDvHajk9lPJvt/rbdKNJPC23N0qjV0fIfaMjsN1mTrbeL3JQE7r+17iCJ1EL+dj
 H2BFQlzMN9bPt9wx/VeQnTqPiTuwNpB5/eNb3mfGKGDkKmmfnL0+DDJEQycBgfK7
 gRgX4XGsMYLmKPAJvrQdSvMvu0V8UTAkZNBdcMydhl9Jba9elXPqI5kYFi7pNajD
 09fAGKhkeHd9whRNa2O6wKyRXh+c7regPAMtwjwlmv4dsmRHocYeLQOI05guuKf1
 /+0I+ptOf8RRHGOFX8j7rXua9Q2B+SzXsmoH4RlJLb23Jcqz7/ZDfcAGGVPndlME
 R3vGsYsoSLkmbRkVQ9ygDrzRsNnFKw/pR+u+zKdi/DH3C9EUI5JmRAkJSloElmrr
 VE1ZC7HXxUiKjfZaBLFeuugt65QGfxsGp+UsuFIgg0WQGk7yVWdC8RL9SZUy3wEq
 xFcfiWfbJp/LnVjs6aUBAV8cROswBv/ebcQZgOSPC/j8HyU6xRzmXVt4urBVwKVd
 gr3G+w7JhxCyByXJp7vqFtOmYeHB1X1UY8GNzgxsz9q2A1wtlEsXGpIh/arDY4r9
 toiSQAPAoVRBoLYfj+32EWgPR0iahjE81QZwWAqSzgBmompTQ1ByAyieOC4whgOe
 Lau/nLtAvGU=
 =nq1b
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-5.2a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus:

Jonathan writes:

First set of IIO fixes for the 5.2 cycle.

* ads124
  - Avoid a buffer overrun when setting an array to 0.
* ads8688
  - Don't use the pollfunc timestamp as it isn't set and would be wrong
    anyway for a device that does sampling on demand.
* ds4422
  - Fix masking on register used for chip verification. Wrong address
    was being read.
* mpu6050
  - Fix the fifo layout for ICM20602 to avoid underreading and hence failure
    to move on to the next record in the fifo.
* NPCM ADC
  - Make sure there is actually a valid regulator before reading its voltage.

* tag 'iio-fixes-for-5.2a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio:
  iio: adc: ti-ads8688: fix timestamp is not updated in buffer
  iio: dac: ds4422/ds4424 fix chip verification
  iio: imu: mpu6050: Fix FIFO layout for ICM20602
  iio: adc: ads124: avoid buffer overflow
  iio: adc: modify NPCM ADC read reference voltage
2019-05-20 09:15:14 +02:00
Sean Nyekjaer e6d1229831 iio: adc: ti-ads8688: fix timestamp is not updated in buffer
When using the hrtimer iio trigger timestamp isn't updated.
If we use iio_get_time_ns it is updated correctly.

Fixes: 2a86487786 ("iio: adc: ti-ads8688: add trigger and buffer support")
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-05-11 12:50:18 +01:00
Sean Nyekjaer bcccd7ab3d iio: adc: ti-ads8688: Update the module author email address
Update the module author to the current email address.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04 20:19:53 +01:00
Dan Murphy f214ff521f iio: ti-ads8688: Update buffer allocation for timestamps
Per Jonathan Cameron, the buffer needs to allocate room for a
64 bit timestamp as well as the channels.  Change the buffer
to allocate this additional space.

Fixes: 2a86487786 ("iio: adc: ti-ads8688: add trigger and buffer support")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-12 18:32:28 +00:00
Sean Nyekjaer 2a86487786 iio: adc: ti-ads8688: add trigger and buffer support
Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-05-12 12:00:30 +01:00
Jonathan Cameron aacbd095b4 iio:adc:ti-ads8688: Drop manual setting of the driver owner field.
This has been handled by the spi core for some time now.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2017-09-03 18:10:25 +01:00
Jonathan Cameron 52b31bcc93 iio:adc: drop assign iio_info.driver_module and iio_trigger_ops.owner
The equivalent of both of these are now done via macro magic when
the relevant register calls are made.  The actual structure
elements will shortly go away.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
2017-08-22 21:22:25 +01:00
Crt Mori fbe84bd480 iio: devm_regulator_get_optional never returns NULL
This patch is inspired by a comment of Jonathan Cameron on patch of
Linus Walleij commit aeb55fff38 ("iio:
st_sensors: fetch and enable regulators unconditionally"). Because
changes made in this patch are actually reference generators they should
be using devm_regulator_get_optional, but if they do not explicitly set
the reference to NULL they should not be using IS_ERR_OR_NULL, but
simple IS_ERR check.

Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-09-05 21:09:38 +01:00
Matt Ranostay b541eaff49 iio: adc: add missing of_node references to iio_dev
Adding missing indio_dev->dev.of_node references to allow iio consumers
to access the device channels.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-07-03 13:40:08 +01:00
Sean Nyekjaer 3e87e78383 iio: adc: Add TI ADS8688
This patch adds support for the Texas Intruments ADS8688 ADC.

Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Reviewed-by: Martin Hundebøll <martin.hundeboll@prevas.dk>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-11-15 10:54:44 +00:00