Linux IIO development
 help / color / mirror / Atom feed
From: Joshua Crofts <joshua.crofts1@gmail.com>
To: "Tuna Kılıç" <tuna@tunakilic.com>
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: dac: mcp47a1: Allow full-scale output
Date: Fri, 4 Sep 2026 14:38:48 +0200	[thread overview]
Message-ID: <20260904143848.00000d7d@gmail.com> (raw)
In-Reply-To: <20260904122513.175298-1-tuna@tunakilic.com>

Hi Tuna,

Thanks for the patch!

On Fri,  4 Sep 2026 12:25:17 +0000 (UTC)
Tuna Kılıç <tuna@tunakilic.com> wrote:

> The MCP47A1 has 64 resistors but exposes 65 wiper positions. The valid
> DAC codes are 0 through 64, and code 64 selects VREF.
> 
> The driver currently advertises 0 through 63 and uses 64 as the length
> argument to in_range(), which also rejects 64. Therefore userspace
> cannot select full-scale output.
> 
> Advertise code 64 and make validation cover all 65 codes. Keep 64 as
> the scale denominator because the output voltage is VREF multiplied by
> the code and divided by 64.
> 
> Fixes: 350d1fb9204b ("iio: dac: mcp47a1: add support for new device")
> Signed-off-by: Tuna Kılıç <tuna@tunakilic.com>
> ---

This makes sense, I must've misread the datasheet...

Can I ask how this was found? Manual code analysis or AI?

-- 
Kind regards,
Joshua Crofts

  reply	other threads:[~2026-09-04 12:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 12:25 [PATCH] iio: dac: mcp47a1: Allow full-scale output Tuna Kılıç
2026-09-04 12:38 ` Joshua Crofts [this message]
2026-09-04 12:51   ` Tuna Kılıç
2026-09-06  3:54     ` Jonathan Cameron
     [not found]   ` <1788525776688344002.1788525776@tunakilic.com>
2026-09-04 13:03     ` Joshua Crofts

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=20260904143848.00000d7d@gmail.com \
    --to=joshua.crofts1@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=tuna@tunakilic.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