History log of /linux-master/drivers/iio/adc/max11100.c
Revision Date Author Comments
# 51f30d63 08-May-2022 Jonathan Cameron <Jonathan.Cameron@huawei.com>

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: a8e7e88df9ec ("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


# 7169a78e 16-May-2021 Jonathan Cameron <Jonathan.Cameron@huawei.com>

iio: adc: max11100: Use devm_ functions for rest of probe()

By using devm_add_action_or_reset() to manage the regulator disable,
it becomes simple to use managed functions for all of remove.
This simplifies error handling and allows us to drop the remove()
function entirely.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210516172520.1398835-3-jic23@kernel.org


# ff9111ab 16-May-2021 Jonathan Cameron <Jonathan.Cameron@huawei.com>

iio: adc: max11100: Use get_unaligned_be16() rather than opencoding.

The function is more explicit in showing the intent + quicker on some
platforms.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210516172520.1398835-2-jic23@kernel.org


# 7a3e190f 28-Jun-2020 Jonathan Cameron <Jonathan.Cameron@huawei.com>

iio:adc:max11100: Drop of_match_ptr protection / add mod_devicetable.h include

Allows use of driver with ACPI PRP0001 base binding.
Mostly this is about trying to avoid cut and paste of this into new
drivers (it is a frequent review comment) rather than any
thought that this driver might get used on an ACPI platform.

The mod_devicetable.h include is to encourage best practice of including
any header directly used within the code (here for of_match_id)

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>


# 8cb631cc 13-Jun-2020 Lars-Peter Clausen <lars@metafoo.de>

iio: Remove superfluous of_node assignments

If a driver does not assign an of_node to a IIO device to IIO core will
automatically assign the of_node of the parent device. This automatic
assignment is done in the iio_device_register() function.

There is a fair amount of drivers that currently manually assign the
of_node of the IIO device. All but 4 of them can make use of the automatic
assignment though.

The exceptions are:
* mxs-lradc-adc: Which uses the of_node of the parent of the parent.
* stm32-dfsdm-adc, stm32-adc and stm32-dac: Which reference the of_node
assigned to the IIO device before iio_device_register() is called.

All other drivers are updated to use automatic assignment. This reduces
the amount of boilerplate code involved in setting up the IIO device.

The patch has mostly been auto-generated with the following semantic patch

// <smpl>
@exists@
expression indio_dev;
expression parent;
@@
indio_dev = \(devm_iio_device_alloc\|iio_device_alloc\)(&parent, ...)
...
-indio_dev->dev.of_node = parent.of_node;

@exists@
expression indio_dev;
expression parent;
@@
indio_dev = \(devm_iio_device_alloc\|iio_device_alloc\)(parent, ...)
...
-indio_dev->dev.of_node = parent->of_node;
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


# d3be8324 22-May-2020 Alexandru Ardelean <alexandru.ardelean@analog.com>

iio: remove explicit IIO device parent assignment

This patch applies the semantic patch:
@@
expression I, P, SP;
@@
I = devm_iio_device_alloc(P, SP);
...
- I->dev.parent = P;

It updates 302 files and does 307 deletions.
This semantic patch also removes some comments like
'/* Establish that the iio_dev is a child of the i2c device */'

But this is is only done in case where the block is left empty.

The patch does not seem to cover all cases. It looks like in some cases a
different variable is used in some cases to assign the parent, but it
points to the same reference.
In other cases, the block covered by ... may be just too big to be covered
by the semantic patch.

However, this looks pretty good as well, as it does cover a big bulk of the
drivers that should remove the parent assignment.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


# ce6c3736 26-May-2020 Rikard Falkeborn <rikard.falkeborn@gmail.com>

iio: adc: max11100: Constify struct iio_chan_spec

max11100_channels is not modified and can therefore be made const to
allow the compiler to put it in read-only memory.

Before:
text data bss dec hex filename
3776 1168 0 4944 1350 drivers/iio/adc/max11100.o

After:
text data bss dec hex filename
3968 976 0 4944 1350 drivers/iio/adc/max11100.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


# c924eee3 07-Nov-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

iio: adc: max11100: convert to SPDX identifiers

This patch updates license to use SPDX-License-Identifier
instead of verbose license text.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


# 52b31bcc 23-Jul-2017 Jonathan Cameron <jic23@kernel.org>

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>


# bb4787f5 30-Mar-2017 Arushi Singhal <arushisinghal19971997@gmail.com>

iio: adc: replace comma with a semicolon

Replace a comma between expression statements by a semicolon. This
changes the semantics of the code, but given the current indentation
appears to be what is intended.
A simplified version of the Coccinelle semantic patch that performs this
transformation is as follows:

// <smpl>
@r@
expression e1,e2;
@@

e1
-,
+;
e2;
// </smpl>

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# db233ef8 06-Feb-2017 Wei Yongjun <weiyongjun1@huawei.com>

iio: adc: max11100: remove .owner field for driver

Remove .owner field if calls are used which set it automatically.

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# ac2bec9d 16-Jan-2017 Phil Reid <preid@electromag.com.au>

iio: adc: tlc4541: add support for TI tlc4541 adc

This adds TI's tlc4541 16-bit ADC driver. Which is a single channel
ADC. Supports raw and trigger buffer access.
Also supports the tlc3541 14-bit device, which has not been tested.
Implementation of the tlc3541 is fairly straight forward thou.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Phil Reid <preid@electromag.com.au>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# a8e7e88d 18-Jan-2017 Jacopo Mondi <jacopo@jmondi.org>

iio: adc: Add Maxim MAX11100 driver

Add iio driver for Maxim MAX11100 single-channel ADC.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Tested-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>