platform/kernel/linux-rpi.git
2 years agoiio: accel: adxl367: unlock on error in adxl367_buffer_predisable()
Dan Carpenter [Thu, 24 Feb 2022 15:02:28 +0000 (18:02 +0300)]
iio: accel: adxl367: unlock on error in adxl367_buffer_predisable()

This error path needs to call the mutex_unlock(&st->lock) before
returning.

Fixes: cbab791c5e2a ("iio: accel: add ADXL367 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20220224150228.GB6856@kili
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoiio: adc: xilinx-ams: Use devm_delayed_work_autocancel() to simplify code
Christophe JAILLET [Sun, 13 Feb 2022 18:29:05 +0000 (19:29 +0100)]
iio: adc: xilinx-ams: Use devm_delayed_work_autocancel() to simplify code

Use devm_delayed_work_autocancel() instead of hand writing it. This is
less verbose and saves a few lines of code.

devm_delayed_work_autocancel() uses devm_add_action() instead of
devm_add_action_or_reset(). This is fine, because if the underlying memory
allocation fails, no work has been scheduled yet. So there is nothing to
undo.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/2626e6a057e40cd2271ef0e5f81d12e607bad5b4.1644776929.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoMAINTAINERS: add maintainer for ADMV1014 driver
Antoniu Miclaus [Tue, 15 Feb 2022 08:12:16 +0000 (10:12 +0200)]
MAINTAINERS: add maintainer for ADMV1014 driver

Add myself as maintainer for the ADMV1014 driver.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20220215081216.67706-4-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoDocumentation: ABI: testing: admv1014: add ABI docs
Antoniu Miclaus [Tue, 15 Feb 2022 08:12:15 +0000 (10:12 +0200)]
Documentation: ABI: testing: admv1014: add ABI docs

Add documentation for the use of the Digital Attenuator gain.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20220215081216.67706-3-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agodt-bindings: iio: frequency: add admv1014 binding
Antoniu Miclaus [Tue, 15 Feb 2022 08:12:14 +0000 (10:12 +0200)]
dt-bindings: iio: frequency: add admv1014 binding

Add device tree bindings for the ADMV1014 Upconverter.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220215081216.67706-2-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoiio: frequency: admv1014: add support for ADMV1014
Antoniu Miclaus [Tue, 15 Feb 2022 08:12:13 +0000 (10:12 +0200)]
iio: frequency: admv1014: add support for ADMV1014

The ADMV1014 is a silicon germanium (SiGe), wideband,
microwave downconverter optimized for point to point microwave
radio designs operating in the 24 GHz to 44 GHz frequency range.

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADMV1014.pdf
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20220215081216.67706-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoiio: accel: add ADXL367 driver
Cosmin Tanislav [Mon, 14 Feb 2022 07:38:10 +0000 (09:38 +0200)]
iio: accel: add ADXL367 driver

The ADXL367 is an ultralow power, 3-axis MEMS accelerometer.

The ADXL367 does not alias input signals to achieve ultralow power
consumption, it samples the full bandwidth of the sensor at all
data rates. Measurement ranges of +-2g, +-4g, and +-8g are available,
with a resolution of 0.25mg/LSB on the +-2 g range.

In addition to its ultralow power consumption, the ADXL367
has many features to enable true system level power reduction.
It includes a deep multimode output FIFO, a built-in micropower
temperature sensor, and an internal ADC for synchronous conversion
of an additional analog input.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20220214073810.781016-6-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agodt-bindings: iio: accel: add ADXL367
Cosmin Tanislav [Mon, 14 Feb 2022 07:38:09 +0000 (09:38 +0200)]
dt-bindings: iio: accel: add ADXL367

The ADXL367 is an ultralow power, 3-axis MEMS accelerometer.

The ADXL367 does not alias input signals to achieve ultralow power
consumption, it samples the full bandwidth of the sensor at all
data rates. Measurement ranges of +-2g, +-4g, and +-8g are available,
with a resolution of 0.25mg/LSB on the +-2 g range.

In addition to its ultralow power consumption, the ADXL367
has many features to enable true system level power reduction.
It includes a deep multimode output FIFO, a built-in micropower
temperature sensor, and an internal ADC for synchronous conversion
of an additional analog input.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220214073810.781016-5-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoiio: ABI: add note about configuring other attributes during buffer capture
Cosmin Tanislav [Mon, 14 Feb 2022 07:38:08 +0000 (09:38 +0200)]
iio: ABI: add note about configuring other attributes during buffer capture

It might be impossible to configure other attributes (e.g.: events, scale,
sampling rate) if they impact the currently active buffer capture session.

On ADXL367, writing to register before 0x2E requires the device to be
placed in standby mode, otherwise the changes might be effective for
only part of a measurement.

To ensure this requirement, the configuration attributes of the IIO
device try to claim direct mode before switching to standby mode.
During a buffer capture, direct mode cannot be claimed, and the
attribute write callback returns -EBUSY.

Describe this behavior in the buffer/enable attribute description.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20220214073810.781016-4-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoiio: ABI: document mag_referenced
Cosmin Tanislav [Mon, 14 Feb 2022 07:38:07 +0000 (09:38 +0200)]
iio: ABI: document mag_referenced

Some accelerometers that support activity and inactivity
events also support a referenced mode, in which the
gravitational acceleration is taken as a point of
reference before comparing the acceleration to the
specified activity and inactivity magnitude.

For example, in the case of the ADXL367, for activity
detection, the formula is:

abs(acceleration - reference) > magnitude

Add a new event type that makes this behavior clear.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20220214073810.781016-3-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoiio: introduce mag_referenced
Cosmin Tanislav [Mon, 14 Feb 2022 07:38:06 +0000 (09:38 +0200)]
iio: introduce mag_referenced

Some accelerometers that support activity and inactivity
events also support a referenced mode, in which the
gravitational acceleration is taken as a point of
reference before comparing the acceleration to the
specified activity and inactivity magnitude.

For example, in the case of the ADXL367, for activity
detection, the formula is:

abs(acceleration - reference) > magnitude

Add a new event type that makes this behavior clear.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Link: https://lore.kernel.org/r/20220214073810.781016-2-cosmin.tanislav@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agodt-bindings: iio: adc: microchip,mcp3201: fix interface type (I2C -> SPI)
Jan Luebbe [Wed, 16 Feb 2022 16:23:12 +0000 (17:23 +0100)]
dt-bindings: iio: adc: microchip,mcp3201: fix interface type (I2C -> SPI)

This family of ADCs uses SPI, not I2C.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Link: https://lore.kernel.org/r/20220216162312.4064-1-jlu@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2 years agoiio:adc:ad7280a: Move out of staging
Jonathan Cameron [Sun, 6 Feb 2022 19:03:28 +0000 (19:03 +0000)]
iio:adc:ad7280a: Move out of staging

This is a rather unusual device (in IIO anyway).  However, it has
a near to standard userspace ABI.

Note the work to move this out of staging was done against a minimal
QEMU model, which doesn't model all the features of the device.
I have no intention to upstream the QEMU model as it was developed
just to enable this driver cleanup.

https://github.com/jic23/qemu/tree/ad7280a-hacks

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-21-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Use more conservative delays to allow 105C operation.
Jonathan Cameron [Sun, 6 Feb 2022 19:03:27 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Use more conservative delays to allow 105C operation.

The datasheet provides timings for operating this device at up to 105
degrees centigrade. Adopt these more conservative timings.

Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-20-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Remove shift from cb_mask state cache.
Jonathan Cameron [Sun, 6 Feb 2022 19:03:26 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Remove shift from cb_mask state cache.

Making the local storage of the Cell Balance mask a simple
bitmap and then shifting it only at time of register write simplifies
several code paths.

Suggested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-19-jic23@kernel.org
2 years agoiio:adc:ad7280a: Document ABI for cell balance switches
Jonathan Cameron [Sun, 6 Feb 2022 19:03:25 +0000 (19:03 +0000)]
iio:adc:ad7280a: Document ABI for cell balance switches

Very minimal ABI docs. This is unusual enough that I'd expect anyone
who actually wanted to touch them to go look at the datasheet.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-18-jic23@kernel.org
2 years agodt-bindings:iio:adc:ad7280a: Add binding
Jonathan Cameron [Sun, 6 Feb 2022 19:03:24 +0000 (19:03 +0000)]
dt-bindings:iio:adc:ad7280a: Add binding

Add a binding for this Lithium Ion Battery monitoring chip/chain of chips
as it is now clean and ready to move out of staging.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-17-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Drop buggy support for early termination of AUX alert.
Jonathan Cameron [Sun, 6 Feb 2022 19:03:23 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Drop buggy support for early termination of AUX alert.

This functionality is intended to allow for a few temperature
sensors to be missing (and hence not worth reading) on the final
device in a chain.  The ones removed are 3 and 5 (unlike for
the ADC channels where it is 4 and 5).

The datasheet includes a foot note 3 to Table 12 that makes this complex
to support.

"(3) To remove AUX5 or AUX5 and AUX3 from the alert detection, conversions
on three auxiliary ADC input channels only must be selected in the
control register."

This mode has never been supported by the driver.

As this support would be complex to add and the rework is being done
against a QEMU model developed for the purposes of verifying nothing
is broken, it is better to drop this support for now.

Reported-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-16-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Use device properties to replace platform data.
Jonathan Cameron [Sun, 6 Feb 2022 19:03:22 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Use device properties to replace platform data.

Convert all the device specific info that was previously in platform data
over to generic firmware query interfaces.

dt-bindings to follow shortly.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-15-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Use a local dev pointer to avoid &spi->dev
Jonathan Cameron [Sun, 6 Feb 2022 19:03:21 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Use a local dev pointer to avoid &spi->dev

We use this a few times already and it is about to get worse, so
introduce a local variable to simplify things.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-14-jic23@kernel.org
2 years agostaging:iio:ad7280a: Reflect optionality of irq in ABI
Jonathan Cameron [Sun, 6 Feb 2022 19:03:20 +0000 (19:03 +0000)]
staging:iio:ad7280a: Reflect optionality of irq in ABI

Given the irq is optional, let us remove the interfaces related to
events when it is not present.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-13-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Cleanup includes
Jonathan Cameron [Sun, 6 Feb 2022 19:03:19 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Cleanup includes

Drop used includes, add a few missing ones and reorder.
The include-what-you-use tool output was considered in making this
change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-12-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Make oversampling_ratio a runtime control
Jonathan Cameron [Sun, 6 Feb 2022 19:03:18 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Make oversampling_ratio a runtime control

Oversampling has nothing directly to do with analog circuits or
similar so belongs in the control of userspace as a policy decision.

The only complexity in here was that the acquisition time needs
updating if this setting is changed at runtime (as oversampling
is time consuming).

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-11-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Trivial comment formatting cleanup
Jonathan Cameron [Sun, 6 Feb 2022 19:03:17 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Trivial comment formatting cleanup

IIO uses the
/*
 * stuff
 * more stuff
 */

multi-line style, so use that here as well.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-10-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Drop unused timestamp channel.
Jonathan Cameron [Sun, 6 Feb 2022 19:03:16 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Drop unused timestamp channel.

The driver doesn't support buffered mode, so a timestamp channel that
is entirely hidden from userspace without buffer mode is rather pointless.
Drop it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-9-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Standardize extended ABI naming
Jonathan Cameron [Sun, 6 Feb 2022 19:03:15 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Standardize extended ABI naming

The *_balance_switch_en and *_balance_switch_timer attributes had non
standard prefixes. Use the ext_info framework to automatically
create then with in_voltageX-voltageY_ prefix.

Documentation for these two unusual attributes to follow.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-8-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Switch to standard event control
Jonathan Cameron [Sun, 6 Feb 2022 19:03:14 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Switch to standard event control

This driver had a slightly non standard events ABI but there seems
to be no reason for not doing it with the core support for rising and
falling events on the two types of channels.

In theory the events on different daisy chained chips could be at
different levels, but the driver has never supported this and it doesn't
seem likely to be used so let us ignore that option.

Includes reordering so that we only set the software cached value
of the thresholds if the hardware write succeeds.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-7-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Use bitfield ops to managed fields in transfers.
Jonathan Cameron [Sun, 6 Feb 2022 19:03:13 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Use bitfield ops to managed fields in transfers.

The write and two types of read transfer are sufficiently complex that
they benefit from the clarity of using FIELD_PREP() and FIELD_GET().
This also applies to the handling in ad7280_event_handler() so
use a similar approach there as well.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-6-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Split buff[2] into tx and rx parts
Jonathan Cameron [Sun, 6 Feb 2022 19:03:12 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Split buff[2] into tx and rx parts

As the __cacheline_aligned will ensure that the first of these two buffers
is appropriate aligned, there is no need to keep them as a single array
which is confusing given the first element is always tx and the second
rx.  Hence let us just have two parts and name them separately.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-5-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: rename _read() to _read_reg()
Jonathan Cameron [Sun, 6 Feb 2022 19:03:11 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: rename _read() to _read_reg()

This avoids possible confusion with read back of the channel conversions.
These two types of reads are of difference sizes with resulting differences
in the data layout of the response from the hardware.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-4-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Register define cleanup.
Jonathan Cameron [Sun, 6 Feb 2022 19:03:10 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Register define cleanup.

1. Postfix register addresses with _REG to distinguish them from
   fields within the registers
2. Switch to using FIELD_PREP and masks to aid readability.
3. Shorten a few defines to make the lines remain a sensible length.
4. Fix an issue whether where an CTRL_LB field is set in CTRL_HB.
5. Fix wrong AUX1_3_4 which should be AUX_1_3_5 according to
   table 14 in the datasheet.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-3-jic23@kernel.org
2 years agostaging:iio:adc:ad7280a: Fix handing of device address bit reversing.
Jonathan Cameron [Sun, 6 Feb 2022 19:03:09 +0000 (19:03 +0000)]
staging:iio:adc:ad7280a: Fix handing of device address bit reversing.

The bit reversal was wrong for bits 1 and 3 of the 5 bits.
Result is driver failure to probe if you have more than 2 daisy-chained
devices.  Discovered via QEMU based device emulation.

Fixes tag is for when this moved from a macro to a function, but it
was broken before that.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Fixes: 065a7c0b1fec ("Staging: iio: adc: ad7280a.c: Fixed Macro argument reuse")
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-2-jic23@kernel.org
2 years agoiio:adc:stm32*: Use pm[_sleep]_ptr() etc to avoid need to make pm __maybe_unused
Jonathan Cameron [Sun, 30 Jan 2022 19:31:47 +0000 (19:31 +0000)]
iio:adc:stm32*: Use pm[_sleep]_ptr() etc to avoid need to make pm __maybe_unused

The combinations of either
* pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS()
* pm_ptr() and RUNTIME_PM_OPS()/SYSTEM_SLEEP_PM_OPS
Make sure the functions are always visible to the compiler and removed by
it rather than requring #ifdef magic.

This removes the need to mark the functions as __maybe_unused and saves
additional space with some build options as the dev_pm_ops structure
itself can be dropped automatically if CONFIG_PM is not enabled.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Olivier Moysan <olivier.moysan@st.com>
Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-51-jic23@kernel.org
2 years agoiio:light:rpr0521: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:46 +0000 (19:31 +0000)]
iio:light:rpr0521: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Mikko Koivunen <mikko.koivunen@fi.rohmeurope.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-50-jic23@kernel.org
2 years agoiio:chemical:atlas: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:45 +0000 (19:31 +0000)]
iio:chemical:atlas: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-49-jic23@kernel.org
2 years agoiio:proximity:pulsedlight: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:44 +0000 (19:31 +0000)]
iio:proximity:pulsedlight: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-48-jic23@kernel.org
2 years agoiio:light:bh1780: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:43 +0000 (19:31 +0000)]
iio:light:bh1780: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Use the new DEFINE_RUNTIME_DEV_PM_OPS to reduce boilerplate.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-47-jic23@kernel.org
2 years agoiio:adc:rcar: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:42 +0000 (19:31 +0000)]
iio:adc:rcar: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-46-jic23@kernel.org
2 years agoiio:adc:stm32:Switch from CONFIG_PM guards to pm_ptr()
Jonathan Cameron [Sun, 30 Jan 2022 19:31:41 +0000 (19:31 +0000)]
iio:adc:stm32:Switch from CONFIG_PM guards to pm_ptr()

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

The new DEFINE_RUNTIME_DEV_PM_OPS() macro reduces boilerplate.

Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Olivier Moysan <olivier.moysan@foss.st.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-45-jic23@kernel.org
2 years agoiio:adc:ab8500: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:40 +0000 (19:31 +0000)]
iio:adc:ab8500: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

This case uses the new DEFINE_RUNTIME_DEV_PM_OPS() to reduce
boilerplate.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-44-jic23@kernel.org
2 years agoiio:temperature:mlx90614: Switch from CONFIG_PM* guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:39 +0000 (19:31 +0000)]
iio:temperature:mlx90614: Switch from CONFIG_PM* guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without one or  more of CONFIG_PM/CONFIG_PM_SLEEP support is simpler and
less error prone than the use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Crt Mori <cmo@melexis.com>
Reviewed-by: Crt Mori <cmo@melexis.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-43-jic23@kernel.org
2 years agoiio:imu:kmx61: Switch from CONFIG_PM* guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:38 +0000 (19:31 +0000)]
iio:imu:kmx61: Switch from CONFIG_PM* guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without one or  more of CONFIG_PM/CONFIG_PM_SLEEP support is simpler and
less error prone than the use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-42-jic23@kernel.org
2 years agoiio:dac:m62332: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:37 +0000 (19:31 +0000)]
iio:dac:m62332: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Note that in this case the storage for saving state was protected
by CONFIG_PM guards. The storage is very small and unlikely to make
any real difference to the space allocated for state so just drop
those guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-41-jic23@kernel.org
2 years agoiio:accel:bma180: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:36 +0000 (19:31 +0000)]
iio:accel:bma180: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-40-jic23@kernel.org
2 years agoiio:accel:stk8312: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:35 +0000 (19:31 +0000)]
iio:accel:stk8312: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-39-jic23@kernel.org
2 years agoiio:temperature:tmp007: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:34 +0000 (19:31 +0000)]
iio:temperature:tmp007: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-38-jic23@kernel.org
2 years agoiio:temperature:tmp006: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:33 +0000 (19:31 +0000)]
iio:temperature:tmp006: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-37-jic23@kernel.org
2 years agoiio:proximity:sx9500: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:32 +0000 (19:31 +0000)]
iio:proximity:sx9500: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-36-jic23@kernel.org
2 years agoiio:proximity:rfd77492: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:31 +0000 (19:31 +0000)]
iio:proximity:rfd77492: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-35-jic23@kernel.org
2 years agoiio:proximity:as3935: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:30 +0000 (19:31 +0000)]
iio:proximity:as3935: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-34-jic23@kernel.org
2 years agoiio:pressure:mpl3115: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:29 +0000 (19:31 +0000)]
iio:pressure:mpl3115: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-33-jic23@kernel.org
2 years agoiio:magn:mmc35240: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:28 +0000 (19:31 +0000)]
iio:magn:mmc35240: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards. Also use SIMPLE_DEV_PM_OPS instead
of open-coding the equivalent.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-32-jic23@kernel.org
2 years agoiio:magn:mag3110: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:27 +0000 (19:31 +0000)]
iio:magn:mag3110: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-31-jic23@kernel.org
2 years agoiio:magn:ak8975: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:26 +0000 (19:31 +0000)]
iio:magn:ak8975: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Use the new DEFINE_RUNTIME_DEV_PM_OPS() macro to reduce boilerplate.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-30-jic23@kernel.org
2 years agoiio:light:tsl4531: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:25 +0000 (19:31 +0000)]
iio:light:tsl4531: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-29-jic23@kernel.org
2 years agoiio:light:tsl2563: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:24 +0000 (19:31 +0000)]
iio:light:tsl2563: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Vaishnav M A <vaishnav@beagleboard.org>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-28-jic23@kernel.org
2 years agoiio:light:tcs3472: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:23 +0000 (19:31 +0000)]
iio:light:tcs3472: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-27-jic23@kernel.org
2 years agoiio:light:tcs3414: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:22 +0000 (19:31 +0000)]
iio:light:tcs3414: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-26-jic23@kernel.org
2 years agoiio:light:stk3310: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:21 +0000 (19:31 +0000)]
iio:light:stk3310: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Luca Weiss <luca@z3ntu.xyz>
Cc: Martijn Braam <martijn@brixit.nl>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-25-jic23@kernel.org
2 years agoiio:light:ltr501: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:20 +0000 (19:31 +0000)]
iio:light:ltr501: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Maslov Dmitry <maslovdmitry@seeed.cc>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-24-jic23@kernel.org
2 years agoiio:light:jsa1212: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:19 +0000 (19:31 +0000)]
iio:light:jsa1212: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-23-jic23@kernel.org
2 years agoiio:light:isl29125: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:18 +0000 (19:31 +0000)]
iio:light:isl29125: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-22-jic23@kernel.org
2 years agoiio:light:isl29018: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Jonathan Cameron [Sun, 30 Jan 2022 19:31:17 +0000 (19:31 +0000)]
iio:light:isl29018: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Anson Huang <anson.huang@nxp.com>
Cc: Brian Masney <masneyb@onstation.org>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-21-jic23@kernel.org
2 years agoiio:light:cm3232: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:16 +0000 (19:31 +0000)]
iio:light:cm3232: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.  Also switch to SIMPLE_DEV_PM_OPS rather
than opencoding the same.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-20-jic23@kernel.org
2 years agoiio:light:apds9300: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:15 +0000 (19:31 +0000)]
iio:light:apds9300: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-19-jic23@kernel.org
2 years agoiio:dac:vf610: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:14 +0000 (19:31 +0000)]
iio:dac:vf610: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-18-jic23@kernel.org
2 years agoiio:common:ssp: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:13 +0000 (19:31 +0000)]
iio:common:ssp: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of ifdef based config guards.  Also switch to SIMPLE_DEV_PM_OPS
rather than open coding the structure.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-17-jic23@kernel.org
2 years agoiio:adc:vf610: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:12 +0000 (19:31 +0000)]
iio:adc:vf610: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Stefan-Gabriel Mirea <stefan-gabriel.mirea@nxp.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-16-jic23@kernel.org
2 years agoiio:adc:twl6030: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:11 +0000 (19:31 +0000)]
iio:adc:twl6030: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-15-jic23@kernel.org
2 years agoiio:adc:rockchip: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:10 +0000 (19:31 +0000)]
iio:adc:rockchip: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-14-jic23@kernel.org
2 years agoiio:adc:palmas_gpadc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Jonathan Cameron [Sun, 30 Jan 2022 19:31:09 +0000 (19:31 +0000)]
iio:adc:palmas_gpadc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

