From patchwork Thu Sep 10 00:26:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3259 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 2D6B71C0288 for ; Thu, 10 Sep 2026 02:27:04 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-25762-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-25762-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 888143646D for ; Thu, 10 Sep 2026 00:26:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62E122E7635; Thu, 10 Sep 2026 00:26:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZDwNq6Z3" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 71B5D2DF144 for ; Thu, 10 Sep 2026 00:26:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789000018; cv=none; b=avKL20y+OUrmL2vbfPMwrdvGvrc1ign/57lGhwNncQZl+uqlaQqRjUwCjIF5qcKmytheVfkxwlMoAL2Pguv1oMk2fcIb8MDiooWH8tyuoTZRZiub+WHz2j55RBHZGLtFSDK28PgA8ATyWnzImuWAudMMZIwRH2X7EGkvP3MuSnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789000018; c=relaxed/simple; bh=LUDT1kHiXHBCnePbIaYBUJQHAxuAaQl4Sg3kYNxuzRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N/2g6Qvf3tlUX0Rg4ievTXgdFAszxtYvBo61p2eBUZTP0YBt8nTRou7owPkRm6gmGjbjzeUKEZ3Y7+AlnkaVusZ6Jdflo4lp3gZEWP1y0vC2JKTyVJZkAAgJR1YsyHQslMyjX8OXwvVBfC4i7srP6KzMbNEUfh6qSIFu8r7x8JY= 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=ZDwNq6Z3; arc=none smtp.client-ip=209.85.210.52 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-ot1-f52.google.com with SMTP id 46e09a7af769-7ffa69b7462so2357873a34.3 for ; Wed, 09 Sep 2026 17:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789000014; x=1789604814; 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=eTa0efMcyPx+a3sRs/5/R1BWxQ19AFGAD7UOiV7rwak=; b=ZDwNq6Z3bzvpDR2zuIW8Zmdf3OX3SYSb9AUrtMR/BN32hn1Z+tvRWMAj+HsRtxbzdL 3pAYQl32g1dYtU82dX4aQDvJ3XSKPu3nE3FYcbQEHF3jcbzYzEV8I3T1nnrqhtfPPFtA 4WM4AhynH03kQB5iIirTOuhe5eD+9GRkHfVsWM4SYwfdC7YJtAiPfdVW79bCueiZyKFh 7KEtlLf8bL6QvyaGIs30OEgWikvEjKcgwTDaG3uS8ntANKPVrUtFsWfya0+AIo7fmyxO yPxwduoEgaQZivcBoi2JvNW00E9rwAvamJk+wUkDmXUNZAeTafoczhFtUUfP1/wAja5q N5+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789000014; x=1789604814; 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=eTa0efMcyPx+a3sRs/5/R1BWxQ19AFGAD7UOiV7rwak=; b=VURTfK6EDla+3wqeGqjub2fJCI+E50WncEo9nGiAR/zZsUfX5a0ITp92xfW/p6JDzb xyfK/5Q0DStSsCEDy/+tgwe8CFl3NJCfwd4djTNUupymwo6msaCmYz9TzVe22FNhWrWN 8V2Ajyg4QLFFRKwLBBdUsLIQZqU21vjvw5saR+/+jsu5SPgABB1EYA1ePhPY4bahQ8ck WvjbsmncVbCFMuKPedX6kz9qm+Z1Cr/g2G+/M919VtKNdLaxtkF39Djpp17zht7wOcTK /axAqA1F5l6qK4JLkJijFkQgAY/h6/c4JrNUt4eVhbV/4DP/SdxvyJbuZJqEYvIdfrbj crkA== X-Forwarded-Encrypted: i=1; AKwUvBxb20U7v6TFsp0OPR5qAHiMIHY2sqzrBv1FXJCE/J3ZpPKZbAFgbPx+pkNkilmdodA3vQ8IRq/CBhq0KA==@lists.linux.dev X-Gm-Message-State: AFuF++kHojIfA0KxwSjiqXnez2iEK1P+o+wXC3I0cvkMMHD9a+g83mvU hcImMu6EV9jO59PyOZSK4jJ2NC/vSJ3CirFhXWwJtBS9706nTVbaH8YC X-Gm-Gg: AYBFou0wSpGjWqR3jynBMWcx828DtOB8okQLuZ9qqBo3gGwMd7vEWJYLnAN9sARypuX iB4tVcUxfCx35qqEir6tfqBmzChkhi3wZr3KcV6HEHwrQaBizSlWtwlFujoK4EXDgzawNl8su8s miJVo0hcx/yhMorIa9MAIbGv+8anNDabzbkQSqS49hBq35qqe5I7Y4E6ysgxOZUA5QERkKQSysk ZUOPZKlW6tvX0/FDVpSwK+T6JV6hqcXZknEdEaiy+GK7iEZssMZwY1TLudOGc9bD5UDBjFwxDiW W+pkn26Beo2emswD3g0lxmUA6jfRlYIOhE64qoBthFdan008Lgu5zg87MLlyAy/VzSe2ebFK4Vk ft6050Xfqo/FM2jNQzHwnGNFd/51gYWS4zNjJli68Ry4TPnAITUh6UojBG3czLfnJ9lx+I846te Cq9pnPl8jFoO2DWWWw3k6Gw+C6GTQ2LtviO1P1rfxCLpas4qPfgkrVh9oM+9mGsexe3HbozZxir mDu8OsBwnKkJR7EPsFRg6SNtCPVE/CGpHiGXmjdM4AAU+JcMBEMG8STlO3uJpq7kW98TU4A/6jy nkS2P8A8Os6yw+WW60qWMI8MmVRVtFKUdlDAPXGnzufYMJgSI2+7ZOeNiwl/X52S2k9HMWyZ1KC GVJ++lZUSFW8zqFsDMMHsuVU4/DSsSsBY2h69CBt3 X-Received: by 2002:a05:6830:3509:b0:7dc:c749:ade3 with SMTP id 46e09a7af769-7fa1deab695mr24907263a34.3.1789000014269; Wed, 09 Sep 2026 17:26:54 -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 46e09a7af769-7fe2fbf5db8sm10182789a34.25.2026.09.09.17.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 17:26:53 -0700 (PDT) From: James Hilliard Date: Wed, 09 Sep 2026 18:26:50 -0600 Subject: [PATCH v12 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: <20260909-submit-ac200-mfd-v12-1-a44d6bc30a4f@gmail.com> References: <20260909-submit-ac200-mfd-v12-0-a44d6bc30a4f@gmail.com> In-Reply-To: <20260909-submit-ac200-mfd-v12-0-a44d6bc30a4f@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, Conor Dooley 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.105.105.114: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)[]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; TAGGED_RCPT(0.00)[dt]; PRECEDENCE_BULK(0.00)[]; RCPT_COUNT_TWELVE(0.00)[16]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; MID_RHS_MATCH_FROM(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from]; TAGGED_FROM(0.00)[bounces-25762-noreply=patchwork.local]; FREEMAIL_TO(0.00)[gmail.com,kernel.org,arndb.de]; MIME_TRACE(0.00)[0:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 2D6B71C0288 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 shared input clock, audio DAI, TV encoder display graph and optional bandgap calibration in one parent node. The codec and TV encoder do not need separate firmware nodes. AC_LDOIN and TV_VCC are distinct 3.3 V supply inputs. Describe them separately without requiring different external regulators. Require the audio supply when the DAI is described and the video supply when the display graph is present, while allowing PHY-only configurations. Describe the optional shared INTB connection without an internal interrupt domain. Cable detection status remains readable over I2C when INTB is not connected. Include wired and unwired examples. 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. It therefore does not require an MFD child node. 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. Co-developed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Signed-off-by: James Hilliard Reviewed-by: Conor Dooley --- .../devicetree/bindings/mfd/x-powers,ac200.yaml | 168 +++++++++++++++++++++ MAINTAINERS | 7 + 2 files changed, 175 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..75dafa7c1071 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/x-powers,ac200.yaml @@ -0,0 +1,168 @@ +# 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. + The audio codec and TV encoder are described by properties of this node. + The Ethernet PHY is described separately on its MDIO bus. + +allOf: + - $ref: /schemas/sound/dai-common.yaml# + +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, level-triggered, open-drain INTB output for the TV encoder, + Ethernet PHY and RTC interrupts. Omit when INTB is not connected. TV + encoder cable detection status can also be read over I2C without an + interrupt. + + '#sound-dai-cells': + const: 0 + + ac-ldoin-supply: + description: + The 3.3 V supply connected to the AC_LDOIN pin for the audio codec LDO + input. This may be the same regulator as tv-vcc-supply. + + tv-vcc-supply: + description: + The 3.3 V supply connected to the TV_VCC pin for the composite-video + DAC. This may be the same regulator as ac-ldoin-supply. + + nvmem-cells: + maxItems: 1 + description: TV encoder bandgap calibration. + + nvmem-cell-names: + items: + - const: bandgap + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Input to the TV encoder, carrying CCIR656. + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output to the composite-video connector. + + required: + - port@0 + - port@1 + +required: + - compatible + - reg + - clocks + +dependencies: + '#sound-dai-cells': [ ac-ldoin-supply ] + ports: [ tv-vcc-supply ] + nvmem-cells: [ nvmem-cell-names ] + nvmem-cell-names: [ nvmem-cells ] + +unevaluatedProperties: false + +examples: + - | + #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>; + #sound-dai-cells = <0>; + ac-ldoin-supply = <®_aldo2>; + 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-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..419340093c9b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -29504,6 +29504,13 @@ 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 + X-POWERS AXP288 PMIC DRIVERS M: Hans de Goede S: Maintained From patchwork Thu Sep 10 00:26:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3258 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 990E81C0288 for ; Thu, 10 Sep 2026 02:27:02 +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-25763-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-25763-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 3F89860FB4D for ; Thu, 10 Sep 2026 00:27:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAA7F2E7F2C; Thu, 10 Sep 2026 00:26:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pCa+ciKA" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 B5D7C2EEE65 for ; Thu, 10 Sep 2026 00:26:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789000018; cv=none; b=XRdmCGIlRtFVtaemTQ5j2CP8TGkFfn5xIpAKL6trwE6y3vWb6b7NQOtKYyhVoZ1x5p/myA5S3ZWUn2fkSEiqWGgXLwXaeIHtTJMYm3WtuqDC3x7YBXtvW8Ifgk0VT5ejzOjR/TYcbJkiE+GVGYOoDZij9ciPX+17rCtp3KvZjwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789000018; c=relaxed/simple; bh=FW5SV01EPHNg3l3FrgB1ILkB0Ify9YcERXPtAQCkkMw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=i+5/mYpci4EKHKsc7z/oRM2Ok6oWZjM30c57SqyY7/MfwuK2WtAIlz46KHhdS1oFrZPfMrxO6SlVkdrysyaiSNcwI+Fi96qaY7KQuhGGOytAUXMIf0DVen6nrFLm8vNpak7xdSY1Kz51voUy/fESAvIVpcLdRe3AYY2WbdkuXEk= 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=pCa+ciKA; arc=none smtp.client-ip=209.85.210.53 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-ot1-f53.google.com with SMTP id 46e09a7af769-7f64ea07036so5836724a34.0 for ; Wed, 09 Sep 2026 17:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789000015; x=1789604815; 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=Q+4sP2C3v2ZdGguoW3qixGSWTMWMqlk3YkqM2/qh2KM=; b=pCa+ciKAA5+F/Qqx0faf0qz9xFBPrcG47uY2ah+21WGMQSzpNqYaJD2otbFY69ZLMM KXUd5AGl9MHjQ6UnlIwNjAAuerq8DH6PW61PdfOFxg9rCsD3koIklhXqwIEUucy4+qR+ +k3O02gjPr6dxw9Jic5MJFMmKXo+ZKLgWypa52bNNa+BhCdrVbGN/fwyV0i+8dlq0s7C dKPEQMBKvXa+Kehqr8DGz402JtmqA6XbEw8sKbeq2ozfJ4wv4MSukpbSahnUa6CHYMdR UETf/AdBcJaqQQPR7B42gomWhMyWXOvbKdH64TZ1uGgwJ4df4jqHoC0QeVgH8RiGaSZ+ UkJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789000015; x=1789604815; 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=Q+4sP2C3v2ZdGguoW3qixGSWTMWMqlk3YkqM2/qh2KM=; b=tUwdtG4VwtmDSGjDK/QadEn76aAILA6jn/ud0ODN6Af8H//TAsTXi2r8vdOIMMgeoj Fp0aUQNCneX52af1dkvWsIxdCCRLBEImG1ajHfj57dR1beRQf7c0OrG7Q+SVx36JOBW0 IDwCC0z0fxXPRKCiSgP923PmiNx0vFcYvEBno9eufM9NmxZa6wee/MbjNCq/AcOZoaSF 2q62S0NgP1sGY+w4R0L4Lo17VOC+TK54C3F8p/apYR7gHZsatuYHvvB4oiaP1Elw1sas rH6q0wP8rUwfWM7IcwjjjktBQBLiTX38ui4Fq3fZSIJpRrfRK8AmP+KxN+cHOuKxfg6E vv/A== X-Forwarded-Encrypted: i=1; AKwUvBw59HA6N4UJGF1WKTm7wHX3Svk2Nb0EOngepUHWi5rdxkzYHSUz1fPOhodzWLHUczvVOXxMWQ2+OKr7/Q==@lists.linux.dev X-Gm-Message-State: AFuF++mog0ls8uJFmeo1736VYxN/U+RU6mEjMHB0wcCkiY7qCVlOGMk+ gXhyZ/xPySf81aTfudAh5Y3PUubYsYP8QyqJMTCYAQ3oqwZouqQahcn5 X-Gm-Gg: AYBFou1Xu+wSH5THZBIDfgjuWShfFo8l39wDYIEHwbh5JVMm8SxSnZu0dWXXb+fRBi5 GmqH3GEH2t/NtZ4T/mxQ979tBGaM/Iau6A6eD3lqNqXYjWJ5CKvuysb84i5pbC3jYfCyHzSvEpt Unq8Z12pAOvCeXsdCuRpATn/Z6D3DtkPaWgue9mgksJ5tnJ/Rc8EzzGzb4TaS1iFALlBGgokc3E 5qijiaMrv5BKxUqRa+8SwgYCNPEN1lun79aIzoItxFyHuqikHWh9IiVhhxrwKGYFPxeXLjGbjAU fu5e8hXH+pAy6Bkayqctulo2OQ3rBzyq35/t6g/5Px4mSAv3M1n9L4+0Yct2QRNPF7kOF3UmrEp zappk0M2CBvHPWghNg9X3KGCU7I+I6jIcaXcYDyh8P4ltpvtIupI2N4mjxH6L2BwxFUVmhsF+zx POVApdXI/0ioGqh9/bWnLhnDyconzWE8nwy0FPdh53VHgf/cYYK0Wt7Yn19eGqVp7xe2luULq+W Njx9jQC4unlg2m2LiCbJ7aqdK6V6k/59Od+Rlf9S1v2bL3n8QWnaUNt9kpzOFAfY8xXUk7kgNKg 1Z8WoCD6kNti2ZO/ygWQp8SOaXr1YNaZk9K482usYLruqBC+An6WKHo2EvXydAtlTeQQ0d1+ILP BO/+mypU5tP2y1BmVkwuahREsAWVohQ== X-Received: by 2002:a05:6830:6415:b0:7fa:5c49:5251 with SMTP id 46e09a7af769-7fa5c4954demr23897006a34.24.1789000015237; Wed, 09 Sep 2026 17:26:55 -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 46e09a7af769-7fe2fbf5db8sm10182789a34.25.2026.09.09.17.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 17:26:54 -0700 (PDT) From: James Hilliard Date: Wed, 09 Sep 2026 18:26:51 -0600 Subject: [PATCH v12 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: <20260909-submit-ac200-mfd-v12-2-a44d6bc30a4f@gmail.com> References: <20260909-submit-ac200-mfd-v12-0-a44d6bc30a4f@gmail.com> In-Reply-To: <20260909-submit-ac200-mfd-v12-0-a44d6bc30a4f@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 vendor 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 using static MFD cells and automatically assigned platform device IDs. Their firmware properties belong to the parent node. Map their supply lookups to the parent with MFD supply aliases, without assigning separate OF nodes to the cells. When INTB is connected, pass its physical IRQ to the TV encoder cell. Select a cell array without IRQ resources when INTB is absent. No regmap IRQ controller or private IRQ domain is needed. Configure the level-triggered INTB output, defaulting to level-low when the upstream IRQ has no trigger type. Mask all sources before enabling INTB. Function drivers request shared threaded IRQs before enabling their own source, check and clear their own status, and mask their source before freeing the IRQ. Disable INTB after removing the children on failure or removal, while the regmap and clock are still available. 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. Co-developed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Signed-off-by: Andre Przywara Signed-off-by: James Hilliard --- MAINTAINERS | 1 + drivers/mfd/Kconfig | 14 ++++ drivers/mfd/Makefile | 1 + drivers/mfd/ac200.c | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 247 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 419340093c9b..1d03b0060bda 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 X-POWERS AXP288 PMIC DRIVERS M: Hans de Goede diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 857ca3bb0d5b..071cba7c775b 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -205,6 +205,20 @@ 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 + 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..af0d27ff5f45 --- /dev/null +++ b/drivers/mfd/ac200.c @@ -0,0 +1,231 @@ +// 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 + +#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) + +/* 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 char * const ac200_codec_supplies[] = { + "ac-ldoin", +}; + +static const char * const ac200_tve_supplies[] = { + "tv-vcc", +}; + +static const struct resource ac200_tve_resources[] = { + DEFINE_RES_IRQ_NAMED(0, "intb"), +}; + +#define AC200_CELL(_name, _supplies, _resources) \ + { \ + .name = (_name), \ + .parent_supplies = (_supplies), \ + .num_parent_supplies = ARRAY_SIZE(_supplies), \ + .resources = (_resources), \ + .num_resources = MFD_RES_SIZE(_resources), \ + } + +static const struct mfd_cell ac200_cells[] = { + AC200_CELL("ac200-codec", ac200_codec_supplies, NULL), + AC200_CELL("ac200-tve", ac200_tve_supplies, ac200_tve_resources), +}; + +static const struct mfd_cell ac200_noirq_cells[] = { + AC200_CELL("ac200-codec", ac200_codec_supplies, NULL), + AC200_CELL("ac200-tve", ac200_tve_supplies, NULL), +}; + +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) +{ + unsigned int trigger; + u16 value = 0; + int ret; + + trigger = irq_get_trigger_type(irq); + switch (trigger) { + case IRQ_TYPE_LEVEL_HIGH: + value |= AC200_SYS_IRQ_INTB_ACTIVE_HIGH; + break; + case IRQ_TYPE_NONE: + case IRQ_TYPE_LEVEL_LOW: + break; + default: + return dev_err_probe(dev, -EINVAL, + "INTB is level triggered, not type %u\n", + trigger); + } + + /* Mask every source before enabling the shared output. */ + ret = regmap_update_bits(regmap, AC200_SYS_IRQ_ENABLE_REG, + AC200_SYS_IRQ_INTB_ENABLE | + AC200_SYS_IRQ_INTB_ACTIVE_HIGH | + AC200_SYS_IRQ_RTC | AC200_SYS_IRQ_EPHY | + AC200_SYS_IRQ_TVE, value); + if (ret) + return ret; + + /* Children are removed before INTB is disabled and the regmap released. */ + ret = devm_add_action_or_reset(dev, ac200_disable_intb, regmap); + if (ret) + return ret; + + if (trigger == IRQ_TYPE_NONE) { + ret = irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); + if (ret) + return dev_err_probe(dev, ret, "failed to set INTB trigger\n"); + } + + /* + * Function drivers request INTB with IRQF_SHARED | IRQF_ONESHOT before + * enabling their own source. They check and clear their own status and + * mask their source before freeing the IRQ. No IRQ domain is needed. + */ + return regmap_set_bits(regmap, AC200_SYS_IRQ_ENABLE_REG, + AC200_SYS_IRQ_INTB_ENABLE); +} + +static int ac200_probe(struct i2c_client *client) +{ + const struct mfd_cell *cells = ac200_noirq_cells; + unsigned int num_cells = ARRAY_SIZE(ac200_noirq_cells); + 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 vendor 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; + cells = ac200_cells; + num_cells = ARRAY_SIZE(ac200_cells); + } + + /* Function drivers read their firmware properties from the parent. */ + ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, cells, num_cells, + NULL, client->irq, NULL); + if (ret) + return dev_err_probe(dev, ret, "failed to add function devices\n"); + + return 0; +} + +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");