Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304373
b: refs/heads/master
c: 41fd935
h: refs/heads/master
i:
  304371: c8e29a0
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent 9f3a4da commit 4a4c88a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 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: e33e0750826b73ca505244c79152bba1e37c85d0
refs/heads/master: 41fd935b1812b9d811911a85d5893493f5ec774a
19 changes: 17 additions & 2 deletions trunk/drivers/staging/iio/iio_simple_dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ static struct iio_chan_spec iio_dummy_channels[] = {
.channel = 0,
/* What other information is available? */
.info_mask =
/*
* in_voltage0_raw
* Raw (unscaled no bias removal etc) measurement
* from the device.
*/
IIO_CHAN_INFO_RAW_SEPARATE_BIT |
/*
* in_voltage0_offset
* Offset for userspace to apply prior to scale
Expand Down Expand Up @@ -113,6 +119,12 @@ static struct iio_chan_spec iio_dummy_channels[] = {
.channel = 1,
.channel2 = 2,
.info_mask =
/*
* in_voltage1-voltage2_raw
* Raw (unscaled no bias removal etc) measurement
* from the device.
*/
IIO_CHAN_INFO_RAW_SEPARATE_BIT |
/*
* in_voltage-voltage_scale
* Shared version of scale - shared by differential
Expand All @@ -135,6 +147,7 @@ static struct iio_chan_spec iio_dummy_channels[] = {
.channel = 3,
.channel2 = 4,
.info_mask =
IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SHARED_BIT,
.scan_index = diffvoltage3m4,
.scan_type = {
Expand All @@ -154,6 +167,7 @@ static struct iio_chan_spec iio_dummy_channels[] = {
/* Channel 2 is use for modifiers */
.channel2 = IIO_MOD_X,
.info_mask =
IIO_CHAN_INFO_RAW_SEPARATE_BIT |
/*
* Internal bias correction value. Applied
* by the hardware or driver prior to userspace
Expand All @@ -177,6 +191,7 @@ static struct iio_chan_spec iio_dummy_channels[] = {
/* DAC channel out_voltage0_raw */
{
.type = IIO_VOLTAGE,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
.output = 1,
.indexed = 1,
.channel = 0,
Expand All @@ -203,7 +218,7 @@ static int iio_dummy_read_raw(struct iio_dev *indio_dev,

mutex_lock(&st->lock);
switch (mask) {
case 0: /* magic value - channel value read */
case IIO_CHAN_INFO_RAW: /* magic value - channel value read */
switch (chan->type) {
case IIO_VOLTAGE:
if (chan->output) {
Expand Down Expand Up @@ -290,7 +305,7 @@ static int iio_dummy_write_raw(struct iio_dev *indio_dev,
struct iio_dummy_state *st = iio_priv(indio_dev);

switch (mask) {
case 0:
case IIO_CHAN_INFO_RAW:
if (chan->output == 0)
return -EINVAL;

Expand Down

0 comments on commit 4a4c88a

Please sign in to comment.