From nobody Mon Sep 28 16:22:29 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 765893CC330 for ; Thu, 20 Aug 2026 09:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219695; cv=none; b=aEPcnB6/gqKmAVY30PgtaDwpomuTQp85C05pKwN9mO7TRqb0ez3lWhrx+VxiW5qk8N6AmcFwyFWmSpWdd+QzlMv1MDSuYDLFoOO4jIEgFpAl3ohksfgAuonj4nOJ00Nszu50VxL5bVGwkL3I6OKZlzQM3qhoCtO/QFvpxdqeJi0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219695; c=relaxed/simple; bh=3T8yln3axv45A3E63yV5iqv5FT0WT4juR1sxJuajqpM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SwWtU+1dpupvE7+E9OsiMPKCVStr3Xnz23TAmjNHHw0l7zb3OoAaEtuSrn3NxtGtvsatEJGdtunJYPPoU0x+UHk1ftIAGbqL82Tv9NDigP5oZTbHC33zcIa57LqQUiUTyY5JllOlSFR+lfpM+mUYNyTC2kunVvIylNi+5a1Ln4o= 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=Nw9YnraD; arc=none smtp.client-ip=209.85.128.42 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="Nw9YnraD" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4956242332dso21065515e9.2 for ; Thu, 20 Aug 2026 02:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787219692; x=1787824492; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/1UXKqZasUe2XDRGblEDolDFdvU/QcAgxElvCa/O02w=; b=Nw9YnraDqko5OSw17pCDVqqduESo5iOZ1UYRcweCKk+sFmpgKEr8zJx6d47vRiu6K3 CZb9Y3d4q5P60QXu9IU87mB2wPACQVxkKZSFcktwoC56QaRai1X1kvum5/iOFDK+7GYH reH8tT17TWb1q3D6VvT7AgPllTWre9lSxYP5nzGIb6F8fkfw8suNi+z96k10YVpHHRao QMQRifz8xAG13FosOKSAm3JvVjkMCAsXMPyEhoiHy0+ImSXidiaQQQWB/yDq+sUYrejf WYv3Havmf9f786AqEASdUkBZ7oU7gv82c8Qgxa4ZxdpEFDKDpp58oVIi2JeyuTt7xR/b rX4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787219692; x=1787824492; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=/1UXKqZasUe2XDRGblEDolDFdvU/QcAgxElvCa/O02w=; b=j7xXKnUALZfuUWaADZipiiW5ZpTXXHTC3PMuvOuYuUCQbzyQtVxVySroRGnYQpI6xP VRzO4ylm9gmMdx+Us7p4miP9lj38m9Huvtl5EFk80vStjBCDEKPZvbAt64Tyra31e3Bt zpurQxJ7r7ngPGdF1nm7AlCq3/yXqWRIYCOaWazjq8X1NQQzhcRvOHK83C6uphU1Nx8y nBVnlpiAGUllCO2pA8poziOpX3bEHCJMT/DrTqYFsJSi4xBngcb5UQPfbC3Aix3c08M+ M9I5SVy1CWEG/m8BoW+fb94CuqmyrAQLv65THO6xW1k6ZJPaUnRWYQe8e8qz81yMY978 tbQw== X-Forwarded-Encrypted: i=1; AHgh+RqSjiPLQazt867V4w/ASt8DkFhme6HzEuR1bJhlBSkU/el7LShpyQFpGsnEJ1VkLtXf5yJaR8w7Jt60jhU=@vger.kernel.org X-Gm-Message-State: AOJu0Yzo0B028NooecCNM9oXdLBjX/HTjJj3c21EfaX6EOKBwlvO6tq5 5P0A/qWq3FTARs4x4nGf/9VxWvhwV82e1urJx8Sree0mMX79Vd+AkwKX X-Gm-Gg: AR+sD10tfZOGFt7ona+XspFkO707TV0DM277G7bGghWqKVuEDw/Zs5ZM/a45/sSsmnh CH1ec6zbpC4JQQjeAoUkMeQpVMpMkpJW3n25/CnR2i6ya6+Nlejw0EE5GbPHnZWAtnleRPICgi9 JMjqelsCo2AvGtGWFyk+/1OTR8o4H8KtIdRvJaVwj2JwCPr5GmzXpM4a1jRO0hBnivVjtqty7Zd KF6bqkKy+VXMhXI/3vb+FHWwf9NsgIxdD532VnZb2vq8Wgt4sNi1NSM5dPBUYNPFbuyNeVhM6gV sL/9i9UtJGIuioHLJNCAfE/NTtt9hzV/qFpYmOol8RYqnQVkBJ1Djor2TwPCKYrPIGIM8hDbYtS MwMcAq/WRUrbnEuWd3w8+OoQq/FzlJhEL6vKxcTtSEBR2sbIA3yzZs5mEoOO81FrQpqHykZ4VHB JvGWSZ8pOdZ/2ylZbM4YPCpdWwTTaxB2R6mkq1adcDZQHmPUthNDoyQY0l7qyYW/N3CIHv X-Received: by 2002:a05:600c:a30f:b0:499:b01e:911c with SMTP id 5b1f17b1804b1-499b01e9125mr84541145e9.2.1787219691800; Thu, 20 Aug 2026 02:54:51 -0700 (PDT) Received: from biju.lan ([2a00:23c4:a702:d301:eda0:8ef1:e1ab:c2b1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499aa0d6721sm172069675e9.11.2026.08.20.02.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 02:54:51 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Liam Girdwood , Mark Brown , Philipp Zabel Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v8 1/5] regulator: renesas-usb-vbus-regulator: Rename platform device to rzg2l-vbus-regulator Date: Thu, 20 Aug 2026 10:54:39 +0100 Message-ID: <20260820095448.20930-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> References: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Rename the platform device name from "rzg2l-usb-vbus-regulator" to "rzg2l-vbus-regulator" so that it fits within the platform device ID table's name size restriction, allowing the driver to be converted to use ID table based matching (struct platform_device_id) instead of matching purely on driver name string. Update both the driver name in the regulator driver and the matching platform_device_alloc() call in reset-rzg2l-usbphy-ctrl.c to keep the two in sync. Acked-by: Mark Brown Signed-off-by: Biju Das --- v7->v8: * Collected tag v6->v7: * No change. v6: * New patch --- drivers/regulator/renesas-usb-vbus-regulator.c | 2 +- drivers/reset/reset-rzg2l-usbphy-ctrl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/renesas-usb-vbus-regulator.c b/drivers/regul= ator/renesas-usb-vbus-regulator.c index 9ba791bd72ec..22fcf0d10c85 100644 --- a/drivers/regulator/renesas-usb-vbus-regulator.c +++ b/drivers/regulator/renesas-usb-vbus-regulator.c @@ -58,7 +58,7 @@ static int rzg2l_usb_vbus_regulator_probe(struct platform= _device *pdev) static struct platform_driver rzg2l_usb_vbus_regulator_driver =3D { .probe =3D rzg2l_usb_vbus_regulator_probe, .driver =3D { - .name =3D "rzg2l-usb-vbus-regulator", + .name =3D "rzg2l-vbus-regulator", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, }, }; diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-= rzg2l-usbphy-ctrl.c index f003b360629c..f90fdb7e6ea4 100644 --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c @@ -241,7 +241,7 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_devi= ce *pdev) if (error) goto err_pm_runtime_put; =20 - vdev =3D platform_device_alloc("rzg2l-usb-vbus-regulator", pdev->id); + vdev =3D platform_device_alloc("rzg2l-vbus-regulator", pdev->id); if (!vdev) { error =3D -ENOMEM; goto err_pm_runtime_put; --=20 2.43.0 From nobody Mon Sep 28 16:22:29 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 4CA112DD5F6 for ; Thu, 20 Aug 2026 09:54:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219696; cv=none; b=Kt2zOWaKCKAFChTUBiPkCXLfRpVg1YI8hj8M9mPVkBso4UXwgjKJZEk4YwpSV40YGI5D9MwQNkHhL/0qqzTVY6HMoIXb4YjqEgo5p4ve5ZCq0+2i9AHIoUeix4M0SH5wLfKddg49zUGEc00k2beCn3MhBQGHPhIr4fEdSR8v8CU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219696; c=relaxed/simple; bh=AwEZk7WcowM9wEzT938w9dIDoG3dufLIpfMLw0UeSA8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sN9EfSCOmV6BOH4pGSf+cpuim/lbjuzUleR61f7qwoVzfhmHz2CFWJ8jlmaQ9dUZS++jBBVbiJUoAWVYmVveuZk2GXLH1NXMK1J2FQ1/bS4VhNQDUXKw3T/V72f6Iz3pUjAwBQgBAcd8I6F89KyrZbOt2eicqra4Leb0RC5dKDw= 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=ZS1dLrY9; arc=none smtp.client-ip=209.85.128.43 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="ZS1dLrY9" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-49557167508so21264705e9.1 for ; Thu, 20 Aug 2026 02:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787219692; x=1787824492; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=zypP7Z6zLZJ8h5wgmipgBcVN/JTnM3AivoXK7hNLeNo=; b=ZS1dLrY94aMFDmoeKLQn4scRR/F8nq3moX6NmzNQShDCzFXKPVRmDqDY1NOwpWmI5t QnE8eq2Uw+d/x1QpBZAL2LIXzKoc20Ok6vgW/hAOdhOZEaOZGdqUUyKJoFCpy6quSl0/ aVNmIEU48yNSKfeUuaZV//9mVSyh7+2Q0YWEIvd+IVmgkBi6k0cSRYvZ99csJ8qom+gZ a+S3sDvuN5x4MplehHxjBiqs9NfoWTLdgVfnGbi1bYvsVtKdgTctxolp0DT/SxZ8cJd/ yNXrG0h73vLU5Tnp88KgNCSbI8j3W3b9rlWFBslvPaBDtO5tqf/GYWhwgl/DhBUIn7Vg PVnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787219692; x=1787824492; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=zypP7Z6zLZJ8h5wgmipgBcVN/JTnM3AivoXK7hNLeNo=; b=oM2jTCXXFPGnKwiLODRtbTc/3tzQuLHVgQluQM+7em+G8JTl/pW8rNduc9/af9x+/i utLflJHGi+kGwRO6UK1dhkFALLAXkE3yumHQ7e7oQf22tYkgGcuGtZulXw0D0K1SUMtJ kK0hxn2OUXTpKufReW49tH86vCubEtVvU6vvnGKLAVrDRpBUFtZsEo/zlWsQT2F92Mxw dsxrA6Wp9+BbE54ZM4RxA817BE5PRJcPbT0+J/0mATnysUF1DvukHKnIqp2C5g1n/X2a 1zAMtOhqTBDXwHD3kUXzB0oxN0kcj0/a1bG/OHJTRWdVDYIw5ElaHPS9H/tForyUnGN9 06cw== X-Forwarded-Encrypted: i=1; AHgh+RpTfPKMoQvKJBo9xMNiikhAeGUbnDu6Fxea1kU4kxp3vO1As+5IMZbRCwlvDymOBicaBqIFWoF9cvIsj9k=@vger.kernel.org X-Gm-Message-State: AOJu0YxVbvwXw0NLPDF3QC4xPVvTJ4Fq7HEgLqNDexUvBlaQ2Uxau2Gd D598PQtoPQQzLP373HhGWzz0//T7nHPGufRL1emJqtXWiFyp8FZ5TW6+ X-Gm-Gg: AR+sD10sSFGcm6staBsP0vn5B6h3eSpA1HkcUBGFLqEv7gf1wsRGx+dDDXSEDP0+8Ea ugFr6v2ovKB9npCYeqc/WVhHOUsZiXPbaz8E5KoVhMlCmqJWD8aWlz59WdFrUfevzAQOvQTGF5X EUoH/HXICkxZPVv/hDgo2oLXM7f9RwjvIFUZYYz5nXSp8bJ3FEE73Os9gNQOFDEPNwuY4LykOqF s4765MbPfW0w0nmNqXEN9f5ysTDRWZbYNHFb8oG8AAkidMqoLXQXQ8vshkUkIEBzaoTTbUYeUgk 5MU3Mz59vTeNd+n3RiUiWqTDmR9grwVJ6XlOA0TPkzXAhWo85aXeeINrkWCnaXYWSIrMaQ/JuBG L3N7tlren/9ZZmhdEbi60d70i7cjWx872zOvbAx+Y3KNKbUBX0e8d8Gdj6do08AT8AeEfgb8XjZ VyS4fpEdeNjtoXFXF5UYlX7rT18VlEjezMztZElkjBgpgW+Hp+qPsLKhhSiFHr+9cmDpf3 X-Received: by 2002:a05:600c:6749:b0:495:6274:56c2 with SMTP id 5b1f17b1804b1-499aa1896f1mr209432415e9.2.1787219692369; Thu, 20 Aug 2026 02:54:52 -0700 (PDT) Received: from biju.lan ([2a00:23c4:a702:d301:eda0:8ef1:e1ab:c2b1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499aa0d6721sm172069675e9.11.2026.08.20.02.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 02:54:52 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Philipp Zabel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm Cc: Biju Das , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das , Krzysztof Kozlowski Subject: [PATCH v8 2/5] dt-bindings: reset: renesas,rzg2l-usbphy-ctrl: Document RZ/G3L support Date: Thu, 20 Aug 2026 10:54:40 +0100 Message-ID: <20260820095448.20930-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> References: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Document Renesas RZ/G3L (r9a08g046) USB PHY controller bindings. The RZ/G3L USB PHY block is similar to RZ/G3S but differs in that each port has its own OTG controller, whereas RZ/G3S only has one on port 1. To reflect this, RZ/G3L uses a regulators sub-node with per-port vbus0 and vbus1 entries instead of the single regulator-vbus property used by other compatible SoCs. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Biju Das --- v7->v8: * Collected tag. v6->v7: * Added additionalProperties: false in regulators node. v5->v6: * No change. v4->v5: * Dropped renesas,sysc-pwrrdy for RZ/G3L as pwrrdy signal is modelled as power sequence. * Dropped the tag from Conor due to above change . v3->v4: * No change. v2->v3: * Replaced items->enum * Collected tag. v1->v2: * Updated commit description. * Added enum instead of const in the compatible section. * Dropped regulator1-vbus and added a regulators group node. * Updated schema check. --- .../reset/renesas,rzg2l-usbphy-ctrl.yaml | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/reset/renesas,rzg2l-usbphy-c= trl.yaml b/Documentation/devicetree/bindings/reset/renesas,rzg2l-usbphy-ctr= l.yaml index c83469a1b379..75e034fa7ce7 100644 --- a/Documentation/devicetree/bindings/reset/renesas,rzg2l-usbphy-ctrl.yaml +++ b/Documentation/devicetree/bindings/reset/renesas,rzg2l-usbphy-ctrl.yaml @@ -23,6 +23,7 @@ properties: - renesas,r9a07g054-usbphy-ctrl # RZ/V2L - const: renesas,rzg2l-usbphy-ctrl - const: renesas,r9a08g045-usbphy-ctrl # RZ/G3S + - const: renesas,r9a08g046-usbphy-ctrl # RZ/G3L =20 reg: maxItems: 1 @@ -50,6 +51,29 @@ properties: $ref: /schemas/regulator/regulator.yaml# unevaluatedProperties: false =20 + regulators: + type: object + additionalProperties: false + description: + list of vbus regulators provided by this controller. + + properties: + vbus0: + type: object + description: Port 1 USB VBUS regulator + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + + vbus1: + type: object + description: Port 2 USB VBUS regulator + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + + required: + - vbus0 + - vbus1 + renesas,sysc-pwrrdy: description: The system controller PWRRDY indicates to the USB PHY if the power s= upply @@ -71,7 +95,6 @@ required: - resets - power-domains - '#reset-cells' - - regulator-vbus =20 allOf: - if: @@ -86,6 +109,22 @@ allOf: properties: renesas,sysc-pwrrdy: false =20 + - if: + properties: + compatible: + contains: + const: renesas,r9a08g046-usbphy-ctrl + then: + properties: + regulator-vbus: false + required: + - regulators + else: + properties: + regulators: false + required: + - regulator-vbus + additionalProperties: false =20 examples: --=20 2.43.0 From nobody Mon Sep 28 16:22:29 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 097403DA5B4 for ; Thu, 20 Aug 2026 09:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219698; cv=none; b=ar4bLXJUopHu05Y1Id4gsqxEOuJoPGuArsCQx2t+HNDMudug3CB+z3T3kLQZBfLcLfdNZqEWMo3Vp9MZP8wo5SFPzLD9/uAO3o1Z6jfDaZuwmSMzrNvKRA8CC1n9JkUWylwEMYayt99Al6Qq0jvlVNy8IF3t6XTpbxtXNac23IQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219698; c=relaxed/simple; bh=Be5rlx58c3nKi8wfJHKJ3g+BWcqxfwWPy2Y4nKU+NEk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZCKb7ktG/xf9krS57aLzRBiiuyZIXQPJWaidqqIbkt/3gPYkZf+ZARr5wkHaP6bknjRfTWE0I7AWmEP+VMR9JnErQIo2P02wZA1PbDujymhv3f+n3nRF3t0sgbOCngpG6jmJNKJ9YwvUlgoesUwtG4avJmX3PRorRAmtlF6qzxw= 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=DO2Ab3OF; arc=none smtp.client-ip=209.85.128.47 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="DO2Ab3OF" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-499840a2575so15467865e9.3 for ; Thu, 20 Aug 2026 02:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787219694; x=1787824494; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/ySB0ICIj0lyZt3Kc/3j1HhYWUIAhEIVNas2QeZe4JM=; b=DO2Ab3OFdwX4ewcMD0t3SuSNKD5w9ToBg9HJV/bOB1mnTQB+TvUz/AgTjtsgL8AM+7 42poOmGR4fP9c9Yo+oaL118leejWcw0QgTh/D4DZn/FeH5K0BNNxvMnMP2ATayZHdFjz mAxZGZxBl9BbNG/pLLFaqcLmj6hDAjAdj8RxNe1F6X5ZiSqxjAt3rX4pUdCRMhUwtfzf fHHWSeT99RgPSOKG+QUeeSwGqLad/5e7g/FlBMJeDtG+lYho5cxtY8LmVNwFt9is6hwt VbztKsdgQ8Sgrz3E2kFdOyCYJa4SxE6Dg+CW1AY9MKYNQhTcZCC92ymxr39sy0Q6Eh55 SVBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787219694; x=1787824494; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=/ySB0ICIj0lyZt3Kc/3j1HhYWUIAhEIVNas2QeZe4JM=; b=cpGTOgC9fi5ll0bFD3UoE5vxwi8gB03P743Ji3++5PqY6BSytuRoRiRpg+ppuUDUrk YD6cefDHxX6xi6TNLXAsBEIClIOqAAYNRfdHPSjyY8Wx9Qef+Gi1iIOJHfLJQBDw9Gdf 7JrWAsqg3Atbb2YW4flpoZCErlmcxggiFi5KEQDWViALL/DEdZrpht067aN79nMM7HSR 7Zb30ElMH1oegYxd5Ojo7wjEsXJpKG3PkDYHkBPNhDWUKh8CI/rZmCanPcPZ3OlQFvpP wzCUjY76BXVtWuJJpeSggqq3xJYzWg8M06JTQ5Jr0cW6rM4NUnKH4hDyujinvCO2IeG3 qUqw== X-Forwarded-Encrypted: i=1; AHgh+RoEgC1MRbtq47Yw8rCK/gIGIbjPgtHsFOBVSprXTeJIxzo/EveaefoCAL/1QtB4BbcgYv/3gFb9TVu0Q3Q=@vger.kernel.org X-Gm-Message-State: AOJu0YwOfLS8Dh1tQI2qJvfHdTxdGDbANgexmBQPuXHfftAeKvaghzT8 Vagpe3anheIrY7GYlu0xSsM9N3Og+CoY8rgdcE/carwPGBTwbHHhpKfI X-Gm-Gg: AR+sD10PvtrN/oBxktIDu8OuxfP1LqB7CaaRFMEVWRxOWA7MV96r8PL0AOtTMOyWf8j kkVz/51ARRgNca7jIQ+b+9KZSf3KRFl1URulhLoV2S87/KYLqASnV2H48kQ4vKZbE+azanjDrXG ByKFSfzgfysJ5i2zm0R1NAi5lJ1SgDeoAxm4d97D4YpfSH7oZjvzVNzJt5eoykcM34tZsK6nC1+ 9qz0p7aF+hFeR9mNt73jr/XLLZGGgGrf0xS4eSodE84tTx/Zv06tRSLjAZXalCSuD5C62XYeoiU m2JhlXcCgMQp8dGx8GlZeII37xbxlLRjz4iHuo5uTaS3McWCrYVSXfzGUpHYrdlLAYlST70oDjw 2LnbWh4fe6gUhT3lBZnMH26Mjnkz1qmxLPbdoRJLkRL2gFnz/joWyOFoyP0+wztZlBB7HviDxWg AFYRIJWmwh0o0MA9ga1/V2qvx+2zmCDpQbL7CVuAePUldVTVQeXYEctlhs6f8in51d0Rvs X-Received: by 2002:a05:600c:6990:b0:499:8c68:a3aa with SMTP id 5b1f17b1804b1-499aa1c53bfmr196498425e9.13.1787219693922; Thu, 20 Aug 2026 02:54:53 -0700 (PDT) Received: from biju.lan ([2a00:23c4:a702:d301:eda0:8ef1:e1ab:c2b1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499aa0d6721sm172069675e9.11.2026.08.20.02.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 02:54:52 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Philipp Zabel , Geert Uytterhoeven , Mark Brown , Magnus Damm Cc: Biju Das , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH v8 3/5] reset: rzg2l-usbphy-ctrl: Introduce info struct for match data Date: Thu, 20 Aug 2026 10:54:41 +0100 Message-ID: <20260820095448.20930-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> References: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Replace the integer flag RZG2L_USBPHY_CTRL_PWRRDY with a structured rzg2l_usbphy_ctrl_info type to hold per-compatible configuration data. The new struct currently carries a pwrrdy boolean. The probe function now retrieves this struct via device_get_match_data() and conditionally calls rzg2l_usbphy_ctrl_pwrrdy_init() based on the pwrrdy flag, removing the previous integer cast approach. This refactoring prepares the driver for RZ/G3L (r9a08g046) support, which requires a different regulator configuration with two per-port VBUS regulators. Signed-off-by: Biju Das --- v7->v8: * No change. v6->v7: * No change. v5->v6: * No change. v4->v5: * No change. v3->v4: * Updated the commit description. * Moved the handling of regulator_driver_name to patch #3 in preparation for id_table match. v2->v3: * No change. v1->v2: * Updated commit description. --- drivers/reset/reset-rzg2l-usbphy-ctrl.c | 32 ++++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-= rzg2l-usbphy-ctrl.c index f90fdb7e6ea4..79503f6f4b23 100644 --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c @@ -41,6 +41,10 @@ struct rzg2l_usbphy_ctrl_priv { spinlock_t lock; }; =20 +struct rzg2l_usbphy_ctrl_info { + bool pwrrdy; +}; + #define rcdev_to_priv(x) container_of(x, struct rzg2l_usbphy_ctrl_priv, rc= dev) =20 static int rzg2l_usbphy_ctrl_assert(struct reset_controller_dev *rcdev, @@ -106,14 +110,15 @@ static void rzg2l_usbphy_ctrl_init(struct rzg2l_usbph= y_ctrl_priv *priv) spin_unlock_irqrestore(&priv->lock, flags); } =20 -#define RZG2L_USBPHY_CTRL_PWRRDY 1 +static const struct rzg2l_usbphy_ctrl_info rzg2l_info =3D {}; + +static const struct rzg2l_usbphy_ctrl_info rzg3s_info =3D { + .pwrrdy =3D true, +}; =20 static const struct of_device_id rzg2l_usbphy_ctrl_match_table[] =3D { - { .compatible =3D "renesas,rzg2l-usbphy-ctrl" }, - { - .compatible =3D "renesas,r9a08g045-usbphy-ctrl", - .data =3D (void *)RZG2L_USBPHY_CTRL_PWRRDY - }, + { .compatible =3D "renesas,rzg2l-usbphy-ctrl", .data =3D &rzg2l_info }, + { .compatible =3D "renesas,r9a08g045-usbphy-ctrl", .data =3D &rzg3s_info = }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, rzg2l_usbphy_ctrl_match_table); @@ -153,14 +158,9 @@ static int rzg2l_usbphy_ctrl_pwrrdy_init(struct device= *dev, { struct reg_field field; struct regmap *regmap; - const int *data; u32 args[2]; int ret; =20 - data =3D device_get_match_data(dev); - if ((uintptr_t)data !=3D RZG2L_USBPHY_CTRL_PWRRDY) - return 0; - regmap =3D syscon_regmap_lookup_by_phandle_args(dev->of_node, "renesas,sysc-pwrrdy", ARRAY_SIZE(args), args); @@ -188,6 +188,7 @@ static int rzg2l_usbphy_ctrl_pwrrdy_init(struct device = *dev, =20 static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev) { + const struct rzg2l_usbphy_ctrl_info *info; struct device *dev =3D &pdev->dev; struct rzg2l_usbphy_ctrl_priv *priv; struct platform_device *vdev; @@ -206,9 +207,12 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_dev= ice *pdev) if (IS_ERR(regmap)) return PTR_ERR(regmap); =20 - error =3D rzg2l_usbphy_ctrl_pwrrdy_init(dev, priv); - if (error) - return error; + info =3D device_get_match_data(dev); + if (info->pwrrdy) { + error =3D rzg2l_usbphy_ctrl_pwrrdy_init(dev, priv); + if (error) + return error; + } =20 priv->rstc =3D devm_reset_control_get_exclusive(&pdev->dev, NULL); if (IS_ERR(priv->rstc)) --=20 2.43.0 From nobody Mon Sep 28 16:22:29 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 5A4353DAAC0 for ; Thu, 20 Aug 2026 09:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219700; cv=none; b=U+QIVcvkdDZWWo1iDaDPWS2oMOYxWoPClxOrb0WQVCW5Pf2wvMCiF1FTPD93RDV84Re9zyfxGwr1Pjr3PBfcvvhKvf+dcoV5AdXYPIo9maKnodtrJSU1oBirVpz8WTf5lnaWy1ydRaslxUz2YxijfLheywJh6vhW5PKUP5O/udc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219700; c=relaxed/simple; bh=hiux/Qn4TgTgVS5k/2u/A3XVpV/Xm5kCRXHxM5nr+90=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aqP6fMBQXxzqw5FOvjtUEPmBpPbHLuEQm6KKPVjx5U8aARF5imXU/xUmJcx6f4NAibXSm296xWF+wq5FjhOn+L6i9f33Y6re5nBovOTG7HuVWtK/vt3ZK6enTKiNGZlRNl0MBulOfppjCUPZ+uto6DJVRzSamhUyXQu1k3324DA= 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=SMhx1nCk; arc=none smtp.client-ip=209.85.128.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SMhx1nCk" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-49556f97a9dso13994375e9.1 for ; Thu, 20 Aug 2026 02:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787219695; x=1787824495; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=FOqw3tunXuRzUv25jzPvXMhHm8m25g6fnSYlANTTWK4=; b=SMhx1nCkWP1x7vpnKYHnyrTAN1E5qxolf+nJq/6FJWEPS63E3FxVZ/ZY0Cb5+EV//A 2U5MFwINK886IjHHAvzC05fyNuFzy5HV5ZmOuE8iuKODOw6aVYvL7hOeV476M2lIsyqy pyJuDPCNMcika4cBjyl0o9rGzwqrDPLp320xxZbAZ+8TG93BVL8y9C16IJgsc8yjGEfX n72JbdeIN2NPJrnHa9j9DRYc9H7ehtO5Z4JCbXQAMWk6URgbjB8fpcWcN5giB0pHUmmD Gu+rgbueLYNehdmLq2QuNYWEy0mOjIPmmxntOIyfYKCv0GqahnsOD/lVaol9l/bMTr5h tofA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787219695; x=1787824495; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=FOqw3tunXuRzUv25jzPvXMhHm8m25g6fnSYlANTTWK4=; b=q4UVHntHI8kRwlG2U8wkuEff7Qt3M2bQdFqafoEdQtS7EqDNI9+j96Xs+4FgYQpKQY r0CS1tfmAZS9D6NbENglwyxSVoChttuJvPBgDctWN/wqOlxvt2N99lOkEeAY1tj+6Oaq A5zuyBzjTkrnifULynQh61UWs/rclF05DoFps8UWCmcFlFaESN9zvP3A3eBqXnQVK3+O AlH4VIVfZXI+1EvvF/M60BUYcFU0Qkbw7brCRRykWc7v2S0aPUypyuDQAqvFnQHRQsTL lNkR2U01vHXPuQBRZuYFPboYDl4DGJjith41FRXX8cUYnpJ4IUW8cYAZtkc564dVGo4S ARiA== X-Forwarded-Encrypted: i=1; AHgh+Rr9Q5RKrqzM3mXnZAuRpQteD+/DtrV3Zju+6XSGKJkLPq2MM8Delmto/QO7hzfjoSTc5D7swT6kyQTh2TQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyeQBA+e0W9sRE6B+SSgZkYKiAJ9oXPE6u60BgsaX+cRTH/zVzN /K64xUi4hapBQNkKfvimTBLbzn23HWLI6jM3B3JTRA2Q2UfbzsnlsjZ/ X-Gm-Gg: AR+sD12O16ymiq1gWBJmtLR1JDYv1YhAd5uteTRb0C0r9qfsRk2KQnSKBZfBY6ogh+n MXhhdE2FSYSll2j6KJpJbviJFAYJlo8P0ilvISWRG/B+mbgjPyfSgAuoStqcWdWamEV3dsWjkz+ gASDlyxJSS/8NYGpPBTzPKamzgcH41kxr+IiSdLziuEeAB6A3Xxp0L0RhM9kqQXrd2KcXIkfaRJ e8wPLmBSbnSr6KSuuuoTsWBeT0nBAx+4p+r9A6ZXOu4lAzVnJEuO/cQBhDfyAbG2KoBWVp6GbCt TH5YT+UR3t6YVTbw9kVF6/szC3umn1PRb66WG1uzpWK2MWvmYfJqc9Hv3TvHT2I9114yXtLK2Jh xcmqVPH43gsQAnoMmQbOuTFESx9D5aoHIRrZk1b+/O4iSfSAwdPouVr/0DlqHM0DAG7qGG33Nau 6HLOeGdcfNNq0nfUy7z/zMAytrWClo0j4a5LjXIiJjTRc8grZKTXFQg97OUMpd7NtFj0no X-Received: by 2002:a05:600c:4e01:b0:493:e365:ace9 with SMTP id 5b1f17b1804b1-499aa1d0747mr208237845e9.11.1787219694748; Thu, 20 Aug 2026 02:54:54 -0700 (PDT) Received: from biju.lan ([2a00:23c4:a702:d301:eda0:8ef1:e1ab:c2b1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499aa0d6721sm172069675e9.11.2026.08.20.02.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 02:54:54 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Philipp Zabel , Geert Uytterhoeven , Mark Brown , Magnus Damm Cc: Biju Das , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH v8 4/5] reset: rzg2l-usbphy-ctrl: Add RZ/G3L support Date: Thu, 20 Aug 2026 10:54:42 +0100 Message-ID: <20260820095448.20930-5-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> References: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Add the renesas,r9a08g046-usbphy-ctrl compatible string to the OF match table for the RZ/G3L (r9a08g046) SoC, using a dedicated rzg3l_info struct with pwrrdy set, similar to RZ/G3S. The RZ/G3L SoC has 2 OTG controllers compared to one on RZ/G3S, so it uses a separate rzg3l-vbus-regulator driver to handle the additional VBUSEN control for port 2. The regulator_name field is used as the platform device name passed to platform_device_alloc(), and must exactly match the name the corresponding regulator driver registers via its id_table for platform bus matching to succeed. Signed-off-by: Biju Das --- v7->v8: * Avoided code duplication by moving devm_add_action_or_reset() to rzg2l_usbphy_ctrl_pwrrdy_init(). v6->v7: * No change. v5->v6: * No change. v4->v5: * Replaced the variable regulator_driver_name->regulator_name in struct rzg2l_usbphy_ctrl_info * Switched to power sequence consumer for controlling pwrrdy signal. * Updated commit description. v3->v4: * Updated the commit description. * Migrated to id_table match using driver_name and reduced the length < 24. v2->v3: * No change. v1->v2: * No change. --- drivers/reset/reset-rzg2l-usbphy-ctrl.c | 75 ++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 8 deletions(-) diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-= rzg2l-usbphy-ctrl.c index 79503f6f4b23..da98776da648 100644 --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -37,11 +38,13 @@ struct rzg2l_usbphy_ctrl_priv { void __iomem *base; struct platform_device *vdev; struct regmap_field *pwrrdy; + struct pwrseq_desc *pwrseq; =20 spinlock_t lock; }; =20 struct rzg2l_usbphy_ctrl_info { + const char *regulator_name; bool pwrrdy; }; =20 @@ -110,15 +113,24 @@ static void rzg2l_usbphy_ctrl_init(struct rzg2l_usbph= y_ctrl_priv *priv) spin_unlock_irqrestore(&priv->lock, flags); } =20 -static const struct rzg2l_usbphy_ctrl_info rzg2l_info =3D {}; +static const struct rzg2l_usbphy_ctrl_info rzg2l_info =3D { + .regulator_name =3D "rzg2l-vbus-regulator", +}; =20 static const struct rzg2l_usbphy_ctrl_info rzg3s_info =3D { + .regulator_name =3D "rzg2l-vbus-regulator", + .pwrrdy =3D true, +}; + +static const struct rzg2l_usbphy_ctrl_info rzg3l_info =3D { + .regulator_name =3D "rzg3l-vbus-regulator", .pwrrdy =3D true, }; =20 static const struct of_device_id rzg2l_usbphy_ctrl_match_table[] =3D { { .compatible =3D "renesas,rzg2l-usbphy-ctrl", .data =3D &rzg2l_info }, { .compatible =3D "renesas,r9a08g045-usbphy-ctrl", .data =3D &rzg3s_info = }, + { .compatible =3D "renesas,r9a08g046-usbphy-ctrl", .data =3D &rzg3l_info = }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, rzg2l_usbphy_ctrl_match_table); @@ -150,16 +162,20 @@ static int rzg2l_usbphy_ctrl_set_pwrrdy(struct regmap= _field *pwrrdy, =20 static void rzg2l_usbphy_ctrl_pwrrdy_off(void *data) { - rzg2l_usbphy_ctrl_set_pwrrdy(data, false); + struct rzg2l_usbphy_ctrl_priv *priv =3D data; + + if (priv->pwrrdy) + rzg2l_usbphy_ctrl_set_pwrrdy(priv->pwrrdy, false); + else + pwrseq_power_off(priv->pwrseq); } =20 -static int rzg2l_usbphy_ctrl_pwrrdy_init(struct device *dev, - struct rzg2l_usbphy_ctrl_priv *priv) +static int rzg2l_usbphy_ctrl_pwrrdy_syscon_init(struct device *dev, + struct rzg2l_usbphy_ctrl_priv *priv) { struct reg_field field; struct regmap *regmap; u32 args[2]; - int ret; =20 regmap =3D syscon_regmap_lookup_by_phandle_args(dev->of_node, "renesas,sysc-pwrrdy", @@ -179,11 +195,40 @@ static int rzg2l_usbphy_ctrl_pwrrdy_init(struct devic= e *dev, if (IS_ERR(priv->pwrrdy)) return PTR_ERR(priv->pwrrdy); =20 - ret =3D rzg2l_usbphy_ctrl_set_pwrrdy(priv->pwrrdy, true); + return rzg2l_usbphy_ctrl_set_pwrrdy(priv->pwrrdy, true); +} + +static int rzg2l_usbphy_ctrl_pwrrdy_powerseq_init(struct device *dev, + struct rzg2l_usbphy_ctrl_priv *priv) +{ + priv->pwrseq =3D devm_pwrseq_get(dev, "usb-pwrrdy"); + if (IS_ERR(priv->pwrseq)) { + /* + * This platform requires a sequencer. If we can't get it, we + * must return the error (including -EPROBE_DEFER to wait for + * the provider to appear) + */ + return dev_err_probe(dev, PTR_ERR(priv->pwrseq), + "Failed to get required power sequencer\n"); + } + + return pwrseq_power_on(priv->pwrseq); +} + +static int rzg2l_usbphy_ctrl_pwrrdy_init(struct device *dev, + struct rzg2l_usbphy_ctrl_priv *priv) +{ + int ret; + + if (of_property_present(dev->of_node, "renesas,sysc-pwrrdy")) + ret =3D rzg2l_usbphy_ctrl_pwrrdy_syscon_init(dev, priv); + else + ret =3D rzg2l_usbphy_ctrl_pwrrdy_powerseq_init(dev, priv); + if (ret) return ret; =20 - return devm_add_action_or_reset(dev, rzg2l_usbphy_ctrl_pwrrdy_off, priv->= pwrrdy); + return devm_add_action_or_reset(dev, rzg2l_usbphy_ctrl_pwrrdy_off, priv); } =20 static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev) @@ -245,7 +290,7 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_devi= ce *pdev) if (error) goto err_pm_runtime_put; =20 - vdev =3D platform_device_alloc("rzg2l-vbus-regulator", pdev->id); + vdev =3D platform_device_alloc(info->regulator_name, pdev->id); if (!vdev) { error =3D -ENOMEM; goto err_pm_runtime_put; @@ -300,6 +345,12 @@ static int rzg2l_usbphy_ctrl_suspend(struct device *de= v) if (ret) goto reset_deassert; =20 + if (priv->pwrseq) { + ret =3D pwrseq_power_off(priv->pwrseq); + if (ret) + goto reset_deassert; + } + return 0; =20 reset_deassert: @@ -314,6 +365,12 @@ static int rzg2l_usbphy_ctrl_resume(struct device *dev) struct rzg2l_usbphy_ctrl_priv *priv =3D dev_get_drvdata(dev); int ret; =20 + if (priv->pwrseq) { + ret =3D pwrseq_power_on(priv->pwrseq); + if (ret) + return ret; + } + ret =3D rzg2l_usbphy_ctrl_set_pwrrdy(priv->pwrrdy, true); if (ret) return ret; @@ -334,6 +391,8 @@ static int rzg2l_usbphy_ctrl_resume(struct device *dev) reset_control_assert(priv->rstc); pwrrdy_off: rzg2l_usbphy_ctrl_set_pwrrdy(priv->pwrrdy, false); + if (priv->pwrseq) + pwrseq_power_off(priv->pwrseq); return ret; } =20 --=20 2.43.0 From nobody Mon Sep 28 16:22:29 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 766193DDB15 for ; Thu, 20 Aug 2026 09:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219699; cv=none; b=uThh8tSORzWVglZcoHzOTpeeUvtLuzRTgUnlucPiqkxhVxgXSl8ILOi3lygMmGAHATBSM4jScciOjTLfQtnS8uijUEi1Umap0qyBlSwikBVCft8jhwTFFQzDHxDZSXn8rl69V81X9DeMyGxDeAy9lJ2afmGxOj+zgd4Ryynh1Uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787219699; c=relaxed/simple; bh=cmC7ORYb/5Jjq2DDsTTj8RSsB459okJgJXhRg2moZVo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=awlKQmMXDna2AFOKsfUfB9gk/M88LbSFuGLlxGoZZY8erMcpmMn4oB01T62rewZDv4khb/R5yNUG/WC/u4Om5w/HIQ5ZS3p4s/v7rF+nBdTrcimnacEcLY0sxzoatzgF8LtEybLWndbBhmkmab0TZh0jL1o55QafFjG5YNm13Dw= 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=dsCY/0tR; arc=none smtp.client-ip=209.85.128.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dsCY/0tR" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-495590dde14so23432695e9.0 for ; Thu, 20 Aug 2026 02:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787219695; x=1787824495; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=xvgZuC+j2jtOw7qJxYBVGMkHn8ERnr6Y8EdgLSoL0vw=; b=dsCY/0tRFi7Z0v4oYpG7zHis0JAftRQbXIz57gyVC4YXcygCuR4rnghgoTfhM5nawQ DHmm0Da9tg+4HU1mjA66PnjKZzjuksZIc7Dk6KxK0uyQd7OfD6LwG+cFClmWOt1xVrj4 b0ysXX9k6wJQOT5abYPthzcxJ1eqCG/joeaZrxq1z3C//OlPHEyd8fGKAzZzB1RZyoyH OWVd/rNm9BbnkcU0UPLGK9dBAylvnDt1LGjEqphepWqNfwdtYJGG/t6f0bdjTEsTa/hs xWSESptWB02of3KGPse4v/FLtLB+rNFiP8zgWNMDBHeelS9FjDckV9ayysGMNfdsOLEy w0XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787219695; x=1787824495; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=xvgZuC+j2jtOw7qJxYBVGMkHn8ERnr6Y8EdgLSoL0vw=; b=A08KD3jos0vVC6NM2RFft26IXcnLPwqtqkbUyF/xLCNwwR47nVKb32EnwhdOIkLULr /oA58tGnlgp6Bo/5JHQ+HuUKoaikyNZpqK0fL5N9f0kZr+FlLKA7BHszYW5AbXlkNmlj S/xwc0KX2+OMfXcEVl0NF1BP935BUwZn7TUrvAeyl9S6N+NcxI9SgFD1B3IpkWsRlqPE VzjRFvu3az4+cJgZ9G6eP22Mks9gEX3Z2i2UFzfieTW01efp13UAsbaQoCiBM3TWilPV YzJ/XYsbm8pqmNuh6rvsViW69bMk2oyxWcwVSDb8B1h+ITXIHxfpZw80sVMyX7/GbIGc ysDg== X-Forwarded-Encrypted: i=1; AHgh+Ron0ziukqrZ55NfmCJEaPWUw5QEUk2WkSS8pK0xDaaDwjXyrV0/w4IMFaIBCdaZOAzfBprFRLKgPqgLfV0=@vger.kernel.org X-Gm-Message-State: AOJu0YzTMYZf0MTtBCjFKz+Eb/DBMCy2YLlkOimxunHtkJWl0pak31Oz YBUQvRv7rrJY3R75ZRO7Pzb7wG0q0eHvJilKfWWl2GQaVqglUAb6agxI X-Gm-Gg: AR+sD12O3VteGcV7DFxo7xmofAtUn5EkAbThYYLJo5n8lsmH4GLqtxi0eOqucuTZklq cHN2/a/QD9qz/C4YJo+87lBLydBKyW3bGzVLnjqChQSkkExLBsEZvlFYek8NnYsANU16dqgba5X 5xn6mvYJNLdmxIzwUn4UHKOM1TwWrI/tMcrnXHXqSoQ59IdnddTjBnVvvcYBpo/eyyE8xNRuKeB tH1DaRtL+ILM3WQZfz807QSkH6x1NOfyN11opfv4X+n4Ex3dfN5pnyFMy6Bl4DTftHgRrHRMNSA N9ZmRO3etVvf47ODcwhRF+VPrNDwrpXVUN3yinFZssJ+TR0GG0P794VuAmUlIvL3DOcA/SkelT7 fSr6yRkn5CclEkWmGLFbO/T7VJ2EVD9/XGiPZkBVyXWluxQO07g/fsacOHSSlrRLG7MGKdZkT1c 4W8pkS3waQjAo9LxDxA1ugA7xfOYZh8Lo2LFsVE60Dz11o8iHYgN68HNxwGJsVZclZnvU7LSXxO KHgbYo= X-Received: by 2002:a05:600c:c167:b0:495:4d00:2fda with SMTP id 5b1f17b1804b1-499aa143546mr216415815e9.2.1787219695460; Thu, 20 Aug 2026 02:54:55 -0700 (PDT) Received: from biju.lan ([2a00:23c4:a702:d301:eda0:8ef1:e1ab:c2b1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499aa0d6721sm172069675e9.11.2026.08.20.02.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 02:54:55 -0700 (PDT) From: Biju X-Google-Original-From: Biju To: Liam Girdwood , Philipp Zabel , Mark Brown Cc: Biju Das , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH v8 5/5] regulator: renesas-usb-vbus-regulator: Add RZ/G3L VBUS regulator support Date: Thu, 20 Aug 2026 10:54:43 +0100 Message-ID: <20260820095448.20930-6-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> References: <20260820095448.20930-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Biju Das Add dual USB VBUS regulator support for the RZ/G3L (r9a08g046) SoC, which has two OTG controllers (one per port), unlike RZ/G3S which has only one. Introduce a RZG3L_USB_VBUS_REG macro and a rzg3l_usb_vbus_regulators array with two descriptors: vbus0 (BIT(0)) and vbus1 (BIT(1)), both sourced from a regulators sub-node as defined in the binding. Add a dedicated rzg3l_usb_vbus_regulator_probe() that iterates over the array and registers both regulators using devm_regulator_register(). Convert the existing platform driver to use an id_table, allowing it to dispatch to either the RZ/G2L or RZ/G3L probe function based on the matched platform device name. Acked-by: Mark Brown Signed-off-by: Biju Das --- v7->v8: * No change. v6->v7: * No change. v5->v6: * Replaced dev_err->dev_err_probe() in error path of rzg3l_usb_vbus_regulator_probe(). * Retained the tag as the change is trivial. v4->v5: * Collected the tag. v3->v4: * Dropped rzg3l specific platform driver. * Dropped the tag as there are new changes. * Added id_table handling by introducing a common probe(). v2->v3: * No change. v1->v2: * Passing pointer to an array of regulators to make it scalable. * Updated commit description. --- .../regulator/renesas-usb-vbus-regulator.c | 73 ++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/renesas-usb-vbus-regulator.c b/drivers/regul= ator/renesas-usb-vbus-regulator.c index 22fcf0d10c85..050820a30efb 100644 --- a/drivers/regulator/renesas-usb-vbus-regulator.c +++ b/drivers/regulator/renesas-usb-vbus-regulator.c @@ -55,8 +55,79 @@ static int rzg2l_usb_vbus_regulator_probe(struct platfor= m_device *pdev) return 0; } =20 +#define RZG3L_USB_VBUS_REG(rname, en_mask) \ + { \ + .name =3D #rname, \ + .of_match =3D of_match_ptr(#rname), \ + .regulators_node =3D of_match_ptr("regulators"), \ + .type =3D REGULATOR_VOLTAGE, \ + .owner =3D THIS_MODULE, \ + .ops =3D &rzg2l_usb_vbus_reg_ops, \ + .enable_reg =3D 0, \ + .enable_mask =3D (en_mask), \ + .enable_is_inverted =3D true, \ + .fixed_uV =3D 5000000, \ + .n_voltages =3D 1, \ + } + +static const struct regulator_desc rzg3l_usb_vbus_regulators[] =3D { + RZG3L_USB_VBUS_REG(vbus0, BIT(0)), + RZG3L_USB_VBUS_REG(vbus1, BIT(1)), +}; + +static int rzg3l_usb_vbus_regulator_probe(struct platform_device *pdev) +{ + struct regulator_config config =3D { }; + struct device *dev =3D &pdev->dev; + struct regulator_dev *rdev; + + config.dev =3D pdev->dev.parent; + config.regmap =3D dev_get_regmap(dev->parent, NULL); + if (!config.regmap) + return dev_err_probe(dev, -ENOENT, "Failed to get regmap\n"); + + for (unsigned int i =3D 0; i < ARRAY_SIZE(rzg3l_usb_vbus_regulators); i++= ) { + rdev =3D devm_regulator_register(dev, &rzg3l_usb_vbus_regulators[i], + &config); + if (IS_ERR(rdev)) + return dev_err_probe(dev, PTR_ERR(rdev), + "failed to register %s regulator\n", + rzg3l_usb_vbus_regulators[i].name); + } + + return 0; +} + +static int rzg2l_usb_vbus_regulator_common_probe(struct platform_device *p= dev) +{ + int (*probe_func)(struct platform_device *pdev); + const struct platform_device_id *id; + + id =3D platform_get_device_id(pdev); + if (!id) + return dev_err_probe(&pdev->dev, -ENODEV, "No ID match found\n"); + + probe_func =3D (int (*)(struct platform_device *))id->driver_data; + + return probe_func(pdev); +} + +static const struct platform_device_id rzg2l_usb_vbus_regulator_ids[] =3D { + { + .name =3D "rzg2l-vbus-regulator", + .driver_data =3D (kernel_ulong_t)rzg2l_usb_vbus_regulator_probe + }, + { + .name =3D "rzg3l-vbus-regulator", + .driver_data =3D (kernel_ulong_t)rzg3l_usb_vbus_regulator_probe + }, + { /* Sentinel */ } +}; +MODULE_DEVICE_TABLE(platform, rzg2l_usb_vbus_regulator_ids); + static struct platform_driver rzg2l_usb_vbus_regulator_driver =3D { - .probe =3D rzg2l_usb_vbus_regulator_probe, + .probe =3D rzg2l_usb_vbus_regulator_common_probe, + .id_table =3D rzg2l_usb_vbus_regulator_ids, .driver =3D { .name =3D "rzg2l-vbus-regulator", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, --=20 2.43.0