Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304364
b: refs/heads/master
c: b11f98f
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent ddcdc1e commit 802b224
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 55 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31313fc64d51bbd8979997f9d6670cc882c5f963
refs/heads/master: b11f98ff8c35d62523b2bfad07df3d756113aae3
11 changes: 7 additions & 4 deletions trunk/drivers/staging/iio/adc/ad7192.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ static int ad7192_read_raw(struct iio_dev *indio_dev,
bool unipolar = !!(st->conf & AD7192_CONF_UNIPOLAR);

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev))
ret = -EBUSY;
Expand Down Expand Up @@ -981,7 +981,8 @@ static const struct iio_info ad7195_info = {
.extend_name = _name, \
.channel = _chan, \
.channel2 = _chan2, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = _address, \
.scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)}
Expand All @@ -990,7 +991,8 @@ static const struct iio_info ad7195_info = {
{ .type = IIO_VOLTAGE, \
.indexed = 1, \
.channel = _chan, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = _address, \
.scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)}
Expand All @@ -999,7 +1001,8 @@ static const struct iio_info ad7195_info = {
{ .type = IIO_TEMP, \
.indexed = 1, \
.channel = _chan, \
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
.address = _address, \
.scan_index = _si, \
.scan_type = IIO_ST('s', 24, 32, 0)}
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/staging/iio/adc/ad7280a.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ static int ad7280_channel_init(struct ad7280_state *st)
}
st->channels[cnt].indexed = 1;
st->channels[cnt].info_mask =
IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT;
st->channels[cnt].address =
AD7280A_DEVADDR(dev) << 8 | ch;
Expand All @@ -524,7 +525,9 @@ static int ad7280_channel_init(struct ad7280_state *st)
st->channels[cnt].channel2 = dev * 6;
st->channels[cnt].address = AD7280A_ALL_CELLS;
st->channels[cnt].indexed = 1;
st->channels[cnt].info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT;
st->channels[cnt].info_mask =
IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT;
st->channels[cnt].scan_index = cnt;
st->channels[cnt].scan_type.sign = 'u';
st->channels[cnt].scan_type.realbits = 32;
Expand Down Expand Up @@ -788,7 +791,7 @@ static int ad7280_read_raw(struct iio_dev *indio_dev,
int ret;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
if (chan->address == AD7280A_ALL_CELLS)
ret = ad7280_read_all_channels(st, st->scan_cnt, NULL);
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/staging/iio/adc/ad7291.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
s16 signval;

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
switch (chan->type) {
case IIO_VOLTAGE:
mutex_lock(&chip->state_lock);
Expand Down Expand Up @@ -536,7 +536,8 @@ static int ad7291_read_raw(struct iio_dev *indio_dev,
#define AD7291_VOLTAGE_CHAN(_chan) \
{ \
.type = IIO_VOLTAGE, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.indexed = 1, \
.channel = _chan, \
.event_mask = IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING)|\
Expand All @@ -554,7 +555,8 @@ static const struct iio_chan_spec ad7291_channels[] = {
AD7291_VOLTAGE_CHAN(7),
{
.type = IIO_TEMP,
.info_mask = IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT |
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_AVERAGE_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.indexed = 1,
.channel = 0,
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/staging/iio/adc/ad7298_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
.type = IIO_VOLTAGE, \
.indexed = 1, \
.channel = index, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.address = index, \
.scan_index = index, \
.scan_type = { \
Expand All @@ -42,7 +43,8 @@ static struct iio_chan_spec ad7298_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 = 9,
.scan_index = AD7298_CH_TEMP,
.scan_type = {
Expand Down Expand Up @@ -130,7 +132,7 @@ static int ad7298_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) {
ret = -EBUSY;
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/staging/iio/adc/ad7476_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int ad7476_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev))
ret = -EBUSY;
Expand All @@ -70,7 +70,8 @@ static int ad7476_read_raw(struct iio_dev *indio_dev,
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_SCALE_SHARED_BIT, \
.scan_type = { \
.sign = 'u', \
.realbits = bits, \
Expand Down
19 changes: 10 additions & 9 deletions trunk/drivers/staging/iio/adc/ad7606_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static int ad7606_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev))
ret = -EBUSY;
Expand Down Expand Up @@ -229,14 +229,15 @@ static const struct attribute_group ad7606_attribute_group_range = {
.attrs = ad7606_attributes_range,
};

#define AD7606_CHANNEL(num) \
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.channel = num, \
.address = num, \
.scan_index = num, \
.scan_type = IIO_ST('s', 16, 16, 0), \
#define AD7606_CHANNEL(num) \
{ \
.type = IIO_VOLTAGE, \
.indexed = 1, \
.channel = num, \
.address = num, \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT, \
.scan_index = num, \
.scan_type = IIO_ST('s', 16, 16, 0), \
}

static struct iio_chan_spec ad7606_8_channels[] = {
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/staging/iio/adc/ad7780.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int ad7780_read_raw(struct iio_dev *indio_dev,
unsigned long scale_uv;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
ret = ad7780_read(st, &smpl);
mutex_unlock(&indio_dev->mlock);
Expand Down Expand Up @@ -130,7 +130,8 @@ static const struct ad7780_chip_info ad7780_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_type = {
.sign = 's',
.realbits = 24,
Expand All @@ -144,7 +145,8 @@ static const struct ad7780_chip_info ad7780_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_type = {
.sign = 's',
.realbits = 20,
Expand Down
38 changes: 25 additions & 13 deletions trunk/drivers/staging/iio/adc/ad7793.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static int ad7793_read_raw(struct iio_dev *indio_dev,
bool unipolar = !!(st->conf & AD7793_CONF_UNIPOLAR);

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev))
ret = -EBUSY;
Expand Down Expand Up @@ -760,7 +760,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 0,
.channel2 = 0,
.address = AD7793_CH_AIN1P_AIN1M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 0,
.scan_type = IIO_ST('s', 24, 32, 0)
},
Expand All @@ -771,7 +772,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 1,
.channel2 = 1,
.address = AD7793_CH_AIN2P_AIN2M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 1,
.scan_type = IIO_ST('s', 24, 32, 0)
},
Expand All @@ -782,7 +784,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 2,
.channel2 = 2,
.address = AD7793_CH_AIN3P_AIN3M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 2,
.scan_type = IIO_ST('s', 24, 32, 0)
},
Expand All @@ -794,7 +797,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 2,
.channel2 = 2,
.address = AD7793_CH_AIN1M_AIN1M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 2,
.scan_type = IIO_ST('s', 24, 32, 0)
},
Expand All @@ -803,7 +807,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.indexed = 1,
.channel = 0,
.address = AD7793_CH_TEMP,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.scan_index = 4,
.scan_type = IIO_ST('s', 24, 32, 0),
},
Expand All @@ -813,7 +818,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.indexed = 1,
.channel = 4,
.address = AD7793_CH_AVDD_MONITOR,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.scan_index = 5,
.scan_type = IIO_ST('s', 24, 32, 0),
},
Expand All @@ -827,7 +833,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 0,
.channel2 = 0,
.address = AD7793_CH_AIN1P_AIN1M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 0,
.scan_type = IIO_ST('s', 16, 32, 0)
},
Expand All @@ -838,7 +845,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 1,
.channel2 = 1,
.address = AD7793_CH_AIN2P_AIN2M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 1,
.scan_type = IIO_ST('s', 16, 32, 0)
},
Expand All @@ -849,7 +857,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 2,
.channel2 = 2,
.address = AD7793_CH_AIN3P_AIN3M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 2,
.scan_type = IIO_ST('s', 16, 32, 0)
},
Expand All @@ -861,7 +870,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.channel = 2,
.channel2 = 2,
.address = AD7793_CH_AIN1M_AIN1M,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = 2,
.scan_type = IIO_ST('s', 16, 32, 0)
},
Expand All @@ -870,7 +880,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.indexed = 1,
.channel = 0,
.address = AD7793_CH_TEMP,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.scan_index = 4,
.scan_type = IIO_ST('s', 16, 32, 0),
},
Expand All @@ -880,7 +891,8 @@ static const struct ad7793_chip_info ad7793_chip_info_tbl[] = {
.indexed = 1,
.channel = 4,
.address = AD7793_CH_AVDD_MONITOR,
.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
.scan_index = 5,
.scan_type = IIO_ST('s', 16, 32, 0),
},
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/staging/iio/adc/ad7887_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int ad7887_read_raw(struct iio_dev *indio_dev,
unsigned int scale_uv;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(indio_dev))
ret = -EBUSY;
Expand Down Expand Up @@ -75,7 +75,8 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0),
Expand All @@ -84,7 +85,8 @@ static const struct ad7887_chip_info ad7887_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0),
Expand Down
Loading

0 comments on commit 802b224

Please sign in to comment.