From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Antoni Pokusinski <apokusinski01@gmail.com>
Cc: jic23@kernel.org, lars@metafoo.de, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org,
andrej.skvortzov@gmail.com, neil.armstrong@linaro.org,
icenowy@aosc.io, megi@xff.cz, danila@jiaxyga.com,
javier.carrasco.cruz@gmail.com, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iio: magnetometer: si7210: add driver for Si7210
Date: Fri, 17 Jan 2025 15:46:31 +0200 [thread overview]
Message-ID: <Z4pfN6lDKysMxTWR@smile.fi.intel.com> (raw)
In-Reply-To: <20250116200558.mr23jxpdpwyu62md@antoni-VivoBook-ASUSLaptop-X512FAY-K512FA>
On Thu, Jan 16, 2025 at 09:05:58PM +0100, Antoni Pokusinski wrote:
> On Thu, Jan 16, 2025 at 10:26:55AM +0200, Andy Shevchenko wrote:
> > On Wed, Jan 15, 2025 at 09:16:22PM +0100, Antoni Pokusinski wrote:
...
> > > + /* Write the registers 0xCE - 0xD0 */
> > > + ret = regmap_bulk_write(data->regmap, SI7210_REG_A3, &a_otp_values[3], 3);
> > > + if (ret)
> > > + return ret;
> >
> > Just to be sure I understand the above. There are two of 24-bit values or there are
> > two sets of 3 byte arrays? How does datasheet refers to them? What does common sense
> > tell us here?
>
> It's the second option: we have 2 arrays of 3 elements each (a0, a1, a2
> and a3, a4, a5). In the datasheet the names of the values correspond
> to the names I used in the driver, that is there are 6 values a0, ..., a5.
>
> The point is that the their registers are separated by the 0xCD register.
> Therefore I had to call `regmap_bulk_write()` twice in order to
> write values a0 - a2 to the registers 0xCA - 0xCC and similarly the
> values a3 - a5 to the regs 0xCE - 0xD0.
Thanks for the explanation! Looks reasonable to me.
...
> > Overall LGTM, there is no need for resend as I believe the three things above
> > may be tweaked by Jonathan. The last one can go even if there are 2 24-bit
> > values, but ideally in that case we should use those as a such and apply
> > put_unaligned_be24/le24() whichever suits better.
FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-01-17 13:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-15 20:16 [PATCH v4 0/2] iio: magnetometer: add support for Si7210 Antoni Pokusinski
2025-01-15 20:16 ` [PATCH v4 1/2] dt-bindings: iio: magnetometer: add binding " Antoni Pokusinski
2025-01-15 20:24 ` Antoni Pokusinski
2025-01-16 7:52 ` Krzysztof Kozlowski
2025-01-15 20:16 ` [PATCH v4 2/2] iio: magnetometer: si7210: add driver " Antoni Pokusinski
2025-01-16 8:26 ` Andy Shevchenko
2025-01-16 20:05 ` Antoni Pokusinski
2025-01-17 13:46 ` Andy Shevchenko [this message]
2025-01-18 16:16 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z4pfN6lDKysMxTWR@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andrej.skvortzov@gmail.com \
--cc=apokusinski01@gmail.com \
--cc=conor+dt@kernel.org \
--cc=danila@jiaxyga.com \
--cc=devicetree@vger.kernel.org \
--cc=icenowy@aosc.io \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=megi@xff.cz \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox