History log of /linux-master/drivers/iio/adc/berlin2-adc.c
Revision Date Author Comments
# cbd3a015 28-Nov-2022 Xiongfeng Wang <wangxiongfeng2@huawei.com>

iio: adc: berlin2-adc: Add missing of_node_put() in error path

of_get_parent() will return a device_node pointer with refcount
incremented. We need to use of_node_put() on it when done. Add the
missing of_node_put() in the error path of berlin2_adc_probe();

Fixes: 70f1937911ca ("iio: adc: add support for Berlin")
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Link: https://lore.kernel.org/r/20221129020316.191731-1-wangxiongfeng2@huawei.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


# 34de6b50 10-Jun-2022 Nuno Sá <nuno.sa@analog.com>

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>


# 461a1c79 26-Sep-2021 Alexandru Ardelean <aardelean@deviqon.com>

iio: adc: berlin2-adc: convert probe to device-managed only

This driver requires only a devm_add_action_or_reset() hook for the
power-down of the device, and then devm_iio_device_register() can be used
directly.

Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
Link: https://lore.kernel.org/r/20210926192642.4051329-1-aardelean@deviqon.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>


# 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>


# b465fc54 27-Jul-2015 Hartmut Knaack <knaack.h@gmx.de>

iio:adc:berlin2-adc: coding style cleanup

Some adjustment of indentation to make checkpatch.pl happy in strict mode.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 3ac06522 27-Jul-2015 Hartmut Knaack <knaack.h@gmx.de>

iio:adc:berlin2-adc: enable interrupts with mutex locked

Move the call to enable channel interrupts into its _read() function to
have it protected by a mutex. This ensures that only one channel is
sampled at a time.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 4b308e8c 27-Jul-2015 Hartmut Knaack <knaack.h@gmx.de>

iio:adc:berlin2-adc: use GENMASK and BIT for masks

Make use of GENMASK for consecutive bitmasks and BIT for single bitmasks.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 57cb0676 27-Jul-2015 Hartmut Knaack <knaack.h@gmx.de>

iio:adc:berlin2-adc: Fix register definition

Active channel number is stored in BERLIN2_SM_CTRL as value, instead of a
bit map.
The masks for channel interrupts and data ready are a 16 bits wide bit
map each, instead of just 4 bits.

Also correct the data mask for the temperature sensor, which was
Reported-by: Antoine Tenart <antoine.tenart@free-electrons.com>

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 546384c9 27-Jul-2015 Hartmut Knaack <knaack.h@gmx.de>

iio:adc:berlin2-adc: use channel-array size directly

Drop the otherwise unused definition of the channel-array size and use it
directly in _probe - makes it a bit more obvious.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 609e9d88 27-Jul-2015 Hartmut Knaack <knaack.h@gmx.de>

iio:adc:berlin2-adc: use short operator format

Use augmented assignment to subtract the offset for negative temperature
values.
Specify the amount of private data to be allocated through
devm_iio_device_alloc() with sizeof(*priv), as it is shorter and common
practice in IIO.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 688febbd 27-Jul-2015 Hartmut Knaack <knaack.h@gmx.de>

iio:adc:berlin2-adc: constify iio_chan_spec

Mark berlin2_adc_channels array as constant.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 19d56642 27-Jul-2015 Hartmut Knaack <knaack.h@gmx.de>

iio:adc:berlin2-adc: pass up real error code

Pass up the real error code returned by platform_get_irq_byname().

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>


# 70f19379 18-May-2015 Antoine Tenart <atenart@kernel.org>

iio: adc: add support for Berlin

This patch adds the support of the Berlin ADC, available on Berlin SoCs.
This ADC has 8 channels available, with one connected to a temperature
sensor.

The particularity here, is that the temperature sensor connected to the
ADC has its own registers, and both the ADC and the temperature sensor
must be configured when using it.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>