mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v10 0/2] mfd: add X-Powers AC200 support
@ 2026-09-06 22:30 James Hilliard
  2026-09-06 22:30 ` [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200 James Hilliard
  2026-09-06 22:30 ` [PATCH v10 2/2] mfd: ac200: Add X-Powers AC200 support James Hilliard
  0 siblings, 2 replies; 6+ messages in thread
From: James Hilliard @ 2026-09-06 22:30 UTC (permalink / raw)
  To: Jernej Skrabec, James Hilliard, Lee Jones, Arnd Bergmann,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Andrew Lunn, Jagielski, Jedrzej, Andre Przywara, Chen-Yu Tsai,
	linux-sunxi, mfd, devicetree, linux-kernel, Krzysztof Kozlowski

The X-Powers AC200 is an I2C-controlled mixed-signal companion IC with
a paged register map shared by its audio, video, RTC and Fast Ethernet
PHY functions.

Add the parent binding and an I2C provider which enables and rate-locks
the shared input clock and initializes the paged regmap. Before creating
the regmap, retain the 40 ms wait used by the BSP resume path after
enabling the input clock. No minimum delay is documented.

Deassert the common reset without first asserting it, and leave it
deasserted during removal and shutdown. This avoids a provider-initiated
chip-wide reset of unrelated function registers. Supplier unbind still
tears down linked consumers and releases the provider's clock references;
it does not guarantee uninterrupted operation or wake-state retention.

Describe and instantiate the audio codec and TV encoder as MFD children,
and provide a shared regmap interrupt controller for boards with INTB
connected. Only enabled, DT-described function devices are instantiated;
PHY-only systems therefore acquire no unused platform devices.

The INTB connection and TV encoder cable-detection interrupt are optional.
Enabled codec and TV encoder nodes are valid without INTB connected, and
cable detection status remains readable over I2C. A declared TV encoder
interrupt requires a complete parent interrupt domain and upstream path.
The ASoC codec and DRM bridge drivers are separate subsystem work and are
not part of this MFD-only series.

The current regmap consumer is the separately submitted AC200/AC300
Ethernet PHY series:

  https://patch.msgid.link/20260818-submit-acx00-of-dynamic-v1-v9-0-b8c8d9ad0d83@gmail.com

The PHY remains enumerated on MDIO, its primary management bus. Its AC200
package node follows the x-powers,ac200 phandle for ancillary I2C register
access, adds a managed device link and obtains the regmap with
dev_get_regmap(). This series and the PHY series can be merged in either
order; AC200 Ethernet support requires both.

The child descriptions and MFD implementation are adapted from earlier
work by Jernej Skrabec and Andre Przywara, retaining their sign-off chain:

  https://github.com/jernejsk/linux-1/commits/opi3-eth/

Public AC200 documentation is linked from:

  https://linux-sunxi.org/AC200

Validation included dt_binding_check with dtschema 2026.6, W=1 x86_64
object builds, strict checkpatch checks and a clean diff check. A 38-case
host-side harness checked the actual IRQ initialization and cleanup
functions with stubbed regmap and IRQ APIs, covering trigger selection,
firmware register states and failure unwinding under ASan and UBSan.
A 30-case DT validation matrix covered wired and unwired configurations,
enabled and disabled functions, both interrupt-specifier forms and
incomplete IRQ paths.

In earlier AC200 hardware checks, a writable common-register marker
survived supplier unbind and rebind. The provider and PHY completed 100
deliberately overlapping bind cycles while both device links remained
valid and the 100 Mbps full-duplex link recovered.

With temporary codec and TV encoder DT child nodes, a second 100-cycle
run verified that both automatically numbered platform devices were
removed and recreated on every supplier rebind while the PHY continued
to recover. After restoring the production DT, no child devices were
instantiated. One hundred pings in each direction completed without loss
and 8 MiB transfers in both directions compared correctly.

The latest revision was also booted with both MFD children enabled and no
IRQ connection. Twenty supplier rebinds completed without DMA-mask warnings.
All 42 child probes verified DMA-mask inheritance, read the parent common
control register as 0x1 and obtained the expected absent optional IRQ.
The PHY recovered at 100 Mbps full duplex; 20 pings in each direction had
no loss and an 8 MiB upload/download round trip compared correctly. These
child runtime checks cover enumeration, removal/recreation and shared
resource access.

Assisted-by: Codex:gpt-6-astra
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes v9 -> v10:
- combine the parent and function bindings into one complete binding patch
  (requested by Conor Dooley)
- introduce the complete MFD provider, IRQ controller and function cells in
  one driver patch, reducing the series from four patches to two
- retain the existing sign-off chains for the adapted binding and MFD work
- allow enabled codec and TV encoder nodes when INTB is not connected;
  require the parent IRQ path only when a TV encoder interrupt is declared
  or the parent advertises an interrupt controller
- add an unwired TV encoder example
- move the existing 40 ms wait before constructing and publishing the
  regmap, and clarify its origin in the BSP resume path
- use automatic platform-device IDs so MFD children from multiple AC200
  instances cannot collide
- initialize the parent's DMA mask for its non-DMA children, avoiding
  "DMA mask not set" warnings during child enumeration
- explicitly request level-low when no upstream IRQ trigger is configured
- keep INTB disabled until source masking and handler setup are complete,
  and disable it before releasing the IRQ chip on failure or removal
- narrow reset-preservation claims to avoiding a provider-initiated global
  reset; supplier unbind still tears down consumers and releases clocks
- Link to v9: https://patch.msgid.link/20260903-submit-ac200-mfd-v9-0-6b7ed278989c@gmail.com

Changes v8 -> v9:
- deassert common reset without first resetting the entire chip
- leave common reset deasserted during removal and shutdown, avoiding a
  provider-initiated chip-wide reset
  (reported by Sashiko and queried by Lee Jones)
- stop storing the regmap as unused driver data after dropping teardown
  callbacks
- describe the audio codec and TV encoder MFD children
- add the AC200 interrupt definitions and shared regmap IRQ controller
- register only enabled, DT-described codec and TV encoder function devices
- retain Jernej Skrabec and Andre Przywara's authorship and sign-off chain
  for the adapted child and MFD work
- make the base provider depend on COMMON_CLK before child support is added
- require an upstream interrupt when the parent is an interrupt controller
- credit Jernej Skrabec in the module metadata
- exercise child enumeration and parent-regmap access with temporary probes
- rebase on the current MFD for-mfd-next branch
- verify register-state preservation across supplier unbind and rebind
- Link to v8: https://patch.msgid.link/20260902-submit-ac200-mfd-v8-0-2aa06720b8ac@gmail.com

