Commit 443a9ea5 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio:accel:lis3l02dq scrap reading from buffer for sysfs access.

No obvious usecase and complicates in kernel interface work.
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 66748b5a
...@@ -181,11 +181,6 @@ int lis3l02dq_disable_all_events(struct iio_dev *indio_dev); ...@@ -181,11 +181,6 @@ int lis3l02dq_disable_all_events(struct iio_dev *indio_dev);
void lis3l02dq_remove_trigger(struct iio_dev *indio_dev); void lis3l02dq_remove_trigger(struct iio_dev *indio_dev);
int lis3l02dq_probe_trigger(struct iio_dev *indio_dev); int lis3l02dq_probe_trigger(struct iio_dev *indio_dev);
ssize_t lis3l02dq_read_accel_from_buffer(struct iio_buffer *buffer,
int index,
int *val);
int lis3l02dq_configure_buffer(struct iio_dev *indio_dev); int lis3l02dq_configure_buffer(struct iio_dev *indio_dev);
void lis3l02dq_unconfigure_buffer(struct iio_dev *indio_dev); void lis3l02dq_unconfigure_buffer(struct iio_dev *indio_dev);
...@@ -212,13 +207,6 @@ static inline int lis3l02dq_probe_trigger(struct iio_dev *indio_dev) ...@@ -212,13 +207,6 @@ static inline int lis3l02dq_probe_trigger(struct iio_dev *indio_dev)
{ {
return 0; return 0;
} }
static inline ssize_t
lis3l02dq_read_accel_from_buffer(struct iio_buffer *buffer,
int index,
int *val)
{
return 0;
}
static int lis3l02dq_configure_buffer(struct iio_dev *indio_dev) static int lis3l02dq_configure_buffer(struct iio_dev *indio_dev)
{ {
......
...@@ -260,12 +260,9 @@ static int lis3l02dq_read_raw(struct iio_dev *indio_dev, ...@@ -260,12 +260,9 @@ static int lis3l02dq_read_raw(struct iio_dev *indio_dev,
case 0: case 0:
/* Take the iio_dev status lock */ /* Take the iio_dev status lock */
mutex_lock(&indio_dev->mlock); mutex_lock(&indio_dev->mlock);
if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) if (indio_dev->currentmode == INDIO_BUFFER_TRIGGERED) {
ret = lis3l02dq_read_accel_from_buffer(indio_dev-> ret = -EBUSY;
buffer, } else {
chan->scan_index,
val);
else {
reg = lis3l02dq_axis_map reg = lis3l02dq_axis_map
[LIS3L02DQ_ACCEL][chan->address]; [LIS3L02DQ_ACCEL][chan->address];
ret = lis3l02dq_read_reg_s16(indio_dev, reg, val); ret = lis3l02dq_read_reg_s16(indio_dev, reg, val);
......
...@@ -38,38 +38,6 @@ irqreturn_t lis3l02dq_data_rdy_trig_poll(int irq, void *private) ...@@ -38,38 +38,6 @@ irqreturn_t lis3l02dq_data_rdy_trig_poll(int irq, void *private)
return IRQ_WAKE_THREAD; return IRQ_WAKE_THREAD;
} }
/**
* lis3l02dq_read_accel_from_buffer() individual acceleration read from buffer
**/
ssize_t lis3l02dq_read_accel_from_buffer(struct iio_buffer *buffer,
int index,
int *val)
{
int ret;
s16 *data;
if (!iio_scan_mask_query(buffer, index))
return -EINVAL;
if (!buffer->access->read_last)
return -EBUSY;
data = kmalloc(buffer->access->get_bytes_per_datum(buffer),
GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
ret = buffer->access->read_last(buffer, (u8 *)data);
if (ret)
goto error_free_data;
*val = data[bitmap_weight(buffer->scan_mask, index)];
error_free_data:
kfree(data);
return ret;
}
static const u8 read_all_tx_array[] = { static const u8 read_all_tx_array[] = {
LIS3L02DQ_READ_REG(LIS3L02DQ_REG_OUT_X_L_ADDR), 0, LIS3L02DQ_READ_REG(LIS3L02DQ_REG_OUT_X_L_ADDR), 0,
LIS3L02DQ_READ_REG(LIS3L02DQ_REG_OUT_X_H_ADDR), 0, LIS3L02DQ_READ_REG(LIS3L02DQ_REG_OUT_X_H_ADDR), 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment