From: Matti Vaittinen <mazziesaccount@gmail.com>
To: David Lechner <dlechner@baylibre.com>,
Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
"Tobias Sperling" <tobias.sperling@softing.com>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Trevor Gamblin" <tgamblin@baylibre.com>,
"Esteban Blanc" <eblanc@baylibre.com>,
"Herve Codina" <herve.codina@bootlin.com>,
"Ramona Alexandra Nechita" <ramona.nechita@analog.com>,
"Eason Yang" <j2anfernee@gmail.com>,
"Pop Ioan Daniel" <pop.ioan-daniel@analog.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2 2/3] iio: adc: Support ROHM BD79112 ADC/GPIO
Date: Sun, 7 Sep 2025 15:41:49 +0300 [thread overview]
Message-ID: <ecd6cf45-0d60-4f88-a24a-14a5b84c4007@gmail.com> (raw)
In-Reply-To: <d9aa680f-0664-4caf-b885-92c3fce6c7a4@baylibre.com>
On 05/09/2025 16:18, David Lechner wrote:
> On 9/5/25 12:41 AM, Matti Vaittinen wrote:
>> Hi dee Ho Andy!
>>
>> Thanks again. I really appreciate the effort you put in these reviews! :)
>>
>> On 04/09/2025 16:36, Andy Shevchenko wrote:
>>> On Thu, Sep 04, 2025 at 03:36:46PM +0300, Matti Vaittinen wrote:
>>>> The ROHM BD79112 is an ADC/GPIO with 32 channels. The channel inputs can
>>>> be used as ADC or GPIO. Using the GPIOs as IRQ sources isn't supported.
>>>>
>>>> The ADC is 12-bit, supporting input voltages up to 5.7V, and separate I/O
>>>> voltage supply. Maximum SPI clock rate is 20 MHz (10 MHz with
>>>> daisy-chain configuration) and maximum sampling rate is 1MSPS.
>>>>
>>>> The IC does also support CRC but it is not implemented in the driver.
>>>
>>> ...
>>>
>>>> +/*
>>>> + * The data-sheet explains register I/O communication as follows:
>>>> + *
>>>> + * Read, two 16-bit sequences separated by CSB:
>>>> + * MOSI:
>>>> + * SCK: | 1 | 2 | 3 | 4 | 5 .. 8 | 9 .. 16 |
>>>> + * data:| 0 | 0 |IOSET| RW (1) | ADDR | 8'b0 |
>>>> + *
>>>> + * MISO:
>>>> + * SCK: | 1 .. 8 | 9 .. 16 |
>>>> + * data:| 8'b0 | data |
>>>> + *
>>>> + * Note, CSB is shown to be released between writing the address (MOSI) and
>>>> + * reading the register data (MISO).
>>>> + *
>>>> + * Write, single 16-bit sequence:
>>>> + * MOSI:
>>>> + * SCK: | 1 | 2 | 3 | 4 | 5 .. 8 |
>>>> + * data:| 0 | 0 |IOSET| RW(0) | ADDR |
>>>> + *
>>>> + * MISO:
>>>> + * SCK: | 1 .. 8 |
>>>> + * data:| data |
>>>> + */
>>>
>>> I don't know how to read this comment. In the monospace font the whole block
>>> looks like a mess.
>>
>> What do you mean by a mess? Don't you have the '|' -characters aligned? That's very odd because they are aligned for me. Or, is this otherwise unclear?
>
> I find these diagrams very hard to read as well. I would just drop this part
> and let people look it up in the datasheet. I don't think it adds anything
> essential to understanding how the driver works.
>
I am a bit reluctant to drop this because I don't see public data-sheet
anywhere... :/ I think explaining the protocol is somewhat useful so
readers can understand why we have custom regmap read/write functions,
and hopefully also the I/O and RW bits.
I am all for improving this documentation though! Starting by dropping
those tabs, and seeing if I can think of something else too :)
Yours,
-- Matti
next prev parent reply other threads:[~2025-09-07 12:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 12:35 [PATCH v2 0/3] Support ROHM BD79112 ADC Matti Vaittinen
2025-09-04 12:36 ` [PATCH v2 1/3] dt-bindings: iio: adc: ROHM BD79112 ADC/GPIO Matti Vaittinen
2025-09-04 19:24 ` Conor Dooley
2025-09-04 12:36 ` [PATCH v2 2/3] iio: adc: Support " Matti Vaittinen
2025-09-04 13:36 ` Andy Shevchenko
2025-09-05 5:41 ` Matti Vaittinen
2025-09-05 13:18 ` David Lechner
2025-09-07 12:41 ` Matti Vaittinen [this message]
2025-09-07 11:16 ` Jonathan Cameron
2025-09-08 5:07 ` Matti Vaittinen
2025-09-04 12:37 ` [PATCH v2 3/3] MAINTAINERS: Support ROHM BD79112 ADC Matti Vaittinen
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=ecd6cf45-0d60-4f88-a24a-14a5b84c4007@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=eblanc@baylibre.com \
--cc=herve.codina@bootlin.com \
--cc=j2anfernee@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt@analog.com \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=nuno.sa@analog.com \
--cc=pop.ioan-daniel@analog.com \
--cc=ramona.nechita@analog.com \
--cc=robh@kernel.org \
--cc=tgamblin@baylibre.com \
--cc=tobias.sperling@softing.com \
/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;
as well as URLs for NNTP newsgroup(s).