iio: potentiometer: Add driver support for AD5110
Subsystems (4)
Mugilraj Dhavachelvan
maintainercover iio: potentiometer: Add driver support for AD5110
Add dt-bindings and driver support for AD5110, a Nonvolatile Digital Potentiometer.
Mugilraj Dhavachelvan (2):
dt-bindings: iio: potentiometer: Add AD5110 in trivial-devices
iio: potentiometer: Add driver support for AD5110
.../devicetree/bindings/trivial-devices.yaml | 2 + MAINTAINERS | 6 + drivers/iio/potentiometer/Kconfig | 10 + drivers/iio/potentiometer/Makefile | 1 + drivers/iio/potentiometer/ad5110.c | 333 ++++++++++++++++++ 5 files changed, 352 insertions(+) create mode 100644 drivers/iio/potentiometer/ad5110.c
Signature · 1 line
2.25.1
Mugilraj Dhavachelvan
maintainerPATCH 1/2 dt-bindings: iio: potentiometer: Add AD5110 in trivial-devices
Add AD5110, a Nonvolatile Digital Potentiometer into trivial-devices.yaml.
--- Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -33,6 +33,8 @@ properties: - ad,ad7414 # ADM9240: Complete System Hardware Monitor for uProcessor-Based Systems - ad,adm9240 + # AD5110 - Nonvolatile Digital Potentiometer + - adi,ad5110 # Analog Devices ADP5585 Keypad Decoder and I/O Expansion - adi,adp5585 # Analog Devices ADP5585 Keypad Decoder and I/O Expansion with support for Row5
Signature · 1 line
2.25.1
Mugilraj Dhavachelvan
maintainerPATCH 2/2 iio: potentiometer: Add driver support for AD5110
In reply to Mugilraj DhavachelvanThe AD5110/AD5112/AD5114 provide a nonvolatile solution for 128-/64-/32-position adjustment applications, offering guaranteed low resistor tolerance errors of ±8% and up to ±6 mA current density.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5110_5112_5114.pdf
--- MAINTAINERS | 6 + drivers/iio/potentiometer/Kconfig | 10 + drivers/iio/potentiometer/Makefile | 1 + drivers/iio/potentiometer/ad5110.c | 333 +++++++++++++++++++++++++++++ 4 files changed, 350 insertions(+) create mode 100644 drivers/iio/potentiometer/ad5110.c
MAINTAINERS +6 -0
@@ -452,6 +452,12 @@ S: Maintained W: https://parisc.wiki.kernel.org/index.php/AD1889 F: sound/pci/ad1889.* +AD5110 ANALOG DEVICES DIGITAL POTENTIOMETERS DRIVER +M: Mugilraj Dhavachelvan <[email protected]> +L: [email protected] +S: Supported +F: drivers/iio/potentiometer/ad5110.c + AD525X ANALOG DEVICES DIGITAL POTENTIOMETERS DRIVER M: Michael Hennerich <[email protected]> S: Supported
drivers/iio/potentiometer/Kconfig +10 -0
@@ -6,6 +6,16 @@ menu "Digital potentiometers" +config AD5110 + tristate "Analog Devices AD5110 and similar Digital Potentiometer driver" + depends on I2C + help + Say yes here to build support for the Analog Devices AD5110, AD5112 + and AD5114 digital potentiometer chip. + + To compile this driver as a module, choose M here: the + module will be called ad5110. + config AD5272 tristate "Analog Devices AD5272 and similar Digital Potentiometer driver" depends on I2C
drivers/iio/potentiometer/Makefile +1 -0
@@ -4,6 +4,7 @@ # # When adding new entries keep the list in alphabetical order +obj-$(CONFIG_AD5110) += ad5110.o obj-$(CONFIG_AD5272) += ad5272.o obj-$(CONFIG_DS1803) += ds1803.o obj-$(CONFIG_MAX5432) += max5432.o
drivers/iio/potentiometer/ad5110.c new file +333 -0
333 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 7 lines · Mugilraj Dhavachelvan
The AD5110/AD5112/AD5114 provide a nonvolatile solution for 128-/64-/32-position adjustment applications, offering guaranteed low resistor tolerance errors of ±8% and up to ±6 mA current density.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5110_5112_5114.pdf
Signed-off-by Mugilraj Dhavachelvan <[email protected]>
Thanks for the patch. This looks really good!
drivers/iio/potentiometer/ad5110.c line 116
Quoted 12 lines
[...]
drivers/iio/potentiometer/ad5110.c new file +10
-0+static int ad5110_write (struct ad5110_data *data,u8 cmd,u8 val) +{ +int ret; + +mutex_lock (&data->lock); + data->buf[0 ] = cmd; + data->buf[1 ] = val; + + ret =i2c_master_send_dmasafe (data->client, data->buf,sizeof (data->buf)); +mutex_unlock (&data->lock);
This returns the number of bytes written, which can be less then the number of bytes requested if there was an error. This should check if the right amount of bytes was written and return -EIO otherwise. Same for the other places that read/write from I2C.
Quoted 5 lines
drivers/iio/potentiometer/ad5110.c new file +5
-0+ +return ret <0 ? ret :0 ; +} + +static int ad5110_resistor_tol (struct ad5110_data *data,u8 cmd,int val)
drivers/iio/potentiometer/ad5110.c line 131
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+{ +int ret; + + ret =ad5110_read (data, cmd, &val); +if (ret) +return ret; + + data->tol =FIELD_GET (GENMASK (6 ,3 ), val); + data->tol = ((val &GENMASK (2 ,0 )) *1000 /8 ) + data->tol *1000 ; + data->tol = data->cfg->kohms * data->tol /100 ;
This is not wrong, but it can be implemented a bit simpler. The tolerance is encoded as a fixed point number, you don't have to treat them as two independent fields, but can treat it as one fixed point number.
data->tol = data->cfg->kohms * (val & GENMASK(6, 0)) * 1000 / 100 / 8;
Quoted 8 lines
drivers/iio/potentiometer/ad5110.c new file +8
-0+if (!(val &BIT (7 ))) + data->tol *=-1 ; + +return 0 ; +} + +static ssize_t ad5110_eeprom_read(struct device *dev, + struct device_attribute *attr,
drivers/iio/potentiometer/ad5110.c line 149
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+ char *buf) +{ +struct iio_dev *indio_dev =dev_to_iio_dev (dev); +struct ad5110_data *data =iio_priv (indio_dev); +int val =AD5110_WIPER_POS ; +int ret; + + ret =ad5110_read (data,AD5110_EEPROM_RD , &val); +if (ret) +return ret;
Maybe apply shift to get consistent behavior with raw.
Quoted 15 lines
drivers/iio/potentiometer/ad5110.c new file +15
-0+ +return iio_format_value (buf,IIO_VAL_INT ,1 , &val); +} + +static ssize_t ad5110_eeprom_write (struct device *dev, +struct device_attribute *attr, +const char *buf,size_t len) +{ +struct iio_dev *indio_dev =dev_to_iio_dev (dev); +struct ad5110_data *data =iio_priv (indio_dev); +int ret; + + ret =ad5110_write (data,AD5110_EEPROM_WR ,0 ); +if (ret) { +dev_err (&data->client->dev,"RDAC to EEPROM write failed\n" );
drivers/iio/potentiometer/ad5110.c line 174
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+return ret; + } +msleep (20 ); + +return len; +} + +static IIO_DEVICE_ATTR(wiper_pos_eeprom, 0644, + ad5110_eeprom_read, + ad5110_eeprom_write, 0);
This is new custom ABI and needs to be documented.
drivers/iio/potentiometer/ad5110.c line 225
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+static int ad5110_write_raw (struct iio_dev *indio_dev, +struct iio_chan_spec const *chan, +int val,int val2,long mask) +{ +struct ad5110_data *data =iio_priv (indio_dev); +int ret; + +switch (mask) { +case IIO_CHAN_INFO_RAW : +if (val >= data->cfg->max_pos || val <0 )
val == data->cfg->max_pos is a valid setting. Writing max_pos puts it in top-scale mode which gives maximum resistance.
drivers/iio/potentiometer/ad5110.c line 234
Quoted 9 lines
drivers/iio/potentiometer/ad5110.c new file +9
-0+return -EINVAL ; + +return ad5110_write (data,AD5110_RDAC_WR , val << data->cfg->shift); +case IIO_CHAN_INFO_ENABLE : +if (val <0 || val >1 ) +return -EINVAL ; +if (data->enable == val) +return 0 ; + ret =ad5110_write (data,AD5110_SHUTDOWN , val);
Doesn't val have to be inverted to get the right behavior?
Quoted 8 lines
drivers/iio/potentiometer/ad5110.c new file +8
-0+if (ret) +return ret; + data->enable = val; +return 0 ; +default : +return -EINVAL ; + } +}
[...]
Mugilraj Dhavachelvan
maintainerQuoted 13 lines · Lars-Peter Clausen
Quoted 7 lines · Mugilraj Dhavachelvan
The AD5110/AD5112/AD5114 provide a nonvolatile solution for 128-/64-/32-position adjustment applications, offering guaranteed low resistor tolerance errors of ±8% and up to ±6 mA current density.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5110_5112_5114.pdf
Signed-off-by Mugilraj Dhavachelvan <[email protected]>Thanks for the patch. This looks really good>
Quoted 2 lines
[...]
Quoted 12 lines
drivers/iio/potentiometer/ad5110.c line 116
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+static int ad5110_write (struct ad5110_data *data,u8 cmd,u8 val) +{ + int ret; + + mutex_lock(&data->lock); + data->buf[0] = cmd; + data->buf[1] = val; + + ret = i2c_master_send_dmasafe(data->client, data->buf, sizeof(data->buf)); + mutex_unlock(&data->lock);This returns the number of bytes written, which can be less then the number of bytes requested if there was an error. This should check if the right amount of bytes was written and return
-EIOotherwise. Same for the other places that read/write from I2C.
Fixed in v2.
Quoted 19 lines
Quoted 6 lines
drivers/iio/potentiometer/ad5110.c new file +5
-0+ + return ret < 0 ? ret : 0; +} + +static int ad5110_resistor_tol (struct ad5110_data *data,u8 cmd,int val)drivers/iio/potentiometer/ad5110.c line 131
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+{ + int ret; + + ret = ad5110_read(data, cmd, &val); + if (ret) + return ret; + + data->tol = FIELD_GET(GENMASK(6, 3), val); + data->tol = ((val & GENMASK(2, 0)) * 1000 / 8) + data->tol * 1000; + data->tol = data->cfg->kohms * data->tol / 100;This is not wrong, but it can be implemented a bit simpler. The tolerance is encoded as a fixed point number, you don't have to treat them as two independent fields, but can treat it as one fixed point number.
Quoted 2 lines
data->tol=data->cfg->kohms* (val &GENMASK(6, 0)) * 1000 / 100 / 8;
Great, Fixed in v2.
Quoted 12 lines
Quoted 12 lines
+ if (!(val & BIT(7)))
+data->tol*= -1;drivers/iio/potentiometer/ad5110.c new file +9
-0+ + return 0; +} + +static ssize_t ad5110_eeprom_read (struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct iio_dev *indio_dev = dev_to_iio_dev(dev);
Quoted 8 lines
Quoted 7 lines
+ struct
ad5110_data*data =iio_priv(indio_dev); + int val =AD5110_WIPER_POS;
+ int ret;
+
+ ret =ad5110_read(data, AD5110_EEPROM_RD, &val); + if (ret)
+ return ret;Maybe apply shift to get consistent behavior with
raw.
Fixed in v2.
Quoted 26 lines
Quoted 15 lines
drivers/iio/potentiometer/ad5110.c new file +15
-0+ + return iio_format_value(buf, IIO_VAL_INT, 1, &val); +} + +static ssize_t ad5110_eeprom_write (struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct iio_dev *indio_dev = dev_to_iio_dev(dev); + struct ad5110_data *data = iio_priv(indio_dev); + int ret; + + ret = ad5110_write(data, AD5110_EEPROM_WR, 0); + if (ret) { + dev_err(&data->client->dev, "RDAC to EEPROM write failed\n");drivers/iio/potentiometer/ad5110.c line 174
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+ return ret; + } + msleep(20); + + return len; +} + +static IIO_DEVICE_ATTR(wiper_pos_eeprom, 0644, + ad5110_eeprom_read, + ad5110_eeprom_write, 0);This is new custom ABI and needs to be documentedI'm not aware of this, fixed in v2.
Quoted 11 lines
drivers/iio/potentiometer/ad5110.c line 225
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+static int ad5110_write_raw (struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int val, int val2, long mask) +{ + struct ad5110_data *data = iio_priv(indio_dev); + int ret; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + if (val >= data->cfg->max_pos || val < 0)val ==
data->cfg->max_posis a valid setting. Writingmax_posputs it in top-scale mode which gives maximum resistance.
Fixed in v2.
Quoted 10 lines
Quoted 9 lines
+ return
-EINVAL;
+
+ returnad5110_write(data, AD5110_RDAC_WR, val << data->cfg->shift); + caseIIO_CHAN_INFO_ENABLE:
+ if (val < 0 || val > 1)
+ return-EINVAL;
+ if (data->enable== val)
+ return 0;
+ ret =ad5110_write(data, AD5110_SHUTDOWN, val);Doesn't val have to be inverted to get the right behaviorI just replicated the datasheet operation.
You mean,
1 - shutdown off
0 - shutdown on
If yes, then the user won't get confused with the datasheet and the behavior of the driver? Or Is it work like this? But yeah even I like this change it's more convenient.
Quoted 9 lines
Quoted 8 lines
+ if (ret)
+ return ret;
+data->enable= val;
+ return 0;
+ default:
+ return-EINVAL;
+ }
+}[...]
Thanks for feedback!!
Mugilraj Dhavachelvan
maintainerSorry some formatting issues happened in my previous mail.
Quoted 141 lines · Mugilraj Dhavachelvan
Quoted 13 lines · Lars-Peter Clausen
Quoted 7 lines · Mugilraj Dhavachelvan
The AD5110/AD5112/AD5114 provide a nonvolatile solution for 128-/64-/32-position adjustment applications, offering guaranteed low resistor tolerance errors of ±8% and up to ±6 mA current density.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5110_5112_5114.pdf
Signed-off-by Mugilraj Dhavachelvan <[email protected]>Thanks for the patch. This looks really good>
Quoted 2 lines
[...]
Quoted 12 lines
drivers/iio/potentiometer/ad5110.c line 116
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+static int ad5110_write (struct ad5110_data *data,u8 cmd,u8 val) +{ + int ret; + + mutex_lock(&data->lock); + data->buf[0] = cmd; + data->buf[1] = val; + + ret = i2c_master_send_dmasafe(data->client, data->buf, sizeof(data->buf)); + mutex_unlock(&data->lock);This returns the number of bytes written, which can be less then the number of bytes requested if there was an error. This should check if the right amount of bytes was written and return
-EIOotherwise. Same for the other places that read/write from I2C.Fixed in v2.
Quoted 19 lines
Quoted 6 lines
drivers/iio/potentiometer/ad5110.c new file +5
-0+ + return ret < 0 ? ret : 0; +} + +static int ad5110_resistor_tol (struct ad5110_data *data,u8 cmd,int val)drivers/iio/potentiometer/ad5110.c line 131
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+{ + int ret; + + ret = ad5110_read(data, cmd, &val); + if (ret) + return ret; + + data->tol = FIELD_GET(GENMASK(6, 3), val); + data->tol = ((val & GENMASK(2, 0)) * 1000 / 8) + data->tol * 1000; + data->tol = data->cfg->kohms * data->tol / 100;This is not wrong, but it can be implemented a bit simpler. The tolerance is encoded as a fixed point number, you don't have to treat them as two independent fields, but can treat it as one fixed point number.
Quoted 2 lines
data->tol=data->cfg->kohms* (val &GENMASK(6, 0)) * 1000 / 100 / 8;Great, Fixed in v2.
Quoted 12 lines
Quoted 12 lines
+ if (!(val & BIT(7)))
+data->tol*= -1;drivers/iio/potentiometer/ad5110.c new file +9
-0+ + return 0; +} + +static ssize_t ad5110_eeprom_read (struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct iio_dev *indio_dev = dev_to_iio_dev(dev);Quoted 8 lines
Quoted 7 lines
+ struct
ad5110_data*data =iio_priv(indio_dev); + int val =AD5110_WIPER_POS;
+ int ret;
+
+ ret =ad5110_read(data, AD5110_EEPROM_RD, &val); + if (ret)
+ return ret;Maybe apply shift to get consistent behavior with
raw.Fixed in v2.
Quoted 18 lines
Quoted 18 lines
drivers/iio/potentiometer/ad5110.c new file +18
-0+ + return iio_format_value(buf, IIO_VAL_INT, 1, &val); +} + +static ssize_t ad5110_eeprom_write (struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct iio_dev *indio_dev = dev_to_iio_dev(dev); + struct ad5110_data *data = iio_priv(indio_dev); + int ret; + + ret = ad5110_write(data, AD5110_EEPROM_WR, 0); + if (ret) { + dev_err(&data->client->dev, "RDAC to EEPROM write failed\n"); + return ret; + } + msleep(20);Quoted 8 lines
drivers/iio/potentiometer/ad5110.c line 174
Quoted 7 lines
drivers/iio/potentiometer/ad5110.c new file +7
-0+ + return len; +} + +static IIO_DEVICE_ATTR(wiper_pos_eeprom, 0644, + ad5110_eeprom_read, + ad5110_eeprom_write, 0);This is new custom ABI and needs to be documented
I'm not aware of this, fixed in v2.
Quoted 11 lines
drivers/iio/potentiometer/ad5110.c line 225
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+static int ad5110_write_raw (struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int val, int val2, long mask) +{ + struct ad5110_data *data = iio_priv(indio_dev); + int ret; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + if (val >= data->cfg->max_pos || val < 0)val ==
data->cfg->max_posis a valid setting. Writingmax_posputs it in top-scale mode which gives maximum resistance.Fixed in v2.
Quoted 10 lines
Quoted 9 lines
+ return
-EINVAL;
+
+ returnad5110_write(data, AD5110_RDAC_WR, val << data->cfg->shift); + caseIIO_CHAN_INFO_ENABLE:
+ if (val < 0 || val > 1)
+ return-EINVAL;
+ if (data->enable== val)
+ return 0;
+ ret =ad5110_write(data, AD5110_SHUTDOWN, val);Doesn't val have to be inverted to get the right behavior
I just replicated the datasheet operation.
You mean,
1 - shutdown off
0 - shutdown on
If yes, then the user won't get confused with the datasheet and the behavior of the driver? Or Is it work like this? But yeah even I like this change it's more convenient.Quoted 9 lines
Quoted 8 lines
+ if (ret)
+ return ret;
+data->enable= val;
+ return 0;
+ default:
+ return-EINVAL;
+ }
+}[...]
Thanks for feedback!!
Jonathan Cameron
maintainerQuoted 18 lines · On Sat, 7 Aug 2021 23:04:18 +0530 Mugilraj Dhavachelvan <[email protected]>…
Sorry some formatting issues happened in my previous mail.
Quoted 14 lines · Mugilraj Dhavachelvan
Quoted 11 lines · Lars-Peter Clausen
Quoted 7 lines · Mugilraj Dhavachelvan
The AD5110/AD5112/AD5114 provide a nonvolatile solution for 128-/64-/32-position adjustment applications, offering guaranteed low resistor tolerance errors of ±8% and up to ±6 mA current density.
Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD5110_5112_5114.pdf
Signed-off-by Mugilraj Dhavachelvan <[email protected]>Thanks for the patch. This looks really good>
...
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/iio/potentiometer/ad5110.c line 174
Quoted 4 lines
drivers/iio/potentiometer/ad5110.c new file +4
-0+ +static IIO_DEVICE_ATTR(wiper_pos_eeprom, 0644, + ad5110_eeprom_read, + ad5110_eeprom_write, 0);This is new custom ABI and needs to be documented
We have existing similar ABI in dac/mcp4725 which is simply called store_eeprom
It's in the main docs Documentation/ABI/testing/sysfs-bus-iio as storing device configuration. I'm guessing this device doesn't have other configuration so that description will work?
Quoted 23 lines
Quoted 23 lines
I'm not aware of this, fixed in v2.
Quoted 11 lines
drivers/iio/potentiometer/ad5110.c line 225
Quoted 10 lines
drivers/iio/potentiometer/ad5110.c new file +10
-0+static int ad5110_write_raw (struct iio_dev *indio_dev, + struct iio_chan_spec const *chan, + int val, int val2, long mask) +{ + struct ad5110_data *data = iio_priv(indio_dev); + int ret; + + switch (mask) { + case IIO_CHAN_INFO_RAW: + if (val >= data->cfg->max_pos || val < 0)val ==
data->cfg->max_posis a valid setting. Writingmax_posputs it in top-scale mode which gives maximum resistance.Fixed in v2.
Quoted 9 lines
Quoted 9 lines
+ return
-EINVAL;
+
+ returnad5110_write(data, AD5110_RDAC_WR, val << data->cfg->shift); + caseIIO_CHAN_INFO_ENABLE:
+ if (val < 0 || val > 1)
+ return-EINVAL;
+ if (data->enable== val)
+ return 0;
+ ret =ad5110_write(data, AD5110_SHUTDOWN, val);
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Doesn't val have to be inverted to get the right behavior
I just replicated the datasheet operation.
You mean,
1 - shutdown off
0 - shutdown on
If yes, then the user won't get confused with the datasheet and the behavior of the driver? Or Is it work like this? But yeah even I like this change it's more convenient.
ABI has to be consistent and writing an enable attribute with 1 has to mean enabling it whatever approach the datasheet takes to describe things. Most users don't read datasheets so interface needs to be intuitive.
Quoted 11 lines
Quoted 11 lines
Quoted 9 lines
Quoted 8 lines
+ if (ret)
+ return ret;
+data->enable= val;
+ return 0;
+ default:
+ return-EINVAL;
+ }
+}[...]
Thanks for feedback!!
drivers/iio/potentiometer/ad5110.c line 79
Quoted 7 lines · Mugilraj Dhavachelvan
drivers/iio/potentiometer/ad5110.c new file +7
-0+static const struct iio_chan_spec ad5110_channels[] = { + { + .type =IIO_RESISTANCE , + .output =1 , + .info_mask_separate =BIT (IIO_CHAN_INFO_RAW ) |BIT (IIO_CHAN_INFO_OFFSET ), + .info_mask_shared_by_type =BIT (IIO_CHAN_INFO_SCALE ) | +BIT (IIO_CHAN_INFO_ENABLE ),
There is only on channel in this device. Why are some separate and others shared_by_type?
Mugilraj Dhavachelvan
maintainerQuoted 10 lines · Lars-Peter Clausen
Quoted 7 lines · Mugilraj Dhavachelvan
+static const struct
iio_chan_specad5110_channels[] = {
+ {
+ .type =IIO_RESISTANCE,
+ .output = 1,
+ .info_mask_separate =BIT(IIO_CHAN_INFO_RAW)|BIT(IIO_CHAN_INFO_OFFSET), + .info_mask_shared_by_type =BIT(IIO_CHAN_INFO_SCALE)|
+BIT(IIO_CHAN_INFO_ENABLE),There is only on channel in this device. Why are some
separateand othersshared_by_type?
No special reason, I'll put everything into 'separate'. Fixed in v2.