public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] iio: dac: mcp4821: add configurable gain support
@ 2026-04-14  9:22 Nikhil Gautam
  2026-04-14  9:22 ` [PATCH v5 1/3] iio: dac: mcp4821: fix spelling mistake in enum name Nikhil Gautam
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nikhil Gautam @ 2026-04-14  9:22 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23, dlechner, Nikhil Gautam


This series updates the MCP4821 DAC driver to support configurable gain.

Patch 1 fixes a spelling issue in an enum name.
Patch 2 performs a small refactor to simplify state handling.
Patch 3 adds configurable gain support using the GA bit and
adds support for writing to the scale attribute to select the gain.

The scale attribute is used to control gain selection. Writing supported
scale values selects the corresponding gain setting. The implementation
supports all variants of the MCP48xx family (8, 10, and 12-bit devices).

Changes in v5:
- Fix commit message to remove incorrect "fix scale" wording
- Clarify that scale is used to control gain
- _Scale_available is only getting the supported scales
- Make scale write handling generic for all supported resolutions
- Address review comments from David Lechner

Changes in v4:
- Split changes into separate patches as suggested
- Ensure scale_available matches scale
- Handle sysfs write inputs correctly

Changes in v3:
- Restore NULL check in indio_dev allocation

Changes in v2:
- Use IIO_CHAN_INFO_SCALE instead of CALIBSCALE
- Fix error handling and cleanup

Signed-off-by: Nikhil Gautam <nikhilgtr@gmail.com>
Nikhil Gautam (3):
  iio: dac: mcp4821: fix spelling mistake in enum name
  iio: dac: mcp4821: move state initialization outside switch
  iio: dac: mcp4821: add configurable gain support

 drivers/iio/dac/mcp4821.c | 137 +++++++++++++++++++++++++++++++-------
 1 file changed, 114 insertions(+), 23 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-04-14 16:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14  9:22 [PATCH v5 0/3] iio: dac: mcp4821: add configurable gain support Nikhil Gautam
2026-04-14  9:22 ` [PATCH v5 1/3] iio: dac: mcp4821: fix spelling mistake in enum name Nikhil Gautam
2026-04-14  9:22 ` [PATCH v5 2/3] iio: dac: mcp4821: move state initialization outside switch Nikhil Gautam
2026-04-14 13:33   ` David Lechner
2026-04-14  9:22 ` [PATCH v5 3/3] iio: dac: mcp4821: add configurable gain support Nikhil Gautam
2026-04-14 13:57   ` David Lechner
2026-04-14 16:44     ` Nikhil Gautam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox