Skip to content

Refactor Microchip MCP47FEB02 I2C driver in separate modules to add support for MCP48FEB02 SPI driver

Ariana Lazar linux-devicetree linux-iio lkml stable 7 versions – In review

Get series with b4
b4 am [email protected] change-id 20260625-mcp47feb02_refactor-fa8420ae3282

Versions newest first

  1. v8 Latest5 patches 3 repliesIn review
  2. v711 patches 14 repliesSuperseded
  3. v611 patches 5 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v510 patches8 repliesSuperseded
v49 patches6 repliesSuperseded
v33 patches4 repliesSuperseded
v13 patches7 repliesSuperseded

Changes in v8 from the cover letter

- create a new precursor patch for moving mutex in store_eeprom_store()
- add property present check for label before reading
- use EXPORT_NS_SIMPLE_DEV_PM_OPS() instead of EXPORT_SIMPLE_DEV_PM_OPS()
- base this version on testing branch in order to send just remaining
patches to be accepted
- Link to v7: https://lore.kernel.org/r/[email protected]

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5iio: dac: mcp47feb02: Avoid unjustified probe error on missing labeldrivers/iio/dac/mcp47feb02.c+9 -50 replies
2/5iio: dac: mcp47feb02: protect EEPROM store sequence with mutexdrivers/iio/dac/mcp47feb02.c+2 -21 reply
3/5iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modulesMAINTAINERS drivers/iio/dac/Kconfig drivers/iio/dac/Makefile +3 more+219 -3051 reply
4/5dt-bindings: iio: dac: add support for MCP48FEB02 SPIDocumentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml+173 -480 replies
5/5iio: dac: add support for Microchip MCP48FEB02drivers/iio/dac/Kconfig drivers/iio/dac/Makefile drivers/iio/dac/mcp47feb02-core.c +1 more+170 -10 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchRob Herring (Arm)Joshua Crofts
1/5
2/5R-b
3/5
4/5R-b
5/5

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

Read the v8 thread

Cover letter [PATCH v8 0/5] Refactor Microchip MCP47FEB02 I2C driver in separate modules to add support for MCP48FEB02 SPI driver

Refactor I2C driver implementation into separate modules in order to add support for SPI MCP48FxBy1/2/4/8 DAC family on top of the I2C implementation. The I2C and SPI devices have the same memory map and supported functionalities.

---
Changes in v8:
- create a new precursor patch for moving mutex in store_eeprom_store()
- add property present check for label before reading
- use EXPORT_NS_SIMPLE_DEV_PM_OPS() instead of EXPORT_SIMPLE_DEV_PM_OPS()
- base this version on testing branch in order to send just remaining
patches to be accepted
- Link to v7: https://lore.kernel.org/r/[email protected]

Changes in v7:
- replace custom mask define with standard field_prep()
- use "Suggested-by" instead of "Reported-by" where it was more suitable
- use "Fixes:" with "Closes:" instead of "Link:" for fixes tags in commit
messages
- modified module description for core when adding support for SPI parts
in order to specify SPI families too
- remove unused macro MCP47FEB02_GAIN_BIT_MASK from the second commit
- Link to v6: https://lore.kernel.org/r/[email protected]

Changes in v6:
- use field_get() in Gain, Vref and Power-Down registers channel formulas
- rebase from 7.2 to 7.3-rc1
- add fixes tags and Cc stable in the commit messages
- add numeric constants in front of time defines for better readability
- replaced dev_err() with dev_warn_probe() for missing label
- if match data is not found at probe, return -ENODATA and a suitable
error message
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- improve commit messages by justifying the changes made
- increase polling time for EEPROM writes
- delete unnecessary comments and extra blank line from header file
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- remove unused headers
- add missing header types.h in protocol files
- create 6 precursor commits before the refactor patch for handling:
- comment typo
- renaming command mask define
- for an invalid label use a debug message instead of probe error
- correct return value in store_eeprom_store() for false state case
- correct channel gain formula
- read DAC value register to initialize channel data struct field at
probe
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- renumbering the patch version to include the first patch submision
- fix review comments device tree binding:
- change 'additionalProperties' to unevaluatedProperties
- add else branch with spi-max-frequency in the condition which checks
if a device has SPI interface
- correct SPI address example
- add clock polarity and clock phase properties for SPI devices
- enumerate I2C devices in lexicographic order from the description section
- specify supported SPI modes using dependencies
- fix review comments driver:
- remove unneccesarry libraries and add the missing ones
- correct comment typo
- return -ENODEV using dev_err_probe() in protocol probe functions
- use named initializers
- move defines for registers and enums from the header to the core file
- add dev_set_drvdata() in probe()
- move mutex aquiring from mcp47feb02_write_to_eeprom() to
store_eeprom_store()
- write correct value into Vref register in resume()
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- include in the same patch series the refactoring of the driver and the
support for SPI devices, but in different patches
- remove changes regarding review comments received not related to the
code refactoring
- first version of the combined refactoring I2C and adding support for SPI
driver
- Link to v1: https://lore.kernel.org/all/[email protected]

v1:
- first version which did not separate the refactoring and adding support for SPI devices (into different patches from the same series)

---
Ariana Lazar (5):
iio: dac: mcp47feb02: Avoid unjustified probe error on missing label
iio: dac: mcp47feb02: protect EEPROM store sequence with mutex
iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modules
dt-bindings: iio: dac: add support for MCP48FEB02 SPI
iio: dac: add support for Microchip MCP48FEB02

 .../bindings/iio/dac/microchip,mcp47feb02.yaml     | 221 ++++++++++---
 MAINTAINERS                                        |   2 +-
 drivers/iio/dac/Kconfig                            |  32 +-
 drivers/iio/dac/Makefile                           |   4 +-
 .../iio/dac/{mcp47feb02.c => mcp47feb02-core.c}    | 342 ++-------------------
 drivers/iio/dac/mcp47feb02-i2c.c                   | 145 +++++++++
 drivers/iio/dac/mcp47feb02-spi.c                   | 145 +++++++++
 drivers/iio/dac/mcp47feb02.h                       |  43 +++
 8 files changed, 573 insertions(+), 361 deletions(-)

---
base-commit: 81e043887112f846f88ef9ef20c744b5c815de57
change-id: 20260625-mcp47feb02_refactor-fa8420ae3282

Best regards,

Signature · 1 line
Ariana Lazar <[email protected]>