diff options
Diffstat (limited to 'drivers/staging/iio/light/tsl2563.c')
-rw-r--r-- | drivers/staging/iio/light/tsl2563.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c index 7e984bcf8d7e..ffca85e81ef5 100644 --- a/drivers/staging/iio/light/tsl2563.c +++ b/drivers/staging/iio/light/tsl2563.c @@ -37,6 +37,7 @@ #include "../iio.h" #include "../sysfs.h" +#include "../events.h" #include "tsl2563.h" /* Use this many bits for fraction part. */ @@ -226,6 +227,8 @@ static int tsl2563_read_id(struct tsl2563_chip *chip, u8 *id) if (ret < 0) return ret; + *id = ret; + return 0; } @@ -510,7 +513,7 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev, } break; - case (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE): + case IIO_CHAN_INFO_CALIBSCALE: if (chan->channel == 0) *val = calib_to_sysfs(chip->calib0); else @@ -536,7 +539,7 @@ static const struct iio_chan_spec tsl2563_channels[] = { .type = IIO_INTENSITY, .modified = 1, .channel2 = IIO_MOD_LIGHT_BOTH, - .info_mask = (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE), + .info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT, .event_mask = (IIO_EV_BIT(IIO_EV_TYPE_THRESH, IIO_EV_DIR_RISING) | IIO_EV_BIT(IIO_EV_TYPE_THRESH, @@ -544,8 +547,8 @@ static const struct iio_chan_spec tsl2563_channels[] = { }, { .type = IIO_INTENSITY, .modified = 1, - .channel2 = IIO_MOD_LIGHT_BOTH, - .info_mask = (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE), + .channel2 = IIO_MOD_LIGHT_IR, + .info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT, } }; @@ -866,20 +869,8 @@ static struct i2c_driver tsl2563_i2c_driver = { .remove = __devexit_p(tsl2563_remove), .id_table = tsl2563_id, }; - -static int __init tsl2563_init(void) -{ - return i2c_add_driver(&tsl2563_i2c_driver); -} - -static void __exit tsl2563_exit(void) -{ - i2c_del_driver(&tsl2563_i2c_driver); -} +module_i2c_driver(tsl2563_i2c_driver); MODULE_AUTHOR("Nokia Corporation"); MODULE_DESCRIPTION("tsl2563 light sensor driver"); MODULE_LICENSE("GPL"); - -module_init(tsl2563_init); -module_exit(tsl2563_exit); |