In this case SIMPLE_DEV_PM_OPS() could have been used previously.
Now we have DEFINE_SIMPLE_DEV_PM_OPS() which also deals with letting
the compiler remove the structure and functions so use that instead.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-13-jic23@kernel.org
2 years agoiio:adc:exynos_adc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Jonathan Cameron [Sun, 30 Jan 2022 19:31:08 +0000 (19:31 +0000)]
iio:adc:exynos_adc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-12-jic23@kernel.org
2 years agoiio:adc:at91-adc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:07 +0000 (19:31 +0000)]
iio:adc:at91-adc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-11-jic23@kernel.org
2 years agoiio:accel:stk8ba50: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:06 +0000 (19:31 +0000)]
iio:accel:stk8ba50: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-10-jic23@kernel.org
2 years agoiio:accel:mma9553: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:05 +0000 (19:31 +0000)]
iio:accel:mma9553: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-9-jic23@kernel.org
2 years agoiio:accel:mma9551: Switch from CONFIG_PM guards to pm_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:04 +0000 (19:31 +0000)]
iio:accel:mma9551: Switch from CONFIG_PM guards to pm_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-8-jic23@kernel.org
2 years agoiio:accel:mma7660: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Jonathan Cameron [Sun, 30 Jan 2022 19:31:03 +0000 (19:31 +0000)]
iio:accel:mma7660: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-7-jic23@kernel.org
2 years agoiio:accel:mc3230: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:02 +0000 (19:31 +0000)]
iio:accel:mc3230: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-6-jic23@kernel.org
2 years agoiio:accel:dmard10: Switch from CONFIG_PM guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:01 +0000 (19:31 +0000)]
iio:accel:dmard10: Switch from CONFIG_PM guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-5-jic23@kernel.org
2 years agoiio:accel:dmard06: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:31:00 +0000 (19:31 +0000)]
iio:accel:dmard06: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-4-jic23@kernel.org
2 years agoiio:accel:da280: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:30:59 +0000 (19:30 +0000)]
iio:accel:da280: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-3-jic23@kernel.org
2 years agoiio:accel:da311: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Jonathan Cameron [Sun, 30 Jan 2022 19:30:58 +0000 (19:30 +0000)]
iio:accel:da311: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based config guards.

