Re: [RFC 8/8] iio: bmc150: add support for hardware fifo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux