Re: [PATCH 2/2] iio: adc: rohm-bd79112: Support ROHM BD79111
From: Matti Vaittinen
Date: Thu Nov 19 2026 - 04:09:20 EST
On 19/11/2026 11:00, Andy Shevchenko wrote:
On Wed, Nov 18, 2026 at 04:19:35PM +0200, Matti Vaittinen wrote:
ROHM BD79111 is very similar to the BD79112. Both are ADC/GPIO devices,
where pins can be configured to be either used as GPIO or ADC inputs.
ADCs are 12-bit SAR ADCs and GPIOs support input/output but not being IRQ
sources.
The main difference is amount of channels/GPIOs. The BD79112 has 32 pins
for this use, the BD79111 has 16. Furthermore, the BD79111 data-sheet
promises 0.5 MSPS sample rate with maximum of 10 MHz SPI clock, whereas
the BD79112 data-sheet mentioned 1MSPS rate with maximum of 20 MHz SPI
clock.
NOTE: In order to achieve those speeds one needs to use more optimized
protocol compared to the one implemented in this driver. This driver
retrieves samples using two 16-bit SPI transactions. The first
transaction writes the channel to be sampled, and ignores data on MISO.
Then the next 16-bit transaction carries the data.
Achieving maximum sample-rate would require the driver to interpret the
MISO data of each 16-bit transaction so, that when the
channel-to-be-sampled was sent in transaction N, the data is read at
transaction N+1 - which also already configures the channel to be
sampled for transaction N+2. Supporting this would require the
channel-to-be-read for the future read to be known when the current
channel data is retrieved. For raw-reads this is not possible and for
buffered reads it would make things a bit hairy.
So, here we aim for simplicity instead of the peak performance.
...
config ROHM_BD79112
- tristate "Rohm BD79112 ADC driver"
+ tristate "ROHM BD79112 and BD79111 ADC/GPIO driver"
So, as Jonathan mentioned this should be rather relaxed, so we don't update it
each time the new HW is got supported. Also in a new style we want a bit of an
order by having this, text in top comment, and MODULE_DESCRIPTION() to be the
same (or very similar, like with or without word 'driver').
depends on SPI && GPIOLIB
select REGMAP_SPI
select IIO_ADC_HELPER
help
- Say yes here to build support for the ROHM BD79112 ADC. The
- ROHM BD79112 is a 12-bit, 32-channel, SAR ADC. Analog inputs
- can also be used for GPIO.
+ Say yes here to build support for the ROHM BD79112 and BD79111
+ ADCs. Both of the ICs are 12-bit SAR ADCs. The ROHM BD79112 has
+ 32-channels, the BD79111 has 16. Analog inputs can also be used
+ for GPIO.
Yeah, and here the style is to have something like a list
Say yes here to build support for the following ROHM SAR ADCs:
- BD7911 (12-bit, 16 channels)
- BD7912 (12-bit, 32 channels)
Analog inputs can also be used for GPIO.
(feel free to amend, it's just an example).
//snip
Thanks for the examples ...
... and also for the other comments Andy. I'll create v2.
Yours,
-- Matti
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~