mirror of https://gitee.com/openkylin/linux.git
staging:iio:accel Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional. No processed values in accelerometers. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5ccb3adbd7
commit
31313fc64d
|
@ -298,7 +298,7 @@ static int adis16201_read_raw(struct iio_dev *indio_dev,
|
|||
s16 val16;
|
||||
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
addr = adis16201_addresses[chan->address][0];
|
||||
ret = adis16201_spi_read_reg_16(indio_dev, addr, &val16);
|
||||
|
@ -411,7 +411,8 @@ static struct iio_chan_spec adis16201_channels[] = {
|
|||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "supply",
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_supply,
|
||||
.scan_index = ADIS16201_SCAN_SUPPLY,
|
||||
.scan_type = {
|
||||
|
@ -423,8 +424,9 @@ static struct iio_chan_spec adis16201_channels[] = {
|
|||
.type = IIO_TEMP,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT,
|
||||
.address = temp,
|
||||
.scan_index = ADIS16201_SCAN_TEMP,
|
||||
.scan_type = {
|
||||
|
@ -436,7 +438,8 @@ static struct iio_chan_spec adis16201_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = accel_x,
|
||||
.scan_index = ADIS16201_SCAN_ACC_X,
|
||||
|
@ -449,7 +452,8 @@ static struct iio_chan_spec adis16201_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Y,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = accel_y,
|
||||
.scan_index = ADIS16201_SCAN_ACC_Y,
|
||||
|
@ -462,7 +466,8 @@ static struct iio_chan_spec adis16201_channels[] = {
|
|||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_aux,
|
||||
.scan_index = ADIS16201_SCAN_AUX_ADC,
|
||||
.scan_type = {
|
||||
|
@ -474,7 +479,8 @@ static struct iio_chan_spec adis16201_channels[] = {
|
|||
.type = IIO_INCLI,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = incli_x,
|
||||
.scan_index = ADIS16201_SCAN_INCLI_X,
|
||||
|
@ -487,7 +493,8 @@ static struct iio_chan_spec adis16201_channels[] = {
|
|||
.type = IIO_INCLI,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Y,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = incli_y,
|
||||
.scan_index = ADIS16201_SCAN_INCLI_Y,
|
||||
|
|
|
@ -305,7 +305,7 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
|
|||
u8 addr;
|
||||
s16 val16;
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
addr = adis16203_addresses[chan->address][0];
|
||||
ret = adis16203_spi_read_reg_16(indio_dev, addr, &val16);
|
||||
|
@ -377,7 +377,8 @@ static struct iio_chan_spec adis16203_channels[] = {
|
|||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "supply",
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_supply,
|
||||
.scan_index = ADIS16203_SCAN_SUPPLY,
|
||||
.scan_type = {
|
||||
|
@ -389,7 +390,8 @@ static struct iio_chan_spec adis16203_channels[] = {
|
|||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_aux,
|
||||
.scan_index = ADIS16203_SCAN_AUX_ADC,
|
||||
.scan_type = {
|
||||
|
@ -401,7 +403,8 @@ static struct iio_chan_spec adis16203_channels[] = {
|
|||
.type = IIO_INCLI,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = incli_x,
|
||||
.scan_index = ADIS16203_SCAN_INCLI_X,
|
||||
|
@ -414,7 +417,8 @@ static struct iio_chan_spec adis16203_channels[] = {
|
|||
.type = IIO_INCLI,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Y,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT,
|
||||
.address = incli_y,
|
||||
.scan_index = ADIS16203_SCAN_INCLI_Y,
|
||||
.scan_type = {
|
||||
|
@ -426,7 +430,8 @@ static struct iio_chan_spec adis16203_channels[] = {
|
|||
.type = IIO_TEMP,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT,
|
||||
.address = temp,
|
||||
.scan_index = ADIS16203_SCAN_TEMP,
|
||||
|
|
|
@ -342,7 +342,7 @@ static int adis16204_read_raw(struct iio_dev *indio_dev,
|
|||
int addrind;
|
||||
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
addr = adis16204_addresses[chan->address][0];
|
||||
ret = adis16204_spi_read_reg_16(indio_dev, addr, &val16);
|
||||
|
@ -449,7 +449,8 @@ static struct iio_chan_spec adis16204_channels[] = {
|
|||
.indexed = 1, /* Note was not previously indexed */
|
||||
.channel = 0,
|
||||
.extend_name = "supply",
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_supply,
|
||||
.scan_index = ADIS16204_SCAN_SUPPLY,
|
||||
.scan_type = {
|
||||
|
@ -461,7 +462,8 @@ static struct iio_chan_spec adis16204_channels[] = {
|
|||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_aux,
|
||||
.scan_index = ADIS16204_SCAN_AUX_ADC,
|
||||
.scan_type = {
|
||||
|
@ -473,7 +475,8 @@ static struct iio_chan_spec adis16204_channels[] = {
|
|||
.type = IIO_TEMP,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT,
|
||||
.address = temp,
|
||||
.scan_index = ADIS16204_SCAN_TEMP,
|
||||
|
@ -486,7 +489,8 @@ static struct iio_chan_spec adis16204_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_PEAK_SEPARATE_BIT,
|
||||
.address = accel_x,
|
||||
|
@ -500,7 +504,8 @@ static struct iio_chan_spec adis16204_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Y,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_PEAK_SEPARATE_BIT,
|
||||
.address = accel_y,
|
||||
|
|
|
@ -331,7 +331,7 @@ static int adis16209_read_raw(struct iio_dev *indio_dev,
|
|||
s16 val16;
|
||||
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
addr = adis16209_addresses[chan->address][0];
|
||||
ret = adis16209_spi_read_reg_16(indio_dev, addr, &val16);
|
||||
|
@ -413,7 +413,8 @@ static struct iio_chan_spec adis16209_channels[] = {
|
|||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "supply",
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_supply,
|
||||
.scan_index = ADIS16209_SCAN_SUPPLY,
|
||||
.scan_type = {
|
||||
|
@ -425,7 +426,8 @@ static struct iio_chan_spec adis16209_channels[] = {
|
|||
.type = IIO_TEMP,
|
||||
.indexed = 0,
|
||||
.channel = 0,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT,
|
||||
.address = temp,
|
||||
.scan_index = ADIS16209_SCAN_TEMP,
|
||||
|
@ -438,7 +440,8 @@ static struct iio_chan_spec adis16209_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = accel_x,
|
||||
.scan_index = ADIS16209_SCAN_ACC_X,
|
||||
|
@ -451,7 +454,8 @@ static struct iio_chan_spec adis16209_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Y,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = accel_y,
|
||||
.scan_index = ADIS16209_SCAN_ACC_Y,
|
||||
|
@ -464,7 +468,8 @@ static struct iio_chan_spec adis16209_channels[] = {
|
|||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_aux,
|
||||
.scan_index = ADIS16209_SCAN_AUX_ADC,
|
||||
.scan_type = {
|
||||
|
@ -476,7 +481,8 @@ static struct iio_chan_spec adis16209_channels[] = {
|
|||
.type = IIO_INCLI,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT,
|
||||
.address = incli_x,
|
||||
.scan_index = ADIS16209_SCAN_INCLI_X,
|
||||
.scan_type = {
|
||||
|
@ -488,7 +494,8 @@ static struct iio_chan_spec adis16209_channels[] = {
|
|||
.type = IIO_INCLI,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Y,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT,
|
||||
.address = incli_y,
|
||||
.scan_index = ADIS16209_SCAN_INCLI_Y,
|
||||
.scan_type = {
|
||||
|
@ -500,6 +507,7 @@ static struct iio_chan_spec adis16209_channels[] = {
|
|||
.type = IIO_ROT,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
|
||||
.address = rot,
|
||||
.scan_index = ADIS16209_SCAN_ROT,
|
||||
.scan_type = {
|
||||
|
|
|
@ -507,7 +507,7 @@ static int adis16220_read_raw(struct iio_dev *indio_dev,
|
|||
u8 bits;
|
||||
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
addrind = 0;
|
||||
break;
|
||||
case IIO_CHAN_INFO_OFFSET:
|
||||
|
@ -575,11 +575,13 @@ static const struct iio_chan_spec adis16220_channels[] = {
|
|||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "supply",
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_supply,
|
||||
}, {
|
||||
.type = IIO_ACCEL,
|
||||
.info_mask = IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_PEAK_SEPARATE_BIT,
|
||||
.address = accel,
|
||||
|
@ -587,20 +589,23 @@ static const struct iio_chan_spec adis16220_channels[] = {
|
|||
.type = IIO_TEMP,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.info_mask = IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = temp,
|
||||
}, {
|
||||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.info_mask = IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_1,
|
||||
}, {
|
||||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 2,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
|
||||
.address = in_2,
|
||||
}
|
||||
};
|
||||
|
|
|
@ -365,7 +365,7 @@ static int adis16240_read_raw(struct iio_dev *indio_dev,
|
|||
s16 val16;
|
||||
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
addr = adis16240_addresses[chan->address][0];
|
||||
ret = adis16240_spi_read_reg_16(indio_dev, addr, &val16);
|
||||
|
@ -473,7 +473,8 @@ static struct iio_chan_spec adis16240_channels[] = {
|
|||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.extend_name = "supply",
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = in_supply,
|
||||
.scan_index = ADIS16240_SCAN_SUPPLY,
|
||||
.scan_type = {
|
||||
|
@ -485,6 +486,7 @@ static struct iio_chan_spec adis16240_channels[] = {
|
|||
.type = IIO_VOLTAGE,
|
||||
.indexed = 1,
|
||||
.channel = 1,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
|
||||
.address = in_aux,
|
||||
.scan_index = ADIS16240_SCAN_AUX_ADC,
|
||||
.scan_type = {
|
||||
|
@ -496,7 +498,8 @@ static struct iio_chan_spec adis16240_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_X,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = accel_x,
|
||||
.scan_index = ADIS16240_SCAN_ACC_X,
|
||||
|
@ -509,7 +512,8 @@ static struct iio_chan_spec adis16240_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Y,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = accel_y,
|
||||
.scan_index = ADIS16240_SCAN_ACC_Y,
|
||||
|
@ -522,7 +526,8 @@ static struct iio_chan_spec adis16240_channels[] = {
|
|||
.type = IIO_ACCEL,
|
||||
.modified = 1,
|
||||
.channel2 = IIO_MOD_Z,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT |
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
|
||||
.address = accel_z,
|
||||
.scan_index = ADIS16240_SCAN_ACC_Z,
|
||||
|
@ -535,7 +540,8 @@ static struct iio_chan_spec adis16240_channels[] = {
|
|||
.type = IIO_TEMP,
|
||||
.indexed = 1,
|
||||
.channel = 0,
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
|
||||
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
|
||||
.address = temp,
|
||||
.scan_index = ADIS16240_SCAN_TEMP,
|
||||
.scan_type = {
|
||||
|
|
|
@ -158,7 +158,7 @@ static int kxsd9_read_raw(struct iio_dev *indio_dev,
|
|||
struct kxsd9_state *st = iio_priv(indio_dev);
|
||||
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
ret = kxsd9_read(indio_dev, chan->address);
|
||||
if (ret < 0)
|
||||
goto error_ret;
|
||||
|
@ -181,7 +181,8 @@ static int kxsd9_read_raw(struct iio_dev *indio_dev,
|
|||
.type = IIO_ACCEL, \
|
||||
.modified = 1, \
|
||||
.channel2 = IIO_MOD_##axis, \
|
||||
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
|
||||
.address = KXSD9_REG_##axis, \
|
||||
}
|
||||
|
||||
|
@ -189,6 +190,7 @@ static struct iio_chan_spec kxsd9_channels[] = {
|
|||
KXSD9_ACCEL_CHAN(X), KXSD9_ACCEL_CHAN(Y), KXSD9_ACCEL_CHAN(Z),
|
||||
{
|
||||
.type = IIO_VOLTAGE,
|
||||
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
|
||||
.indexed = 1,
|
||||
.address = KXSD9_REG_AUX,
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ static int lis3l02dq_read_raw(struct iio_dev *indio_dev,
|
|||
u8 reg;
|
||||
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
/* Take the iio_dev status lock */
|
||||
mutex_lock(&indio_dev->mlock);
|
||||
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) {
|
||||
|
@ -513,7 +513,8 @@ static irqreturn_t lis3l02dq_event_handler(int irq, void *private)
|
|||
}
|
||||
|
||||
#define LIS3L02DQ_INFO_MASK \
|
||||
(IIO_CHAN_INFO_SCALE_SHARED_BIT | \
|
||||
(IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT | \
|
||||
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | \
|
||||
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT)
|
||||
|
||||
|
|
|
@ -429,7 +429,7 @@ static IIO_DEVICE_ATTR(measurement_mode, S_IRUGO | S_IWUSR,
|
|||
static IIO_DEVICE_ATTR(revision, S_IRUGO, sca3000_show_rev, NULL, 0);
|
||||
|
||||
#define SCA3000_INFO_MASK \
|
||||
IIO_CHAN_INFO_SCALE_SHARED_BIT
|
||||
IIO_CHAN_INFO_RAW_SEPARATE_BIT | IIO_CHAN_INFO_SCALE_SHARED_BIT
|
||||
#define SCA3000_EVENT_MASK \
|
||||
(IIO_EV_BIT(IIO_EV_TYPE_MAG, IIO_EV_DIR_RISING))
|
||||
|
||||
|
@ -476,7 +476,7 @@ static int sca3000_read_raw(struct iio_dev *indio_dev,
|
|||
u8 address;
|
||||
|
||||
switch (mask) {
|
||||
case 0:
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
mutex_lock(&st->lock);
|
||||
if (st->mo_det_use_count) {
|
||||
mutex_unlock(&st->lock);
|
||||
|
|
Loading…
Reference in New Issue