[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f03e9577-41f9-8f1f-1963-3e8cbac5f979@metafoo.de>
Date: Mon, 20 Mar 2017 20:46:11 +0100
From: Lars-Peter Clausen <lars@...afoo.de>
To: Jonathan Cameron <jic23@...nel.org>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Eva Rachel Retuya <eraretuya@...il.com>
Cc: linux-iio@...r.kernel.org, Hartmut Knaack <knaack.h@....de>,
Peter Meerwald <pmeerw@...erw.net>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Michael Hennerich <michael.hennerich@...log.com>,
Daniel Baluta <daniel.baluta@...il.com>,
Alison Schofield <amsfield22@...il.com>,
Florian Vaussard <florian.vaussard@...g-vd.ch>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
devicetree <devicetree@...r.kernel.org>
Subject: Re: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer
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@...il.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.
Powered by blists - more mailing lists