From patchwork Sun Sep 6 22:30:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3210 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 8B9D81C02CA for ; Mon, 7 Sep 2026 00:38:37 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-25647-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-25647-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 19BB53EA63 for ; Sun, 6 Sep 2026 22:31:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C5683C9EFC; Sun, 6 Sep 2026 22:31:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U7mvTQDJ" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (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 3CA673C8731 for ; Sun, 6 Sep 2026 22:31:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788733862; cv=none; b=MA/P2ICbiNYfj6eylbU96Jn3RkSMeWKuLupxrW4ikLufcjP2KClT3z+k2atuqMUeIBuCbNlCgSVwHtDtrXIS/df/9VYBm/ae+rRnvlAaIQ7OYyAyVRAUn60BGk6MnsSaw+a2/I4kgSK0HqPonE9Dm9VjwBznm9LAp+kF+56tWPs= 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=U7mvTQDJ; arc=none smtp.client-ip=209.85.167.172 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 Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-4a45b3f0becso2158681b6e.1 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=lists.linux.dev; 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=U7mvTQDJz0VqSGYgBh49QSgNx1rNB2HbxCyGxnDEzNuJcPhC/8V+vQnm8EpSMK4uls mRAQ9rcXoDNRGy82nuWRh241A96CsYcBTIJHz7vtsG+75ihErVJ+EPwk0LosMJYeIReS UiD3dvOsB33hKqKROvjA9YDQP250mB/ZMPaKYd0LLh74E/9BhjTPfwH2diBZCL2MI7Yd qiQfMOpOPmXuDyKUq9/j8wsCy2LU03v98060YNQPsf+SLH1SMd6A5bCvF328TKi7cJH5 Xu6q5CXIs0iK/EcLDIn+99RWvJAC3+PgrjN0IdDI9mXNxJH2A3vdLBSpIXUTAw5d3kdn zEvQ== 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=W2F0FmCLtiLqnnZNfRpYDrnCqgIQOsmBuRJOb+UZEHLwlmOOmsAbcAR33Q9flWeuuK UaHfkz26cpYtUxtgLH2NulgA0ehjw1/ZyLjAey+ZSD73Ibgg4EQzcG0l+mm635+Dy1Vd QNssAYeWBzgYDW+9sU3LevXOKYunQDocGDFpnPU/LefRcyZln+BWK6nxB+kMhpQUtr2J MPLraB9Kc4EBJB1Qi3dvQGGmjTVNDSIaJQlupX2twKRjde0CZvfWqfzJfKX4Cbeva35n J1ZL8vELy7lroriVRCOgvPLK11Yxf/oSXue/XMlkOitdRv5cOt6A9KSBOl566NXLDPby RA8Q== X-Forwarded-Encrypted: i=1; AKwUvBx01h2mO4pHPz+z/x96+5fztRBbgEHdWu9tsgtmdd53zZGABzmLkAdef1kmKxm6JFG8HIE59xu1eXSnlw==@lists.linux.dev X-Gm-Message-State: AFuF++niOV85sic1C6CrqsAbxXonMuRa1+pJKsTsIDnWZyruvmDTAr7j FVBq23POSQKJKM8/70Pi3A+kb4UahnQzne8tGo6/Ycu2TToxLqqnsrny X-Gm-Gg: AYBFou1EAtQc+GmUMd3BmnVp6yWWzEyYkInwEGNRfZEdqBT3SbYYfSLDMc/TbybkxOJ pBlCXdsW+E12BrndcrvSoG9m6zng9WNrn5QtX0D/GTfrSzSrohoni1ZhNmI2d/vYc4k00KE7Ihl VizPS8E2DyRMEoIZ3dq8YXzxCCoUtVjZQGeQiUgp1JFvoK7SNBoSPAHOzSAoZuD+HvIzrCyToHe JFsrO5hwI8UWRdLSSkSbhdy6+FlINPOTEeKQbCybIAK9uMIMR8R+YnBGfa7I/hrrMIL+K99YxzC Vex8UrmhLKqwl+d8G2iZs/oWNIvkwl/nOYvSjQss0U8hj6WNTCq5LIE+/2Y055Fq947sp/aLKAo q66SR/ZcQsC7bjAwlUS9LbXyISBFyzNLBXEJe7T9SittmKW7NIVar60WGFGF3/Ovikc44LBlFPE 41HG2RGrpRnJhZC8e7N/hbC+pnQkMIXitZluMA8tuCWYaX//b/7Jp5cmPTpgr47IPUaoz9aMb0U vXmIStWNnkqmltN5Vqt+HqThxQ+Ao2LP/9x0bOHbrIxXnWbOKQwRFnHaJEkc5y2fLchmLnvKzg4 2f7slOWXRR/MmPELTrn0wIWFB/lSCvBAIyfvCGstH1ixvyzgA3+oZwpfTqFyH9+JhDNx9x59hZs j+T5DT/1qpwaQh0mVdws= 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-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-1.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.234.253.10:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:rdns,sea.lore.kernel.org:helo]; FORGED_SENDER_MAILLIST(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[dt]; PRECEDENCE_BULK(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; TAGGED_FROM(0.00)[bounces-25647-noreply=patchwork.local]; R_SPF_ALLOW(0.00)[+ip4:172.234.253.10]; FREEMAIL_TO(0.00)[gmail.com,kernel.org,arndb.de]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 8B9D81C02CA X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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/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 + - 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 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 + #include + + 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 = <®_aldo2>; + }; + + tv-encoder { + compatible = "x-powers,ac200-tve"; + interrupts = ; + tv-vcc-supply = <®_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 = <®_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 +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 */ From patchwork Sun Sep 6 22:30:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3209 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id B3FCE1C0295 for ; Mon, 7 Sep 2026 00:31:12 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-25648-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-25648-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 633F0602DE3 for ; Sun, 6 Sep 2026 22:31:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 601B83CC334; Sun, 6 Sep 2026 22:31:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A/GYR33r" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (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 5993A3939A6 for ; Sun, 6 Sep 2026 22:31:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788733863; cv=none; b=dwFMUppJ1u2A6VQu+5m5q705K3S1QzdIzpR7b9UtSbC4VlbNvkEtPuwfvxiHN8641w8X5OitwyIHTHzzQ32d8nkFI8UxzCJ71GF15o6Ad8cXWCPnSNJ5dgOyztc2m9/uXc4JLJRKm4JKQ9mVsDSuUxSmxmGkgBwk2UooBdnbEgw= 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=A/GYR33r; arc=none smtp.client-ip=209.85.167.178 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 Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-4b333de9451so2920715b6e.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=lists.linux.dev; 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=A/GYR33rWOfp26eJvHek3h3sPxLnyvKC9kUIsmaGFmp3gssvGx6e+fJFb5TVdVoXNc 1cQfTvqqZdBBc9pULuP3J1LNPYIM21E8TbgPNG0V9VemH9paBrqP5YHV0cO2p2ain3p1 nB3582QMz8alHAxy1VsYt6oaW0k5Nvafmx4P4hG1fClatnYqAxCsWa6uFwOfQ3rbW28v 3mEm1aKT7pAOnnIALOFd6vx/TcsyZ+dSrqX+0tZGUAsuUywAxPYFqMAzmt0+R+luGSiC t7pT5B936JARwx60/CKipxiLq2x+28c7VFcf5YWlZKR/qzc8dEPK58c3rqtebkJbXSLp iCBA== 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=EVXNbdagsyjTHlcaEx4+YC2PH44VSWJ+eGwh7l/gyZC8nI8MmKsPgUZ/PSZGQACHXN hyf4XmKetS2UzA3YEN6LNXp3ZW2BH6bQI1clM0k+rRzMMpGjjP5QpiTEDDisXktBmi25 S1lgKyUpBgbWCUvrUseNFLkFETiFnfDlVmCxw4VJ7H/V7HWVU5IYoub9j/fV33/KNm2g LqzQaHCvWY+k+BZ/bYYiawIhJhDt0EpvSaIpK4ngM++wSeF6tbyVOR8r4NawCNzPZNYb 5KL7blPhUxF8ClxAUaj5iNW2ecCHrzww8fc2sBIiwfgheqHFVCpi6Pcry23EN3IOsAB4 MqkQ== X-Forwarded-Encrypted: i=1; AKwUvBwhhyOMgnyITV6oOX7buuqAcSEiCYeS6JZKVNNIEwNf6Pkg0gFGBf0l9W2OgJe3QwfVa6icnzTznsho6A==@lists.linux.dev X-Gm-Message-State: AFuF++mo0f/c+CPi8ejsZBCS3DhNLvSstW7RwbpKsJfuz0lvm+0Mxd12 6sdQpNW8DeTJN5k2PiGn2R+LFhaYQpxQVplX4huSPf+lTafBLYa5h7ot X-Gm-Gg: AYBFou2U8S121coJmPGviMuj5NjirfsD/Pn3ixsQY9l1KcKfm6Uu07p/xtl18KYNOxZ meZT/QTT6CYG9S2EXecBJY594NwTs5L9I+5cwjvLvFXWiM0vqoWDrcfUVAqlGSPZkJtPyPMZ1JA Ea7k2z/H5fU3HszOkE7UErebW7ihx6jzqWGBmV5cfA6v4ylpY8dEvaWeU5FSrn67u8o7V4R2SOC WNyUJ1Dbgpk+9zCqZRCsHUOt4ujx0U4QTYTZB5G12voSRrEi9DVmqPBP2IASgStyA2NJ+Z2NEAU A8bd2lDN4vUrEVMWyYM26wf9tU+rF0QL8RCiaUiOnhZiKFIencdaSKa/0yyhw4EYFMPyS1+VyTL if1ov6g/ARUzVX+0X38lY9EFcC8lUtju/zTDWgwJy9HDuWCzDhV2gfbKWn/XXQdAm5ETdGOV77W oJwzyQB8iTk6iYWzMlfXHgHGQUMFKXG/rVZOF5eNyV0uiVd4pUECogMsuDGoJ7NAShk4Ewl8LQU 8Xg8D5Lb9CNaXl2GDFFpy63HbIn00ufLSmwOuhAdzVwFW84oYOn6yhlr/AKsvWzqrw7H03P3SJt v3AEGvz0hwGDGpM4W+/OHFj8cnL/4pt3gcbuqs7wXunnakWiCNCmyh57n5SDHxyjyAj2ds/r9Sg mrMmu2nKjBZ2WVt1mV3A= 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-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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 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 + * 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[] = { + { + .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 "); +MODULE_AUTHOR("James Hilliard "); +MODULE_DESCRIPTION("X-Powers AC200 MFD core driver"); +MODULE_LICENSE("GPL");