Removing instances of this approach from IIO also stops them being
copied into new drivers.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220130193147.279148-2-jic23@kernel.org
2 years agoiio:chemical:bme680: Move exports to IIO_BME680 namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:57:01 +0000 (20:57 +0000)]
iio:chemical:bme680: Move exports to IIO_BME680 namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Himanshu Jha <himanshujha199640@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-17-jic23@kernel.org
2 years agoiio:light:st_uvis25: Move exports to IIO_UVIS25 namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:57:00 +0000 (20:57 +0000)]
iio:light:st_uvis25: Move exports to IIO_UVIS25 namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-16-jic23@kernel.org
2 years agoiio:magnetometer:hmc5843: Move exports to IIO_HMC5843 namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:59 +0000 (20:56 +0000)]
iio:magnetometer:hmc5843: Move exports to IIO_HMC5843 namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-15-jic23@kernel.org
2 years agoiio:magnetometer:bmc150: Move exports to IIO_BMC150_MAGN namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:58 +0000 (20:56 +0000)]
iio:magnetometer:bmc150: Move exports to IIO_BMC150_MAGN namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

Note the MAGN postfix here is reflecting that this driver is only
responsible for part of the BMC150 device.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-14-jic23@kernel.org
2 years agoiio:magnetometer:rm3100: Move exports to IIO_RM3100 namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:57 +0000 (20:56 +0000)]
iio:magnetometer:rm3100: Move exports to IIO_RM3100 namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Song Qiang <songqiang1304521@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-13-jic23@kernel.org
2 years agoiio:pressure:mpl115: Move exports into IIO_MPL115 namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:56 +0000 (20:56 +0000)]
iio:pressure:mpl115: Move exports into IIO_MPL115 namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-12-jic23@kernel.org
2 years agoiio:pressure:ms5611: Move exports into IIO_MS5611 namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:55 +0000 (20:56 +0000)]
iio:pressure:ms5611: Move exports into IIO_MS5611 namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tomasz Duszynski <tduszyns@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-11-jic23@kernel.org
2 years agoiio:pressure:zpa2326: Move exports into IIO_ZPA2326 namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:54 +0000 (20:56 +0000)]
iio:pressure:zpa2326: Move exports into IIO_ZPA2326 namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-10-jic23@kernel.org
2 years agoiio:imu:adis: Move exports into IIO_ADISLIB namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:53 +0000 (20:56 +0000)]
iio:imu:adis: Move exports into IIO_ADISLIB namespace

In order to avoid unneessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the various specific device drivers that use them.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Song Bao Hua (Barry Song) <song.bao.hua@hisilicon.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-9-jic23@kernel.org
2 years agoiio:dac:ad5686: Move exports into IIO_AD5686 namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:52 +0000 (20:56 +0000)]
iio:dac:ad5686: Move exports into IIO_AD5686 namespace

Note these are used in the related ad5696-i2c drivers as well as the
more obviously connected ad5686-spi driver.

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the various specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-8-jic23@kernel.org
2 years agoiio:dac:ad5592r: Move exports into IIO_AD5592R namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:51 +0000 (20:56 +0000)]
iio:dac:ad5592r: Move exports into IIO_AD5592R namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the various specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-7-jic23@kernel.org
2 years agoiio:common:ssp_sensors: Move exports into IIO_SSP_SENSORS namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:50 +0000 (20:56 +0000)]
iio:common:ssp_sensors: Move exports into IIO_SSP_SENSORS namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the various specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Both the exports used between the two common modules and the individual
drivers are moved to a single namespace as greater granularity does
not feel useful.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-6-jic23@kernel.org
2 years agoiio:common:meas-spec: Move exports into IIO_MEAS_SPEC_SENSORS
Jonathan Cameron [Sun, 30 Jan 2022 20:56:49 +0000 (20:56 +0000)]
iio:common:meas-spec: Move exports into IIO_MEAS_SPEC_SENSORS

