summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/accel/lis3l02dq_core.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-05-18 14:42:37 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-19 16:15:05 -0700
commit6fe8135fccd66aedcc55ded70824342587fd2499 (patch)
tree3afc7acfd0edc052ba93241761e935af9a3b6ebc /drivers/staging/iio/accel/lis3l02dq_core.c
parenta3f02370c9fa6d85fbee2c11649ebc9c84bae919 (diff)
staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev.
This was suggested by Arnd Bergmann, Other elements may well move in here in future, but it definitely makes sense for these. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/accel/lis3l02dq_core.c')
-rw-r--r--drivers/staging/iio/accel/lis3l02dq_core.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
index 942139a02ed7..ba5bc679204f 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -651,6 +651,18 @@ static const struct attribute_group lis3l02dq_attribute_group = {
.attrs = lis3l02dq_attributes,
};
+static const struct iio_info lis3l02dq_info = {
+ .num_interrupt_lines = 1,
+ .read_raw = &lis3l02dq_read_raw,
+ .write_raw = &lis3l02dq_write_raw,
+ .read_event_value = &lis3l02dq_read_thresh,
+ .write_event_value = &lis3l02dq_write_thresh,
+ .write_event_config = &lis3l02dq_write_event_config,
+ .read_event_config = &lis3l02dq_read_event_config,
+ .driver_module = THIS_MODULE,
+ .attrs = &lis3l02dq_attribute_group,
+};
+
static int __devinit lis3l02dq_probe(struct spi_device *spi)
{
int ret, regdone = 0;
@@ -670,17 +682,10 @@ static int __devinit lis3l02dq_probe(struct spi_device *spi)
mutex_init(&st->buf_lock);
indio_dev->name = spi->dev.driver->name;
indio_dev->dev.parent = &spi->dev;
- indio_dev->num_interrupt_lines = 1;
+ indio_dev->info = &lis3l02dq_info;
indio_dev->channels = lis3l02dq_channels;
indio_dev->num_channels = ARRAY_SIZE(lis3l02dq_channels);
- indio_dev->read_raw = &lis3l02dq_read_raw;
- indio_dev->write_raw = &lis3l02dq_write_raw;
- indio_dev->read_event_value = &lis3l02dq_read_thresh;
- indio_dev->write_event_value = &lis3l02dq_write_thresh;
- indio_dev->write_event_config = &lis3l02dq_write_event_config;
- indio_dev->read_event_config = &lis3l02dq_read_event_config;
- indio_dev->attrs = &lis3l02dq_attribute_group;
- indio_dev->driver_module = THIS_MODULE;
+
indio_dev->modes = INDIO_DIRECT_MODE;
ret = lis3l02dq_configure_ring(indio_dev);