On Tue, Nov 18, 2014 at 3:49 PM, <jic23@xxxxxxxxxx> wrote: > Octavian Purdila writes: >> >> This patch adds support for hardware fifo. Fifo and stream mode are >> supported as well as fifo-full and fifo-watermark events. >> Signed-off-by: Octavian Purdila <octavian.purdila@xxxxxxxxx> > > A few minor bits inline. The implementation seems fine, I am just > unconvinced that the user interface is the best way to go. > Of course, I didn't expect to get the right interface :) This was suppose to be just code support for discussing it (the interface). >> + >> + if (!data->timestamp) >> + data->timestamp = iio_get_time_ns(); >> + >> + tstamp = data->timestamp - count * sample_freq; > > > Hmm... These are likely to be less than accurate... > Yes, especially for fifo mode (for stream should be close). Unfortunately the hardware doesn't store any sort of timestamp in the buffer, so any ideas of how can we improve this? >> +static int bmc150_accel_fifo_mode_set(struct iio_dev *indio_dev, >> + const struct iio_chan_spec *chan, >> + unsigned int mode) >> +{ >> + struct bmc150_accel_data *data = iio_priv(indio_dev); >> + int ret; >> + u8 val; >> + >> + switch (mode) { >> + case 0: > > Some defines and a local enum should get rid of the magic numbers here. You're right, I'll update that. Thanks for taking the time to look at these patches Jonathan, I know that you are very busy. -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html