staging:iio: tree wide IIO_RING_TRIGGERED -> IIO_BUFFER_TRIGGERED

also, IIO_RING_HARDWARE_BUFFER -> IIO_BUFFER_HARDWARE

These aren't always rings so the naming should not imply that.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Jonathan Cameron 2011-09-21 11:15:54 +01:00 committed by Greg Kroah-Hartman
parent 3b99fb7656
commit ec3afa40c6
26 changed files with 39 additions and 39 deletions

View file

@ -132,7 +132,7 @@ int adis16201_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:
iio_sw_rb_free(indio_dev->ring);

View file

@ -134,7 +134,7 @@ int adis16203_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:

View file

@ -130,7 +130,7 @@ int adis16204_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:

View file

@ -130,7 +130,7 @@ int adis16209_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:

View file

@ -127,7 +127,7 @@ int adis16240_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:

View file

@ -259,7 +259,7 @@ static int lis3l02dq_read_raw(struct iio_dev *indio_dev,
case 0:
/* Take the iio_dev status lock */
mutex_lock(&indio_dev->mlock);
if (indio_dev->currentmode == INDIO_RING_TRIGGERED)
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED)
ret = lis3l02dq_read_accel_from_ring(indio_dev->ring,
chan->scan_index,
val);
@ -725,7 +725,7 @@ static int __devinit lis3l02dq_probe(struct spi_device *spi)
return 0;
error_remove_trigger:
if (indio_dev->modes & INDIO_RING_TRIGGERED)
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
lis3l02dq_remove_trigger(indio_dev);
error_free_interrupt:
if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)

View file

@ -455,7 +455,7 @@ int lis3l02dq_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:

View file

@ -290,7 +290,7 @@ int sca3000_configure_ring(struct iio_dev *indio_dev)
indio_dev->ring = sca3000_rb_allocate(indio_dev);
if (indio_dev->ring == NULL)
return -ENOMEM;
indio_dev->modes |= INDIO_RING_HARDWARE_BUFFER;
indio_dev->modes |= INDIO_BUFFER_HARDWARE;
indio_dev->ring->access = &sca3000_ring_access_funcs;

View file

@ -595,7 +595,7 @@ static int ad7192_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->ring->setup_ops = &ad7192_ring_setup_ops;
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_deallocate_sw_rb:

View file

@ -178,7 +178,7 @@ int ad7298_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->ring->scan_timestamp = true;
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_deallocate_sw_rb:

View file

@ -141,7 +141,7 @@ int ad7476_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->ring->scan_timestamp = true;
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_deallocate_sw_rb:

View file

@ -186,7 +186,7 @@ int ad7606_register_ring_funcs_and_init(struct iio_dev *indio_dev)
INIT_WORK(&st->poll_work, &ad7606_poll_bh_to_ring);
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_deallocate_sw_rb:

View file

@ -461,7 +461,7 @@ static int ad7793_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->ring->setup_ops = &ad7793_ring_setup_ops;
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_deallocate_sw_rb:

View file

@ -179,7 +179,7 @@ int ad7887_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->ring->setup_ops = &ad7887_ring_setup_ops;
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_deallocate_sw_rb:

View file

@ -187,7 +187,7 @@ int ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->ring->scan_timestamp = true;
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_deallocate_sw_rb:

View file

@ -182,7 +182,7 @@ int max1363_register_ring_funcs_and_init(struct iio_dev *indio_dev)
indio_dev->ring->setup_ops = &max1363_ring_setup_ops;
/* Flag that polled ring buffering is possible */
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;

View file

@ -131,7 +131,7 @@ int adis16260_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:

View file

@ -189,10 +189,11 @@ static inline s64 iio_get_time_ns(void)
/* Device operating modes */
#define INDIO_DIRECT_MODE 0x01
#define INDIO_RING_TRIGGERED 0x02
#define INDIO_RING_HARDWARE_BUFFER 0x08
#define INDIO_BUFFER_TRIGGERED 0x02
#define INDIO_BUFFER_HARDWARE 0x08
#define INDIO_ALL_RING_MODES (INDIO_RING_TRIGGERED | INDIO_RING_HARDWARE_BUFFER)
#define INDIO_ALL_BUFFER_MODES \
(INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE)
/* Vast majority of this is set by the industrialio subsystem on a
* call to iio_device_register. */
@ -388,8 +389,7 @@ void iio_free_device(struct iio_dev *dev);
static inline bool iio_ring_enabled(struct iio_dev *dev_info)
{
return dev_info->currentmode
& (INDIO_RING_TRIGGERED
| INDIO_RING_HARDWARE_BUFFER);
& (INDIO_BUFFER_TRIGGERED | INDIO_BUFFER_HARDWARE);
};
#endif /* _INDUSTRIAL_IO_H_ */

View file

@ -612,7 +612,7 @@ static int ad5933_register_ring_funcs_and_init(struct iio_dev *indio_dev)
/* Ring buffer functions - here trigger setup related */
indio_dev->ring->setup_ops = &ad5933_ring_setup_ops;
indio_dev->modes |= INDIO_RING_HARDWARE_BUFFER;
indio_dev->modes |= INDIO_BUFFER_HARDWARE;
return 0;
}

View file

