iio: accel: adxl313: add power-save on activity/inactivity
Subsystems (4)
v2 cover iio: accel: adxl313: add power-save on activity/inactivity
The patch set covers the following topics:
- add debug register and regmap cache
- prepare iio channel scan_type and scan_index
- prepare interrupt handling
- implement fifo with watermark
- add activity/inactivity together with auto-sleep with link bit
- documentation
Similar situation and approach as for the ADXL345. AC/DC coupling might be a pending option as it is quite the same as for ADXL345.
Since activity and inactivity here are implemented covering all axis, I assumed x&y&z. Thus the driver uses a fake channel for activity/inactiviy.
---
v1 -> v2:
- usage of units.h
- simplify approach for return values
---
Lothar Rubusch (12):
iio: accel: adxl313: add debug register
iio: accel: adxl313: introduce channel scan_index
iio: accel: adxl313: configure scan type for buffer
iio: accel: adxl313: make use of regmap cache
iio: accel: adxl313: add function to enable measurement
iio: accel: adxl313: prepare interrupt handling
iio: accel: adxl313: add basic interrupt handling
iio: accel: adxl313: add FIFO watermark
iio: accel: adxl313: add activity sensing
iio: accel: adxl313: add inactivity sensing
iio: accel: adxl313: implement power-save on inactivity
docs: iio: add ADXL313 accelerometer
Documentation/iio/adxl313.rst | 196 ++++++++++ Documentation/iio/index.rst | 1 + drivers/iio/accel/adxl313.h | 35 +- drivers/iio/accel/adxl313_core.c | 625 ++++++++++++++++++++++++++++++- drivers/iio/accel/adxl313_i2c.c | 6 + drivers/iio/accel/adxl313_spi.c | 6 + 6 files changed, 860 insertions(+), 9 deletions(-) create mode 100644 Documentation/iio/adxl313.rst
Signature · 1 line
2.39.5
PATCH v2 1/12 iio: accel: adxl313: add debug register
Add iio debug register for general sensor debugging.
--- drivers/iio/accel/adxl313_core.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/iio/accel/adxl313_core.c +11 -0
@@ -321,10 +321,21 @@ static int adxl313_write_raw(struct iio_dev *indio_dev, } } +static int adxl313_reg_access (struct iio_dev *indio_dev,unsigned int reg, +unsigned int writeval,unsigned int *readval) +{ +struct adxl313_data *data =iio_priv (indio_dev); + +if (readval) +return regmap_read (data->regmap, reg, readval); +return regmap_write (data->regmap, reg, writeval); +} +static const struct iio_info adxl313_info = { .read_raw = adxl313_read_raw, .write_raw = adxl313_write_raw, .read_avail = adxl313_read_freq_avail, + .debugfs_reg_access = &adxl313_reg_access, }; static int adxl313_setup(struct device *dev, struct adxl313_data *data,
Signature · 1 line
2.39.5
PATCH v2 2/12 iio: accel: adxl313: introduce channel scan_index
In reply to Lothar RubuschAdd a scan_mask and scan_index to the iio channel. The scan_index prepares the buffer usage.
--- drivers/iio/accel/adxl313_core.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/iio/accel/adxl313_core.c +16 -5
@@ -171,9 +171,10 @@ static const int adxl313_odr_freqs[][2] = { [9] = { 3200, 0 }, }; -#define ADXL313_ACCEL_CHANNEL (index, axis) { \ +#define ADXL313_ACCEL_CHANNEL (index, reg, axis) { \ .type = IIO_ACCEL, \ - .address = index, \ + .scan_index = (index), \ + .address = (reg), \ .modified = 1, \ .channel2 = IIO_MOD_##axis, \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
@@ -187,10 +188,19 @@ static const int adxl313_odr_freqs[][2] = { }, \ } +enum adxl313_chans { + chan_x, chan_y, chan_z, +}; +static const struct iio_chan_spec adxl313_channels[] = { -ADXL313_ACCEL_CHANNEL (0 ,X ), -ADXL313_ACCEL_CHANNEL (1 ,Y ), -ADXL313_ACCEL_CHANNEL (2 ,Z ), +ADXL313_ACCEL_CHANNEL (0 , chan_x,X ), +ADXL313_ACCEL_CHANNEL (1 , chan_y,Y ), +ADXL313_ACCEL_CHANNEL (2 , chan_z,Z ), +}; + +static const unsigned long adxl313_scan_masks[] = { +BIT (chan_x) |BIT (chan_y) |BIT (chan_z), +0 }; static int adxl313_set_odr(struct adxl313_data *data,
@@ -419,6 +429,7 @@ int adxl313_core_probe(struct device *dev, indio_dev->modes =INDIO_DIRECT_MODE ; indio_dev->channels = adxl313_channels; indio_dev->num_channels =ARRAY_SIZE (adxl313_channels); + indio_dev->available_scan_masks = adxl313_scan_masks; ret =adxl313_setup (dev, data, setup);if (ret) {
Signature · 1 line
2.39.5
PATCH v2 3/12 iio: accel: adxl313: configure scan type for buffer
In reply to Lothar RubuschAccording to the datasheet the ADXL313 uses 13 bit in full resolution. Also, add signedness, storage bits and endianness.
--- drivers/iio/accel/adxl313_core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/iio/accel/adxl313_core.c +3 -0
@@ -184,7 +184,10 @@ static const int adxl313_odr_freqs[][2] = { .info_mask_shared_by_type_available = \ BIT(IIO_CHAN_INFO_SAMP_FREQ), \ .scan_type = { \ + .sign = 's', \ .realbits = 13, \ + .storagebits = 16, \ + .endianness = IIO_BE, \ }, \ }
Signature · 1 line
2.39.5
PATCH v2 4/12 iio: accel: adxl313: make use of regmap cache
In reply to Lothar RubuschSetup regmap cache to cache register configuration. This is a preparatory step for follow up patches, to allow easy acces to the cached configuration.
--- drivers/iio/accel/adxl313.h | 2 ++ drivers/iio/accel/adxl313_core.c | 17 +++++++++++++++++ drivers/iio/accel/adxl313_i2c.c | 6 ++++++ drivers/iio/accel/adxl313_spi.c | 6 ++++++ 4 files changed, 31 insertions(+)
drivers/iio/accel/adxl313.h +2 -0
@@ -54,6 +54,8 @@ extern const struct regmap_access_table adxl312_writable_regs_table;extern const struct regmap_access_table adxl313_writable_regs_table;extern const struct regmap_access_table adxl314_writable_regs_table; +bool adxl313_is_volatile_reg (struct device *dev,unsigned int reg); +enum adxl313_device_type {ADXL312 ,ADXL313 ,
drivers/iio/accel/adxl313_core.c +17 -0
@@ -46,6 +46,23 @@ const struct regmap_access_table adxl314_readable_regs_table = { };EXPORT_SYMBOL_NS_GPL (adxl314_readable_regs_table,IIO_ADXL313 ); +bool adxl313_is_volatile_reg (struct device *dev,unsigned int reg) +{ +switch (reg) { +case ADXL313_REG_DATA_AXIS (0 ): +case ADXL313_REG_DATA_AXIS (1 ): +case ADXL313_REG_DATA_AXIS (2 ): +case ADXL313_REG_DATA_AXIS (3 ): +case ADXL313_REG_DATA_AXIS (4 ): +case ADXL313_REG_DATA_AXIS (5 ): +case ADXL313_REG_FIFO_STATUS : +return true; +default : +return false; + } +} +EXPORT_SYMBOL_NS_GPL (adxl313_is_volatile_reg,"IIO_ADXL313" ); +static int adxl312_check_id (struct device *dev,struct adxl313_data *data) {
drivers/iio/accel/adxl313_i2c.c +6 -0
@@ -21,6 +21,8 @@ static const struct regmap_config adxl31x_i2c_regmap_config[] = { .rd_table = &adxl312_readable_regs_table, .wr_table = &adxl312_writable_regs_table, .max_register = 0x39, + .volatile_reg = adxl313_is_volatile_reg, + .cache_type = REGCACHE_MAPLE, }, [ADXL313] = { .reg_bits = 8,
@@ -28,6 +30,8 @@ static const struct regmap_config adxl31x_i2c_regmap_config[] = { .rd_table = &adxl313_readable_regs_table, .wr_table = &adxl313_writable_regs_table, .max_register = 0x39, + .volatile_reg = adxl313_is_volatile_reg, + .cache_type = REGCACHE_MAPLE, }, [ADXL314] = { .reg_bits = 8,
@@ -35,6 +39,8 @@ static const struct regmap_config adxl31x_i2c_regmap_config[] = { .rd_table = &adxl314_readable_regs_table, .wr_table = &adxl314_writable_regs_table, .max_register = 0x39, + .volatile_reg = adxl313_is_volatile_reg, + .cache_type = REGCACHE_MAPLE, }, };
drivers/iio/accel/adxl313_spi.c +6 -0
@@ -24,6 +24,8 @@ static const struct regmap_config adxl31x_spi_regmap_config[] = { .max_register = 0x39,/* Setting bits 7 and 6 enables multiple-byte read */ .read_flag_mask = BIT(7) | BIT(6), + .volatile_reg = adxl313_is_volatile_reg, + .cache_type = REGCACHE_MAPLE, }, [ADXL313] = { .reg_bits = 8,
@@ -33,6 +35,8 @@ static const struct regmap_config adxl31x_spi_regmap_config[] = { .max_register = 0x39,/* Setting bits 7 and 6 enables multiple-byte read */ .read_flag_mask = BIT(7) | BIT(6), + .volatile_reg = adxl313_is_volatile_reg, + .cache_type = REGCACHE_MAPLE, }, [ADXL314] = { .reg_bits = 8,
@@ -42,6 +46,8 @@ static const struct regmap_config adxl31x_spi_regmap_config[] = { .max_register = 0x39, /* Setting bits 7 and 6 enables multiple-byte read */ .read_flag_mask = BIT(7) | BIT(6), + .volatile_reg = adxl313_is_volatile_reg, + .cache_type = REGCACHE_MAPLE, }, };
Signature · 1 line
2.39.5
PATCH v2 5/12 iio: accel: adxl313: add function to enable measurement
In reply to Lothar RubuschAdd a function to enable measurement. The data-sheet recomments turning of measurement while modifying certain config registers. This is a preparatory step.
--- drivers/iio/accel/adxl313.h | 3 ++- drivers/iio/accel/adxl313_core.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/iio/accel/adxl313.h +2 -1
@@ -36,8 +36,9 @@#define ADXL313_RATE_MSK GENMASK(3, 0)#define ADXL313_RATE_BASE 6 -#define ADXL313_POWER_CTL_MSK GENMASK(3, 2) +#define ADXL313_POWER_CTL_MSK BIT(3)#define ADXL313_MEASUREMENT_MODE BIT(3) +#define ADXL313_MEASUREMENT_STANDBY 0x00#define ADXL313_RANGE_MSK GENMASK(1, 0)#define ADXL313_RANGE_MAX 3
drivers/iio/accel/adxl313_core.c +9 -3
@@ -63,6 +63,14 @@ bool adxl313_is_volatile_reg(struct device *dev, unsigned int reg) }EXPORT_SYMBOL_NS_GPL (adxl313_is_volatile_reg,"IIO_ADXL313" ); +static int adxl313_set_measure_en (struct adxl313_data *data,bool en) +{ +unsigned int val = en ?ADXL313_MEASUREMENT_MODE :ADXL313_MEASUREMENT_STANDBY ; + +return regmap_update_bits (data->regmap,ADXL313_REG_POWER_CTL , +ADXL313_POWER_CTL_MSK , val); +} +static int adxl312_check_id (struct device *dev,struct adxl313_data *data) {
@@ -410,9 +418,7 @@ static int adxl313_setup(struct device *dev, struct adxl313_data *data, }/* Enables measurement mode */ -return regmap_update_bits (data->regmap,ADXL313_REG_POWER_CTL , -ADXL313_POWER_CTL_MSK , -ADXL313_MEASUREMENT_MODE ); +return adxl313_set_measure_en (data, true); }/**
Signature · 1 line
2.39.5
PATCH v2 6/12 iio: accel: adxl313: prepare interrupt handling
In reply to Lothar RubuschEvaluate the devicetree property for an optional interrupt line, and configure the interrupt mapping accordingly. When no interrupt line is defined in the devicetree, keep the FIFO in bypass mode as before.
--- drivers/iio/accel/adxl313.h | 8 ++++++++ drivers/iio/accel/adxl313_core.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+)
drivers/iio/accel/adxl313.h +8 -0
@@ -21,7 +21,9 @@#define ADXL313_REG_ACT_INACT_CTL 0x27#define ADXL313_REG_BW_RATE 0x2C#define ADXL313_REG_POWER_CTL 0x2D +#define ADXL313_REG_INT_ENABLE 0x2E#define ADXL313_REG_INT_MAP 0x2F +#define ADXL313_REG_INT_SOURCE 0x30#define ADXL313_REG_DATA_FORMAT 0x31#define ADXL313_REG_DATA_AXIS (index) (0x32 + ((index) * 2))#define ADXL313_REG_FIFO_CTL 0x38
@@ -47,6 +49,11 @@#define ADXL313_SPI_3WIRE BIT(6)#define ADXL313_I2C_DISABLE BIT(6) +#define ADXL313_REG_FIFO_CTL_MODE_MSK GENMASK(7, 6) + +#define ADXL313_FIFO_BYPASS 0 +#define ADXL313_FIFO_STREAM 2 +extern const struct regmap_access_table adxl312_readable_regs_table;extern const struct regmap_access_table adxl313_readable_regs_table;extern const struct regmap_access_table adxl314_readable_regs_table;
@@ -67,6 +74,7 @@ struct adxl313_data {struct regmap *regmap;const struct adxl313_chip_info *chip_info;struct mutex lock;/* lock to protect transf_buf */ +int irq;__le16 transf_buf__aligned(IIO_DMA_MINALIGN) ; };
drivers/iio/accel/adxl313_core.c +32 -0
@@ -8,11 +8,17 @@*/ #include <linux/bitfield.h> +#include <linux/interrupt.h> #include <linux/module.h> +#include <linux/property.h> #include <linux/regmap.h> #include "adxl313.h" +#define ADXL313_INT_NONE U8_MAX +#define ADXL313_INT1 1 +#define ADXL313_INT2 2 +static const struct regmap_range adxl312_readable_reg_range[] = {regmap_reg_range (ADXL313_REG_DEVID0 ,ADXL313_REG_DEVID0 ),regmap_reg_range (ADXL313_REG_OFS_AXIS (0 ),ADXL313_REG_OFS_AXIS (2 )),
@@ -438,6 +444,8 @@ int adxl313_core_probe(struct device *dev, {struct adxl313_data *data;struct iio_dev *indio_dev; +unsigned int regval; +u8 int_line;int ret; indio_dev =devm_iio_device_alloc (dev,sizeof (*data));
@@ -463,6 +471,30 @@ int adxl313_core_probe(struct device *dev,return ret; } + int_line =ADXL313_INT1 ; + data->irq =fwnode_irq_get_byname (dev_fwnode (dev),"INT1" ); +if (data->irq <0 ) { + int_line =ADXL313_INT2 ; + data->irq =fwnode_irq_get_byname (dev_fwnode (dev),"INT2" ); +if (data->irq <0 ) + int_line =ADXL313_INT_NONE ; + } + +if (int_line ==ADXL313_INT1 || int_line ==ADXL313_INT2 ) { +/* FIFO_STREAM mode */ + regval = int_line ==ADXL313_INT2 ?0xff :0 ; + ret =regmap_write (data->regmap,ADXL313_REG_INT_MAP , regval); +if (ret) +return ret; + }else { +/* FIFO_BYPASSED mode */ + ret =regmap_write (data->regmap,ADXL313_REG_FIFO_CTL , +FIELD_PREP (ADXL313_REG_FIFO_CTL_MODE_MSK , +ADXL313_FIFO_BYPASS )); +if (ret) +return ret; + } +return devm_iio_device_register (dev, indio_dev); }EXPORT_SYMBOL_NS_GPL (adxl313_core_probe,IIO_ADXL313 );
Signature · 1 line
2.39.5
PATCH v2 7/12 iio: accel: adxl313: add basic interrupt handling
In reply to Lothar RubuschPrepare the interrupt handler. Add register entries to evaluate the incoming interrupt. Add functions to clear status registers and reset the FIFO.
--- drivers/iio/accel/adxl313.h | 16 ++++ drivers/iio/accel/adxl313_core.c | 131 +++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+)
drivers/iio/accel/adxl313.h +16 -0
@@ -49,11 +49,25 @@#define ADXL313_SPI_3WIRE BIT(6)#define ADXL313_I2C_DISABLE BIT(6) +#define ADXL313_INT_OVERRUN BIT(0) +#define ADXL313_INT_WATERMARK BIT(1) +#define ADXL313_INT_INACTIVITY BIT(3) +#define ADXL313_INT_ACTIVITY BIT(4) +#define ADXL313_INT_DREADY BIT(7) + +/* FIFO entries: how many values are stored in the FIFO */ +#define ADXL313_REG_FIFO_STATUS_ENTRIES_MSK GENMASK(5, 0) +/* FIFO samples: number of samples needed for watermark (FIFO mode) */ +#define ADXL313_REG_FIFO_CTL_SAMPLES_MSK GENMASK(4, 0)#define ADXL313_REG_FIFO_CTL_MODE_MSK GENMASK(7, 6)#define ADXL313_FIFO_BYPASS 0#define ADXL313_FIFO_STREAM 2 +#define ADXL313_FIFO_SIZE 32 + +#define ADXL313_NUM_AXIS 3 +extern const struct regmap_access_table adxl312_readable_regs_table;extern const struct regmap_access_table adxl313_readable_regs_table;extern const struct regmap_access_table adxl314_readable_regs_table;
@@ -75,7 +89,9 @@ struct adxl313_data {const struct adxl313_chip_info *chip_info;struct mutex lock;/* lock to protect transf_buf */ int irq; +u8 fifo_mode;__le16 transf_buf__aligned(IIO_DMA_MINALIGN) ; +__le16 fifo_buf[ADXL313_NUM_AXIS *ADXL313_FIFO_SIZE +1 ]; };struct adxl313_chip_info {
drivers/iio/accel/adxl313_core.c +131 -0
161 lines not on this page · raw message
Signature · 1 line
2.39.5
Andy Shevchenko
reviewerRe: [PATCH v2 07/12] iio: accel: adxl313: add basic interrupt handling
Quoted 3 lines · Lothar Rubusch
Prepare the interrupt handler. Add register entries to evaluate the incoming interrupt. Add functions to clear status registers and reset the FIFO.
...
drivers/iio/accel/adxl313_core.c static int adxl313_write_raw(struct iio_dev *indio_dev, · line 411
Quoted 5 lines
drivers/iio/accel/adxl313_core.c +4
-0+static int adxl313_fifo_transfer (struct adxl313_data *data,int samples) +{ +size_t count; +int i;
Does it need to be signed?
Quoted 11 lines
drivers/iio/accel/adxl313_core.c +11
-0+int ret; + + count =sizeof (data->fifo_buf[0 ]) *ADXL313_NUM_AXIS ; +for (i =0 ; i < samples; i++) { + ret =regmap_bulk_read (data->regmap,ADXL313_REG_XYZ_BASE , + data->fifo_buf + (i * count /2 ), count); +if (ret) +return ret; + } +return 0 ; +}
...
drivers/iio/accel/adxl313_core.c static int adxl313_write_raw(struct iio_dev *indio_dev, · line 426
Quoted 3 lines
drivers/iio/accel/adxl313_core.c +3
-0+static void adxl313_fifo_reset (struct adxl313_data *data) +{ +int regval;
Incorrect type. Please, go through your whole code and check that for regmap returned value you use the same type. Using signed might lead to subtle and hard-to-hunt mistakes due to integer promotion rules in C language.
drivers/iio/accel/adxl313_core.c static int adxl313_write_raw(struct iio_dev *indio_dev, · line 437
Quoted 11 lines
drivers/iio/accel/adxl313_core.c +11
-0+int samples; + +adxl313_set_measure_en (data, false); + +/* clear samples */ + samples =adxl313_get_samples (data); +if (samples) +adxl313_fifo_transfer (data, samples); + +/* clear interrupt register */ +regmap_read (data->regmap,ADXL313_REG_INT_SOURCE , ®val);
No error check? At least comment why it's okay to go like this.
Quoted 2 lines
(quoted diff) +2
-0+ adxl313_set_measure_en(data, true); +}
...
Quoted 8 lines
drivers/iio/accel/adxl313_core.c +8
-0+static irqreturn_t adxl313_irq_handler (int irq,void *p) +{ +struct iio_dev *indio_dev = p; +struct adxl313_data *data =iio_priv (indio_dev); +int int_stat; + +if (regmap_read (data->regmap,ADXL313_REG_INT_SOURCE , &int_stat)) +return IRQ_NONE ;
drivers/iio/accel/adxl313_core.c static int adxl313_write_raw(struct iio_dev *indio_dev, · line 484
Quoted 10 lines
drivers/iio/accel/adxl313_core.c +9
-0+ +if (FIELD_GET (ADXL313_INT_OVERRUN , int_stat)) + goto err; + +return IRQ_HANDLED ; +err: +adxl313_fifo_reset (data); + +return IRQ_HANDLED ;
Seems you ignored my comment in previous review round. Please, re-read that thread and discuss all the stuff you disagree with (I want to know why).
Quoted 1 line
+}
...
drivers/iio/accel/adxl313_core.c int adxl313_core_probe(struct device *dev, · line 609
Quoted 1 line
drivers/iio/accel/adxl313_core.c +1
-0+ ret = devm_iio_kfifo_buffer_setup(dev, indio_dev,
One space too many.
Quoted 3 lines
drivers/iio/accel/adxl313_core.c +3
-0+ &adxl313_buffer_ops); +if (ret) +return ret;
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH v2 8/12 iio: accel: adxl313: add FIFO watermark
In reply to Lothar RubuschAdd FIFO watermark configuration and evaluation. Let a watermark to be configured. Evaluate the interrupt accordingly. Read out the FIFO content and push the values to the IIO channel.
--- drivers/iio/accel/adxl313.h | 1 + drivers/iio/accel/adxl313_core.c | 59 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+)
drivers/iio/accel/adxl313.h +1 -0
@@ -89,6 +89,7 @@ struct adxl313_data {const struct adxl313_chip_info *chip_info;struct mutex lock;/* lock to protect transf_buf */ int irq; +u8 watermark;u8 fifo_mode;__le16 transf_buf__aligned(IIO_DMA_MINALIGN) ;__le16 fifo_buf[ADXL313_NUM_AXIS *ADXL313_FIFO_SIZE +1 ];
drivers/iio/accel/adxl313_core.c +59 -0
89 lines not on this page · raw message
Signature · 1 line
2.39.5
Andy Shevchenko
reviewerRe: [PATCH v2 08/12] iio: accel: adxl313: add FIFO watermark
Quoted 3 lines · Lothar Rubusch
Add FIFO watermark configuration and evaluation. Let a watermark to be configured. Evaluate the interrupt accordingly. Read out the FIFO content and push the values to the IIO channel.
...
drivers/iio/accel/adxl313_core.c static int adxl313_write_raw(struct iio_dev *indio_dev, · line 380
Quoted 1 line
drivers/iio/accel/adxl313_core.c +1
-0+const unsigned int fifo_mask =0x1f , watermark_mask =0x02 ;
Seems you have some (wrong) setting in the text editor? One space too many again...
...
drivers/iio/accel/adxl313_core.c static const struct iio_buffer_setup_ops adxl313_buffer_ops = { · line 491
Quoted 4 lines
drivers/iio/accel/adxl313_core.c +4
-0+static int adxl313_fifo_push (struct iio_dev *indio_dev,int samples) +{ +struct adxl313_data *data =iio_priv (indio_dev); +int i, ret;
Why is 'i' signed?
drivers/iio/accel/adxl313_core.c static const struct iio_buffer_setup_ops adxl313_buffer_ops = { · line 493
Quoted 1 line
drivers/iio/accel/adxl313_core.c +1
-0+if (samples <=0 )
What is the semantics of the negative samples? Is it an error code? Why not? I believe it's ignored again from my previous review.
drivers/iio/accel/adxl313_core.c static const struct iio_buffer_setup_ops adxl313_buffer_ops = { · line 500
Quoted 7 lines
drivers/iio/accel/adxl313_core.c +7
-0+return -EINVAL ; + + ret =adxl313_fifo_transfer (data, samples); +if (ret) +return ret; + +for (i =0 ; i <ADXL313_NUM_AXIS * samples; i +=ADXL313_NUM_AXIS )
Ouch, one space too many, *again*!
Quoted 4 lines
drivers/iio/accel/adxl313_core.c +4
-0+iio_push_to_buffers (indio_dev, &data->fifo_buf[i]); + +return 0 ; +}
...
Quoted 6 lines
drivers/iio/accel/adxl313_core.c +6
-0+static int adxl313_push_event (struct iio_dev *indio_dev,int int_stat) +{ +struct adxl313_data *data =iio_priv (indio_dev); +int samples; +int ret = -ENOENT ; +
drivers/iio/accel/adxl313_core.c static const struct iio_buffer_setup_ops adxl313_buffer_ops = { · line 521
Quoted 10 lines
drivers/iio/accel/adxl313_core.c +10
-0+if (FIELD_GET (ADXL313_INT_WATERMARK , int_stat)) { + samples =adxl313_get_samples (data); +if (samples <0 ) +return -EINVAL ; + + ret =adxl313_fifo_push (indio_dev, samples); + } + +return ret; +}
...and again... If you are going to ignore most of the comments, do not expect your patches to be applied. I'm stopping here.
...
Also note, try to avoid sending a new version until the review is settled down on a previous round.
...
With this being said, I stopped here. Take your time (you have now a few weeks) and carefully address / discuss all mentioned pieces of the code in both review rounds.
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH v2 9/12 iio: accel: adxl313: add activity sensing
In reply to Lothar RubuschAdd possibilities to set a threshold for activity sensing. Extend the interrupt handler to process activity interrupts. Provide functions to set the activity threshold and to enable/disable activity sensing. Further add a fake channel for having x, y and z axis anded on the iio channel.
This is a preparatory patch. Some of the definitions and functions are supposed to be extended for inactivity later on.
--- drivers/iio/accel/adxl313_core.c | 230 +++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+)
drivers/iio/accel/adxl313_core.c +230 -0
@@ -12,6 +12,7 @@#include <linux/module.h> #include <linux/property.h> #include <linux/regmap.h> +#include <linux/units.h> #include <linux/iio/buffer.h> #include <linux/iio/events.h>
@@ -27,6 +28,21 @@#define ADXL313_REG_XYZ_BASE ADXL313_REG_DATA_AXIS(0) +#define ADXL313_ACT_XYZ_EN GENMASK(6, 4) + +/* activity/inactivity */ +enum adxl313_activity_type { +ADXL313_ACTIVITY , +}; + +static const unsigned int adxl313_act_int_reg[] = { + [ADXL313_ACTIVITY ] =ADXL313_INT_ACTIVITY , +}; + +static const unsigned int adxl313_act_thresh_reg[] = { + [ADXL313_ACTIVITY ] =ADXL313_REG_THRESH_ACT , +}; +static const struct regmap_range adxl312_readable_reg_range[] = {regmap_reg_range (ADXL313_REG_DEVID0 ,ADXL313_REG_DEVID0 ),regmap_reg_range (ADXL313_REG_OFS_AXIS (0 ),ADXL313_REG_OFS_AXIS (2 )),
@@ -231,6 +247,16 @@ static const int adxl313_odr_freqs[][2] = { }, \ } +static const struct iio_event_spec adxl313_fake_chan_events[] = { + { +/* activity */ + .type =IIO_EV_TYPE_MAG , + .dir =IIO_EV_DIR_RISING , + .mask_separate =BIT (IIO_EV_INFO_ENABLE ), + .mask_shared_by_type =BIT (IIO_EV_INFO_VALUE ), + }, +}; +enum adxl313_chans { chan_x, chan_y, chan_z, };
@@ -239,6 +265,14 @@ static const struct iio_chan_spec adxl313_channels[] = {ADXL313_ACCEL_CHANNEL (0 , chan_x,X ),ADXL313_ACCEL_CHANNEL (1 , chan_y,Y ), ADXL313_ACCEL_CHANNEL(2, chan_z, Z), + { + .type =IIO_ACCEL , + .modified = 1, + .channel2 = IIO_MOD_X_AND_Y_AND_Z, + .scan_index = -1, /* Fake channel for axis AND'ing */ + .event_spec = adxl313_fake_chan_events, + .num_event_specs = ARRAY_SIZE(adxl313_fake_chan_events), + }, }; static const unsigned long adxl313_scan_masks[] = {
@@ -301,6 +335,66 @@ static int adxl313_read_freq_avail(struct iio_dev *indio_dev, } } +static int adxl313_is_act_inact_en (struct adxl313_data *data, +enum adxl313_activity_type type) +{ +unsigned int axis_ctrl; +unsigned int regval; +int axis_en, int_en, ret; + + ret =regmap_read (data->regmap,ADXL313_REG_ACT_INACT_CTL , &axis_ctrl); +if (ret) +return ret; + +/* Check if axis for activity are enabled */ +if (type ==ADXL313_ACTIVITY ) + axis_en =FIELD_GET (ADXL313_ACT_XYZ_EN , axis_ctrl); +else +return 0 ; + +/* The axis are enabled, now check if specific interrupt is enabled */ + ret =regmap_read (data->regmap,ADXL313_REG_INT_ENABLE , ®val); +if (ret) +return ret; + + int_en = adxl313_act_int_reg[type] & regval; + +return axis_en && int_en; +} + +static int adxl313_set_act_inact_en (struct adxl313_data *data, +enum adxl313_activity_type type, +bool cmd_en) +{ +unsigned int axis_ctrl =0 ; +unsigned int threshold; +bool en; +int ret; + +if (type ==ADXL313_ACTIVITY ) + axis_ctrl =ADXL313_ACT_XYZ_EN ; + + ret =regmap_update_bits (data->regmap, +ADXL313_REG_ACT_INACT_CTL , + axis_ctrl, + cmd_en ?0xff :0x00 ); +if (ret) +return ret; + + ret =regmap_read (data->regmap, adxl313_act_thresh_reg[type], &threshold); +if (ret) +return ret; + +if (type ==ADXL313_ACTIVITY ) + en = cmd_en && threshold; +else + en = false; + +return regmap_update_bits (data->regmap,ADXL313_REG_INT_ENABLE , + adxl313_act_int_reg[type], + en ? adxl313_act_int_reg[type] :0 ); +} +static int adxl313_read_raw (struct iio_dev *indio_dev,struct iio_chan_spec const *chan,int *val,int *val2,long mask)
@@ -374,6 +468,113 @@ static int adxl313_write_raw(struct iio_dev *indio_dev, } } +static int adxl313_read_event_config (struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir) +{ +struct adxl313_data *data =iio_priv (indio_dev); + +if (type !=IIO_EV_TYPE_MAG ) +return -EINVAL ; + +switch (dir) { +case IIO_EV_DIR_RISING : +return adxl313_is_act_inact_en (data,ADXL313_ACTIVITY ); +default : +return -EINVAL ; + } +} + +static int adxl313_write_event_config (struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir, +bool state) +{ +struct adxl313_data *data =iio_priv (indio_dev); + +if (type !=IIO_EV_TYPE_MAG ) +return -EINVAL ; + +switch (dir) { +case IIO_EV_DIR_RISING : +return adxl313_set_act_inact_en (data,ADXL313_ACTIVITY , state); +default : +return -EINVAL ; + } +} + +static int adxl313_read_event_value (struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir, +enum iio_event_info info, +int *val,int *val2) +{ +struct adxl313_data *data =iio_priv (indio_dev); +unsigned int act_threshold; +int ret; + +/* Measurement stays enabled, reading from regmap cache */ + +if (type !=IIO_EV_TYPE_MAG ) +return -EINVAL ; + +if (info !=IIO_EV_INFO_VALUE ) +return -EINVAL ; + +switch (dir) { +case IIO_EV_DIR_RISING : + ret =regmap_read (data->regmap, + adxl313_act_thresh_reg[ADXL313_ACTIVITY ], + &act_threshold); +if (ret) +return ret; + *val = act_threshold *15625 ; + *val2 =MICRO ; +return IIO_VAL_FRACTIONAL ; +default : +return -EINVAL ; + } +} + +static int adxl313_write_event_value (struct iio_dev *indio_dev, +const struct iio_chan_spec *chan, +enum iio_event_type type, +enum iio_event_direction dir, +enum iio_event_info info, +int val,int val2) +{ +struct adxl313_data *data =iio_priv (indio_dev); +unsigned int regval; +int ret; + + ret =adxl313_set_measure_en (data, false); +if (ret) +return ret; + +if (type !=IIO_EV_TYPE_MAG ) +return -EINVAL ; + +if (info !=IIO_EV_INFO_VALUE ) +return -EINVAL ; + +/* Scale factor 15.625 mg/LSB */ + regval =DIV_ROUND_CLOSEST (MICRO * val + val2,15625 ); +switch (dir) { +case IIO_EV_DIR_RISING : + ret =regmap_write (data->regmap, + adxl313_act_thresh_reg[ADXL313_ACTIVITY ], + regval); +if (ret) +return ret; +return adxl313_set_measure_en (data, true); +default : +return -EINVAL ; + } +} +static int adxl313_set_watermark (struct iio_dev *indio_dev,unsigned int value) {struct adxl313_data *data =iio_priv (indio_dev);
@@ -505,10 +706,22 @@ static int adxl313_fifo_push(struct iio_dev *indio_dev, int samples)static int adxl313_push_event (struct iio_dev *indio_dev,int int_stat) { +s64 ts =iio_get_time_ns (indio_dev);struct adxl313_data *data =iio_priv (indio_dev);int samples;int ret = -ENOENT ; +if (FIELD_GET (ADXL313_INT_ACTIVITY , int_stat)) { + ret =iio_push_event (indio_dev, +IIO_MOD_EVENT_CODE (IIO_ACCEL ,0 , +IIO_MOD_X_AND_Y_AND_Z , +IIO_EV_TYPE_MAG , +IIO_EV_DIR_RISING ), + ts); +if (ret) +return ret; + } +if (FIELD_GET (ADXL313_INT_WATERMARK , int_stat)) { samples =adxl313_get_samples (data);if (samples <0 )
@@ -555,6 +768,10 @@ static int adxl313_reg_access(struct iio_dev *indio_dev, unsigned int reg,static const struct iio_info adxl313_info = { .read_raw = adxl313_read_raw, .write_raw = adxl313_write_raw, + .read_event_config = adxl313_read_event_config, + .write_event_config = adxl313_write_event_config, + .read_event_value = adxl313_read_event_value, + .write_event_value = adxl313_write_event_value, .read_avail = adxl313_read_freq_avail, .hwfifo_set_watermark = adxl313_set_watermark, .debugfs_reg_access = &adxl313_reg_access,
@@ -665,6 +882,19 @@ int adxl313_core_probe(struct device *dev,if (ret)return ret; +/* +* Reset or configure the registers with reasonable default +* values. As having 0 in most cases may result in undesirable +* behavior if the interrupts are enabled. +*/ + ret =regmap_write (data->regmap,ADXL313_REG_ACT_INACT_CTL ,0x00 ); +if (ret) +return ret; + + ret =regmap_write (data->regmap,ADXL313_REG_THRESH_ACT ,0x52 ); +if (ret) +return ret; + ret =devm_iio_kfifo_buffer_setup (dev, indio_dev, &adxl313_buffer_ops);if (ret)
Signature · 1 line
2.39.5
Andy Shevchenko
reviewerRe: [PATCH v2 09/12] iio: accel: adxl313: add activity sensing
Quoted 7 lines · Lothar Rubusch
Add possibilities to set a threshold for activity sensing. Extend the interrupt handler to process activity interrupts. Provide functions to set the activity threshold and to enable/disable activity sensing. Further add a fake channel for having x, y and z axis anded on the iio channel.
This is a preparatory patch. Some of the definitions and functions are supposed to be extended for inactivity later on.
...
drivers/iio/accel/adxl313_core.c static int adxl313_read_freq_avail(struct iio_dev *indio_dev, · line 352
Quoted 10 lines
drivers/iio/accel/adxl313_core.c +9
-0+int axis_en, int_en, ret; + + ret =regmap_read (data->regmap,ADXL313_REG_ACT_INACT_CTL , &axis_ctrl); +if (ret) +return ret; +/* Check if axis for activity are enabled */ +if (type ==ADXL313_ACTIVITY ) + axis_en =FIELD_GET (ADXL313_ACT_XYZ_EN , axis_ctrl); +else
Probably redundant 'else'. Wouldn't
if (!=) return 0;
work?
drivers/iio/accel/adxl313_core.c static int adxl313_read_freq_avail(struct iio_dev *indio_dev, · line 362
Quoted 10 lines
drivers/iio/accel/adxl313_core.c +8
-0+return 0 ; +/* The axis are enabled, now check if specific interrupt is enabled */ + ret =regmap_read (data->regmap,ADXL313_REG_INT_ENABLE , ®val); +if (ret) +return ret; + int_en = adxl313_act_int_reg[type] & regval; + +return axis_en && int_en;
With the above these lines become:
if (FIELD_GET(ADXL313_ACT_XYZ_EN, axis_ctrl) == 0) return 0; return !!(adxl313_act_int_reg[type] & regval);
...
drivers/iio/accel/adxl313_core.c static int adxl313_read_freq_avail(struct iio_dev *indio_dev, · line 380
Quoted 4 lines
drivers/iio/accel/adxl313_core.c +4
-0+ ret =regmap_update_bits (data->regmap, +ADXL313_REG_ACT_INACT_CTL , + axis_ctrl, + cmd_en ?0xff :0x00 );
Please, utilize given space. You have a lot of it in each line above.
Quoted 2 lines
(quoted diff) +2
-0+ if (ret) + return ret;
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH v2 10/12 iio: accel: adxl313: add inactivity sensing
In reply to Lothar RubuschExtend the interrupt handler to process interrupts as inactivity events. Add functions to set threshold and period registers for inactivity. Add functions to enable / disable inactivity. Extend the fake iio channel to deal with inactivity events on x, y and z combined with AND.
--- drivers/iio/accel/adxl313.h | 2 + drivers/iio/accel/adxl313_core.c | 138 +++++++++++++++++++++++++------ 2 files changed, 114 insertions(+), 26 deletions(-)
drivers/iio/accel/adxl313.h +2 -0
@@ -18,6 +18,8 @@#define ADXL313_REG_SOFT_RESET 0x18#define ADXL313_REG_OFS_AXIS (index) (0x1E + (index))#define ADXL313_REG_THRESH_ACT 0x24 +#define ADXL313_REG_THRESH_INACT 0x25 +#define ADXL313_REG_TIME_INACT 0x26#define ADXL313_REG_ACT_INACT_CTL 0x27#define ADXL313_REG_BW_RATE 0x2C#define ADXL313_REG_POWER_CTL 0x2D
drivers/iio/accel/adxl313_core.c +112 -26
237 lines not on this page · raw message
Signature · 1 line
2.39.5
PATCH v2 11/12 iio: accel: adxl313: implement power-save on inactivity
In reply to Lothar RubuschLink activity and inactivity to indicate the internal power-saving state. Add auto-sleep to be linked to inactivity.
--- drivers/iio/accel/adxl313.h | 3 +++ drivers/iio/accel/adxl313_core.c | 29 ++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-)
drivers/iio/accel/adxl313.h +3 -0
@@ -41,6 +41,9 @@#define ADXL313_RATE_BASE 6#define ADXL313_POWER_CTL_MSK BIT(3) +#define ADXL313_POWER_CTL_INACT_MSK GENMASK(5, 4) +#define ADXL313_POWER_CTL_LINK BIT(5) +#define ADXL313_POWER_CTL_AUTO_SLEEP BIT(4)#define ADXL313_MEASUREMENT_MODE BIT(3)#define ADXL313_MEASUREMENT_STANDBY 0x00
drivers/iio/accel/adxl313_core.c +26 -3
@@ -390,6 +390,7 @@ static int adxl313_set_act_inact_en(struct adxl313_data *data,unsigned int axis_ctrl;unsigned int threshold;unsigned int inact_time_s; +int act_en, inact_en;bool en;int ret;
@@ -418,9 +419,31 @@ static int adxl313_set_act_inact_en(struct adxl313_data *data, en = en && inact_time_s; } -return regmap_update_bits (data->regmap,ADXL313_REG_INT_ENABLE , - adxl313_act_int_reg[type], - en ? adxl313_act_int_reg[type] :0 ); + ret =regmap_update_bits (data->regmap,ADXL313_REG_INT_ENABLE , + adxl313_act_int_reg[type], + en ? adxl313_act_int_reg[type] :0 ); +if (ret) +return ret; + +/* +* Advanced power saving: Set sleep and link bit only when ACT and INACT +* are set. Check enable against regmap cached values. +*/ + act_en =adxl313_is_act_inact_en (data,ADXL313_ACTIVITY ); +if (act_en <0 ) +return act_en; + + inact_en =adxl313_is_act_inact_en (data,ADXL313_INACTIVITY ); +if (inact_en <0 ) +return inact_en; + + en = en && act_en && inact_en; + +return regmap_update_bits (data->regmap, +ADXL313_REG_POWER_CTL , +ADXL313_POWER_CTL_INACT_MSK , + en ? + (ADXL313_POWER_CTL_AUTO_SLEEP |ADXL313_POWER_CTL_LINK ) :0 ); } static int adxl313_read_raw(struct iio_dev *indio_dev,
Signature · 1 line
2.39.5
PATCH v2 12/12 docs: iio: add ADXL313 accelerometer
In reply to Lothar RubuschAdd documentation for the ADXL313 accelerometer driver.
--- Documentation/iio/adxl313.rst | 196 ++++++++++++++++++++++++++++++++++ Documentation/iio/index.rst | 1 + 2 files changed, 197 insertions(+) create mode 100644 Documentation/iio/adxl313.rst
Documentation/iio/adxl313.rst new file +196 -0
@@ -0,0 +1,196 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=============== +ADXL313 driver +=============== + +This driver supports Analog Device's ADXL313 on SPI/I2C bus. + +1. Supported devices +==================== + +* `ADXL313 <https://www.analog.com/ADXL313>`_ + +The ADXL313is a low noise density, low power, 3-axis accelerometer with +selectable measurement ranges. The ADXL313 supports the ±0.5 g, ±1 g, ±2 g and +±4 g ranges. + +2. Device attributes +==================== + +Accelerometer measurements are always provided. + +Temperature data are also provided. This data can be used to monitor the +internal system temperature or to improve the temperature stability of the +device via calibration. + +Each IIO device, has a device folder under ``/sys/bus/iio/devices/iio:deviceX``, +where X is the IIO index of the device. Under these folders reside a set of +device files, depending on the characteristics and features of the hardware +device in questions. These files are consistently generalized and documented in +the IIO ABI documentation. + +The following tables show the adxl313 related device files, found in the +specific device folder path ``/sys/bus/iio/devices/iio:deviceX``. + ++---------------------------------------------------+----------------------------------------------------------+ +| 3-Axis Accelerometer related device files | Description | ++---------------------------------------------------+----------------------------------------------------------+ +| in_accel_scale | Scale for the accelerometer channels. | ++---------------------------------------------------+----------------------------------------------------------+ +| in_accel_x_calibbias | Calibration offset for the X-axis accelerometer channel. | ++---------------------------------------------------+----------------------------------------------------------+ +| in_accel_x_raw | Raw X-axis accelerometer channel value. | ++---------------------------------------------------+----------------------------------------------------------+ +| in_accel_y_calibbias | y-axis acceleration offset correction | ++---------------------------------------------------+----------------------------------------------------------+ +| in_accel_y_raw | Raw Y-axis accelerometer channel value. | ++---------------------------------------------------+----------------------------------------------------------+ +| in_accel_z_calibbias | Calibration offset for the Z-axis accelerometer channel. | ++---------------------------------------------------+----------------------------------------------------------+ +| in_accel_z_raw | Raw Z-axis accelerometer channel value. | ++---------------------------------------------------+----------------------------------------------------------+ + ++---------------------------------------+----------------------------------------------+ +| Miscellaneous device files | Description | ++---------------------------------------+----------------------------------------------+ +| name | Name of the IIO device. | ++---------------------------------------+----------------------------------------------+ +| in_accel_sampling_frequency | Currently selected sample rate. | ++---------------------------------------+----------------------------------------------+ +| in_accel_sampling_frequency_available | Available sampling frequency configurations. | ++---------------------------------------+----------------------------------------------+ + +Channels processed values +------------------------- + +A channel value can be read from its _raw attribute. The value returned is the +raw value as reported by the devices. To get the processed value of the channel, +apply the following formula: + +.. code-block:: bash + + processed value = (_raw + _offset) * _scale + +Where _offset and _scale are device attributes. If no _offset attribute is +present, simply assume its value is 0. + +The ADXL313 driver offers data for a single types of channels, the table below +shows the measurement units for the processed value, which are defined by the +IIO framework: + ++-------------------------------------+---------------------------+ +| Channel type | Measurement unit | ++-------------------------------------+---------------------------+ +| Acceleration on X, Y, and Z axis | Meters per Second squared | ++-------------------------------------+---------------------------+ + +Usage examples +-------------- + +Show device name: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat name + adxl313 + +Show accelerometer channels value: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_raw + 2 + root:/sys/bus/iio/devices/iio:device0> cat in_accel_y_raw + -57 + root:/sys/bus/iio/devices/iio:device0> cat in_accel_z_raw + 2 + root:/sys/bus/iio/devices/iio:device0> cat in_accel_scale + 0.009576806 + +- X-axis acceleration = in_accel_x_raw * in_accel_scale = 0.0191536 m/s^2 +- Y-axis acceleration = in_accel_y_raw * in_accel_scale = -0.5458779 m/s^2 +- Z-axis acceleration = in_accel_z_raw * in_accel_scale = 0.0191536 m/s^2 + +Set calibration offset for accelerometer channels. Note, the calibration will be +rounded according to the graduation of LSB units: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias + 0 + + root:/sys/bus/iio/devices/iio:device0> echo 50 > in_accel_x_calibbias + root:/sys/bus/iio/devices/iio:device0> cat in_accel_x_calibbias + 48 + +Set sampling frequency: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> cat in_accel_sampling_frequency + 100.000000 + root:/sys/bus/iio/devices/iio:device0> cat in_accel_sampling_frequency_available + 6.250000 12.500000 25.000000 50.000000 100.000000 200.000000 400.000000 800.000000 1600.000000 3200.000000 + + root:/sys/bus/iio/devices/iio:device0> echo 400 > in_accel_sampling_frequency + root:/sys/bus/iio/devices/iio:device0> cat in_accel_sampling_frequency + 400.000000 + +3. Device buffers +================= + +This driver supports IIO buffers. + +All devices support retrieving the raw acceleration measurements using buffers. + +Usage examples +-------------- + +Select channels for buffer read: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_x_en + root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_y_en + root:/sys/bus/iio/devices/iio:device0> echo 1 > scan_elements/in_accel_z_en + +Set the number of samples to be stored in the buffer: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> echo 10 > buffer/length + +Enable buffer readings: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> echo 1 > buffer/enable + +Obtain buffered data: + +.. code-block:: bash + + root:/sys/bus/iio/devices/iio:device0> hexdump -C /dev/iio\:device0 + ... + 000000d0 01 fc 31 00 c7 ff 03 fc 31 00 c7 ff 04 fc 33 00 |..1.....1.....3.| + 000000e0 c8 ff 03 fc 32 00 c5 ff ff fc 32 00 c7 ff 0a fc |....2.....2.....| + 000000f0 30 00 c8 ff 06 fc 33 00 c7 ff 01 fc 2f 00 c8 ff |0.....3...../...| + 00000100 02 fc 32 00 c6 ff 04 fc 33 00 c8 ff 05 fc 33 00 |..2.....3.....3.| + 00000110 ca ff 02 fc 31 00 c7 ff 02 fc 30 00 c9 ff 09 fc |....1.....0.....| + 00000120 35 00 c9 ff 08 fc 35 00 c8 ff 02 fc 31 00 c5 ff |5.....5.....1...| + 00000130 03 fc 32 00 c7 ff 04 fc 32 00 c7 ff 02 fc 31 00 |..2.....2.....1.| + 00000140 c7 ff 08 fc 30 00 c7 ff 02 fc 32 00 c5 ff ff fc |....0.....2.....| + 00000150 31 00 c5 ff 04 fc 31 00 c8 ff 03 fc 32 00 c8 ff |1.....1.....2...| + 00000160 01 fc 31 00 c7 ff 05 fc 31 00 c3 ff 04 fc 31 00 |..1.....1.....1.| + 00000170 c5 ff 04 fc 30 00 c7 ff 03 fc 31 00 c9 ff 03 fc |....0.....1.....| + ... + +See ``Documentation/iio/iio_devbuf.rst`` for more information about how buffered +data is structured. + +4. IIO Interfacing Tools +======================== + +See ``Documentation/iio/iio_tools.rst`` for the description of the available IIO +interfacing tools.
Documentation/iio/index.rst +1 -0
@@ -31,6 +31,7 @@ Industrial I/O Kernel Drivers adis16475 adis16480 adis16550 + adxl313 adxl380 bno055 ep93xx_adc
Signature · 1 line
2.39.5