Changes v7 -> v8:
- identify the PHY series as the current regmap consumer
- describe future MFD children and the MDIO/I2C split
- store the regmap directly as driver data  (suggested by Lee Jones)
- reset the chip from the remove callback  (suggested by Lee Jones)
- drop the revision log and inherited-driver attribution  (suggested by Lee Jones)
- add Krzysztof's Reviewed-by tag to the binding
- rebase on the current MFD for-mfd-next branch
- Link to v7: https://patch.msgid.link/20260811-submit-ac200-mfd-v7-0-8b06f552a4d7@gmail.com

Changes v6 -> v7:
- drop the managed external-syscon helper and AC200 syscon registration
- leave the regmap attached to the I2C provider for direct device lookup
- reduce the MFD series from three patches to two
- Link to v6: https://patch.msgid.link/20260811-submit-ac200-mfd-v6-0-c5b1292c8498@gmail.com

Changes v5 -> v6:
- split the MFD work from the independently mergeable networking series
- put the merge routing and shared DT design at the start of the cover letter
- rebase on the MFD for-mfd-next branch
- Link to v5: https://patch.msgid.link/20260809-submit-acx00-of-dynamic-v1-v5-0-bfa1f8518b28@gmail.com

To: Jernej Skrabec <jernej.skrabec@gmail.com>
To: James Hilliard <james.hilliard1@gmail.com>
To: Lee Jones <lee@kernel.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
Cc: linux-sunxi@lists.linux.dev
Cc: mfd@lists.linux.dev
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

---
James Hilliard (2):
      dt-bindings: mfd: x-powers: Add AC200
      mfd: ac200: Add X-Powers AC200 support

 .../devicetree/bindings/mfd/x-powers,ac200.yaml    | 231 +++++++++++++++++++
 MAINTAINERS                                        |   9 +
 drivers/mfd/Kconfig                                |  15 ++
 drivers/mfd/Makefile                               |   1 +
 drivers/mfd/ac200.c                                | 255 +++++++++++++++++++++
 include/dt-bindings/mfd/x-powers,ac200.h           |  13 ++
 6 files changed, 524 insertions(+)
---
base-commit: b07adc1a304c7ca9ac25a01051561538757363c9
change-id: 20260811-submit-ac200-mfd-8bad6d09e285

Best regards,
--  
James Hilliard <james.hilliard1@gmail.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200
  2026-09-06 22:30 [PATCH v10 0/2] mfd: add X-Powers AC200 support James Hilliard
