diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2010-05-04 13:42:58 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 18:36:05 (GMT) |
commit | f3fb001191a38a81bbc3cb363af2c279609ecc7c (patch) | |
tree | d2d17c61c682131e2c02deb536db2f35afa0169f /drivers/staging/iio/accel/sca3000_ring.c | |
parent | ff7723e203349c18d7149e7cf2a4ae928bb9da69 (diff) | |
download | linux-f3fb001191a38a81bbc3cb363af2c279609ecc7c.tar.xz |
iio:staging:accelerometers move towards the new abi
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/sca3000_ring.c')
-rw-r--r-- | drivers/staging/iio/accel/sca3000_ring.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/staging/iio/accel/sca3000_ring.c b/drivers/staging/iio/accel/sca3000_ring.c index 40cbab2..2b39e6f 100644 --- a/drivers/staging/iio/accel/sca3000_ring.c +++ b/drivers/staging/iio/accel/sca3000_ring.c @@ -186,11 +186,29 @@ static ssize_t sca3000_store_ring_bpse(struct device *dev, return ret ? ret : len; } -static IIO_CONST_ATTR(bpse_available, "8 11"); +static IIO_SCAN_EL_C(accel_x, 0, 0, 0, 0); +static IIO_SCAN_EL_C(accel_y, 1, 0, 0, 0); +static IIO_SCAN_EL_C(accel_z, 2, 0, 0, 0); +static IIO_CONST_ATTR(accel_precision_available, "8 11"); +static IIO_DEVICE_ATTR(accel_precision, + S_IRUGO | S_IWUSR, + sca3000_show_ring_bpse, + sca3000_store_ring_bpse, + 0); + +static struct attribute *sca3000_scan_el_attrs[] = { + &iio_scan_el_accel_x.dev_attr.attr, + &iio_scan_el_accel_y.dev_attr.attr, + &iio_scan_el_accel_z.dev_attr.attr, + &iio_const_attr_accel_precision_available.dev_attr.attr, + &iio_dev_attr_accel_precision.dev_attr.attr, + NULL +}; -static IIO_DEV_ATTR_BPSE(S_IRUGO | S_IWUSR, - sca3000_show_ring_bpse, - sca3000_store_ring_bpse); +static struct attribute_group sca3000_scan_el_group = { + .attrs = sca3000_scan_el_attrs, + .name = "scan_elements", +}; /* * Ring buffer attributes @@ -198,17 +216,15 @@ static IIO_DEV_ATTR_BPSE(S_IRUGO | S_IWUSR, * only apply to the ring buffer. At all times full rate and accuracy * is available via direct reading from registers. */ -static struct attribute *iio_ring_attributes[] = { +static struct attribute *sca3000_ring_attributes[] = { &dev_attr_length.attr, &dev_attr_bps.attr, &dev_attr_ring_enable.attr, - &iio_dev_attr_bpse.dev_attr.attr, - &iio_const_attr_bpse_available.dev_attr.attr, NULL, }; static struct attribute_group sca3000_ring_attr = { - .attrs = iio_ring_attributes, + .attrs = sca3000_ring_attributes, }; static const struct attribute_group *sca3000_ring_attr_groups[] = { @@ -248,6 +264,7 @@ static inline void sca3000_rb_free(struct iio_ring_buffer *r) int sca3000_configure_ring(struct iio_dev *indio_dev) { + indio_dev->scan_el_attrs = &sca3000_scan_el_group; indio_dev->ring = sca3000_rb_allocate(indio_dev); if (indio_dev->ring == NULL) return -ENOMEM; |