From: Jonathan Cameron <jic23@kernel.org>
To: Ariana Lazar <ariana.lazar@microchip.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/3] iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modules
Date: Wed, 5 Aug 2026 02:13:41 +0100 [thread overview]
Message-ID: <20260805021341.2b45e680@jic23-huawei> (raw)
In-Reply-To: <20260804-mcp47feb02_refactor-v3-1-97f8b81f3628@microchip.com>
On Tue, 4 Aug 2026 16:29:47 +0300
Ariana Lazar <ariana.lazar@microchip.com> wrote:
> Prepare the driver for the bus-specific code by refactoring into separate
> files. The renamed file will contain the common DAC functionality shared by
> the MCP47FxBy1/2/4/8 I2C and MCP48FxBy1/2/4/8 SPI drivers. The MCP47FEB02
> driver was refactored into two modules: mcp47feb02-core.c and
> mcp47feb02-i2c.c in order to prepare the support for SPI MCP48FxBy1/2/4/8
> DAC family on top of the current implementation.
>
> Signed-off-by: Ariana Lazar <ariana.lazar@microchip.com>
Hi Ariana,
There are a couple of things in here unrelated to the code movement etc
and splitting of the drivers. Please pull anything like that out to
precursor patches where we can clearly see what changed.
Jonathan
> diff --git a/drivers/iio/dac/mcp47feb02.c b/drivers/iio/dac/mcp47feb02-core.c
> similarity index 72%
> rename from drivers/iio/dac/mcp47feb02.c
> rename to drivers/iio/dac/mcp47feb02-core.c
> index a823c2a673a26d70e5829cb587034da435af0451..e686c511d73f2be978f3a77af7a4004194e5d284 100644
> --- a/drivers/iio/dac/mcp47feb02.c
> +++ b/drivers/iio/dac/mcp47feb02-core.c
> @@ -1,8 +1,8 @@
> // SPDX-License-Identifier: GPL-2.0+
> /*
> - * IIO driver for MCP47FEB02 Multi-Channel DAC with I2C interface
> + * IIO driver for MCP47FEB02 Multi-Channel DAC with I2C and SPI interface
> *
> - * Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
> + * Copyright (C) 2025-2026 Microchip Technology Inc. and its subsidiaries
> *
> * Author: Ariana Lazar <ariana.lazar@microchip.com>
> *
> @@ -15,13 +15,12 @@
> #include <linux/bits.h>
> #include <linux/bitfield.h>
> #include <linux/delay.h>
> +#include <linux/dev_printk.h>
> #include <linux/err.h>
> -#include <linux/i2c.h>
> #include <linux/iio/iio.h>
> #include <linux/iio/sysfs.h>
> #include <linux/kstrtox.h>
> #include <linux/module.h>
> -#include <linux/mod_devicetable.h>
> #include <linux/mutex.h>
> #include <linux/property.h>
> #include <linux/regmap.h>
> @@ -30,11 +29,13 @@
> #include <linux/types.h>
> #include <linux/units.h>
>
> +#include "mcp47feb02.h"
> +
> /* Register addresses must be left shifted with 3 positions in order to append command mask */
> #define MCP47FEB02_DAC0_REG_ADDR 0x00
> #define MCP47FEB02_VREF_REG_ADDR 0x40
> #define MCP47FEB02_POWER_DOWN_REG_ADDR 0x48
> -#define MCP47FEB02_DAC_CTRL_MASK GENMASK(1, 0)
> +#define MCP47FEB02_CMD_MASK GENMASK(1, 0)
These renames don't belong in a patch doing anything else. Please break
them out as a precursor.
>
> #define MCP47FEB02_GAIN_CTRL_STATUS_REG_ADDR 0x50
> #define MCP47FEB02_GAIN_BIT_MASK BIT(0)
> @@ -53,7 +54,7 @@
> #define DAC_CTRL_MASK(ch) (GENMASK(1, 0) << (2 * (ch)))
> #define DAC_CTRL_VAL(ch, val) ((val) << (2 * (ch)))
>
> -/* Gain Control and I2C Slave Address Reguster fields */
> +/* Gain Control and I2C Slave Address Register fields */
This is also an unrelated change. Precursor patch.
> #define DAC_GAIN_MASK(ch) (BIT(0) << (8 + (ch)))
> #define DAC_GAIN_VAL(ch, val) ((val) << (8 + (ch)))
next prev parent reply other threads:[~2026-08-05 1:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 13:29 [PATCH v3 0/3] Refactor Microchip MCP47FEB02 I2C driver in separate modules to add support for MCP48FEB02 SPI driver Ariana Lazar
2026-08-04 13:29 ` [PATCH v3 1/3] iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modules Ariana Lazar
2026-08-04 13:49 ` Andy Shevchenko
2026-08-05 1:13 ` Jonathan Cameron [this message]
2026-08-04 13:29 ` [PATCH v3 2/3] dt-bindings: iio: dac: add support for MCP48FEB02 SPI Ariana Lazar
2026-08-04 13:29 ` [PATCH v3 3/3] iio: dac: add support for Microchip MCP48FEB02 Ariana Lazar
2026-08-04 13:53 ` Andy Shevchenko
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=20260805021341.2b45e680@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=ariana.lazar@microchip.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
/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