Commit a47c1cdc authored by Jean-Baptiste Maneyrol's avatar Jean-Baptiste Maneyrol Committed by Jonathan Cameron

iio: imu: inv_icm42600: add accelerometer IIO device

Add IIO device for accelerometer sensor with data polling
interface.
Attributes: raw, scale, sampling_frequency, calibbias.

Accelerometer in low noise mode.
Signed-off-by: default avatarJean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a095fadb
...@@ -121,6 +121,7 @@ struct inv_icm42600_suspended { ...@@ -121,6 +121,7 @@ struct inv_icm42600_suspended {
* @conf: chip sensors configurations. * @conf: chip sensors configurations.
* @suspended: suspended sensors configuration. * @suspended: suspended sensors configuration.
* @indio_gyro: gyroscope IIO device. * @indio_gyro: gyroscope IIO device.
* @indio_accel: accelerometer IIO device.
* @buffer: data transfer buffer aligned for DMA. * @buffer: data transfer buffer aligned for DMA.
*/ */
struct inv_icm42600_state { struct inv_icm42600_state {
...@@ -134,6 +135,7 @@ struct inv_icm42600_state { ...@@ -134,6 +135,7 @@ struct inv_icm42600_state {
struct inv_icm42600_conf conf; struct inv_icm42600_conf conf;
struct inv_icm42600_suspended suspended; struct inv_icm42600_suspended suspended;
struct iio_dev *indio_gyro; struct iio_dev *indio_gyro;
struct iio_dev *indio_accel;
uint8_t buffer[2] ____cacheline_aligned; uint8_t buffer[2] ____cacheline_aligned;
}; };
...@@ -375,4 +377,6 @@ int inv_icm42600_core_probe(struct regmap *regmap, int chip, ...@@ -375,4 +377,6 @@ int inv_icm42600_core_probe(struct regmap *regmap, int chip,
struct iio_dev *inv_icm42600_gyro_init(struct inv_icm42600_state *st); struct iio_dev *inv_icm42600_gyro_init(struct inv_icm42600_state *st);
struct iio_dev *inv_icm42600_accel_init(struct inv_icm42600_state *st);
#endif #endif
This diff is collapsed.
...@@ -513,6 +513,10 @@ int inv_icm42600_core_probe(struct regmap *regmap, int chip, ...@@ -513,6 +513,10 @@ int inv_icm42600_core_probe(struct regmap *regmap, int chip,
if (IS_ERR(st->indio_gyro)) if (IS_ERR(st->indio_gyro))
return PTR_ERR(st->indio_gyro); return PTR_ERR(st->indio_gyro);
st->indio_accel = inv_icm42600_accel_init(st);
if (IS_ERR(st->indio_accel))
return PTR_ERR(st->indio_accel);
/* setup runtime power management */ /* setup runtime power management */
ret = pm_runtime_set_active(dev); ret = pm_runtime_set_active(dev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment