diff options
author | Jonathan Cameron <jic23@kernel.org> | 2012-06-30 15:06:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-11-10 05:17:21 -0500 |
commit | 84b36ce5f79c01f792c623f14e92ed86cdccb42f (patch) | |
tree | aa763089df10007bc42aa02b747e652e0b99003e /drivers/iio/magnetometer | |
parent | 4eb3ccf157639a9d9c7829de94017c46c73d9cc4 (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/magnetometer')
-rw-r--r-- | drivers/iio/magnetometer/hid-sensor-magn-3d.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c index c4f0d274f577..d1b5fb74b9bf 100644 --- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c +++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c | |||
@@ -198,21 +198,8 @@ static const struct iio_info magn_3d_info = { | |||
198 | /* Function to push data to buffer */ | 198 | /* Function to push data to buffer */ |
199 | static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) | 199 | static void hid_sensor_push_data(struct iio_dev *indio_dev, u8 *data, int len) |
200 | { | 200 | { |
201 | struct iio_buffer *buffer = indio_dev->buffer; | ||
202 | int datum_sz; | ||
203 | |||
204 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); | 201 | dev_dbg(&indio_dev->dev, "hid_sensor_push_data\n"); |
205 | if (!buffer) { | 202 | iio_push_to_buffers(indio_dev, (u8 *)data); |
206 | dev_err(&indio_dev->dev, "Buffer == NULL\n"); | ||
207 | return; | ||
208 | } | ||
209 | datum_sz = buffer->access->get_bytes_per_datum(buffer); | ||
210 | if (len > datum_sz) { | ||
211 | dev_err(&indio_dev->dev, "Datum size mismatch %d:%d\n", len, | ||
212 | datum_sz); | ||
213 | return; | ||
214 | } | ||
215 | iio_push_to_buffer(buffer, (u8 *)data); | ||
216 | } | 203 | } |
217 | 204 | ||
218 | /* Callback handler to send event after all samples are received and captured */ | 205 | /* Callback handler to send event after all samples are received and captured */ |