Skip to content

Commit

Permalink
staging:iio:light:tsl2563 remove use of IIO_CHAN macro and make use m…
Browse files Browse the repository at this point in the history
…odifier defines.

This avoids issues in the new event code introduced shortly + makes
moving this one out of staging easier.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent 9dd1cb3 commit 7993906
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions drivers/staging/iio/light/tsl2563.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,16 +528,26 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev,
return ret;
}

#define INFO_MASK (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE)
#define EVENT_MASK (IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING) | \
IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_FALLING))
#define IIO_CHAN_2563(type, mod, proc, chan, imask, emask) \
IIO_CHAN(type, mod, 1, proc, NULL, chan, 0, imask, 0, 0, {}, emask)

static const struct iio_chan_spec tsl2563_channels[] = {
IIO_CHAN_2563(IIO_LIGHT, 0, 1, 0, 0, 0),
IIO_CHAN_2563(IIO_INTENSITY, 1, 0, 0, INFO_MASK, EVENT_MASK),
IIO_CHAN_2563(IIO_INTENSITY, 1, 0, 1, INFO_MASK, 0),
{
.type = IIO_LIGHT,
.indexed = 1,
.channel = 0,
}, {
.type = IIO_INTENSITY,
.modified = 1,
.channel2 = IIO_MOD_LIGHT_BOTH,
.info_mask = (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE),
.event_mask = (IIO_EV_BIT(IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING) |
IIO_EV_BIT(IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING)),
}, {
.type = IIO_INTENSITY,
.modified = 1,
.channel2 = IIO_MOD_LIGHT_BOTH,
.info_mask = (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE),
}
};

static int tsl2563_read_thresh(struct iio_dev *indio_dev,
Expand Down

0 comments on commit 7993906

Please sign in to comment.