Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1601772 > unrolled thread

Re: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer

Started byJonathan Cameron <jic23@kernel.org>
First post2017-03-15 23:00 +0100
Last post2017-03-21 11:10 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer Jonathan Cameron <jic23@kernel.org> - 2017-03-15 23:00 +0100
    Re: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer Lars-Peter Clausen <lars@metafoo.de> - 2017-03-20 21:10 +0100
      Re: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer Eva Rachel Retuya <eraretuya@gmail.com> - 2017-03-21 11:10 +0100

#1601772 — Re: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer

FromJonathan Cameron <jic23@kernel.org>
Date2017-03-15 23:00 +0100
SubjectRe: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer
Message-ID<tlp7A-5du-21@gated-at.bofh.it>
On 13/03/17 12:16, Andy Shevchenko wrote:
> On Mon, Mar 13, 2017 at 1:11 PM, Eva Rachel Retuya <eraretuya@gmail.com> wrote:
>> Provide an all-axes read for triggered buffering.
> 
> Better description is needed.
> 
>> -static int adxl345_get_triple(struct adxl345_data *data, void *buf)
>> +static int adxl345_get_triple(struct adxl345_data *data)
> 
> Ping-ponging again. This should be essentially a change in the patch
> where you introduce a helper.
> 
>> +err_buffer_cleanup:
>> +       iio_triggered_buffer_cleanup(indio_dev);
>>  err_trigger_unregister:
>>         if (data->drdy_trig)
>>                 iio_trigger_unregister(data->drdy_trig);
> 
> devm_iio_*() ?
> 
>> @@ -334,6 +435,7 @@ int adxl345_core_remove(struct device *dev)
>>         struct adxl345_data *data = iio_priv(indio_dev);
>>
>>         iio_device_unregister(indio_dev);
>> +       iio_triggered_buffer_cleanup(indio_dev);
>>         if (data->drdy_trig)
>>                 iio_trigger_unregister(data->drdy_trig);
> 
> Ditto.
> 
>> diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
>> index 8c791b8..1e0f071 100644
>> --- a/drivers/iio/accel/adxl345_i2c.c
>> +++ b/drivers/iio/accel/adxl345_i2c.c
>> @@ -30,6 +30,10 @@ static int adxl345_i2c_probe(struct i2c_client *client,
>>         bool use_int2 = false;
>>         int irq;
>>
>> +       if (!i2c_check_functionality(client->adapter,
>> +                                    I2C_FUNC_SMBUS_READ_I2C_BLOCK))
>> +               return -EOPNOTSUPP;
> 
> And if driver works before, you make a regression here.
Absolutely. Need a fallback if it's not supported...

Jonathan
> 

[toc] | [next] | [standalone]


#1605102

FromLars-Peter Clausen <lars@metafoo.de>
Date2017-03-20 21:10 +0100
Message-ID<tnbMS-1ns-3@gated-at.bofh.it>
In reply to#1601772
On 03/15/2017 10:50 PM, Jonathan Cameron wrote:
> On 13/03/17 12:16, Andy Shevchenko wrote:
>> On Mon, Mar 13, 2017 at 1:11 PM, Eva Rachel Retuya <eraretuya@gmail.com> wrote:
>>> Provide an all-axes read for triggered buffering.
>>
>> Better description is needed.
>>
>>> -static int adxl345_get_triple(struct adxl345_data *data, void *buf)
>>> +static int adxl345_get_triple(struct adxl345_data *data)
>>
>> Ping-ponging again. This should be essentially a change in the patch
>> where you introduce a helper.
>>
>>> +err_buffer_cleanup:
>>> +       iio_triggered_buffer_cleanup(indio_dev);
>>>  err_trigger_unregister:
>>>         if (data->drdy_trig)
>>>                 iio_trigger_unregister(data->drdy_trig);
>>
>> devm_iio_*() ?
>>
>>> @@ -334,6 +435,7 @@ int adxl345_core_remove(struct device *dev)
>>>         struct adxl345_data *data = iio_priv(indio_dev);
>>>
>>>         iio_device_unregister(indio_dev);
>>> +       iio_triggered_buffer_cleanup(indio_dev);
>>>         if (data->drdy_trig)
>>>                 iio_trigger_unregister(data->drdy_trig);
>>
>> Ditto.
>>
>>> diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
>>> index 8c791b8..1e0f071 100644
>>> --- a/drivers/iio/accel/adxl345_i2c.c
>>> +++ b/drivers/iio/accel/adxl345_i2c.c
>>> @@ -30,6 +30,10 @@ static int adxl345_i2c_probe(struct i2c_client *client,
>>>         bool use_int2 = false;
>>>         int irq;
>>>
>>> +       if (!i2c_check_functionality(client->adapter,
>>> +                                    I2C_FUNC_SMBUS_READ_I2C_BLOCK))
>>> +               return -EOPNOTSUPP;
>>
>> And if driver works before, you make a regression here.
> Absolutely. Need a fallback if it's not supported...

I believe regmap has a fallback, so that check could simply be removed, I guess.

[toc] | [prev] | [next] | [standalone]


#1605480

FromEva Rachel Retuya <eraretuya@gmail.com>
Date2017-03-21 11:10 +0100
Message-ID<tnoTM-1S7-3@gated-at.bofh.it>
In reply to#1605102
On Mon, Mar 20, 2017 at 08:46:11PM +0100, Lars-Peter Clausen wrote:
> On 03/15/2017 10:50 PM, Jonathan Cameron wrote:
> > On 13/03/17 12:16, Andy Shevchenko wrote:
> >> On Mon, Mar 13, 2017 at 1:11 PM, Eva Rachel Retuya <eraretuya@gmail.com> wrote:
> >>> Provide an all-axes read for triggered buffering.
> >>
> >> Better description is needed.
> >>
> >>> -static int adxl345_get_triple(struct adxl345_data *data, void *buf)
> >>> +static int adxl345_get_triple(struct adxl345_data *data)
> >>
> >> Ping-ponging again. This should be essentially a change in the patch
> >> where you introduce a helper.
> >>
> >>> +err_buffer_cleanup:
> >>> +       iio_triggered_buffer_cleanup(indio_dev);
> >>>  err_trigger_unregister:
> >>>         if (data->drdy_trig)
> >>>                 iio_trigger_unregister(data->drdy_trig);
> >>
> >> devm_iio_*() ?
> >>
> >>> @@ -334,6 +435,7 @@ int adxl345_core_remove(struct device *dev)
> >>>         struct adxl345_data *data = iio_priv(indio_dev);
> >>>
> >>>         iio_device_unregister(indio_dev);
> >>> +       iio_triggered_buffer_cleanup(indio_dev);
> >>>         if (data->drdy_trig)
> >>>                 iio_trigger_unregister(data->drdy_trig);
> >>
> >> Ditto.
> >>
> >>> diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
> >>> index 8c791b8..1e0f071 100644
> >>> --- a/drivers/iio/accel/adxl345_i2c.c
> >>> +++ b/drivers/iio/accel/adxl345_i2c.c
> >>> @@ -30,6 +30,10 @@ static int adxl345_i2c_probe(struct i2c_client *client,
> >>>         bool use_int2 = false;
> >>>         int irq;
> >>>
> >>> +       if (!i2c_check_functionality(client->adapter,
> >>> +                                    I2C_FUNC_SMBUS_READ_I2C_BLOCK))
> >>> +               return -EOPNOTSUPP;
> >>
> >> And if driver works before, you make a regression here.
> > Absolutely. Need a fallback if it's not supported...
> 
> I believe regmap has a fallback, so that check could simply be removed, I guess.
> 

Yes, regmap does this check. I've seen it while working on the patchset.
I checked other drivers doing regmap and some have this check_functionality
check so I chose to include it because I'm not sure.

Will remove it on the next version.

Thanks,
Eva

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web