Yang Yingliang
f762650443
iio: trigger: sysfs: rename error label in iio_sysfs_trigger_probe()
...
Rename error label in iio_sysfs_trigger_probe() to make more readable.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com >
Link: https://lore.kernel.org/r/20221024105250.873394-1-yangyingliang@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:03 +00:00
Crt Mori
a95ccebde7
iio: temperature: mlx90632 Style alignment for the driver
...
Changing and aligning the overall style of the driver with the recent
reviews. There is no functional change, only type generalization and
moving to the reverse Christmas tree for variable declarations.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Signed-off-by: Crt Mori <cmo@melexis.com >
Link: https://lore.kernel.org/r/d59aad00891c1a64e044a0f5bc7d40e42d47e9c7.1666606912.git.cmo@melexis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:03 +00:00
Uwe Kleine-König
2ca0b16f6c
iio: accel: vl6180: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-24-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:03 +00:00
Uwe Kleine-König
9492c00d83
iio: accel: st_magn: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-23-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:03 +00:00
Uwe Kleine-König
d18e70608e
iio: accel: stk8ba50: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-22-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:03 +00:00
Uwe Kleine-König
3d8a49ebd6
iio: accel: stk8312: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-21-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
76e4a118c8
iio: accel: mxc6255: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-20-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
a97d9d95a1
iio: accel: mxc4005: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-19-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
76403ea698
iio: accel: mma7660: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-15-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
ded7a4f8f9
iio: accel: mc3230: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-13-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
2ba423fefb
iio: accel: kxsd9: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-12-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
5019025fc3
iio: accel: dmard10: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
d61f79d383
iio: accel: dmard09: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-9-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
72907238b1
iio: accel: dmard06: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-8-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
a9e38f1ecc
iio: accel: da311: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-7-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Uwe Kleine-König
ecff5cb471
iio: accel: adxl367: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221023132302.911644-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:02 +00:00
Jonathan Cameron
1db96143df
iio: proximity: sx_common: Use devm_regulator_bulk_get_enable()
...
This driver only turns the power for some regulators on at probe and off
via a custom devm_add_action_or_reset() callback. The new
devm_regulator_bulk_get_enable() replaces all this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Gwendal Grignou <gwendal@chromium.org >
Reviewed-by: Stephen Boyd <swboyd@chromium.org >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-13-jic23@kernel.org
2022-11-23 19:44:02 +00:00
Jonathan Cameron
b620be5f32
iio: light: noa1305: Use devm_regulator_get_enable()
...
This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Martyn Welch <martyn.welch@collabora.com >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-12-jic23@kernel.org
2022-11-23 19:44:02 +00:00
Jonathan Cameron
c437c977c1
iio: light: ltr501: Use devm_regulator_bulk_get_enable()
...
This driver only turns the power for some regulators on at probe and off
via a custom devm_add_action_or_reset() callback. The new
devm_regulator_bulk_get_enable() replaces all this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-11-jic23@kernel.org
2022-11-23 19:44:02 +00:00
Jonathan Cameron
2c97f7b404
iio: humidity: hts211: Use devm_regulator_get_enable()
...
This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-10-jic23@kernel.org
2022-11-23 19:44:02 +00:00
Jonathan Cameron
d86186a6e0
iio: frequency: ad9523: Use devm_regulator_get_enable()
...
This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.
Note that in event of an error on the devm_regulator_get() the driver
would have continued without enabling the regulator which is probably
not a good idea. So here we handle any error as a reason to fail the
probe(). In theory this may expose breakage on a platform that was
previously papered over but it seems low risk.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Michael Hennerich <michael.hennerich@analog.com >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-9-jic23@kernel.org
2022-11-23 19:44:01 +00:00
Jonathan Cameron
9e855d77b1
iio: st_sensors: core and lsm9ds0 switch to devm_regulator_bulk_get_enable()
...
These drivers only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The two regulators were handled
separately so also switch to bulk registration.
The new devm_regulator_bulk_get_enable() replaces all this boilerplate
code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Linus Walleij <linus.walleij@linaro.org >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-8-jic23@kernel.org
2022-11-23 19:44:01 +00:00
Jonathan Cameron
72ce527c7b
iio: cdc: ad7150: Use devm_regulator_get_enable()
...
This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-7-jic23@kernel.org
2022-11-23 19:44:01 +00:00
Jonathan Cameron
eefa008b16
iio: accel: msa311: Use devm_regulator_get_enable()
...
This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Dmitry Rokosov <DDRokosov@sberdevices.ru >
Reviewed-by: Dmitry Rokosov <ddrokosov@sberdevices.ru >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-6-jic23@kernel.org
2022-11-23 19:44:01 +00:00
Jonathan Cameron
1fa4ff1f24
iio: accel: kxcjk-1013: Use devm_regulator_bulk_get_enable()
...
This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new
devm_regulator_bulk_get_enable() replaces this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-5-jic23@kernel.org
2022-11-23 19:44:01 +00:00
Jonathan Cameron
5b30e739ce
iio: accel: fxls8962af: Use devm_regulator_get_enable()
...
This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new devm_regulator_get_enable()
replaces this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Sean Nyekjaer <sean@geanix.com >
Reviewed-by: Sean Nyekjaer <sean@geanix.com >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-4-jic23@kernel.org
2022-11-23 19:44:01 +00:00
Jonathan Cameron
e9b96e18cf
iio: accel: adxl367: Use devm_regulator_bulk_get_enable()
...
This driver only turns the power on at probe and off via a custom
devm_add_action_or_reset() callback. The new
devm_regulator_bulk_get_enable() replaces this boilerplate code.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Cosmin Tanislav <cosmin.tanislav@analog.com >
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221016163409.320197-2-jic23@kernel.org
2022-11-23 19:44:01 +00:00
Deepak R Varma
e54ec96c72
staging: iio: frequency: ad9834: merge unnecessary split lines
...
Improve code readability by merging unnecessary split lines that are
well within the code-style guidelines post merge.
Signed-off-by: Deepak R Varma <drv@mailo.com >
Acked-by: Julia Lawall <julia.lawall@inria.fr >
Link: https://lore.kernel.org/r/Y0z2/qFe3kW96MTs@debian-BULLSEYE-live-builder-AMD64
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:01 +00:00
Cosmin Tanislav
62094060cf
iio: adc: ad4130: add AD4130 driver
...
AD4130-8 is an ultra-low power, high precision, measurement solution for
low bandwidth battery operated applications.
The fully integrated AFE (Analog Front-End) includes a multiplexer for up
to 16 single-ended or 8 differential inputs, PGA (Programmable Gain
Amplifier), 24-bit Sigma-Delta ADC, on-chip reference and oscillator,
selectable filter options, smart sequencer, sensor biasing and excitation
options, diagnostics, and a FIFO buffer.
Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20221021104115.1812486-3-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:01 +00:00
Cosmin Tanislav
36a4df5003
dt-bindings: iio: adc: add AD4130
...
AD4130-8 is an ultra-low power, high precision, measurement solution for
low bandwidth battery operated applications.
The fully integrated AFE (Analog Front-End) includes a multiplexer for up
to 16 single-ended or 8 differential inputs, PGA (Programmable Gain
Amplifier), 24-bit Sigma-Delta ADC, on-chip reference and oscillator,
selectable filter options, smart sequencer, sensor biasing and excitation
options, diagnostics, and a FIFO buffer.
Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com >
Reviewed-by: Rob Herring <robh@kernel.org >
Link: https://lore.kernel.org/r/20221021104115.1812486-2-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:01 +00:00
Mitja Spes
fd4fc88d0b
dt-bindings: iio: pressure: meas,ms5611: add max SPI frequency to the example
...
Added max SPI frequency setting to the example.
Signed-off-by: Mitja Spes <mitja@lxnav.com >
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Link: https://lore.kernel.org/r/20221021135827.1444793-4-mitja@lxnav.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:01 +00:00
Matti Vaittinen
563746c26d
iio: amplifier: hmc425a: simplify using devm_regulator_get_enable()
...
Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable() and drop the pointer to the regulator.
This simplifies code and makes it less tempting to add manual control
for the regulator which is also controlled by devm.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/8b1193fdefb231a6d721e2bded52c48e56039c20.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:01 +00:00
Matti Vaittinen
3dfa1d4f63
iio: adc: max1363: simplify using devm_regulator_get_enable()
...
Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable() and drop the pointer to the regulator.
This simplifies code and makes it less tempting to add manual control
for the regulator which is also controlled by devm.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/1286ea127d190e5708a0aaff271819b2d3f8802d.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:01 +00:00
Matti Vaittinen
f55c8e6696
iio: adc: max1241: simplify using devm_regulator_get_enable()
...
Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable() and drop the pointer to the regulator.
This simplifies code and makes it less tempting to add manual control
for the regulator which is also controlled by devm.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Acked-by: Alexandru Lazar <alazar@startmail.com >
Link: https://lore.kernel.org/r/7c759bf6c06e72ae70bffeebc1939d9903427278.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:01 +00:00
Matti Vaittinen
fd5b6c48ec
iio: adc: ad7606: simplify using devm_regulator_get_enable()
...
Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable() and drop the pointer to the regulator.
This simplifies code and makes it less tempting to add manual control
for the regulator which is also controlled by devm.
Whilst here also switch to dev_err_probe() to provide more information
if a deferred probe occurs.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/521c52f5a9bdc2db04d5775b36df4b233ae338da.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Matti Vaittinen
7ff0ad35aa
iio: adc: ad7476: simplify using devm_regulator_get_enable()
...
Drop open-coded pattern: 'devm_regulator_get(), regulator_enable(),
add_action_or_reset(regulator_disable)' and use the
devm_regulator_get_enable()
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Acked-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/33070d66b9b976acac1cee5570facef9278b6b61.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Matti Vaittinen
6900cdbfb9
iio: imu: st_lsm6dsx: Simplify using devm_regulator_*get_enable()
...
Use devm_regulator_bulk_get_enable() instead of open coded bulk-get,
bulk-enable, add-action-to-disable-at-detach - pattern.
A functional change (which seems like a bugfix) is that if
regulator_bulk_get fails, the enable is not attempted.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://lore.kernel.org/r/876e58428cec056d51070e49eff559e2d7c23b12.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Matti Vaittinen
2c620883a4
iio: gyro: bmg160_core: Simplify using devm_regulator_*get_enable()
...
Use devm_regulator_bulk_get_enable() instead of open coded bulk-get,
bulk-enable, add-action-to-disable-at-detach - pattern.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://lore.kernel.org/r/3fd11489356b1c73a3d7b4bd9dec7e12c9fe8788.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Matti Vaittinen
08f75f180d
iio: dac: ltc2688: Simplify using devm_regulator_*get_enable()
...
Use devm_regulator_bulk_get_enable() instead of open coded bulk-get,
bulk-enable, add-action-to-disable-at-detach - pattern.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Reviewed-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/a29493f594c84b3bd852e462bbd3e591a8575a27.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Matti Vaittinen
1ccef2e6e9
iio: adc: ad7192: Simplify using devm_regulator_get_enable()
...
Use devm_regulator_get_enable() instead of open coded get, enable,
add-action-to-disable-at-detach - pattern. Also drop the seemingly unused
struct member 'dvdd'.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://lore.kernel.org/r/9719c445c095d3d308e2fc9f4f93294f5806c41c.1660934107.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Jonathan Cameron
62bfa12c87
iio: imu: inv_mpu: Move exports to IIO_MPU6050 namespace
...
As these exports are only relevant to core module and users in the
bus specific modules, move them out of the main kernel namespace.
Includes using EXPORT_NS_GPL_DEV_PM_OPS() and the simplifications that
brings by allowing the compiler to remove unused struct dev_pm_ops
and callbacks without needing explicit __maybe_unused markings.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com >
Cc: Linus Walleij <linus.walleij@linaro.org >
--
Dropped Linus' tag as the new patch is significantly different.
v2: Switch to more flexible version of EXPORT* macro from Paul.
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com >
Link: https://lore.kernel.org/r/20220925155719.3316280-6-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Jonathan Cameron
ef5a5ef29c
iio: imu: inv_icm42600: Move exports to IIO_ICM42600 namespace
...
As these exports are only relevant to core module and users in the
bus specific modules, move them out of the main kernel namespace.
Includes using EXPORT_NS_GPL_DEV_PM_OPS() and the simplifications that
brings by allowing the compiler to remove unused struct dev_pm_ops
and callbacks without needing explicit __maybe_unused markings.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com >
--
EXPORT_NS_GPL_DEV_PM_OPS()
v2: Switch to Paul's more flexible version of the
Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com >
Link: https://lore.kernel.org/r/20220925155719.3316280-5-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Jonathan Cameron
02e082c433
iio: gyro: fxas210002c: Move exports to IIO_FXAS210002C namespace.
...
Includes using EXPORT_NS_GPL_DEV_PM_OPS() and the simplifications that
brings by allowing the compiler to remove unused struct dev_pm_ops
and callbacks without needing explicit __maybe_unused markings.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Rui Miguel Silva <rui.silva@linaro.org >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
--
Dropped Rui's tag on basis this is rather different from v1 due to
the different macro implementation.
v2: Switch to Paul's more flexible approach to EXPORT_NS_GPL_DEV_PM_OPS()
Acked-by: Rui Miguel Silva <rui.silva@linaro.org >
Link: https://lore.kernel.org/r/20220925155719.3316280-4-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Jonathan Cameron
687c8848c6
iio: accel: fxls8962af: Use new EXPORT_NS_GPL_DEV_PM_OPS()
...
Using this macro allows the compiler to remove unused
structures and callbacks if we are not building with
CONFIG_PM* without needing __maybe_unused markings.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Sean Nyekjaer <sean@geanix.com >
--
Switched to Paul Cercueil's more flexible implementation fo the macro.
Dropped Sean's Ack given new form of macro being used.
Acked-by: Sean Nyekjaer <sean@geanix.com >
Link: https://lore.kernel.org/r/20220925155719.3316280-3-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Rajat Khandelwal
0c3a333524
iio: pressure: mpl115: Implementing low power mode by shutdown gpio
...
MPL115 supports shutdown gpio which can be used to set the state
to low power mode. Power from all internal circuits and
registers is removed. This is done by pulling the SHDN pin to low.
This patch enables runtime PM on MPL115 to increase power savings.
According to spec., a wakeup time period of ~5 ms exists between
waking up and actually communicating with the device. This is
implemented using sleep delay.
Signed-off-by: Rajat Khandelwal <rajat.khandelwal@linux.intel.com >
Link: https://lore.kernel.org/r/20221010173720.568916-1-rajat.khandelwal@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Nuno Sá
16afe125b5
iio: core: move 'mlock' to 'struct iio_dev_opaque'
...
Now that there are no more users accessing 'mlock' directly, we can move
it to the iio_dev private structure. Hence, it's now explicit that new
driver's should not directly use this lock.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20221012151620.1725215-5-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Nuno Sá
6b701cda36
iio: health: max30102: do not use internal iio_dev lock
...
The pattern used in this device does not quite fit in the
iio_device_claim_direct_mode() typical usage. In this case, we want to
know if we are in buffered mode or not to know if the device is powered
(buffer mode) or not. And depending on that max30102_get_temp() will
power on the device if needed. Hence, in order to keep the same
functionality, we try to:
1. Claim Buffered mode;
2: If 1) succeeds call max30102_get_temp() without powering on the
device;
3: Release Buffered mode;
4: If 1) fails, Claim Direct mode;
5: If 4) succeeds call max30102_get_temp() with powering on the device;
6: Release Direct mode;
7: If 4) fails, goto to 1) and try again.
This dance between buffered and direct mode is not particularly pretty
(as well as the loop introduced by the goto statement) but it does allow
us to get rid of the mlock usage while keeping the same behavior.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20221012151620.1725215-4-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Nuno Sá
1555790c86
iio: health: max30100: do not use internal iio_dev lock
...
The pattern used in this device does not quite fit in the
iio_device_claim_direct_mode() typical usage. In this case,
iio_buffer_enabled() was being used not to prevent the raw
access but to allow it. Hence, let's make use of the new
iio_device_claim_buffer_mode() API to make sure we stay in
buffered mode during the complete read.
Note that we are shadowing the error code returned by
iio_device_claim_buffer_mode() so that we keep the original one
(-EAGAIN). The reason is that some userspace stack might already be
relying on this particular code so that we are not taking chances and
leave it alone.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Link: https://lore.kernel.org/r/20221012151620.1725215-3-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:44:00 +00:00
Nuno Sá
0a8565425a
iio: core: introduce iio_device_{claim|release}_buffer_mode() APIs
...
These APIs are analogous to iio_device_claim_direct_mode() and
iio_device_release_direct_mode() but, as the name suggests, with the
logic flipped. While this looks odd enough, it will have at least two
users (in following changes) and it will be important to move the IIO
mlock to the private struct.
Signed-off-by: Nuno Sá <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20221012151620.1725215-2-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:43:59 +00:00
Olivier Moysan
7cb2303dd0
iio: adc: stm32: manage min sampling time on all internal channels
...
Force minimum sampling time for all internal channels according
to datasheet requirement. This value can be increased through
DT st,min-sample-time-ns property.
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com >
Link: https://lore.kernel.org/r/20221012142205.13041-5-olivier.moysan@foss.st.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-11-23 19:43:59 +00:00