Re: [PATCH 2/2] iio: dac: mcp47feb02: add MCP48FEB02 SPI driver to MCP47FEB02 I2C driver

From: David Lechner

Date: Sat Apr 04 2026 - 09:50:13 EST


On 4/3/26 5:50 AM, Ariana Lazar wrote:
> This is the iio driver for Microchip MCP48FxBy1/2/4/8 series of
> buffered voltage output Digital-to-Analog Converters with nonvolatile or
> volatile memory on top of MCP47FEB02. The families support up to 8
> output channels and have 8-bit, 10-bit or 12-bit resolution.
>
> The MCP47FEB02 driver was split into three modules: mcp47feb02-core.c,
> mcp47feb02-i2c.c and mcp47feb02-spi.c in order to support both DAC families
> - I2C (MCP47F(E/V)BXX) and SPI (MCP48F(E/V)BXX).
>
> Fixes: bf394cc80369 ("iio: dac: adding support for Microchip MCP47FEB02")
> Signed-off-by: Ariana Lazar <ariana.lazar@xxxxxxxxxxxxx>
> Link: https://lore.kernel.org/all/aY4yaVP2TQFRI1E4@xxxxxxxxxxxxxxxxxx/
> ---
> MAINTAINERS | 4 +
> drivers/iio/dac/Kconfig | 29 +-
> drivers/iio/dac/Makefile | 3 +
> drivers/iio/dac/mcp47feb02-core.c | 845 ++++++++++++++++++++++++++++++++++++++
> drivers/iio/dac/mcp47feb02-i2c.c | 145 +++++++
> drivers/iio/dac/mcp47feb02-spi.c | 145 +++++++
> drivers/iio/dac/mcp47feb02.h | 158 +++++++
> 7 files changed, 1328 insertions(+), 1 deletion(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5997cf04b0732beaf69ac78cb762c42c56e4fcd6..af747c5449681807d3d74014dc11dffea5acc012 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -15850,6 +15850,10 @@ M: Ariana Lazar <ariana.lazar@xxxxxxxxxxxxx>
> L: linux-iio@xxxxxxxxxxxxxxx
> S: Supported
> F: Documentation/devicetree/bindings/iio/dac/microchip,mcp47feb02.yaml
> +F: drivers/iio/dac/mcp47feb02-core.c
> +F: drivers/iio/dac/mcp47feb02-i2c.c
> +F: drivers/iio/dac/mcp47feb02-spi.c
> +F: drivers/iio/dac/mcp47feb02.h
>
> MCP4821 DAC DRIVER
> M: Anshul Dalal <anshulusr@xxxxxxxxx>
> diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig
> index cd4870b654153e91c3c44860be43d231ee3b5519..5bec52552d263532ffe357666a64a1c6bb968d85 100644
> --- a/drivers/iio/dac/Kconfig
> +++ b/drivers/iio/dac/Kconfig
> @@ -539,8 +539,12 @@ config MCP4728
> will be called mcp4728.
>
> config MCP47FEB02
> + tristate
> +
> +config MCP47FEB02_I2C
> tristate "MCP47F(E/V)B01/02/04/08/11/12/14/18/21/22/24/28 DAC driver"
> depends on I2C
> + select MCP47FEB02
> help
> Say yes here if you want to build the driver for the Microchip:
> - 8-bit DAC:
> @@ -556,7 +560,30 @@ config MCP47FEB02
> (DAC) with I2C interface.
>
> To compile this driver as a module, choose M here: the module
> - will be called mcp47feb02.
> + will be called mcp47feb02_i2c and you will also get
> + mcp47feb02_core for the core module.
> +
> +config MCP47FEB02_SPI
> + tristate "MCP48F(E/V)B01/02/04/08/11/12/14/18/21/22/24/28 DAC driver"
> + depends on SPI
> + select MCP47FEB02
> + help
> + Say yes here if you want to build the driver for the Microchip:
> + - 8-bit DAC:
> + MCP48FEB01, MCP48FEB02, MCP48FEB04, MCP48FEB08,
> + MCP48FVB01, MCP48FVB02, MCP48FVB04, MCP48FVB08
> + - 10-bit DAC:
> + MCP48FEB11, MCP48FEB12, MCP48FEB14, MCP48FEB18,
> + MCP48FVB11, MCP48FVB12, MCP48FVB14, MCP48FVB18
> + - 12-bit DAC:
> + MCP48FEB21, MCP48FEB22, MCP48FEB24, MCP48FEB28,
> + MCP48FVB21, MCP48FVB22, MCP48FVB24, MCP48FVB28
> + having 1 to 8 channels, 8/10/12-bit digital-to-analog converter
> + (DAC) with SPI interface.
> +
> + To compile this driver as a module, choose M here: the module
> + will be called mcp47feb02_spi and you will also get
> + mcp47feb02_core for the core module.
>
> config MCP4821
> tristate "MCP4801/02/11/12/21/22 DAC driver"
> diff --git a/drivers/iio/dac/Makefile b/drivers/iio/dac/Makefile
> index 2a80bbf4e80ad557da79ed916027cedff286984b..d2a2279b15499e1b43ed0e3e1f180b5b1ff72785 100644
> --- a/drivers/iio/dac/Makefile
> +++ b/drivers/iio/dac/Makefile
> @@ -54,6 +54,9 @@ obj-$(CONFIG_MAX5821) += max5821.o
> obj-$(CONFIG_MCP4725) += mcp4725.o
> obj-$(CONFIG_MCP4728) += mcp4728.o
> obj-$(CONFIG_MCP47FEB02) += mcp47feb02.o

Shouldn't we be removing this old file?

The patch series would be eaiser to understand if it was split into
one commit to split the existing driver into two files and then
another commit to add support for the new parts.


> +mcp47feb02-objs := mcp47feb02-core.o
> +obj-$(CONFIG_MCP47FEB02_I2C) += mcp47feb02-i2c.o
> +obj-$(CONFIG_MCP47FEB02_SPI) += mcp47feb02-spi.o
> obj-$(CONFIG_MCP4821) += mcp4821.o
> obj-$(CONFIG_MCP4922) += mcp4922.o
> obj-$(CONFIG_STM32_DAC_CORE) += stm32-dac-core.o