@ -1070,7 +1070,7 @@ static int __devinit adis16400_probe(struct spi_device *spi)
return 0;
error_remove_trigger:
if (indio_dev->modes & INDIO_RING_TRIGGERED)
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
adis16400_remove_trigger(indio_dev);
error_uninitialize_ring:
iio_ring_buffer_unregister(indio_dev);

View file

@ -203,7 +203,7 @@ int adis16400_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
return 0;
error_iio_sw_rb_free:
iio_sw_rb_free(indio_dev->ring);

View file

@ -998,7 +998,7 @@ static void iio_dev_release(struct device *device)
{
struct iio_dev *dev_info = container_of(device, struct iio_dev, dev);
cdev_del(&dev_info->chrdev);
if (dev_info->modes & INDIO_RING_TRIGGERED)
if (dev_info->modes & INDIO_BUFFER_TRIGGERED)
iio_device_unregister_trigger_consumer(dev_info);
iio_device_unregister_eventset(dev_info);
iio_device_unregister_sysfs(dev_info);
@ -1126,7 +1126,7 @@ int iio_device_register(struct iio_dev *dev_info)
"Failed to register event set\n");
goto error_free_sysfs;
}
if (dev_info->modes & INDIO_RING_TRIGGERED)
if (dev_info->modes & INDIO_BUFFER_TRIGGERED)
iio_device_register_trigger_consumer(dev_info);
ret = device_add(&dev_info->dev);

View file

@ -150,7 +150,7 @@ static ssize_t iio_scan_el_store(struct device *dev,
state = !(buf[0] == '0');
mutex_lock(&indio_dev->mlock);
if (indio_dev->currentmode == INDIO_RING_TRIGGERED) {
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) {
ret = -EBUSY;
goto error_ret;
}
@ -193,7 +193,7 @@ static ssize_t iio_scan_el_ts_store(struct device *dev,
state = !(buf[0] == '0');
mutex_lock(&indio_dev->mlock);
if (indio_dev->currentmode == INDIO_RING_TRIGGERED) {
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) {
ret = -EBUSY;
goto error_ret;
}
@ -430,7 +430,7 @@ ssize_t iio_store_ring_enable(struct device *dev,
mutex_lock(&dev_info->mlock);
previous_mode = dev_info->currentmode;
requested_state = !(buf[0] == '0');
current_state = !!(previous_mode & INDIO_ALL_RING_MODES);
current_state = !!(previous_mode & INDIO_ALL_BUFFER_MODES);
if (current_state == requested_state) {
printk(KERN_INFO "iio-ring, current state requested again\n");
goto done;
@ -457,7 +457,7 @@ ssize_t iio_store_ring_enable(struct device *dev,
if (ring->access->mark_in_use)
ring->access->mark_in_use(ring);
/* Definitely possible for devices to support both of these.*/
if (dev_info->modes & INDIO_RING_TRIGGERED) {
if (dev_info->modes & INDIO_BUFFER_TRIGGERED) {
if (!dev_info->trig) {
printk(KERN_INFO
"Buffer not started: no trigger\n");
@ -466,9 +466,9 @@ ssize_t iio_store_ring_enable(struct device *dev,
ring->access->unmark_in_use(ring);
goto error_ret;
}
dev_info->currentmode = INDIO_RING_TRIGGERED;
} else if (dev_info->modes & INDIO_RING_HARDWARE_BUFFER)
dev_info->currentmode = INDIO_RING_HARDWARE_BUFFER;
dev_info->currentmode = INDIO_BUFFER_TRIGGERED;
} else if (dev_info->modes & INDIO_BUFFER_HARDWARE)
dev_info->currentmode = INDIO_BUFFER_HARDWARE;
else { /* should never be reached */
ret = -EINVAL;
goto error_ret;
@ -519,7 +519,7 @@ ssize_t iio_show_ring_enable(struct device *dev,
{
struct iio_dev *dev_info = dev_get_drvdata(dev);
return sprintf(buf, "%d\n", !!(dev_info->currentmode
& INDIO_ALL_RING_MODES));
& INDIO_ALL_BUFFER_MODES));
}
EXPORT_SYMBOL(iio_show_ring_enable);

View file

@ -329,7 +329,7 @@ static ssize_t iio_trigger_write_current(struct device *dev,
int ret;
mutex_lock(&dev_info->mlock);
if (dev_info->currentmode == INDIO_RING_TRIGGERED) {
if (dev_info->currentmode == INDIO_BUFFER_TRIGGERED) {
mutex_unlock(&dev_info->mlock);
return -EBUSY;
}

View file

@ -801,7 +801,7 @@ static int __devinit ade7758_probe(struct spi_device *spi)
return 0;
error_remove_trigger:
if (indio_dev->modes & INDIO_RING_TRIGGERED)
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
ade7758_remove_trigger(indio_dev);
error_uninitialize_ring:
ade7758_uninitialize_ring(indio_dev);

View file

@ -158,7 +158,7 @@ int ade7758_configure_ring(struct iio_dev *indio_dev)
goto error_iio_sw_rb_free;
}
indio_dev->modes |= INDIO_RING_TRIGGERED;
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;
st->tx_buf[0] = ADE7758_READ_REG(ADE7758_RSTATUS);
st->tx_buf[1] = 0;