andy.shevchenko@gmail.com
8655d0e378
iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables
...
Use common style for a terminator entry in the ID tables.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20240211201526.1518165-4-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-02-19 19:32:22 +00:00
andy.shevchenko@gmail.com
07d6a5a482
iio: st_sensors: lsm9ds0: Don't use "proxy" headers
...
Update header inclusions to follow IWYU (Include What You Use)
principle.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20240211201526.1518165-3-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-02-19 19:32:22 +00:00
andy.shevchenko@gmail.com
ac73e222e3
iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere
...
Use dev_err_probe() everywhere where it is appropriate.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20240211201526.1518165-2-andy.shevchenko@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-02-19 19:32:22 +00: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
Marius Hoch
598e971fab
iio: st_sensors: Add ACPI support for lsm303d to the LSM9DS0 IMU driver
...
The lsm303d can be found as ACCL0001 on various Lenovo devices,
including the Lenovo Yoga Tablet 2 1051-F, where I tested this
patch.
Dropped SPI support as per discussion in thread linked below.
Signed-off-by: Marius Hoch <mail@mariushoch.de >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Tested-by: Hans de Goede <hansg@kernel.org >
Link: https://lore.kernel.org/r/20230415231130.115094-5-mail@mariushoch.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-05-13 17:56:04 +01:00
Marius Hoch
c0f68439ae
iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driver
...
The lsm303d is basically the lsm9ds0 without the gyroscope
(which the LSM9DS0 IMU driver doesn't handle), as far as I
can tell.
Signed-off-by: Marius Hoch <mail@mariushoch.de >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Tested-by: Hans de Goede <hansg@kernel.org >
Link: https://lore.kernel.org/r/20230415231130.115094-4-mail@mariushoch.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2023-05-13 17:56:04 +01: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
0805b5121f
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
2022-02-18 11:36:54 +00:00
Nikita Yushchenko
26b2ec2e9a
iio: st_sensors: don't always auto-enable I2C and SPI interface drivers
...
This patch makes I2C and SPI interface drivers for STMicroelectronics
sensor chips individually selectable via Kconfig.
The default is kept unchanged - I2C and SPI interface drivers are still
selected by default if the corresponding bus support is available.
However, the patch makes it possible to explicitly disable drivers
that are not needed for a particular target.
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com >
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20220110152432.3799227-1-nikita.yoush@cogentembedded.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2022-01-23 18:03:35 +00:00
Cai Huoqing
b42baaa3e2
iio: st_lsm9ds0: Make use of the helper function dev_err_probe()
...
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
Using dev_err_probe() can reduce code size, and the error value
gets printed.
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com >
Link: https://lore.kernel.org/r/20210928014055.1431-2-caihuoqing@baidu.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-10-19 08:30:44 +01:00
Alexandru Ardelean
e426965154
iio: st_sensors: remove reference to parent device object on st_sensor_data
...
The idea behind it, is that all devm_ calls in ST sensors are bound to the
parent device object.
However, the reference to that object is kept on both the st_sensor_data
struct and the IIO object parent (indio_dev->dev.parent).
This change only adds a bit consistency and uses the reference stored on
indio_dev->dev.parent, to enforce the assumption that all ST sensors' devm_
calls are bound to the same reference as the one store on st_sensor_data.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Link: https://lore.kernel.org/r/20210823112204.243255-6-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-09-14 12:00:32 +01:00
Alexandru Ardelean
6b658c31bb
iio: st_sensors: remove all driver remove functions
...
At this point all ST driver remove functions do iio_device_unregister().
This change removes them from them and replaces all iio_device_register()
with devm_iio_device_register().
This can be done in a single change relatively easy, since all these remove
functions are define in st_sensors.h.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Link: https://lore.kernel.org/r/20210823112204.243255-5-aardelean@deviqon.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-09-14 12:00:31 +01:00
Jonathan Cameron
9c6cd755b5
iio: st-sensors: Remove some unused includes and add some that should be there
...
The st-sensors drivers have changed in structure over time, and includes
have not always kept up with this. Let's bring them back to nearer
the ideal.
Identified with the include-what-you-use tool and careful checking of
its suggestions.
Note I haven't been particularly aggressive here, so this is just the
cases where the include obviously isn't needed rather than the more
subtle corners.
Note I took the opportunity to add mod_devicetable.h as I generally
prefer to see that when acpi or of match tables are present.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Linus Walleij <linus.walleij@linaro.org >
Cc: Denis Ciocca <denis.ciocca@st.com >
Cc: Hans de Goede <hdegoede@redhat.com >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Link: https://lore.kernel.org/r/20210608175149.4019289-1-jic23@kernel.org
2021-07-24 15:59:00 +01:00
Andy Shevchenko
6731ca3999
iio: st_sensors: Add lsm9ds0 IMU support
...
We can utilize separate drivers for accelerometer and magnetometer,
so here is the glue driver to enable LSM9DS0 IMU support.
The idea was suggested by Crestez Dan Leonard in [1]. The proposed change
was sent as RFC due to race condition concerns, which are indeed possible.
In order to amend the initial change, I went further by providing a specific
multi-instantiate probe driver that reuses existing accelerometer and
magnetometer.
[1]: https://lore.kernel.org/patchwork/patch/670353/
Suggested-by: Crestez Dan Leonard <leonard.crestez@intel.com >
Cc: mr.lahorde@laposte.net
Cc: Matija Podravec <matija_podravec@fastmail.fm >
Cc: Sergey Borishchenko <borischenko.sergey@gmail.com >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20210414195454.84183-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2021-05-17 13:54:22 +01:00