The obvious choice of ms_sensors felt rather too likely to clash with other
namespaces introduced in future, hence the longer abbreviation.

In order to avoid unnecessary pollution of the global symbol namespace
move the common/library functions into a specific namespace and import
that into the various specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: William Markezana <william.markezana@meas-spec.com>
Cc: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-5-jic23@kernel.org
2 years agoiio:adc:ad76060: Move exports into IIO_AD7606 namespace.
Jonathan Cameron [Sun, 30 Jan 2022 20:56:48 +0000 (20:56 +0000)]
iio:adc:ad76060: Move exports into IIO_AD7606 namespace.

In order to avoid unnecessary pollution of the global symbol namespace
move the core/library functions into a specific namespace and import
that into the various bus specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-4-jic23@kernel.org
2 years agoiio:adc:ad7091r: Move exports into IIO_AD7091R namespace.
Jonathan Cameron [Sun, 30 Jan 2022 20:56:47 +0000 (20:56 +0000)]
iio:adc:ad7091r: Move exports into IIO_AD7091R namespace.

In order to avoid unnecessary pollution of the global symbol namespace
move the core/library functions into a specific namespace and import
that into the various specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

An alternative here would be to conclude that we are unlikely to see
support for the other ad7091r parts in the near future and just merge
the two modules into one supporting just the i2c -5 variant.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-3-jic23@kernel.org
2 years agoiio:adc:ad_sigma_delta: Move exports into IIO_AD_SIGMA_DELTA namespace
Jonathan Cameron [Sun, 30 Jan 2022 20:56:46 +0000 (20:56 +0000)]
iio:adc:ad_sigma_delta: Move exports into IIO_AD_SIGMA_DELTA namespace

