From: Jonathan Cameron <jic23@kernel.org>
To: Matti Vaittinen <matti.vaittinen@linux.dev>
Cc: "Matti Vaittinen" <mazziesaccount@gmail.com>,
"Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
"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>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] bd79703: Support ROHM BD7971x DACs
Date: Sun, 6 Dec 2026 00:21:08 +0000 [thread overview]
Message-ID: <20261206002108.2caa9e4f@jic23-hlaptop> (raw)
In-Reply-To: <dad8730304665b9a8bed56c3b7b5eaf3d58c78fb.1796049052.git.mazziesaccount@gmail.com>
On Wed, 2 Dec 2026 15:39:21 +0200
Matti Vaittinen <matti.vaittinen@linux.dev> wrote:
> From: Matti Vaittinen <mazziesaccount@gmail.com>
>
> The BD7971x are logically similar to BD7970x. Main difference is the
> amount of bits in DAC-word. The BD7970x had 8-bit DAC whereas the
> BD7971x use 10-bit DAC word.
>
> The SPI data format differs. The BD7971x requires two least significant
> bits to be zeroes, and carries the DAC word in following 10 bits. The
> channel number is in highest 4 bits.
>
> Add support for the BD7971x family of DACs.
>
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Trivial stuff only inline.
Thanks,
Jonathan
> ---
> drivers/iio/dac/rohm-bd79703.c | 91 ++++++++++++++++++++++++++++++++--
> 1 file changed, 87 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/dac/rohm-bd79703.c b/drivers/iio/dac/rohm-bd79703.c
> index b6508e1e1c4f..32f283714852 100644
> --- a/drivers/iio/dac/rohm-bd79703.c
> +++ b/drivers/iio/dac/rohm-bd79703.c
> @@ -17,6 +17,8 @@
> #define BD79703_DAC_BITS 8
> #define BD79703_REG_OUT_ALL GENMASK(2, 0)
>
> +#define BD7971X_DAC_BITS 10
> +
> /*
> * The BD79703 uses 12-bit SPI commands. First four bits (high bits) define
> * channel(s) which are operated on, and also the mode. The mode can be to set
> @@ -38,11 +40,27 @@ static const struct regmap_config bd79703_regmap_config = {
> .cache_type = REGCACHE_MAPLE,
> };
>
> +/* The BD7971X uses 16-bit data transfers. Four high bits define the channel
/*
* The BD...
> + * and following 10 bits define the DAC word. Two last bits must be zero.
> + *
> + * Let's try having the 4 channel-bits as an address and following bits as data
> + */
>
> +/*
> + * The BD7971[0,3] have same amount of channels as BD7970[0,3]. Also the SPI
same number of channels
(ever so slightly clearer English).
> + * command number for 'set DAC and output fir channel N' is same, although
> + * bits where the value is placed differ. We can still use the same channel
> + * config and only provide a different regmap config.
> + */
> +static const struct bd7970x_chip_data bd79710_chip_data = {
> + .name = "bd79710",
> + .regmap_conf = &bd7971x_regmap_config,
> + .channels = bd79700_channels,
> + .num_channels = ARRAY_SIZE(bd79700_channels),
> + .num_vfs_chan = 0,
> + .num_bits = BD7971X_DAC_BITS,
> + .l_shift = 2,
> +};
prev parent reply other threads:[~2026-12-06 0:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 13:38 [PATCH 0/4] Support ROHM BD7971x family of DACs Matti Vaittinen
2026-12-02 13:38 ` [PATCH 1/4] dt-bindings: iio: bd79703: Fix VFS explanation Matti Vaittinen
2026-12-02 13:38 ` [PATCH 2/4] dt-bindings: iio: dac: Add ROHM BD7971x Matti Vaittinen
2026-12-02 18:05 ` Conor Dooley
2026-12-03 6:54 ` Matti Vaittinen
2026-12-03 8:35 ` Conor Dooley
2026-12-03 9:03 ` Matti Vaittinen
2026-12-03 12:10 ` Matti Vaittinen
2026-12-03 16:36 ` Conor Dooley
2026-12-04 5:52 ` Matti Vaittinen
2026-12-02 13:39 ` [PATCH 3/4] iio: dac: rohm-bd79703: Avoid copying chip-data Matti Vaittinen
2026-12-03 17:10 ` Andy Shevchenko
2026-12-02 13:39 ` [PATCH 4/4] bd79703: Support ROHM BD7971x DACs Matti Vaittinen
2026-12-03 17:09 ` Andy Shevchenko
2026-12-04 5:58 ` Matti Vaittinen
2026-12-04 9:39 ` Andy Shevchenko
2026-12-06 0:21 ` Jonathan Cameron [this message]
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=20261206002108.2caa9e4f@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=matti.vaittinen@linux.dev \
--cc=mazziesaccount@gmail.com \
--cc=nuno.sa@analog.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.