@ 2026-09-06 22:30 ` James Hilliard
  2026-09-07 17:19   ` Conor Dooley
  2026-09-06 22:30 ` [PATCH v10 2/2] mfd: ac200: Add X-Powers AC200 support James Hilliard
  1 sibling, 1 reply; 6+ messages in thread
From: James Hilliard @ 2026-09-06 22:30 UTC (permalink / raw)
  To: Jernej Skrabec, James Hilliard, Lee Jones, Arnd Bergmann,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Andrew Lunn, Jagielski, Jedrzej, Andre Przywara, Chen-Yu Tsai,
	linux-sunxi, mfd, devicetree, linux-kernel, Krzysztof Kozlowski

The AC200 is an I2C-controlled mixed-signal companion IC containing
audio, video, RTC and Fast Ethernet PHY functions.

Describe the parent device and its shared input clock together with the
audio codec and TV encoder child nodes. Keep their analog supplies on the
function consumers and describe the TV encoder display graph and optional
bandgap calibration cell.

Add the shared interrupt-controller properties and interrupt numbers used
by the TV encoder. The Ethernet PHY is represented by a PHY package on its
MDIO bus, with a phandle back to this device for access to the package
control registers, so it does not require an MFD child node.

Keep the INTB connection and TV encoder interrupt optional, including when
the TV encoder is enabled. Cable detection status is readable over I2C
without an interrupt. If a TV encoder interrupt is described, require the
parent interrupt domain and its upstream connection. Include examples
with and without INTB connected.

The input clock must run at 24 or 27 MHz when the Ethernet PHY is used,
matching the rates encoded by its documented clock selector.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 .../devicetree/bindings/mfd/x-powers,ac200.yaml    | 231 +++++++++++++++++++++
 MAINTAINERS                                        |   8 +
 include/dt-bindings/mfd/x-powers,ac200.h           |  13 ++
 3 files changed, 252 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml b/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
new file mode 100644
index 000000000000..0f2e6922fc4f
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
@@ -0,0 +1,231 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/x-powers,ac200.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: X-Powers AC200 mixed-signal IC
+
+maintainers:
+  - James Hilliard <james.hilliard1@gmail.com>
+  - Jernej Skrabec <jernej.skrabec@gmail.com>
+
+description:
+  The AC200 is a mixed-signal companion IC containing audio, video, RTC and
+  Fast Ethernet PHY functions. Its control registers are accessed over I2C.
+
+properties:
+  compatible:
+    const: x-powers,ac200
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description:
+      AC200 input clock. When using the Ethernet PHY, its configured rate must
+      be 24 or 27 MHz, matching the rates encoded by the documented EPHY clock
+      selector.
+
+  interrupts:
+    maxItems: 1
+    description:
+      The shared open-drain INTB output for the TV encoder, Ethernet PHY and
+      RTC interrupts. Omit when INTB is not connected.
+
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 1
+    description:
+      The interrupt number, as defined in
+      include/dt-bindings/mfd/x-powers,ac200.h.
+
+  codec:
+    type: object
+    $ref: /schemas/sound/dai-common.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      compatible:
+        const: x-powers,ac200-codec
+
+      '#sound-dai-cells':
+        const: 0
+
+      ac-ldoin-supply:
+        description: The 3.3 V supply for the audio codec LDO input.
+
+    required:
+      - compatible
+      - '#sound-dai-cells'
+      - ac-ldoin-supply
+
+  tv-encoder:
+    type: object
+    additionalProperties: false
+
+    properties:
+      compatible:
+        const: x-powers,ac200-tve
+
+      interrupts:
+        maxItems: 1
+        description:
+          Cable detection interrupt routed through the AC200 interrupt
+          controller. Omit when INTB is not connected. Cable detection status
+          can also be read over I2C without an interrupt.
+
+      tv-vcc-supply:
+        description: The 3.3 V supply for the composite-video DAC.
+
+      nvmem-cells:
+        maxItems: 1
+
+      nvmem-cell-names:
+        items:
+          - const: bandgap
+
+      ports:
+        $ref: /schemas/graph.yaml#/properties/ports
+
+        properties:
+          port@0:
+            $ref: /schemas/graph.yaml#/properties/port
+            description: Input from the display pipeline, carrying CCIR656.
+
+          port@1:
+            $ref: /schemas/graph.yaml#/properties/port
+            description: Output to the composite-video connector.
+
+        required:
+          - port@0
+          - port@1
+
+    required:
+      - compatible
+      - tv-vcc-supply
+      - ports
+
+    dependencies:
+      nvmem-cells: [ nvmem-cell-names ]
+      nvmem-cell-names: [ nvmem-cells ]
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+allOf:
+  - if:
+      properties:
+        tv-encoder:
+          anyOf:
+            - required: [ interrupts ]
+            - required: [ interrupts-extended ]
+      required:
+        - tv-encoder
+    then:
+      required:
+        - interrupts
+        - interrupt-controller
+        - '#interrupt-cells'
+
+dependencies:
+  interrupt-controller: [ '#interrupt-cells', interrupts ]
+  '#interrupt-cells': [ interrupt-controller ]
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/mfd/x-powers,ac200.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mixed-signal@10 {
+            compatible = "x-powers,ac200";
+            reg = <0x10>;
+            clocks = <&pwm 5>;
+            interrupt-parent = <&pio>;
+            interrupts = <1 20 IRQ_TYPE_LEVEL_LOW>;
+            interrupt-controller;
+            #interrupt-cells = <1>;
+
+            codec {
+                compatible = "x-powers,ac200-codec";
+                #sound-dai-cells = <0>;
+                ac-ldoin-supply = <&reg_aldo2>;
+            };
+
+            tv-encoder {
+                compatible = "x-powers,ac200-tve";
+                interrupts = <AC200_IRQ_TVE>;
+                tv-vcc-supply = <&reg_aldo2>;
+
+                ports {
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+
+                    port@0 {
+                        reg = <0>;
+
+                        tve_in: endpoint {
+                            remote-endpoint = <&tcon_out_tve>;
+                        };
+                    };
+
+                    port@1 {
+                        reg = <1>;
+
+                        tve_out: endpoint {
+                            remote-endpoint = <&composite_in>;
+                        };
+                    };
+                };
+            };
+        };
+    };
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        mixed-signal@10 {
+            compatible = "x-powers,ac200";
+            reg = <0x10>;
+            clocks = <&pwm 5>;
+            /* INTB is not connected. */
+
+            tv-encoder {
+                compatible = "x-powers,ac200-tve";
+                tv-vcc-supply = <&reg_aldo2>;
+
+                ports {
+                    #address-cells = <1>;
+                    #size-cells = <0>;
+
+                    port@0 {
+                        reg = <0>;
+
+                        endpoint {
+                            remote-endpoint = <&tcon_out_tve>;
+                        };
+                    };
+
+                    port@1 {
+                        reg = <1>;
+
+                        endpoint {
+                            remote-endpoint = <&composite_in>;
+                        };
+                    };
+                };
+            };
+        };
+    };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 3a19da74d00c..1b1dd57cc419 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -29504,6 +29504,14 @@ F:	drivers/net/wwan/
 F:	include/linux/wwan.h
 F:	include/uapi/linux/wwan.h
 
+X-POWERS AC200 DRIVERS
+M:	Jernej Skrabec <jernej.skrabec@gmail.com>
+M:	James Hilliard <james.hilliard1@gmail.com>
+L:	linux-sunxi@lists.linux.dev
+S:	Maintained
+F:	Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
+F:	include/dt-bindings/mfd/x-powers,ac200.h
+
 X-POWERS AXP288 PMIC DRIVERS
 M:	Hans de Goede <hansg@kernel.org>
 S:	Maintained
diff --git a/include/dt-bindings/mfd/x-powers,ac200.h b/include/dt-bindings/mfd/x-powers,ac200.h
new file mode 100644
index 000000000000..cc59e2ab4912
--- /dev/null
+++ b/include/dt-bindings/mfd/x-powers,ac200.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Interrupt numbers of the X-Powers AC200 interrupt controller.
+ */
+
+#ifndef _DT_BINDINGS_MFD_X_POWERS_AC200_H
+#define _DT_BINDINGS_MFD_X_POWERS_AC200_H
+
+#define AC200_IRQ_TVE			0
+#define AC200_IRQ_EPHY			1
+#define AC200_IRQ_RTC			2
+
+#endif /* _DT_BINDINGS_MFD_X_POWERS_AC200_H */

-- 
2.53.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v10 2/2] mfd: ac200: Add X-Powers AC200 support
  2026-09-06 22:30 [PATCH v10 0/2] mfd: add X-Powers AC200 support James Hilliard
  2026-09-06 22:30 ` [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200 James Hilliard
@ 2026-09-06 22:30 ` James Hilliard
  1 sibling, 0 replies; 6+ messages in thread
From: James Hilliard @ 2026-09-06 22:30 UTC (permalink / raw)
  To: Jernej Skrabec, James Hilliard, Lee Jones, Arnd Bergmann,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Andrew Lunn, Jagielski, Jedrzej, Andre Przywara, Chen-Yu Tsai,
	linux-sunxi, mfd, devicetree, linux-kernel

The X-Powers AC200 is a mixed-signal companion IC with a paged register
map accessed over I2C.

Enable and rate-lock the shared input clock, retain the BSP resume path's
40 ms wait before creating the regmap and accessing registers, and
deassert the common reset. No minimum delay is documented. Set only the
deassert bit instead of forcing a reset cycle, avoiding a chip-wide reset
of unrelated function registers. Leave the common reset deasserted during
driver removal and system shutdown; function drivers own their block
resets. Supplier unbind still tears down linked consumers and releases
the provider's clock references.

Cache only the common page selector. Individual functions can reset
independently and invalidate their other registers, so leave all
functional registers volatile.

Register the audio codec and TV encoder as MFD cells when their enabled
child nodes are present. Filtering the cell list avoids unused platform
devices and warnings about missing firmware nodes on PHY-only boards.
Use automatically assigned platform device IDs to support multiple AC200
instances. Initialize the parent's DMA mask for its non-DMA children so
their OF configuration does not warn about a missing mask.

Add a regmap IRQ controller for the shared level-triggered INTB output so
the TV encoder can consume its cable-detection interrupt. Default to
level-low when the upstream interrupt has no trigger type configured.
Keep INTB disabled until regmap has masked the sources and installed the
handler, and disable it before releasing the IRQ chip. The source
function remains responsible for clearing its interrupt condition.

The Ethernet PHY is enumerated on its MDIO bus rather than as an MFD
child. It follows the x-powers,ac200 phandle and uses this regmap for
ancillary package-control access.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 MAINTAINERS          |   1 +
 drivers/mfd/Kconfig  |  15 +++
 drivers/mfd/Makefile |   1 +
 drivers/mfd/ac200.c  | 255 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 272 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1b1dd57cc419..8a48f6a1e593 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -29510,6 +29510,7 @@ M:	James Hilliard <james.hilliard1@gmail.com>
 L:	linux-sunxi@lists.linux.dev
 S:	Maintained
 F:	Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
+F:	drivers/mfd/ac200.c
 F:	include/dt-bindings/mfd/x-powers,ac200.h
 
 X-POWERS AXP288 PMIC DRIVERS
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 857ca3bb0d5b..5193c6f71bd8 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -205,6 +205,21 @@ 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 COMMON_CLK
+	depends on I2C
+	depends on OF
+	select MFD_CORE
+	select REGMAP_I2C
+	select REGMAP_IRQ
+	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 and instantiates the individual function
+	  devices.
+
 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..30828e113c11
--- /dev/null
+++ b/drivers/mfd/ac200.c
@@ -0,0 +1,255 @@
+// 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>
+ */
+
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/mfd/core.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regmap.h>
+
+#include <dt-bindings/mfd/x-powers,ac200.h>
+
+#define AC200_SYS_CONTROL_REG			0x0002
+#define AC200_SYS_CONTROL_CHIP_RESET_DEASSERT	BIT(0)
+#define AC200_SYS_IRQ_ENABLE_REG		0x0004
+#define AC200_SYS_IRQ_INTB_ENABLE		BIT(15)
+#define AC200_SYS_IRQ_INTB_ACTIVE_HIGH		BIT(14)
+#define AC200_SYS_IRQ_RTC			BIT(12)
+#define AC200_SYS_IRQ_EPHY			BIT(8)
+#define AC200_SYS_IRQ_TVE			BIT(4)
+#define AC200_SYS_IRQ_STATUS_REG		0x0006
+
+/* Interface register accessible from every register page. */
+#define AC200_TWI_REG_ADDR_H	0x00fe
+#define AC200_MAX_REG		0xa1f2
+
+static const struct regmap_range_cfg ac200_range_cfg[] = {
+	{
+		.range_max = AC200_MAX_REG,
+		.selector_reg = AC200_TWI_REG_ADDR_H,
+		.selector_mask = 0xff,
+		.window_len = 256,
+	},
+};
+
+/*
+ * Each AC200 sub-block can reset independently, invalidating its register
+ * contents without regmap's knowledge. Cache only the common page selector;
+ * this avoids a selector read-modify-write for every access on the same page
+ * without ever returning stale functional-register values.
+ */
+static bool ac200_volatile_reg(struct device *dev, unsigned int reg)
+{
+	return reg != AC200_TWI_REG_ADDR_H;
+}
+
+static const struct regmap_config ac200_regmap_config = {
+	.name = "ac200",
+	.reg_bits = 8,
+	.reg_stride = 2,
+	.val_bits = 16,
+	.ranges = ac200_range_cfg,
+	.num_ranges = ARRAY_SIZE(ac200_range_cfg),
+	.max_register = AC200_MAX_REG,
+	.volatile_reg = ac200_volatile_reg,
+	.cache_type = REGCACHE_MAPLE,
+};
+
+static const struct regmap_irq ac200_irqs[] = {
+	REGMAP_IRQ_REG(AC200_IRQ_TVE, 0, AC200_SYS_IRQ_TVE),
+	REGMAP_IRQ_REG(AC200_IRQ_EPHY, 0, AC200_SYS_IRQ_EPHY),
+	REGMAP_IRQ_REG(AC200_IRQ_RTC, 0, AC200_SYS_IRQ_RTC),
+};
+
+/*
+ * SYS_IRQ_ENABLE is an enable register rather than a mask register, hence
+ * unmask_base. SYS_IRQ_STATUS reflects the source levels, so the function
+ * which raised an interrupt is responsible for clearing it.
+ */
+static const struct regmap_irq_chip ac200_irq_chip = {
+	.name = "ac200",
+	.status_base = AC200_SYS_IRQ_STATUS_REG,
+	.unmask_base = AC200_SYS_IRQ_ENABLE_REG,
+	.num_regs = 1,
+	.irqs = ac200_irqs,
+	.num_irqs = ARRAY_SIZE(ac200_irqs),
+};
+
+static const struct mfd_cell ac200_cells[] = {
+	{
+		.name = "ac200-codec",
+		.of_compatible = "x-powers,ac200-codec",
+	}, {
+		.name = "ac200-tve",
+		.of_compatible = "x-powers,ac200-tve",
+	},
+};
+
+static void ac200_disable_intb(void *data)
+{
+	struct regmap *regmap = data;
+	int ret;
+
+	ret = regmap_clear_bits(regmap, AC200_SYS_IRQ_ENABLE_REG,
+				AC200_SYS_IRQ_INTB_ENABLE);
+	if (ret)
+		dev_err(regmap_get_device(regmap), "failed to disable INTB: %d\n",
+			ret);
+}
+
+static int ac200_init_irq(struct device *dev, struct regmap *regmap, int irq)
+{
+	struct regmap_irq_chip_data *irq_data;
+	unsigned int trigger;
+	u16 value = 0;
+	int ret;
+
+	trigger = irq_get_trigger_type(irq);
+	if (trigger == IRQ_TYPE_NONE)
+		trigger = IRQ_TYPE_LEVEL_LOW;
+
+	switch (trigger) {
+	case IRQ_TYPE_LEVEL_HIGH:
+		value |= AC200_SYS_IRQ_INTB_ACTIVE_HIGH;
+		break;
+	case IRQ_TYPE_LEVEL_LOW:
+		break;
+	default:
+		return dev_err_probe(dev, -EINVAL,
+				     "INTB is level triggered, not type %u\n",
+				     trigger);
+	}
+
+	/* Keep INTB disabled until the sources are masked and the IRQ is ready. */
+	ret = regmap_update_bits(regmap, AC200_SYS_IRQ_ENABLE_REG,
+				 AC200_SYS_IRQ_INTB_ENABLE |
+				 AC200_SYS_IRQ_INTB_ACTIVE_HIGH, value);
+	if (ret)
+		return ret;
+
+	ret = devm_regmap_add_irq_chip(dev, regmap, irq, trigger | IRQF_ONESHOT, 0,
+				       &ac200_irq_chip, &irq_data);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to add IRQ chip\n");
+
+	/* Disable INTB before the IRQ chip and regmap are released. */
+	ret = devm_add_action_or_reset(dev, ac200_disable_intb, regmap);
+	if (ret)
+		return ret;
+
+	return regmap_set_bits(regmap, AC200_SYS_IRQ_ENABLE_REG,
+			       AC200_SYS_IRQ_INTB_ENABLE);
+}
+
+static int ac200_add_devices(struct device *dev)
+{
+	struct mfd_cell cells[ARRAY_SIZE(ac200_cells)];
+	unsigned int num_cells = 0;
+	unsigned int i;
+	int ret;
+
+	for (i = 0; i < ARRAY_SIZE(ac200_cells); i++) {
+		const struct mfd_cell *cell = &ac200_cells[i];
+		struct device_node *child;
+
+		child = of_get_compatible_child(dev->of_node,
+						cell->of_compatible);
+		if (!child)
+			continue;
+		if (of_device_is_available(child))
+			cells[num_cells++] = *cell;
+		of_node_put(child);
+	}
+
+	if (!num_cells)
+		return 0;
+
+	ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, cells, num_cells,
+				   NULL, 0, NULL);
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "failed to add function devices\n");
+
+	return 0;
+}
+
+static int ac200_probe(struct i2c_client *client)
+{
+	struct device *dev = &client->dev;
+	struct regmap *regmap;
+	struct clk *clk;
+	int ret;
+
+	clk = devm_clk_get_enabled(dev, NULL);
+	if (IS_ERR(clk))
+		return dev_err_probe(dev, PTR_ERR(clk),
+				     "failed to enable input clock\n");
+
+	ret = devm_clk_rate_exclusive_get(dev, clk);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to lock clock rate\n");
+
+	/*
+	 * No minimum delay is documented. Retain the BSP resume path's 40 ms wait
+	 * after enabling the input clock and before register access.
+	 */
+	msleep(40);
+
+	regmap = devm_regmap_init_i2c(client, &ac200_regmap_config);
+	if (IS_ERR(regmap))
+		return dev_err_probe(dev, PTR_ERR(regmap),
+				     "failed to initialize regmap\n");
+
+	ret = regmap_set_bits(regmap, AC200_SYS_CONTROL_REG,
+			      AC200_SYS_CONTROL_CHIP_RESET_DEASSERT);
+	if (ret)
+		return ret;
+
+	if (client->irq > 0) {
+		ret = ac200_init_irq(dev, regmap, client->irq);
+		if (ret)
+			return ret;
+	}
+
+	/* AC200 and its children do not perform DMA. */
+	dev->coherent_dma_mask = 0;
+	dev->dma_mask = &dev->coherent_dma_mask;
+
+	return ac200_add_devices(dev);
+}
+
+static const struct of_device_id ac200_of_match[] = {
+	{ .compatible = "x-powers,ac200" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, ac200_of_match);
+
+static const struct i2c_device_id ac200_i2c_ids[] = {
+	{ .name = "ac200" },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, ac200_i2c_ids);
+
+static struct i2c_driver ac200_driver = {
+	.driver = {
+		.name = "ac200",
+		.of_match_table = ac200_of_match,
+	},
+	.probe = ac200_probe,
+	.id_table = ac200_i2c_ids,
+};
+module_i2c_driver(ac200_driver);
+
+MODULE_AUTHOR("Jernej Skrabec <jernej.skrabec@gmail.com>");
+MODULE_AUTHOR("James Hilliard <james.hilliard1@gmail.com>");
+MODULE_DESCRIPTION("X-Powers AC200 MFD core driver");
+MODULE_LICENSE("GPL");

-- 
2.53.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200
  2026-09-06 22:30 ` [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200 James Hilliard
@ 2026-09-07 17:19   ` Conor Dooley
  2026-09-07 17:34     ` James Hilliard
  0 siblings, 1 reply; 6+ messages in thread
From: Conor Dooley @ 2026-09-07 17:19 UTC (permalink / raw)
  To: James Hilliard
  Cc: Jernej Skrabec, Lee Jones, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andrew Lunn, Jagielski,
	Jedrzej, Andre Przywara, Chen-Yu Tsai, linux-sunxi, mfd,
	devicetree, linux-kernel, Krzysztof Kozlowski

[-- Attachment #1: Type: text/plain, Size: 9988 bytes --]

On Sun, Sep 06, 2026 at 04:30:46PM -0600, James Hilliard wrote:
> The AC200 is an I2C-controlled mixed-signal companion IC containing
> audio, video, RTC and Fast Ethernet PHY functions.
> 
> Describe the parent device and its shared input clock together with the
> audio codec and TV encoder child nodes. Keep their analog supplies on the
> function consumers and describe the TV encoder display graph and optional
> bandgap calibration cell.
> 
> Add the shared interrupt-controller properties and interrupt numbers used
> by the TV encoder. The Ethernet PHY is represented by a PHY package on its
> MDIO bus, with a phandle back to this device for access to the package
> control registers, so it does not require an MFD child node.
> 
> Keep the INTB connection and TV encoder interrupt optional, including when
> the TV encoder is enabled. Cable detection status is readable over I2C
> without an interrupt. If a TV encoder interrupt is described, require the
> parent interrupt domain and its upstream connection. Include examples
> with and without INTB connected.
> 
> The input clock must run at 24 or 27 MHz when the Ethernet PHY is used,
> matching the rates encoded by its documented clock selector.

> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

This should have been dropped when you merged the patches.
Not sure why you sent v10 without waiting for a reply from me on the v9.

Thanks,
Conor.

> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>  .../devicetree/bindings/mfd/x-powers,ac200.yaml    | 231 +++++++++++++++++++++
>  MAINTAINERS                                        |   8 +
>  include/dt-bindings/mfd/x-powers,ac200.h           |  13 ++
>  3 files changed, 252 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml b/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
> new file mode 100644
> index 000000000000..0f2e6922fc4f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
> @@ -0,0 +1,231 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/x-powers,ac200.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: X-Powers AC200 mixed-signal IC
> +
> +maintainers:
> +  - James Hilliard <james.hilliard1@gmail.com>
> +  - Jernej Skrabec <jernej.skrabec@gmail.com>
> +
> +description:
> +  The AC200 is a mixed-signal companion IC containing audio, video, RTC and
> +  Fast Ethernet PHY functions. Its control registers are accessed over I2C.
> +
> +properties:
> +  compatible:
> +    const: x-powers,ac200
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +    description:
> +      AC200 input clock. When using the Ethernet PHY, its configured rate must
> +      be 24 or 27 MHz, matching the rates encoded by the documented EPHY clock
> +      selector.
> +
> +  interrupts:
> +    maxItems: 1
> +    description:
> +      The shared open-drain INTB output for the TV encoder, Ethernet PHY and
> +      RTC interrupts. Omit when INTB is not connected.
> +
> +  interrupt-controller: true
> +
> +  '#interrupt-cells':
> +    const: 1
> +    description:
> +      The interrupt number, as defined in
> +      include/dt-bindings/mfd/x-powers,ac200.h.
> +
> +  codec:
> +    type: object
> +    $ref: /schemas/sound/dai-common.yaml#
> +    unevaluatedProperties: false
> +
> +    properties:
> +      compatible:
> +        const: x-powers,ac200-codec
> +
> +      '#sound-dai-cells':
> +        const: 0
> +
> +      ac-ldoin-supply:
> +        description: The 3.3 V supply for the audio codec LDO input.
> +
> +    required:
> +      - compatible
> +      - '#sound-dai-cells'
> +      - ac-ldoin-supply
> +
> +  tv-encoder:
> +    type: object
> +    additionalProperties: false
> +
> +    properties:
> +      compatible:
> +        const: x-powers,ac200-tve
> +
> +      interrupts:
> +        maxItems: 1
> +        description:
> +          Cable detection interrupt routed through the AC200 interrupt
> +          controller. Omit when INTB is not connected. Cable detection status
> +          can also be read over I2C without an interrupt.
> +
> +      tv-vcc-supply:
> +        description: The 3.3 V supply for the composite-video DAC.
> +
> +      nvmem-cells:
> +        maxItems: 1
> +
> +      nvmem-cell-names:
> +        items:
> +          - const: bandgap
> +
> +      ports:
> +        $ref: /schemas/graph.yaml#/properties/ports
> +
> +        properties:
> +          port@0:
> +            $ref: /schemas/graph.yaml#/properties/port
> +            description: Input from the display pipeline, carrying CCIR656.
> +
> +          port@1:
> +            $ref: /schemas/graph.yaml#/properties/port
> +            description: Output to the composite-video connector.
> +
> +        required:
> +          - port@0
> +          - port@1
> +
> +    required:
> +      - compatible
> +      - tv-vcc-supply
> +      - ports
> +
> +    dependencies:
> +      nvmem-cells: [ nvmem-cell-names ]
> +      nvmem-cell-names: [ nvmem-cells ]
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +
> +allOf:
> +  - if:
> +      properties:
> +        tv-encoder:
> +          anyOf:
> +            - required: [ interrupts ]
> +            - required: [ interrupts-extended ]
> +      required:
> +        - tv-encoder
> +    then:
> +      required:
> +        - interrupts
> +        - interrupt-controller
> +        - '#interrupt-cells'
> +
> +dependencies:
> +  interrupt-controller: [ '#interrupt-cells', interrupts ]
> +  '#interrupt-cells': [ interrupt-controller ]
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/mfd/x-powers,ac200.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        mixed-signal@10 {
> +            compatible = "x-powers,ac200";
> +            reg = <0x10>;
> +            clocks = <&pwm 5>;
> +            interrupt-parent = <&pio>;
> +            interrupts = <1 20 IRQ_TYPE_LEVEL_LOW>;
> +            interrupt-controller;
> +            #interrupt-cells = <1>;
> +
> +            codec {
> +                compatible = "x-powers,ac200-codec";
> +                #sound-dai-cells = <0>;
> +                ac-ldoin-supply = <&reg_aldo2>;
> +            };
> +
> +            tv-encoder {
> +                compatible = "x-powers,ac200-tve";
> +                interrupts = <AC200_IRQ_TVE>;
> +                tv-vcc-supply = <&reg_aldo2>;
> +
> +                ports {
> +                    #address-cells = <1>;
> +                    #size-cells = <0>;
> +
> +                    port@0 {
> +                        reg = <0>;
> +
> +                        tve_in: endpoint {
> +                            remote-endpoint = <&tcon_out_tve>;
> +                        };
> +                    };
> +
> +                    port@1 {
> +                        reg = <1>;
> +
> +                        tve_out: endpoint {
> +                            remote-endpoint = <&composite_in>;
> +                        };
> +                    };
> +                };
> +            };
> +        };
> +    };
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        mixed-signal@10 {
> +            compatible = "x-powers,ac200";
> +            reg = <0x10>;
> +            clocks = <&pwm 5>;
> +            /* INTB is not connected. */
> +
> +            tv-encoder {
> +                compatible = "x-powers,ac200-tve";
> +                tv-vcc-supply = <&reg_aldo2>;
> +
> +                ports {
> +                    #address-cells = <1>;
> +                    #size-cells = <0>;
> +
> +                    port@0 {
> +                        reg = <0>;
> +
> +                        endpoint {
> +                            remote-endpoint = <&tcon_out_tve>;
> +                        };
> +                    };
> +
> +                    port@1 {
> +                        reg = <1>;
> +
> +                        endpoint {
> +                            remote-endpoint = <&composite_in>;
> +                        };
> +                    };
> +                };
> +            };
> +        };
> +    };
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 3a19da74d00c..1b1dd57cc419 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -29504,6 +29504,14 @@ F:	drivers/net/wwan/
>  F:	include/linux/wwan.h
>  F:	include/uapi/linux/wwan.h
>  
> +X-POWERS AC200 DRIVERS
> +M:	Jernej Skrabec <jernej.skrabec@gmail.com>
> +M:	James Hilliard <james.hilliard1@gmail.com>
> +L:	linux-sunxi@lists.linux.dev
> +S:	Maintained
> +F:	Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
> +F:	include/dt-bindings/mfd/x-powers,ac200.h
> +
>  X-POWERS AXP288 PMIC DRIVERS
>  M:	Hans de Goede <hansg@kernel.org>
>  S:	Maintained
> diff --git a/include/dt-bindings/mfd/x-powers,ac200.h b/include/dt-bindings/mfd/x-powers,ac200.h
> new file mode 100644
> index 000000000000..cc59e2ab4912
> --- /dev/null
> +++ b/include/dt-bindings/mfd/x-powers,ac200.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +/*
> + * Interrupt numbers of the X-Powers AC200 interrupt controller.
> + */
> +
> +#ifndef _DT_BINDINGS_MFD_X_POWERS_AC200_H
> +#define _DT_BINDINGS_MFD_X_POWERS_AC200_H
> +
> +#define AC200_IRQ_TVE			0
> +#define AC200_IRQ_EPHY			1
> +#define AC200_IRQ_RTC			2
> +
> +#endif /* _DT_BINDINGS_MFD_X_POWERS_AC200_H */
> 
> -- 
> 2.53.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200
  2026-09-07 17:19   ` Conor Dooley
@ 2026-09-07 17:34     ` James Hilliard
  2026-09-07 17:56       ` Conor Dooley
  0 siblings, 1 reply; 6+ messages in thread
From: James Hilliard @ 2026-09-07 17:34 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Jernej Skrabec, Lee Jones, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andrew Lunn, Jagielski,
	Jedrzej, Andre Przywara, Chen-Yu Tsai, linux-sunxi, mfd,
	devicetree, linux-kernel, Krzysztof Kozlowski

On Mon, Sep 7, 2026 at 11:19 AM Conor Dooley <conor@kernel.org> wrote:
>
> On Sun, Sep 06, 2026 at 04:30:46PM -0600, James Hilliard wrote:
> > The AC200 is an I2C-controlled mixed-signal companion IC containing
> > audio, video, RTC and Fast Ethernet PHY functions.
> >
> > Describe the parent device and its shared input clock together with the
> > audio codec and TV encoder child nodes. Keep their analog supplies on the
> > function consumers and describe the TV encoder display graph and optional
> > bandgap calibration cell.
> >
> > Add the shared interrupt-controller properties and interrupt numbers used
> > by the TV encoder. The Ethernet PHY is represented by a PHY package on its
> > MDIO bus, with a phandle back to this device for access to the package
> > control registers, so it does not require an MFD child node.
> >
> > Keep the INTB connection and TV encoder interrupt optional, including when
> > the TV encoder is enabled. Cable detection status is readable over I2C
> > without an interrupt. If a TV encoder interrupt is described, require the
> > parent interrupt domain and its upstream connection. Include examples
> > with and without INTB connected.
> >
> > The input clock must run at 24 or 27 MHz when the Ethernet PHY is used,
> > matching the rates encoded by its documented clock selector.
>
> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>
> This should have been dropped when you merged the patches.

Oh, forgot to do that.

> Not sure why you sent v10 without waiting for a reply from me on the v9.

I had figured I had enough pending fixes(i.e. sashiko reported issues and
combining the patches) that it made sense to spin an updated series.

>
> Thanks,
> Conor.
>
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> > Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> > ---
> >  .../devicetree/bindings/mfd/x-powers,ac200.yaml    | 231 +++++++++++++++++++++
> >  MAINTAINERS                                        |   8 +
> >  include/dt-bindings/mfd/x-powers,ac200.h           |  13 ++
> >  3 files changed, 252 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml b/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
> > new file mode 100644
> > index 000000000000..0f2e6922fc4f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
> > @@ -0,0 +1,231 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mfd/x-powers,ac200.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: X-Powers AC200 mixed-signal IC
> > +
> > +maintainers:
> > +  - James Hilliard <james.hilliard1@gmail.com>
> > +  - Jernej Skrabec <jernej.skrabec@gmail.com>
> > +
> > +description:
> > +  The AC200 is a mixed-signal companion IC containing audio, video, RTC and
> > +  Fast Ethernet PHY functions. Its control registers are accessed over I2C.
> > +
> > +properties:
> > +  compatible:
> > +    const: x-powers,ac200
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    maxItems: 1
> > +    description:
> > +      AC200 input clock. When using the Ethernet PHY, its configured rate must
> > +      be 24 or 27 MHz, matching the rates encoded by the documented EPHY clock
> > +      selector.
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +    description:
> > +      The shared open-drain INTB output for the TV encoder, Ethernet PHY and
> > +      RTC interrupts. Omit when INTB is not connected.
> > +
> > +  interrupt-controller: true
> > +
> > +  '#interrupt-cells':
> > +    const: 1
> > +    description:
> > +      The interrupt number, as defined in
> > +      include/dt-bindings/mfd/x-powers,ac200.h.
> > +
> > +  codec:
> > +    type: object
> > +    $ref: /schemas/sound/dai-common.yaml#
> > +    unevaluatedProperties: false
> > +
> > +    properties:
> > +      compatible:
> > +        const: x-powers,ac200-codec
> > +
> > +      '#sound-dai-cells':
> > +        const: 0
> > +
> > +      ac-ldoin-supply:
> > +        description: The 3.3 V supply for the audio codec LDO input.
> > +
> > +    required:
> > +      - compatible
> > +      - '#sound-dai-cells'
> > +      - ac-ldoin-supply
> > +
> > +  tv-encoder:
> > +    type: object
> > +    additionalProperties: false
> > +
> > +    properties:
> > +      compatible:
> > +        const: x-powers,ac200-tve
> > +
> > +      interrupts:
> > +        maxItems: 1
> > +        description:
> > +          Cable detection interrupt routed through the AC200 interrupt
> > +          controller. Omit when INTB is not connected. Cable detection status
> > +          can also be read over I2C without an interrupt.
> > +
> > +      tv-vcc-supply:
> > +        description: The 3.3 V supply for the composite-video DAC.
> > +
> > +      nvmem-cells:
> > +        maxItems: 1
> > +
> > +      nvmem-cell-names:
> > +        items:
> > +          - const: bandgap
> > +
> > +      ports:
> > +        $ref: /schemas/graph.yaml#/properties/ports
> > +
> > +        properties:
> > +          port@0:
> > +            $ref: /schemas/graph.yaml#/properties/port
> > +            description: Input from the display pipeline, carrying CCIR656.
> > +
> > +          port@1:
> > +            $ref: /schemas/graph.yaml#/properties/port
> > +            description: Output to the composite-video connector.
> > +
> > +        required:
> > +          - port@0
> > +          - port@1
> > +
> > +    required:
> > +      - compatible
> > +      - tv-vcc-supply
> > +      - ports
> > +
> > +    dependencies:
> > +      nvmem-cells: [ nvmem-cell-names ]
> > +      nvmem-cell-names: [ nvmem-cells ]
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - clocks
> > +
> > +allOf:
> > +  - if:
> > +      properties:
> > +        tv-encoder:
> > +          anyOf:
> > +            - required: [ interrupts ]
> > +            - required: [ interrupts-extended ]
> > +      required:
> > +        - tv-encoder
> > +    then:
> > +      required:
> > +        - interrupts
> > +        - interrupt-controller
> > +        - '#interrupt-cells'
> > +
> > +dependencies:
> > +  interrupt-controller: [ '#interrupt-cells', interrupts ]
> > +  '#interrupt-cells': [ interrupt-controller ]
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    #include <dt-bindings/mfd/x-powers,ac200.h>
> > +
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        mixed-signal@10 {
> > +            compatible = "x-powers,ac200";
> > +            reg = <0x10>;
> > +            clocks = <&pwm 5>;
> > +            interrupt-parent = <&pio>;
> > +            interrupts = <1 20 IRQ_TYPE_LEVEL_LOW>;
> > +            interrupt-controller;
> > +            #interrupt-cells = <1>;
> > +
> > +            codec {
> > +                compatible = "x-powers,ac200-codec";
> > +                #sound-dai-cells = <0>;
> > +                ac-ldoin-supply = <&reg_aldo2>;
> > +            };
> > +
> > +            tv-encoder {
> > +                compatible = "x-powers,ac200-tve";
> > +                interrupts = <AC200_IRQ_TVE>;
> > +                tv-vcc-supply = <&reg_aldo2>;
> > +
> > +                ports {
> > +                    #address-cells = <1>;
> > +                    #size-cells = <0>;
> > +
> > +                    port@0 {
> > +                        reg = <0>;
> > +
> > +                        tve_in: endpoint {
> > +                            remote-endpoint = <&tcon_out_tve>;
> > +                        };
> > +                    };
> > +
> > +                    port@1 {
> > +                        reg = <1>;
> > +
> > +                        tve_out: endpoint {
> > +                            remote-endpoint = <&composite_in>;
> > +                        };
> > +                    };
> > +                };
> > +            };
> > +        };
> > +    };
> > +  - |
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        mixed-signal@10 {
> > +            compatible = "x-powers,ac200";
> > +            reg = <0x10>;
> > +            clocks = <&pwm 5>;
> > +            /* INTB is not connected. */
> > +
> > +            tv-encoder {
> > +                compatible = "x-powers,ac200-tve";
> > +                tv-vcc-supply = <&reg_aldo2>;
> > +
> > +                ports {
> > +                    #address-cells = <1>;
> > +                    #size-cells = <0>;
> > +
> > +                    port@0 {
> > +                        reg = <0>;
> > +
> > +                        endpoint {
> > +                            remote-endpoint = <&tcon_out_tve>;
> > +                        };
> > +                    };
> > +
> > +                    port@1 {
> > +                        reg = <1>;
> > +
> > +                        endpoint {
> > +                            remote-endpoint = <&composite_in>;
> > +                        };
> > +                    };
> > +                };
> > +            };
> > +        };
> > +    };
> > +...
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 3a19da74d00c..1b1dd57cc419 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -29504,6 +29504,14 @@ F:   drivers/net/wwan/
> >  F:   include/linux/wwan.h
> >  F:   include/uapi/linux/wwan.h
> >
> > +X-POWERS AC200 DRIVERS
> > +M:   Jernej Skrabec <jernej.skrabec@gmail.com>
> > +M:   James Hilliard <james.hilliard1@gmail.com>
> > +L:   linux-sunxi@lists.linux.dev
> > +S:   Maintained
> > +F:   Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml
> > +F:   include/dt-bindings/mfd/x-powers,ac200.h
> > +
> >  X-POWERS AXP288 PMIC DRIVERS
> >  M:   Hans de Goede <hansg@kernel.org>
> >  S:   Maintained
> > diff --git a/include/dt-bindings/mfd/x-powers,ac200.h b/include/dt-bindings/mfd/x-powers,ac200.h
> > new file mode 100644
> > index 000000000000..cc59e2ab4912
> > --- /dev/null
> > +++ b/include/dt-bindings/mfd/x-powers,ac200.h
> > @@ -0,0 +1,13 @@
> > +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> > +/*
> > + * Interrupt numbers of the X-Powers AC200 interrupt controller.
> > + */
> > +
> > +#ifndef _DT_BINDINGS_MFD_X_POWERS_AC200_H
> > +#define _DT_BINDINGS_MFD_X_POWERS_AC200_H
> > +
> > +#define AC200_IRQ_TVE                        0
> > +#define AC200_IRQ_EPHY                       1
> > +#define AC200_IRQ_RTC                        2
> > +
> > +#endif /* _DT_BINDINGS_MFD_X_POWERS_AC200_H */
> >
> > --
> > 2.53.0
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200
  2026-09-07 17:34     ` James Hilliard
@ 2026-09-07 17:56       ` Conor Dooley
  0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2026-09-07 17:56 UTC (permalink / raw)
  To: James Hilliard
  Cc: Jernej Skrabec, Lee Jones, Arnd Bergmann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andrew Lunn, Jagielski,
	Jedrzej, Andre Przywara, Chen-Yu Tsai, linux-sunxi, mfd,
	devicetree, linux-kernel, Krzysztof Kozlowski

[-- Attachment #1: Type: text/plain, Size: 1974 bytes --]

On Mon, Sep 07, 2026 at 11:34:05AM -0600, James Hilliard wrote:
> On Mon, Sep 7, 2026 at 11:19 AM Conor Dooley <conor@kernel.org> wrote:
> >
> > On Sun, Sep 06, 2026 at 04:30:46PM -0600, James Hilliard wrote:
> > > The AC200 is an I2C-controlled mixed-signal companion IC containing
> > > audio, video, RTC and Fast Ethernet PHY functions.
> > >
> > > Describe the parent device and its shared input clock together with the
> > > audio codec and TV encoder child nodes. Keep their analog supplies on the
> > > function consumers and describe the TV encoder display graph and optional
> > > bandgap calibration cell.
> > >
> > > Add the shared interrupt-controller properties and interrupt numbers used
> > > by the TV encoder. The Ethernet PHY is represented by a PHY package on its
> > > MDIO bus, with a phandle back to this device for access to the package
> > > control registers, so it does not require an MFD child node.
> > >
> > > Keep the INTB connection and TV encoder interrupt optional, including when
> > > the TV encoder is enabled. Cable detection status is readable over I2C
> > > without an interrupt. If a TV encoder interrupt is described, require the
> > > parent interrupt domain and its upstream connection. Include examples
> > > with and without INTB connected.
> > >
> > > The input clock must run at 24 or 27 MHz when the Ethernet PHY is used,
> > > matching the rates encoded by its documented clock selector.
> >
> > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> >
> > This should have been dropped when you merged the patches.
> 
> Oh, forgot to do that.
> 
> > Not sure why you sent v10 without waiting for a reply from me on the v9.
> 
> I had figured I had enough pending fixes(i.e. sashiko reported issues and
> combining the patches) that it made sense to spin an updated series.

Please don't, it leads to fragmented discussions and missed comments.

Thanks,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-07 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-06 22:30 [PATCH v10 0/2] mfd: add X-Powers AC200 support James Hilliard
2026-09-06 22:30 ` [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200 James Hilliard
2026-09-07 17:19   ` Conor Dooley
2026-09-07 17:34     ` James Hilliard
2026-09-07 17:56       ` Conor Dooley
2026-09-06 22:30 ` [PATCH v10 2/2] mfd: ac200: Add X-Powers AC200 support James Hilliard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®