In order to avoid unnecessary pollution of the global symbol namespace
move the core/library functions into a specific namespace and import
that into the various specific device drivers that use them.

For more information see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Renato Lui Geh <renatogeh@gmail.com>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220130205701.334592-2-jic23@kernel.org
2 years agoiio:st-sensors: Move exports into IIO_ST_SENSORS namespace
Jonathan Cameron [Sun, 16 Jan 2022 18:05:35 +0000 (18:05 +0000)]
iio:st-sensors: Move exports into IIO_ST_SENSORS namespace

To avoid unnecessary pollution of the global symbol namespace move the
driver core and type specific core exports into their a new namespace
and import that where needed.

For more info see https://lwn.net/Articles/760045/

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Denis Ciocca <denis.ciocca@st.com>
Link: https://lore.kernel.org/r/20220116180535.2367780-14-jic23@kernel.org
2 years agoiio:st-sensors: Remove duplicate MODULE_*
Jonathan Cameron [Sun, 16 Jan 2022 18:05:34 +0000 (18:05 +0000)]
iio:st-sensors: Remove duplicate MODULE_*

The core module and type specific core modules are made up of
several files. There is no benefit in duplicating the MODULE_* macros
in each file so remove them.

Noticed whilst adding MODULE_IMPORT_NS() as I missed some files and
it still worked, making it clear not all of these blocks were needed.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220116180535.2367780-13-jic23@kernel.org