aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/gyro
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@kernel.org>2012-06-30 15:06:00 -0400
committerJonathan Cameron <jic23@kernel.org>2012-11-10 05:17:21 -0500
commit84b36ce5f79c01f792c623f14e92ed86cdccb42f (patch)
treeaa763089df10007bc42aa02b747e652e0b99003e /drivers/iio/gyro
parent4eb3ccf157639a9d9c7829de94017c46c73d9cc4 (diff)
staging:iio: Add support for multiple buffers
Route all buffer writes through the demux. Addition or removal of a buffer results in tear down and setup of all the buffers for a given device. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Tested-by: srinivas pandruvada <srinivas.pandruvada@intel.com>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r--drivers/iio/gyro/hid-sensor-gyro-3d.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index 4c56ada51c39..02ef989b830d 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -197,21 +197,8 @@ static const struct iio_info gyro_3d_info = {
197/* Function to push data to buffer */ 197/* Function to push data to buffer */
198static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) 198static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len)
199{ 199{
200 struct iio_buffer *buffer = indio_dev->buffer;
201 int datum_sz;
202
203 dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); 200 dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n");
204 if (!buffer) { 201 iio_push_to_buffers(indio_dev, (u8 *)data);
205 dev_err(&indio_dev->dev, "Buffer == NULL\n");
206 return;
207 }
208 datum_sz = buffer->access->get_bytes_per_datum(buffer);
209 if (len > datum_sz) {
210 dev_err(&indio_dev->dev, "Datum size mismatch %d:%d\n", len,
211 datum_sz);
212 return;
213 }
214 iio_push_to_buffer(buffer, (u8 *)data);
215} 202}
216 203
217/* Callback handler to send event after all samples are received and captured */ 204/* Callback handler to send event after all samples are received and captured */