Nuno Sa
e5003b6098
iio: accel: msa311: make use of iio_for_each_active_channel()
...
Use iio_for_each_active_channel() to iterate over active channels
accessing '.masklength' so it can be annotated as __private when there are
no more direct users of it.
Signed-off-by: Nuno Sa <nuno.sa@analog.com >
Reviewed-by: Alexandru Ardelean <aardelean@baylibre.com >
Link: https://patch.msgid.link/20240702-dev-iio-masklength-private-v1-10-98193bf536a6@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-07-29 20:31:08 +01:00
Trevor Gamblin
4ed403d823
iio: accel: msa311: make use of regmap_clear_bits()
...
Instead of using regmap_update_bits() and passing val = 0, use
regmap_clear_bits().
Suggested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com >
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Link: https://patch.msgid.link/20240617-review-v3-3-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-25 21:04:44 +01:00
Andy Shevchenko
de39695dd1
iio: accel: msa311: Use correct header(s) instead of string_helpers.h
...
There is nothing from string_helpers.h used in the driver, correct
the header inclusion block accordingly.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Dmitry Rokosov <ddrokosov@sberdevices.ru >
Link: https://lore.kernel.org/r/20230808164152.66748-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-09-12 10:42:03 +01:00
Uwe Kleine-König
7cf15f4275
iio: Switch i2c drivers back to use .probe()
...
After commit b8a1a4cd5a ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20230515205048.19561-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-05-21 18:54:53 +01:00
Mehdi Djait
f700e55ef6
iio: Rename iio_trigger_poll_chained and add kernel-doc
...
Rename the function to iio_trigger_poll_nested. Add kernel-doc with
a note on the context where the function is expected to be called.
Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com >
Link: https://lore.kernel.org/r/841b533cba28ca25a8e87280c44e45979166e8e2.1677761379.git.mehdi.djait.k@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-03-11 12:18:29 +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
Dmitry Rokosov
1ca2cfbc0c
iio: add MEMSensing MSA311 3-axis accelerometer driver
...
MSA311 is a tri-axial, low-g accelerometer with I2C digital output for
sensitivity consumer applications. It has dynamic user-selectable full
scales range of +-2g/+-4g/+-8g/+-16g and allows acceleration measurements
with output data rates from 1Hz to 1000Hz.
This driver supports following MSA311 features:
- IIO interface
- Different power modes: NORMAL and SUSPEND (using pm_runtime)
- ODR (Output Data Rate) selection
- Scale and samp_freq selection
- IIO triggered buffer, IIO reg access
- NEW_DATA interrupt + trigger
Below features to be done:
- Motion Events: ACTIVE, TAP, ORIENT, FREEFALL
- Low Power mode
Datasheet: https://cdn-shop.adafruit.com/product-files/5309/MSA311-V1.1-ENG.pdf
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20220822175011.2886-4-ddrokosov@sberdevices.ru
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-08-30 18:35:38 +01:00