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


Groups > linux.kernel > #1599271

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

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer
Date 2017-03-13 13:20 +0100
Message-ID <tkx7b-nh-7@gated-at.bofh.it> (permalink)
References <tkwb8-8aF-3@gated-at.bofh.it> <tkwb8-8aF-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] iio: accel: adxl345: Add support for buffered readings Eva Rachel Retuya <eraretuya@gmail.com> - 2017-03-13 12:20 +0100
  [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer Eva Rachel Retuya <eraretuya@gmail.com> - 2017-03-13 12:20 +0100
    Re: [PATCH 4/4] iio: accel: adxl345: Add support for triggered buffer Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-13 13:20 +0100
  [PATCH 1/4] dt-bindings: iio: accel: adxl345: Add optional interrupt-names support Eva Rachel Retuya <eraretuya@gmail.com> - 2017-03-13 12:20 +0100
  [PATCH 3/4] iio: accel: adxl345: Setup DATA_READY trigger Eva Rachel Retuya <eraretuya@gmail.com> - 2017-03-13 12:20 +0100
    Re: [PATCH 3/4] iio: accel: adxl345: Setup DATA_READY trigger Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-13 13:20 +0100
  [PATCH 2/4] iio: accel: adxl345_core: Introduce set_mode, drdy & get_triple functions Eva Rachel Retuya <eraretuya@gmail.com> - 2017-03-13 12:20 +0100
    Re: [PATCH 2/4] iio: accel: adxl345_core: Introduce set_mode, drdy &  get_triple functions Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-13 13:00 +0100

csiph-web