Andy Shevchenko
6531f3a41f
iio: adc: meson_saradc: Use devm_clk_get_optional()
...
Replace open coded variants of devm_clk_get_optional().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com >
Link: https://lore.kernel.org/r/20220603100004.70336-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-15 22:07:10 +01:00
Andy Shevchenko
2d27a02139
iio: adc: meson_saradc: Convert to use dev_err_probe()
...
It's fine to call dev_err_probe() in ->probe() when error code is known.
Convert the driver to use dev_err_probe().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com >
Link: https://lore.kernel.org/r/20220603100004.70336-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-15 22:07:10 +01:00
Andy Shevchenko
d43c7006e4
iio: adc: meson_saradc: Align messages to be with physical device prefix
...
Align messages to be printed with the physical device prefix as it's done
everywhere else in this driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com >
Link: https://lore.kernel.org/r/20220603100004.70336-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-15 22:07:10 +01:00
Andy Shevchenko
ec25bb6e84
iio: adc: meson_saradc: Don't attach managed resource to IIO device object
...
It feels wrong and actually inconsistent to attach managed resources
to the IIO device object, which is child of the physical device object.
The rest of the ->probe() calls do that against physical device.
Resolve this by reassigning managed resources to the physical device object.
Suggested-by: Lars-Peter Clausen <lars@metafoo.de >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com >
Link: https://lore.kernel.org/r/20220603100004.70336-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-15 22:07:10 +01:00
Andy Shevchenko
5a3ec28ada
iio: adc: sc27xx_adc: Re-use generic struct u32_fract
...
Instead of a pair of u32 re-use generic struct u32_fract.
No functional changes intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Cixi Geng <cixi.geng1@unisoc.com >
Link: https://lore.kernel.org/r/20220530180910.2533-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-15 22:07:10 +01:00
Paul Cercueil
754d013433
iio: at91-sama5d2: Limit requested watermark value to hwfifo size
...
Instead of returning an error if the watermark value is too high, which
the core will silently ignore anyway, limit the value to the hardware
FIFO size; a lower-than-requested value is still better than using the
default, which is usually 1.
Cc: Eugen Hristev <eugen.hristev@microchip.com >
Cc: Nicolas Ferre <nicolas.ferre@microchip.com >
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com >
Cc: Ludovic Desroches <ludovic.desroches@microchip.com >
Signed-off-by: Paul Cercueil <paul@crapouillou.net >
Link: https://lore.kernel.org/r/20220117102512.31725-2-paul@crapouillou.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-15 22:07:10 +01:00
Andy Shevchenko
bf49a46b6d
iio: adc: intel_mrfld_adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220615120803.41350-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-15 22:07:09 +01:00
Nuno Sá
d428e68a26
iio: adc: rzg2l_adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-11-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:20 +01:00
Nuno Sá
074d68c1c0
iio: adc: npcm_adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-10-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:20 +01:00
Nuno Sá
e335cd347e
iio: adc: mt6360-adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-9-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:20 +01:00
Nuno Sá
1fd4c0cd78
iio: adc: mp2629_adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-8-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:20 +01:00
Nuno Sá
4738b57a6c
iio: adc: ingenic-adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-7-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:20 +01:00
Nuno Sá
c2bb705f45
iio: adc: imx8qxp-adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-6-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:20 +01:00
Nuno Sá
848d190104
iio: adc: imx7d_adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-5-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:20 +01:00
Nuno Sá
34de6b50dd
iio: adc: berlin2-adc: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-4-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:20 +01:00
Nuno Sá
f3823017e1
iio: adc: ad7606_par: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:19 +01:00
Nuno Sá
ae3babe1c4
iio: adc: ad7606: explicitly add proper header files
...
Do not trust the fact that iio.h includes of.h which in turn includes
all the headers we are relying on.
The ultimate goal is to actually drop of.h from iio.h.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220610084545.547700-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-06-14 11:53:19 +01:00
Jonathan Cameron
62fa19bf48
iio: adc: ti-tlc4541: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Fixes: ac2bec9d58 ("iio: adc: tlc4541: add support for TI tlc4541 adc")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-40-jic23@kernel.org
2022-06-14 11:53:15 +01:00
Jonathan Cameron
a2105d87eb
iio: adc: ti-ads8688: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 3e87e78383 ("iio: adc: Add TI ADS8688")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-39-jic23@kernel.org
2022-06-14 11:53:15 +01:00
Jonathan Cameron
8966b11e5a
iio: adc: ti-ads8344: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 8dd2d7c0fe ("iio: adc: Add driver for the TI ADS8344 A/DC chips")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-38-jic23@kernel.org
2022-06-14 11:53:15 +01:00
Jonathan Cameron
dd54ba8b24
iio: adc: ti-ads7950: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Fixes: 902c4b2446 ("iio: adc: New driver for TI ADS7950 chips")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: David Lechner <david@lechnology.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-37-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
55afdd050c
iio: adc: ti-ads131e08: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: d935eddd27 ("iio: adc: Add driver for Texas Instruments ADS131E0x ADC family")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Tomislav Denis <tomislav.denis@avl.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-36-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
7df19bd26c
iio: adc: ti-ads124s08: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: e717f8c6df ("iio: adc: Add the TI ads124s08 ADC code")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-35-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
3a828f204a
iio: adc: ti-adc161s626: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 4d671b71be ("iio: adc: ti-adc161s626: add support for TI 1-channel differential ADCs")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Matt Ranostay <mranostay@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-34-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
23c81e7a7e
iio: adc: ti-adc128s052: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 913b864686 ("iio: adc: Add TI ADC128S052")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-33-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
76890c3bce
iio: adc: ti-adc12138: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 50a6edb1b6 ("iio: adc: add ADC12130/ADC12132/ADC12138 ADC driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Akinobu Mita <akinobu.mita@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-32-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
6909fe1788
iio: adc: ti-adc108s102: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Dual fixes tags as two cases that were introduced in different patches.
One of those patches is a fix however and likely to have been backported
to stable kernels.
Note the second alignment marking is likely to be unnecessary, but is
left for now to keep this fix simple.
Fixes: 3691e5a694 ("iio: adc: add driver for the ti-adc084s021 chip")
Fixes: cbe5c69776 ("iio: adc: ti-adc108s102: Fix alignment of buffer pushed to iio buffers.")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-31-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
bb102fd600
iio: adc: ti-adc084s021: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Fixes: 3691e5a694 ("iio: adc: add driver for the ti-adc084s021 chip")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Acked-by: Mårten Lindahl <marten.lindahl@axis.com >
Link: https://lore.kernel.org/r/20220508175712.647246-30-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
1e6bb81c23
iio: adc: ti-adc0832: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: efc945fb72 ("iio: adc: add support for ADC0831/ADC0832/ADC0834/ADC0838 chips")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Akinobu Mita <akinobu.mita@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-29-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
e770f78036
iio: adc: mcp320x: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Worth noting the fixes tag refers to the same issue being observed
on a platform that probably had only 64 byte cachelines.
Fixes: 0e81bc99a0 ("iio: mcp320x: Fix occasional incorrect readings")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Michael Welling <mwelling@ieee.org >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-28-jic23@kernel.org
2022-06-14 11:53:14 +01:00
Jonathan Cameron
9d7019e43e
iio: adc: max1241: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 8a80a71d90 ("iio: adc: Add MAX1241 driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Alexandru Lazar <alazar@startmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-27-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
f746ab0bac
iio: adc: max1118: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: a9e9c7153e ("iio: adc: add max1117/max1118/max1119 ADC driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Akinobu Mita <akinobu.mita@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-26-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
51f30d6314
iio: adc: max11100: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Fixes: a8e7e88df9 ("iio: adc: Add Maxim MAX11100 driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Jacopo Mondi <jacopo@jmondi.org >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-25-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
e754fb7e7a
iio: adc: max1027: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: fc167f6248 ("iio: add support of the max1027")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-24-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
6ebf401d55
iio: adc: ltc2497: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Fixes: bc82222fcc ("iio:adc: Driver for Linear Technology LTC2497 ADC")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Michael Hennerich <michael.hennerich@analog.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-23-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
1673b7ca2d
iio: adc: ltc2496: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Fixes: e4c5c4dfaa ("iio: adc: new driver to support Linear technology's ltc2496")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-22-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
48e4ae96b0
iio: adc: hi8435: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 72aa29ce0a ("iio: adc: hi8435: Holt HI-8435 threshold detector")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-21-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
9c6c7eff7d
iio: adc: ad7949: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Note the fixes tag predates some changes to this line of code so
automated application of this fix may fail.
Fixes: 7f40e06143 ("iio:adc:ad7949: Add AD7949 ADC driver family")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Charles-Antoine Couret <charles-antoine.couret@essensium.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-20-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
908af45d70
iio: adc: ad7923: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Note that some other fixes have applied to this line of code
that may complicate automated backporting.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Fixes: 0eac259db2 ("IIO ADC support for AD7923")
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-19-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
b330ea6bc5
iio: adc: ad7887: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to include 'may'.
Fixes tag is clearly not where this was introduced but it is very unlikely
anyone will back port it past that point.
Fixes: 65dd3d3d7a ("staging:iio:ad7887: Squash everything into one file")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Lars-Peter Clausen <lars@metafoo.de >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-18-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
211f810f8f
iio: adc: ad7768-1: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to reflect that separate cachelines 'may' be
required.
Fixes: a5f8c7da3d ("iio: adc: Add AD7768-1 ADC basic support")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-17-jic23@kernel.org
2022-06-14 11:53:13 +01:00
Jonathan Cameron
009ae227a1
iio: adc: ad7766: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to reflect the fact DMA safety 'may' require
separate cachelines.
Fixes: aa16c6bd0e ("iio:adc: Add support for AD7766/AD7767")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Lars-Peter Clausen <lars@metafoo.de >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-16-jic23@kernel.org
2022-06-14 11:53:12 +01:00
Jonathan Cameron
6268c6eebb
iio: adc: ad7606: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_ALIGN definition.
Update the comment to reflect the fact DMA safety 'may' require
separate cachelines.
Fixes: 7989b4bb23 ("iio: adc: ad7616: Add support for AD7616 ADC")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-15-jic23@kernel.org
2022-06-14 11:53:12 +01:00
Jonathan Cameron
58b74555af
iio: adc: ad7476: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to reflect that DMA safety 'may' require separate
cachelines.
Fixes tag is unlikely to be the actual introdution of the problem but is
far enough back to cover any likely backporting.
Fixes: 7a28fe3c93 ("staging:iio:ad7476: Squash driver into a single file.")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-14-jic23@kernel.org
2022-06-14 11:53:12 +01:00
Jonathan Cameron
585c9772f8
iio: adc: ad7298: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: be7fd3b86a ("iio:adc:ad7298 make the tx and rx buffers __be16")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-13-jic23@kernel.org
2022-06-14 11:53:12 +01:00
Jonathan Cameron
98295a206d
iio: adc: ad7292: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 506d2e317a ("iio: adc: Add driver support for AD7292")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-12-jic23@kernel.org
2022-06-14 11:53:12 +01:00
Jonathan Cameron
4e20084295
iio: adc: ad7280a: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Fixes: 003f1d48de ("staging:iio:adc:ad7280a: Split buff[2] into tx and rx parts")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-11-jic23@kernel.org
2022-06-14 11:53:12 +01:00
Jonathan Cameron
b990cdfe75
iio: adc: ad7266: Fix alignment for DMA safety
...
____cacheline_aligned is an insufficient guarantee for non-coherent DMA
on platforms with 128 byte cachelines above L1. Switch to the updated
IIO_DMA_MINALIGN definition.
Update the comment to reflect that DMA safety 'may' require separate
cachelines.
Fixes: 54e018da31 ("iio:ad7266: Mark transfer buffer as __be16")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-10-jic23@kernel.org
2022-06-14 11:53:12 +01:00
Jonathan Cameron
12c4efe350
iio: core: Fix IIO_ALIGN and rename as it was not sufficiently large
...
Discussion of the series:
https://lore.kernel.org/all/20220405135758.774016-1-catalin.marinas@arm.com/
mm, arm64: Reduce ARCH_KMALLOC_MINALIGN brought to my attention that
our current IIO usage of L1CACHE_ALIGN is insufficient as their are Arm
platforms out their with non coherent DMA and larger cache lines at
at higher levels of their cache hierarchy.
Rename the define to make it's purpose more explicit. It will be used
much more widely going forwards (to replace incorrect ____cacheline_aligned
markings.
Note this patch will greatly reduce the padding on some architectures
that have smaller requirements for DMA safe buffers.
The history of changing values of ARCH_KMALLOC_MINALIGN via
ARCH_DMA_MINALIGN on arm64 is rather complex. I'm not tagging this
as fixing a particular patch from that route as it's not clear what to tag.
Most recently a change to bring them back inline was reverted because
of some Qualcomm Kryo cores with an L2 cache with 128-byte lines
sitting above the point of coherency.
c1132702c7 Revert "arm64: cache: Lower ARCH_DMA_MINALIGN to 64 (L1_CACHE_BYTES)"
That reverts:
65688d2a05 arm64: cache: Lower ARCH_DMA_MINALIGN to 64 (L1_CACHE_BYTES) which
refers to the change originally being motivated by Thunder x1 performance
rather than correctness.
Fixes: 6f7c8ee585 ("staging:iio: Add ability to allocate private data space to iio_allocate_device")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220508175712.647246-2-jic23@kernel.org
2022-06-14 11:53:11 +01:00
Jonathan Cameron
129d7c49c5
iio: adc: adi-axi: Move exported symbols into IIO_ADI_AXI namespace.
...
Avoid unnecessary pollution of the global symbol namespace by
moving library functions in to a specific namespace and import
that into the drivers that make use of the functions.
For more info: https://lwn.net/Articles/760045/
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20220220173701.502331-5-jic23@kernel.org
2022-06-14 11:53:10 +01:00