[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdPdSrXDyuiwvOyC64qDhoTRZ0YFEDjHnYCX7dvBE1P1w@mail.gmail.com>
Date: Sun, 14 Sep 2025 15:07:59 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Petre Rodan <petre.rodan@...dimension.ro>
Cc: Jonathan Cameron <jic23@...nel.org>, David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 08/18] iio: accel: bma220: reset registers during init stage
On Sat, Sep 13, 2025 at 6:40 PM Petre Rodan <petre.rodan@...dimension.ro> wrote:
>
> Bring all configuration registers to default values during device probe().
> Remove trivial code duplication regarding bma220_power() in _init()
...
> +static int bma220_reset(struct spi_device *spi, bool up)
> +{
> + int i, ret;
Why is 'i' signed?
> + /**
Same comment as per previous patch.
> + * The chip can be reset by a simple register read.
> + * We need up to 2 register reads of the softreset register
> + * to make sure that the device is in the desired state.
> + */
> + for (i = 0; i < 2; i++) {
> + ret = bma220_read_reg(spi, BMA220_REG_SOFTRESET);
> + if (ret < 0)
> + return ret;
> +
> + if (up && ret == BMA220_RESET_MODE)
> + return 0;
> +
> + if (!up && ret == BMA220_NONRESET_MODE)
> + return 0;
> + }
> +
> + return -EBUSY;
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists