Skip to content

iio: dac: mcp4821: add configurable gain support

Nikhil Gautam linux-iio 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 2 repliesIn review
  2. v53 patches 3 repliesSuperseded
  3. v43 patches 2 repliesSuperseded

Changes in v6 from the cover letter

- Removed enums of supported gain
- Fixed commit msg for patch 2
- Renamed avail_gain to scale_avail
- Used MICRO Macro where needed
- Addressed comments suggested by David Lechner

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3iio: dac: mcp4821: fix spelling mistake in enum namedrivers/iio/dac/mcp4821.c+1 -10 replies
2/3iio: dac: mcp4821: move state initialization outside switchdrivers/iio/dac/mcp4821.c+1 -20 replies
3/3iio: dac: mcp4821: add configurable gain supportdrivers/iio/dac/mcp4821.c+108 -200 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDavid Lechner
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH v6 0/3] iio: dac: mcp4821: add configurable gain support

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 v6:
- Removed enums of supported gain
- Fixed commit msg for patch 2
- Renamed avail_gain to scale_avail
- Used MICRO Macro where needed
- Addressed comments suggested by David Lechner

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

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(-)
Signature · 1 line
2.43.0