From: Lee Jones <lee@kernel.org>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: "Arnd Bergmann" <arnd@arndb.de>, "Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Andrew Lunn" <andrew@lunn.ch>,
"Jagielski, Jedrzej" <jedrzej.jagielski@intel.com>,
"Andre Przywara" <andre.przywara@arm.com>,
"Chen-Yu Tsai" <wens@kernel.org>,
"Jernej Škrabec" <jernej.skrabec@gmail.com>,
linux-sunxi@lists.linux.dev, mfd@lists.linux.dev,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 2/2] mfd: ac200: Add X-Powers AC200 support
Date: Thu, 3 Sep 2026 09:54:36 +0100 [thread overview]
Message-ID: <20260903085436.GG2133376@google.com> (raw)
In-Reply-To: <CADvTj4oytrbZw9oKzRu=+tL1WZMyscfDvBMm2uK5hhNv8ZxTBw@mail.gmail.com>
On Wed, 02 Sep 2026, James Hilliard wrote:
> On Wed, Sep 2, 2026 at 8:31 AM Lee Jones <lee@kernel.org> wrote:
> >
> > On Tue, 11 Aug 2026, James Hilliard wrote:
> >
> > > The X-Powers AC200 is a mixed-signal companion IC with a paged register
> > > map accessed over I2C.
> > >
> > > Enable the shared input clock and prevent its rate from changing. Match
> > > the vendor driver's 40 ms wait before the first register access,
> > > initialize the paged regmap, report the chip and package revision, and
> > > apply common reset.
> > >
> > > The Ethernet PHY link endpoint is independently enumerated on its MDIO
> > > bus rather than created as an MFD platform child. Keep the regmap attached
> > > to the AC200 I2C device so a separately enumerated function can resolve
> > > that device, establish its required lifetime relationship and retrieve
> > > the regmap from the provider.
> > >
> > > Cache only the common page selector. Individual functions can reset
> > > independently and invalidate their other registers without regmap's
> > > knowledge, so leave all functional registers volatile.
> > >
> > > Reset the chip during managed teardown and system shutdown.
> > >
> > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> > > ---
> > > drivers/mfd/Kconfig | 11 ++++
> > > drivers/mfd/Makefile | 1 +
> > > drivers/mfd/ac200.c | 163 +++++++++++++++++++++++++++++++++++++++++++++++++++
> > > 3 files changed, 175 insertions(+)
> > >
> > > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> > > index e4fd4572472f..cac3fff5aee9 100644
> > > --- a/drivers/mfd/Kconfig
> > > +++ b/drivers/mfd/Kconfig
> > > @@ -205,6 +205,17 @@ config MFD_AC100
> > > This driver include only the core APIs. You have to select individual
> > > components like codecs or RTC under the corresponding menus.
> > >
> > > +config MFD_AC200
> > > + tristate "X-Powers AC200"
> > > + depends on I2C
> > > + depends on OF
> > > + select REGMAP_I2C
> > > + help
> > > + Support for the X-Powers AC200 mixed-signal companion IC. The AC200
> > > + contains audio, video, RTC and Fast Ethernet PHY functions and is
> > > + co-packaged with some Allwinner H6 and H616 SoCs. This driver provides
> > > + the shared register access used by the individual function drivers.
> > > +
> > > config MFD_AXP20X
> > > tristate
> > > select MFD_CORE
> > > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> > > index 72d3944b0ad8..f8101d2a9ce9 100644
> > > --- a/drivers/mfd/Makefile
> > > +++ b/drivers/mfd/Makefile
> > > @@ -150,6 +150,7 @@ obj-$(CONFIG_MFD_DA9052_SPI) += da9052-spi.o
> > > obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o
> > >
> > > obj-$(CONFIG_MFD_AC100) += ac100.o
> > > +obj-$(CONFIG_MFD_AC200) += ac200.o
> > > obj-$(CONFIG_MFD_AXP20X) += axp20x.o
> > > obj-$(CONFIG_MFD_AXP20X_I2C) += axp20x-i2c.o
> > > obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o
> > > diff --git a/drivers/mfd/ac200.c b/drivers/mfd/ac200.c
> > > new file mode 100644
> > > index 000000000000..0964e637afef
> > > --- /dev/null
> > > +++ b/drivers/mfd/ac200.c
> > > @@ -0,0 +1,163 @@
> > > +// SPDX-License-Identifier: GPL-2.0-only
> > > +/*
> > > + * MFD core driver for the X-Powers AC200
> > > + *
> > > + * Copyright (C) 2019 Jernej Skrabec <jernej.skrabec@gmail.com>
> > > + * Copyright (C) 2026 James Hilliard <james.hilliard1@gmail.com>
> > > + *
> > > + * Based on the AC100 driver:
> > > + * Copyright (C) 2016 Chen-Yu Tsai
> >
> > Drop this. Every driver tends to be based on something else.
>
> Dropped in v8.
>
> >
> > > + */
> > > +
> > > +#include <linux/bitfield.h>
> > > +#include <linux/clk.h>
> > > +#include <linux/delay.h>
> > > +#include <linux/i2c.h>
> > > +#include <linux/module.h>
> > > +#include <linux/regmap.h>
> >
> > Why aren't you using the MFD API?
> >
> > If you don't need it, then why is this in drivers/mfd?
>
> The EPHY remains enumerated on its primary MDIO bus, so it is not an MFD
> child. For non-EPHY use cases, the AC200 audio, video and RTC functions
> are intended to be added as MFD children.
>
> There are no such child drivers in this series, so I have not added
> unused MFD cells. Those can be introduced with their corresponding
> bindings and drivers.
The rule is that you must provide at least 2 MFD children before this
constitute as an MFD. Please provide them in the same series.
--
Lee Jones
prev parent reply other threads:[~2026-09-03 8:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 23:11 [PATCH v7 0/2] mfd: add X-Powers AC200 support James Hilliard
2026-08-11 23:11 ` [PATCH v7 1/2] dt-bindings: mfd: x-powers: Add AC200 James Hilliard
2026-08-11 23:22 ` sashiko-bot
2026-08-13 6:49 ` Krzysztof Kozlowski
2026-08-13 6:58 ` James Hilliard
2026-08-13 13:31 ` Andrew Lunn
2026-08-11 23:11 ` [PATCH v7 2/2] mfd: ac200: Add X-Powers AC200 support James Hilliard
2026-08-11 23:18 ` sashiko-bot
2026-09-02 14:31 ` Lee Jones
2026-09-02 19:36 ` James Hilliard
2026-09-03 8:54 ` Lee Jones [this message]
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=20260903085436.GG2133376@google.com \
--to=lee@kernel.org \
--cc=andre.przywara@arm.com \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=james.hilliard1@gmail.com \
--cc=jedrzej.jagielski@intel.com \
--cc=jernej.skrabec@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=mfd@lists.linux.dev \
--cc=robh@kernel.org \
--cc=wens@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