From nobody Sat Sep 26 01:04:54 2026 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C9E53C8713 for ; Sun, 6 Sep 2026 22:31:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788733862; cv=none; b=Y8J445t4DwC67pt5GgzL6GEI6dNhjvQAZbRrXIB3++SAyOHqvnimiFNp1hRSH3Ryrnb1di5i40O7TpT3GUvXHR8qpKNGZN5tH7hiWRKp3VPpPoJplG2suou2zWDvZ1Pucezo1b6D2lt+C7toF27YHF+t0AGsuoX6HDYgENM6iQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788733862; c=relaxed/simple; bh=OGsCagdTQ+zJAJGqKzDMI7cJBz71EXy5YSri/vMsPgU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nQ3QX7tV9id+uP4HUaWDFtJMEUG3Vc44MfgAI+VdRTlOjbTranCTQg70rp47nVs3+yCeed8lPtKb4mIx546KSxSoFTFn0YmaCV19hEw9vnIUkOYQkleDxmuZR3KGqAc+mu1o/MJFpnCzblkrBqdEO043VQOcW+SJyjRUWANmDUs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=V9WaMXgT; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V9WaMXgT" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-4ab8cb2a6e4so2170396b6e.0 for ; Sun, 06 Sep 2026 15:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788733859; x=1789338659; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=CukfHUjzOJRi0Y8QjR8TlAI+njW1u2VLACWncIjF8WU=; b=V9WaMXgTTbpq2zRfJPDPv0+2VtY03XWUnx2fMaWdxdTWUiOvgEoTj/p/a2vgJzWFOK pU4MgfofsnLAZ/SaVHCFVK+h8oO4+Q7fyHU6Ho34WaysJ1szTPpKHXu7pabk3eYZW4E8 QS1zp+qdd05lQhCu+JkcCxHpuQEB4bxO54v9HIczHVNKfThz6uaTTYMMoTkroGiPlgJq AX6wfGPCty7E4YwsqTZ65gB4dVWiJJHwr1n2c9Wi226TeGrYJ2wm7aUkHdQ5ol87YUO9 zjqyd6/RR+T7YkQkG0IxI+c+HjvDVVHKOC0mtLIKXNQim/qK0UcJ6c+I4DBZJoN2WqpJ SImA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788733859; x=1789338659; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CukfHUjzOJRi0Y8QjR8TlAI+njW1u2VLACWncIjF8WU=; b=SQohXg2/nTLq8Yr4O1VUkXTRTQzU68nrJXij2OqAqctD4elMjpuzZp08l2weh+nmsV HEQsuJKqgf7kVuvBnudk3IawpyZ3HczdZYZ0jKcYkfnTqRz8mXGb72hXSqJGyQVPd1mp meBWZxvDIB29s5cWA8M8DBcoU11aKVcRXcgTOxnKm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IcmJYiPD7 NTuxjNNe4j+2xI7J9VBs= X-Received: by 2002:a05:6808:e8c7:20b0:4bc:3b8f:2a38 with SMTP id 5614622812f47-4bc3b8f4076mr1825276b6e.43.1788733858893; Sun, 06 Sep 2026 15:30:58 -0700 (PDT) Received: from [127.0.1.1] (184-96-151-165.hlrn.qwest.net. [184.96.151.165]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4b970d200fesm8701910b6e.3.2026.09.06.15.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2026 15:30:58 -0700 (PDT) From: James Hilliard Date: Sun, 06 Sep 2026 16:30:46 -0600 Subject: [PATCH v10 1/2] dt-bindings: mfd: x-powers: Add AC200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260906-submit-ac200-mfd-v10-1-f522e8dc2bd4@gmail.com> References: <20260906-submit-ac200-mfd-v10-0-f522e8dc2bd4@gmail.com> In-Reply-To: <20260906-submit-ac200-mfd-v10-0-f522e8dc2bd4@gmail.com> 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@lists.linux.dev, mfd@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.15.2 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 Signed-off-by: Jernej Skrabec Signed-off-by: James Hilliard --- .../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/Do= cumentation/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 + - Jernej Skrabec + +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 c= lock + selector. + + interrupts: + maxItems: 1 + description: + The shared open-drain INTB output for the TV encoder, Ethernet PHY a= nd + 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 sta= tus + 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 + #include + + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + mixed-signal@10 { + compatible =3D "x-powers,ac200"; + reg =3D <0x10>; + clocks =3D <&pwm 5>; + interrupt-parent =3D <&pio>; + interrupts =3D <1 20 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells =3D <1>; + + codec { + compatible =3D "x-powers,ac200-codec"; + #sound-dai-cells =3D <0>; + ac-ldoin-supply =3D <®_aldo2>; + }; + + tv-encoder { + compatible =3D "x-powers,ac200-tve"; + interrupts =3D ; + tv-vcc-supply =3D <®_aldo2>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + tve_in: endpoint { + remote-endpoint =3D <&tcon_out_tve>; + }; + }; + + port@1 { + reg =3D <1>; + + tve_out: endpoint { + remote-endpoint =3D <&composite_in>; + }; + }; + }; + }; + }; + }; + - | + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + mixed-signal@10 { + compatible =3D "x-powers,ac200"; + reg =3D <0x10>; + clocks =3D <&pwm 5>; + /* INTB is not connected. */ + + tv-encoder { + compatible =3D "x-powers,ac200-tve"; + tv-vcc-supply =3D <®_aldo2>; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + + endpoint { + remote-endpoint =3D <&tcon_out_tve>; + }; + }; + + port@1 { + reg =3D <1>; + + endpoint { + remote-endpoint =3D <&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 =20 +X-POWERS AC200 DRIVERS +M: Jernej Skrabec +M: James Hilliard +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 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 */ --=20 2.53.0 From nobody Sat Sep 26 01:04:54 2026 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6227A3C5550 for ; Sun, 6 Sep 2026 22:31:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788733863; cv=none; b=LsZTb47I4xoZZSLWGszv2mT7uaUl9tsbYNplNZnhWAo679rcppBhz69kcxhPC/cfaTqlNGXEgLkx2qxrtnp34fWnJpNQGCg937MgOtnv+DNF3aqKLRn1lnQxoBHUgB1k9uVTX/2p9WFhddOQ2LhjBzFXNUepLKM4Mw8cD43G02E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788733863; c=relaxed/simple; bh=os/NIfl1ccq6gUHp5OfT9qtp40l8U56ofBPUWhCh9Lg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sbBxZUHB32WhURD1xN7Gym+y0SDdig8zBOoDRdNEDwtNTTQrB8Tx5CnqAPYymw64Yzj0J6sZ3d/8Gtm0jTdkDfiL9nlB/+o3jFXJzdXqIDVj46Bp4aEOTh++KTq+aibqrEvEfwcgUKttAKW28VsdWb2Y+kQzN+GaMJSieYIvu6k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gETbhrkv; arc=none smtp.client-ip=209.85.167.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gETbhrkv" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-4b333de9451so2920714b6e.3 for ; Sun, 06 Sep 2026 15:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788733860; x=1789338660; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=AsJq6AK24wZ1N9wcHHbuy2vFWyU6KtPM7MjpT9Bw5M8=; b=gETbhrkvY9WIn/aN1/CrN70C0RJr/defGxYug84DeXxkr28REUOsXLDGvTnpTOM6Fb Qg+CBe6aDoYk+aeapl2d+tCcIFERraZvYQbpJQKcDY5+S5TMpSQAjGs1aT82gxDeXIkX PcQh0Sb31Fzsv9WYkO+A/0ZAH/zt8f4SahrobpXoxuXS4SH050Z0OsMPbamgq+ehhnTf SSyIqB849wDDVXZpGzXNrgsJKao0mlGs36Epr8QEKtdL9tVL/SHlMnMXPHQr2YI4fPJh Lq6OlqgySChzaJ+Y8mXL3KTb2to3E+n1UlIWnL4G85n1J8HZNy7lRRpL5owAzNTpl7eH Cdtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788733860; x=1789338660; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=AsJq6AK24wZ1N9wcHHbuy2vFWyU6KtPM7MjpT9Bw5M8=; b=jbrg47jww4edyrFw25Hnj9ZR63RqaW/VJGOV63AX0QbVLtFSMoeimtCyG9Uf/I1//F YNa8yeBii3I6SE+p//lkq+jixeBmrHWf3HWos76akgrWKPY4v3tO72gxy+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FE/ERKQMJ5SlZouNbF2ebbpJkCNi2MDXweFldY7QNel4tAc8rtBZRY GAa/EcM4WZMEeLtDNIOo= X-Received: by 2002:a05:6808:f90:b0:4b9:e6ab:d07d with SMTP id 5614622812f47-4b9e6abd4e7mr8544835b6e.29.1788733860184; Sun, 06 Sep 2026 15:31:00 -0700 (PDT) Received: from [127.0.1.1] (184-96-151-165.hlrn.qwest.net. [184.96.151.165]) by smtp.gmail.com with ESMTPSA id 5614622812f47-4b970d200fesm8701910b6e.3.2026.09.06.15.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2026 15:30:59 -0700 (PDT) From: James Hilliard Date: Sun, 06 Sep 2026 16:30:47 -0600 Subject: [PATCH v10 2/2] mfd: ac200: Add X-Powers AC200 support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260906-submit-ac200-mfd-v10-2-f522e8dc2bd4@gmail.com> References: <20260906-submit-ac200-mfd-v10-0-f522e8dc2bd4@gmail.com> In-Reply-To: <20260906-submit-ac200-mfd-v10-0-f522e8dc2bd4@gmail.com> 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@lists.linux.dev, mfd@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.15.2 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 Signed-off-by: Andre Przywara Signed-off-by: James Hilliard --- 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 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 =20 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. =20 +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) +=3D da9052-spi.o obj-$(CONFIG_MFD_DA9052_I2C) +=3D da9052-i2c.o =20 obj-$(CONFIG_MFD_AC100) +=3D ac100.o +obj-$(CONFIG_MFD_AC200) +=3D ac200.o obj-$(CONFIG_MFD_AXP20X) +=3D axp20x.o obj-$(CONFIG_MFD_AXP20X_I2C) +=3D axp20x-i2c.o obj-$(CONFIG_MFD_AXP20X_RSB) +=3D 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 + * Copyright (C) 2026 James Hilliard + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#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[] =3D { + { + .range_max =3D AC200_MAX_REG, + .selector_reg =3D AC200_TWI_REG_ADDR_H, + .selector_mask =3D 0xff, + .window_len =3D 256, + }, +}; + +/* + * Each AC200 sub-block can reset independently, invalidating its register + * contents without regmap's knowledge. Cache only the common page selecto= r; + * this avoids a selector read-modify-write for every access on the same p= age + * without ever returning stale functional-register values. + */ +static bool ac200_volatile_reg(struct device *dev, unsigned int reg) +{ + return reg !=3D AC200_TWI_REG_ADDR_H; +} + +static const struct regmap_config ac200_regmap_config =3D { + .name =3D "ac200", + .reg_bits =3D 8, + .reg_stride =3D 2, + .val_bits =3D 16, + .ranges =3D ac200_range_cfg, + .num_ranges =3D ARRAY_SIZE(ac200_range_cfg), + .max_register =3D AC200_MAX_REG, + .volatile_reg =3D ac200_volatile_reg, + .cache_type =3D REGCACHE_MAPLE, +}; + +static const struct regmap_irq ac200_irqs[] =3D { + 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 =3D { + .name =3D "ac200", + .status_base =3D AC200_SYS_IRQ_STATUS_REG, + .unmask_base =3D AC200_SYS_IRQ_ENABLE_REG, + .num_regs =3D 1, + .irqs =3D ac200_irqs, + .num_irqs =3D ARRAY_SIZE(ac200_irqs), +}; + +static const struct mfd_cell ac200_cells[] =3D { + { + .name =3D "ac200-codec", + .of_compatible =3D "x-powers,ac200-codec", + }, { + .name =3D "ac200-tve", + .of_compatible =3D "x-powers,ac200-tve", + }, +}; + +static void ac200_disable_intb(void *data) +{ + struct regmap *regmap =3D data; + int ret; + + ret =3D 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 i= rq) +{ + struct regmap_irq_chip_data *irq_data; + unsigned int trigger; + u16 value =3D 0; + int ret; + + trigger =3D irq_get_trigger_type(irq); + if (trigger =3D=3D IRQ_TYPE_NONE) + trigger =3D IRQ_TYPE_LEVEL_LOW; + + switch (trigger) { + case IRQ_TYPE_LEVEL_HIGH: + value |=3D 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 =3D 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 =3D 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 =3D 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 =3D 0; + unsigned int i; + int ret; + + for (i =3D 0; i < ARRAY_SIZE(ac200_cells); i++) { + const struct mfd_cell *cell =3D &ac200_cells[i]; + struct device_node *child; + + child =3D of_get_compatible_child(dev->of_node, + cell->of_compatible); + if (!child) + continue; + if (of_device_is_available(child)) + cells[num_cells++] =3D *cell; + of_node_put(child); + } + + if (!num_cells) + return 0; + + ret =3D 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 =3D &client->dev; + struct regmap *regmap; + struct clk *clk; + int ret; + + clk =3D 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 =3D 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 =3D 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 =3D regmap_set_bits(regmap, AC200_SYS_CONTROL_REG, + AC200_SYS_CONTROL_CHIP_RESET_DEASSERT); + if (ret) + return ret; + + if (client->irq > 0) { + ret =3D ac200_init_irq(dev, regmap, client->irq); + if (ret) + return ret; + } + + /* AC200 and its children do not perform DMA. */ + dev->coherent_dma_mask =3D 0; + dev->dma_mask =3D &dev->coherent_dma_mask; + + return ac200_add_devices(dev); +} + +static const struct of_device_id ac200_of_match[] =3D { + { .compatible =3D "x-powers,ac200" }, + { } +}; +MODULE_DEVICE_TABLE(of, ac200_of_match); + +static const struct i2c_device_id ac200_i2c_ids[] =3D { + { .name =3D "ac200" }, + { } +}; +MODULE_DEVICE_TABLE(i2c, ac200_i2c_ids); + +static struct i2c_driver ac200_driver =3D { + .driver =3D { + .name =3D "ac200", + .of_match_table =3D ac200_of_match, + }, + .probe =3D ac200_probe, + .id_table =3D ac200_i2c_ids, +}; +module_i2c_driver(ac200_driver); + +MODULE_AUTHOR("Jernej Skrabec "); +MODULE_AUTHOR("James Hilliard "); +MODULE_DESCRIPTION("X-Powers AC200 MFD core driver"); +MODULE_LICENSE("GPL"); --=20 2.53.0