From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Matti Vaittinen <mazziesaccount@gmail.com>,
Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"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>,
"Matti Vaittinen" <mazziesaccount@gmail.com>,
"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>,
"Ramona Alexandra Nechita" <ramona.nechita@analog.com>,
"Thomas Bonnefille" <thomas.bonnefille@bootlin.com>,
"Hans de Goede" <hansg@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: [PATCH 0/3] Support ROHM BD79112 ADC
Date: Tue, 2 Sep 2025 15:23:21 +0300 [thread overview]
Message-ID: <cover.1756813980.git.mazziesaccount@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2389 bytes --]
Support ROHM BD79112 ADC/GPIO
The ROHM BD79112 is a 12-bit, 32 channel SAR ADC / GPIO IC. Or, a "Signal
Monitor Hub IC" as data-sheet describes it.
Data sheet states the maximum sampling rate to be 1 MSPS, but achieving
this would probably require the SPI and samples to be processed by
something else but the CPU running Linux. This could work with the "SPI
offloading" which has recently landed upstream - but I have no HW to test
this so nothing fancy is implemented here. It's still worth mentioning
if someone needs the speed and wants to try implementing it :)
The SPI protocol is slightly peculiar. Accesses are done in 16-bit
sequences, separated by releasing and re-aquiring the chip-select.
Register write takes 1 such sequence. The 8-bit register data to write,
is stored in the last 8 bits. The high 8 bits contain register address
and an I/O-bit which needs to be set for register accesses.
Register read consists of two 16-bit sequences (separated by
chip-select). First sequence has again the register address and an IO
bit in the high byte. Additionally, reads must have a 'read bit' set.
The last 8 bits must be zero. The register data will be carried in the
last 8 bits of the next 16-bit sequence while high bits in reply are zero.
ADC data reading is similar to register reading except:
- No R/W bit or I/O bit should be set.
- Register address is replaced by channel number (0 - 31).
- Reply data is carried in the 12 low bits (instead of 8 bits) of the
reply sequence.
The protocol is implemented using custom regmap read() and write()
operations.
Other than that, pretty standard device and driver.
Matti Vaittinen (3):
dt-bindings: iio: adc: ROHM BD79112 ADC/GPIO
iio: adc: Support ROHM BD79112 ADC/GPIO
MAINTAINERS: Support ROHM BD79112 ADC
.../bindings/iio/adc/rohm,bd79112.yaml | 118 ++++
MAINTAINERS | 3 +-
drivers/iio/adc/Kconfig | 10 +
drivers/iio/adc/Makefile | 1 +
drivers/iio/adc/rohm-bd79112.c | 542 ++++++++++++++++++
5 files changed, 673 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/iio/adc/rohm,bd79112.yaml
create mode 100644 drivers/iio/adc/rohm-bd79112.c
base-commit: d1487b0b78720b86ec2a2ac7acc683ec90627e5b
--
2.51.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next reply other threads:[~2025-09-02 12:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 12:23 Matti Vaittinen [this message]
2025-09-02 12:23 ` [PATCH 1/3] dt-bindings: iio: adc: ROHM BD79112 ADC/GPIO Matti Vaittinen
2025-09-02 17:57 ` Rob Herring (Arm)
2025-09-02 12:24 ` [PATCH 2/3] iio: adc: Support " Matti Vaittinen
2025-09-02 14:15 ` Andy Shevchenko
2025-09-03 6:52 ` Matti Vaittinen
2025-09-03 11:23 ` Andy Shevchenko
2025-09-03 12:14 ` Matti Vaittinen
2025-09-03 13:29 ` Andy Shevchenko
2025-09-04 12:35 ` Matti Vaittinen
2025-09-04 13:04 ` Andy Shevchenko
2025-09-05 5:47 ` Matti Vaittinen
2025-09-02 15:14 ` David Lechner
2025-09-03 7:03 ` Matti Vaittinen
2025-09-02 22:34 ` Linus Walleij
2025-09-03 5:23 ` Matti Vaittinen
2025-09-03 6:47 ` Linus Walleij
2025-09-03 7:17 ` Matti Vaittinen
2025-09-03 7:17 ` Matti Vaittinen
2025-09-03 8:17 ` Matti Vaittinen
2025-09-03 11:02 ` Nuno Sá
2025-09-03 11:27 ` Andy Shevchenko
2025-09-04 14:02 ` kernel test robot
2025-09-02 12:30 ` [PATCH 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=cover.1756813980.git.mazziesaccount@gmail.com \
--to=mazziesaccount@gmail.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=hansg@kernel.org \
--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=ramona.nechita@analog.com \
--cc=robh@kernel.org \
--cc=tgamblin@baylibre.com \
--cc=thomas.bonnefille@bootlin.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).