Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304365
b: refs/heads/master
c: 09f4eb4
h: refs/heads/master
i:
  304363: ddcdc1e
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent 802b224 commit cdeee68
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 29 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: b11f98ff8c35d62523b2bfad07df3d756113aae3
refs/heads/master: 09f4eb404689bef8766f195d4476ebe98f851ce6
7 changes: 4 additions & 3 deletions trunk/drivers/staging/iio/dac/ad5064.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ static int ad5064_read_raw(struct iio_dev *indio_dev,
int scale_uv;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
*val = st->dac_cache[chan->channel];
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
Expand All @@ -260,7 +260,7 @@ static int ad5064_write_raw(struct iio_dev *indio_dev,
int ret;

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
if (val > (1 << chan->scan_type.realbits) || val < 0)
return -EINVAL;

Expand Down Expand Up @@ -308,7 +308,8 @@ static struct iio_chan_spec_ext_info ad5064_ext_info[] = {
.indexed = 1, \
.output = 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 = AD5064_ADDR_DAC(chan), \
.scan_type = IIO_ST('u', (bits), 16, 20 - (bits)), \
.ext_info = ad5064_ext_info, \
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/staging/iio/dac/ad5360.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ enum ad5360_type {
.type = IIO_VOLTAGE, \
.indexed = 1, \
.output = 1, \
.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 | \
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | \
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT, \
Expand Down Expand Up @@ -319,7 +320,7 @@ static int ad5360_write_raw(struct iio_dev *indio_dev,
unsigned int ofs_index;

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
if (val >= max_val || val < 0)
return -EINVAL;

Expand Down Expand Up @@ -376,7 +377,7 @@ static int ad5360_read_raw(struct iio_dev *indio_dev,
int ret;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
ret = ad5360_read(indio_dev, AD5360_READBACK_X1A,
chan->address);
if (ret < 0)
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/staging/iio/dac/ad5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ enum ad5380_type {
.type = IIO_VOLTAGE, \
.indexed = 1, \
.output = 1, \
.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_CALIBSCALE_SEPARATE_BIT | \
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT, \
.scan_type = IIO_ST('u', (_bits), 16, 14 - (_bits)) \
Expand Down Expand Up @@ -292,7 +293,7 @@ static int ad5380_write_raw(struct iio_dev *indio_dev,
struct ad5380_state *st = iio_priv(indio_dev);

switch (info) {
case 0:
case IIO_CHAN_INFO_RAW:
case IIO_CHAN_INFO_CALIBSCALE:
if (val >= max_val || val < 0)
return -EINVAL;
Expand Down Expand Up @@ -322,7 +323,7 @@ static int ad5380_read_raw(struct iio_dev *indio_dev,
int ret;

switch (info) {
case 0:
case IIO_CHAN_INFO_RAW:
case IIO_CHAN_INFO_CALIBSCALE:
ret = regmap_read(st->regmap, ad5380_info_to_reg(chan, info),
val);
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/staging/iio/dac/ad5421.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ static const struct iio_chan_spec ad5421_channels[] = {
.indexed = 1,
.output = 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 |
IIO_CHAN_INFO_OFFSET_SHARED_BIT |
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT |
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT,
Expand Down Expand Up @@ -304,7 +305,7 @@ static int ad5421_read_raw(struct iio_dev *indio_dev,
return -EINVAL;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
ret = ad5421_read(indio_dev, AD5421_REG_DAC_DATA);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -340,7 +341,7 @@ static int ad5421_write_raw(struct iio_dev *indio_dev,
const unsigned int max_val = 1 << 16;

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
if (val >= max_val || val < 0)
return -EINVAL;

Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/staging/iio/dac/ad5446.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ static const struct attribute_group ad5446_attribute_group = {
.indexed = 1, \
.output = 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 = IIO_ST('u', (bits), (storage), (shift)) \
}

Expand Down Expand Up @@ -274,7 +275,7 @@ static int ad5446_write_raw(struct iio_dev *indio_dev,
int ret;

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
if (val >= (1 << chan->scan_type.realbits) || val < 0)
return -EINVAL;

Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/staging/iio/dac/ad5504.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
.indexed = 1, \
.output = 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 = AD5504_ADDR_DAC(_chan), \
.scan_type = IIO_ST('u', 12, 16, 0), \
}
Expand Down Expand Up @@ -81,7 +82,7 @@ static int ad5504_read_raw(struct iio_dev *indio_dev,
int ret;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
ret = ad5504_spi_read(st->spi, chan->address);
if (ret < 0)
return ret;
Expand Down Expand Up @@ -109,7 +110,7 @@ static int ad5504_write_raw(struct iio_dev *indio_dev,
int ret;

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
if (val >= (1 << chan->scan_type.realbits) || val < 0)
return -EINVAL;

Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/staging/iio/dac/ad5624r_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
.indexed = 1, \
.output = 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 = (_chan), \
.scan_type = IIO_ST('u', (_bits), 16, 16 - (_bits)), \
}
Expand Down Expand Up @@ -122,7 +123,7 @@ static int ad5624r_write_raw(struct iio_dev *indio_dev,
int ret;

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
if (val >= (1 << chan->scan_type.realbits) || val < 0)
return -EINVAL;

Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/staging/iio/dac/ad5686.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ enum ad5686_supported_device_ids {
.indexed = 1, \
.output = 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 = AD5686_ADDR_DAC(chan), \
.scan_type = IIO_ST('u', bits, 16, shift) \
}
Expand Down Expand Up @@ -296,7 +297,7 @@ static int ad5686_read_raw(struct iio_dev *indio_dev,
int ret;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
mutex_lock(&indio_dev->mlock);
ret = ad5686_spi_read(st, chan->address);
mutex_unlock(&indio_dev->mlock);
Expand Down Expand Up @@ -326,7 +327,7 @@ static int ad5686_write_raw(struct iio_dev *indio_dev,
int ret;

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
if (val > (1 << chan->scan_type.realbits) || val < 0)
return -EINVAL;

Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/staging/iio/dac/ad5764.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ enum ad5764_type {
.output = 1, \
.channel = (_chan), \
.address = (_chan), \
.info_mask = IIO_CHAN_INFO_OFFSET_SHARED_BIT | \
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
IIO_CHAN_INFO_OFFSET_SHARED_BIT | \
IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \
IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT | \
IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT, \
Expand Down Expand Up @@ -188,7 +189,7 @@ static int ad5764_write_raw(struct iio_dev *indio_dev,
unsigned int reg;

switch (info) {
case 0:
case IIO_CHAN_INFO_RAW:
if (val >= max_val || val < 0)
return -EINVAL;
val <<= chan->scan_type.shift;
Expand Down Expand Up @@ -228,7 +229,7 @@ static int ad5764_read_raw(struct iio_dev *indio_dev,
int ret;

switch (info) {
case 0:
case IIO_CHAN_INFO_RAW:
reg = AD5764_REG_DATA(chan->address);
ret = ad5764_read(indio_dev, reg, val);
if (ret < 0)
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/staging/iio/dac/ad5791.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ static int ad5791_spi_read(struct spi_device *spi, u8 addr, u32 *val)
.indexed = 1, \
.address = AD5791_ADDR_DAC0, \
.channel = 0, \
.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_OFFSET_SHARED_BIT, \
.scan_type = IIO_ST('u', bits, 24, shift) \
}
Expand Down Expand Up @@ -231,7 +232,7 @@ static int ad5791_read_raw(struct iio_dev *indio_dev,
int ret;

switch (m) {
case 0:
case IIO_CHAN_INFO_RAW:
ret = ad5791_spi_read(st->spi, chan->address, val);
if (ret)
return ret;
Expand Down Expand Up @@ -263,7 +264,7 @@ static int ad5791_write_raw(struct iio_dev *indio_dev,
struct ad5791_state *st = iio_priv(indio_dev);

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
val &= AD5791_RES_MASK(chan->scan_type.realbits);
val <<= chan->scan_type.shift;

Expand Down

0 comments on commit cdeee68

Please sign in to comment.