From nobody Thu Nov 14 05:42:51 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5906CC001E0 for ; Thu, 3 Aug 2023 07:54:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230481AbjHCHyV (ORCPT ); Thu, 3 Aug 2023 03:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230226AbjHCHxl (ORCPT ); Thu, 3 Aug 2023 03:53:41 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1158C8A5E for ; Thu, 3 Aug 2023 00:43:25 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3a4875e65a3so492320b6e.2 for ; Thu, 03 Aug 2023 00:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048580; x=1691653380; 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; bh=O80suLs8Qvsgc7R30L63r0azKWcMa3PZDlYRfpOpp9M=; b=G50odMpAiZPUQ5zKrQkOTXNvwx71UmOrW5jQwfS90yBVF4M1S1MmNa91G9TeT3n6x9 kcPygwXC5w7+KoeaijZIPd62cmcxCJBeeJ4uc68B4fPzdMdTG58FRERDnHX3inxJbaWI bKxOMGW/At9tyeEGMXhL/vivf8DwgG9a/sh5M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048580; x=1691653380; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O80suLs8Qvsgc7R30L63r0azKWcMa3PZDlYRfpOpp9M=; b=BddNXkUEnCQAtAFBhHSY1zpkqBKoZO4zXj+xtEgqbw8UU8QzmhnlLUaQm8tGV1kvkm VF+x1Xoec7QOKvBD5CPtVXuq1pZbZfvZZDgMog8h78DWddAOYHrEQoxkNL0EhOI+2WQB EiWOttpTtIQ45gSbbmalNW+/8ukYG5ZUCkOYKrVU2yF3N93VZYnHSuarZwn+31BT71KI UawIvlJxVtZt4OnSEjNJO76bG4PWdmXcOV1oVT/QcsU6vLwb9hQv3GVdowM6+ugrOijq WoGdGnjkOr384aQtTXDmQAzZu7Guz6IatWBkQSeFXqHA5nBmXaXwq301tuyXarzZyhQn NVtg== X-Gm-Message-State: ABy/qLabrUOS/+5pkf+EhK80VVR3aSA49OAH+9t8rXr1m1OzhDjLEOFg dYrdHiFfec+c7e45wkK5Jw97UQ== X-Google-Smtp-Source: APBJJlGY9mduFao8XJQFVBFE9ih/bv4zzgVrQtxOi7vXuN0THQ/f3tRLfB/zLRer9OPXZDJahrPkbA== X-Received: by 2002:a54:4d8b:0:b0:3a6:f876:148d with SMTP id y11-20020a544d8b000000b003a6f876148dmr18312483oix.8.1691048580528; Thu, 03 Aug 2023 00:43:00 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:00 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/9] dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC Date: Thu, 3 Aug 2023 15:42:39 +0800 Message-ID: <20230803074249.3065586-2-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The MT6366 PMIC is mostly, but not fully, compatible with MT6358. It has a different set of regulators. Specifically, it lacks the camera related VCAM* LDOs, but has additional VM18, VMDDR, and VSRAM_CORE LDOs. Add a separate compatible for the MT6366 PMIC. Fixes: 49be16305587 ("dt-bindings: mfd: Add compatible for the MediaTek MT6= 366 PMIC") Signed-off-by: Chen-Yu Tsai Reviewed-by: Conor Dooley --- Documentation/devicetree/bindings/mfd/mt6397.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentati= on/devicetree/bindings/mfd/mt6397.txt index 294693a8906c..d4778b0d5f5c 100644 --- a/Documentation/devicetree/bindings/mfd/mt6397.txt +++ b/Documentation/devicetree/bindings/mfd/mt6397.txt @@ -22,8 +22,9 @@ compatible: "mediatek,mt6323" for PMIC MT6323 "mediatek,mt6331" for PMIC MT6331 and MT6332 "mediatek,mt6357" for PMIC MT6357 - "mediatek,mt6358" for PMIC MT6358 and MT6366 + "mediatek,mt6358" for PMIC MT6358 "mediatek,mt6359" for PMIC MT6359 + "mediatek,mt6366" for PMIC MT6366 "mediatek,mt6397" for PMIC MT6397 =20 Optional subnodes: @@ -41,6 +42,8 @@ Optional subnodes: see ../regulator/mt6323-regulator.txt - compatible: "mediatek,mt6358-regulator" see ../regulator/mt6358-regulator.txt + - compatible: "mediatek,mt6366-regulator" + see ../regulator/mediatek,mt6366-regulator.yaml - compatible: "mediatek,mt6397-regulator" see ../regulator/mt6397-regulator.txt - codec --=20 2.41.0.585.gd2178a4bd4-goog From nobody Thu Nov 14 05:42:51 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9782BC04A6A for ; Thu, 3 Aug 2023 07:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231972AbjHCHyk (ORCPT ); Thu, 3 Aug 2023 03:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbjHCHxv (ORCPT ); Thu, 3 Aug 2023 03:53:51 -0400 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D01A559F for ; Thu, 3 Aug 2023 00:43:30 -0700 (PDT) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-583b019f1cbso6372167b3.3 for ; Thu, 03 Aug 2023 00:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048583; x=1691653383; 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; bh=qnzZ3mVH80rTTFN4mmKfEKmsqs6Mvvf/rKk6UFaJvog=; b=YjgZrYrzrSWDTKHQbzvAl9fyP6k0Y2XLjBp7NBcToctpo8q7X00iDlGKSDLi/19g3D GNG/a/5ar6VjBdKrTVjMXKj9dHQjEE7EsDlL5tUkojNPVj8oCELo/8onbf/YnM3Tn4pu x3j0g9jhvSbVQo/FI4p6Ud4CmHDms6CiCOs64= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048583; x=1691653383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qnzZ3mVH80rTTFN4mmKfEKmsqs6Mvvf/rKk6UFaJvog=; b=lnHJa7TGmO4fVckixLn749fDRoxIfsWQj0W2HHeL8rtcTr93sXOyYyJfDgdcbw3Po/ ujJQKRV8foS+qE0Yj/FQLh+PuvY8PYDjy+deUSa6uxfe16+8ev/+Efw2Y74UNBTSYV4Q vZAJclbbslXF8VdE/e1lwh79lgwTcCh0typZ6BcTqwj4nhIq7WV5pVBrV7/b0HZLAH8M ZXsOjfB21Bdp3vKKH+qH41e/2RcwC+yvKDal1qYeBAqjJqliBuhkN/2yKrs4sOINHMr0 89Zq6qcHe1RfTjRLonSxlmu9app8N8qlTyxrpAPv6YOLbHbd1YH4V8SErqmqhSoW0XLj e1vA== X-Gm-Message-State: ABy/qLbx+TPaXK3QZMSjrgiCPeQKbkO6lwf0aqqrZVtioXQTX2rrjw/z MF3mqk6fUfQk9u7QkFfY6awB/A== X-Google-Smtp-Source: APBJJlGxB/1X32tTrdlyPkNI+lx6FksiZGUPbX+vn+B/9U+9kI595eZfjC5HlvPRxIAHElcWNyE5DA== X-Received: by 2002:a0d:d490:0:b0:585:fb08:157a with SMTP id w138-20020a0dd490000000b00585fb08157amr13328988ywd.50.1691048583049; Thu, 03 Aug 2023 00:43:03 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:02 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 2/9] mfd: mt6358: Add registers for MT6366 specific regulators Date: Thu, 3 Aug 2023 15:42:40 +0800 Message-ID: <20230803074249.3065586-3-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The MT6366 PMIC, compared to the MT6358, does away with the VCAM* regulators. Two regulators VM18 and VMDDR reuse their register space. There's also a VSRAM type regulator VSRAM_CORE thats' split between the VCAM* register space and other parts. Add register address macros for these MT6366 specific regulators. Signed-off-by: Chen-Yu Tsai --- include/linux/mfd/mt6358/registers.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/linux/mfd/mt6358/registers.h b/include/linux/mfd/mt635= 8/registers.h index 5ea2590be710..f4c321574da3 100644 --- a/include/linux/mfd/mt6358/registers.h +++ b/include/linux/mfd/mt6358/registers.h @@ -219,6 +219,7 @@ #define MT6358_LDO_VCAMIO_CON1 0x1cbe #define MT6358_LDO_VCAMIO_CON2 0x1cc0 #define MT6358_LDO_VCAMIO_CON3 0x1cc2 + #define MT6358_LDO_VMC_CON0 0x1cc4 #define MT6358_LDO_VMC_CON1 0x1cd2 #define MT6358_LDO_VMC_CON2 0x1cd4 @@ -294,4 +295,21 @@ #define MT6358_AUD_TOP_INT_CON0 0x2228 #define MT6358_AUD_TOP_INT_STATUS0 0x2234 =20 +/* + * MT6366 has no VCAM*, but has other regulators in its place. The names + * keep the MT6358 prefix for ease of use in the regulator driver. + */ +#define MT6358_LDO_VSRAM_CON5 0x1bf8 +#define MT6358_LDO_VM18_CON0 MT6358_LDO_VCAMA1_CON0 +#define MT6358_LDO_VM18_CON1 MT6358_LDO_VCAMA1_CON1 +#define MT6358_LDO_VM18_CON2 MT6358_LDO_VCAMA1_CON2 +#define MT6358_LDO_VMDDR_CON0 MT6358_LDO_VCAMA2_CON0 +#define MT6358_LDO_VMDDR_CON1 MT6358_LDO_VCAMA2_CON1 +#define MT6358_LDO_VMDDR_CON2 MT6358_LDO_VCAMA2_CON2 +#define MT6358_LDO_VSRAM_CORE_CON0 MT6358_LDO_VCAMD_CON0 +#define MT6358_LDO_VSRAM_CORE_DBG0 0x1cb6 +#define MT6358_LDO_VSRAM_CORE_DBG1 0x1cb8 +#define MT6358_VM18_ANA_CON0 MT6358_VCAMA1_ANA_CON0 +#define MT6358_VMDDR_ANA_CON0 MT6358_VCAMD_ANA_CON0 + #endif /* __MFD_MT6358_REGISTERS_H__ */ --=20 2.41.0.585.gd2178a4bd4-goog From nobody Thu Nov 14 05:42:51 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 277F0C0015E for ; Thu, 3 Aug 2023 07:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233854AbjHCHy4 (ORCPT ); Thu, 3 Aug 2023 03:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231903AbjHCHxx (ORCPT ); Thu, 3 Aug 2023 03:53:53 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 001B155A6 for ; Thu, 3 Aug 2023 00:43:32 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-26830595676so369948a91.2 for ; Thu, 03 Aug 2023 00:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048585; x=1691653385; 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; bh=0qupwZObmmk0/sdY9oZ6qJIIOW7j+/1bq8fINDZIIlo=; b=iuw6BH7uxiaSd8Em4i2OVoxw9xOQqLbcZoPiSw5kiOmF8T+bhab7wAMcmOxJJ7Hmpi MNKPP/N4/aFleUK4RWH5+LhgCg5aL9Wt5DNlukiGWxm5GtOn8OEE1JXNQSmyJCIXyS8c tUXmKwYpnBorP0BECIRrJ9/KO1SX5Ir0MwtFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048585; x=1691653385; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0qupwZObmmk0/sdY9oZ6qJIIOW7j+/1bq8fINDZIIlo=; b=D/HULacjYq2Ef+VDaNADFc675wDKwQcl+0SopFC1EX3P1ctCZvuxKDwV4xYaaW2cMI zk1q2asTHjLYEUE7niG0NA+Y7iGYgMHk3fPEswspErulQdPS4sH1cGUMnvHftxHlq+Qn fS2w4hwdjCwQ0o7YJL/9bOkAEwJHCxMUWucnXr8YPeepuhBZ9LqbCkQOp9q0ydlvjirz OEjypEpEUaIJdbGSx3DuAyRBq3FiTbyYbZ+Ai3BOnhqgh388kGxMUHAPh9f6I6kHrCsg U2bHIiHfCYXM5OXfCWwpgrwJeW56EYML7beVugVOJDxfK0kVOHfJVSeywvVVRoXPfE28 Da7A== X-Gm-Message-State: ABy/qLZyboZ8SxxIdwVFaUmVv1Z9iv1PWTwBOpoPlY8iiM4H5RiUY5Gd sIXXUjKTCSby8YSHDStA/Djr1A== X-Google-Smtp-Source: APBJJlG87/Ro7nZXzml9fmHTU6Ab8cH9lat6x4i0wjt2yZq9zHMRteYWrxBWgji+jke4gg8BS4lUxQ== X-Received: by 2002:a17:90a:7f8d:b0:263:72fe:3ef7 with SMTP id m13-20020a17090a7f8d00b0026372fe3ef7mr15974468pjl.42.1691048585544; Thu, 03 Aug 2023 00:43:05 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:05 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 3/9] mfd: mt6397: Split MediaTek MT6366 PMIC out of MT6358 Date: Thu, 3 Aug 2023 15:42:41 +0800 Message-ID: <20230803074249.3065586-4-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The MT6366 PMIC is mostly, but not fully, compatible with MT6358. It has a different set of regulators. Specifically, it lacks the camera related VCAM* LDOs, but has additional VM18, VMDDR, and VSRAM_CORE LDOs. Add a separate compatible for the MT6366 PMIC. The regulator cell for this new entry uses a new compatible string matching MT6366. Fixes: c47383f84909 ("mfd: Add support for the MediaTek MT6366 PMIC") Signed-off-by: Chen-Yu Tsai --- drivers/mfd/mt6397-core.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c index f6c1f80f94a4..3f8dfe60a59b 100644 --- a/drivers/mfd/mt6397-core.c +++ b/drivers/mfd/mt6397-core.c @@ -206,6 +206,26 @@ static const struct mfd_cell mt6359_devs[] =3D { }, }; =20 +static const struct mfd_cell mt6366_devs[] =3D { + { + .name =3D "mt6358-regulator", + .of_compatible =3D "mediatek,mt6366-regulator" + }, { + .name =3D "mt6358-rtc", + .num_resources =3D ARRAY_SIZE(mt6358_rtc_resources), + .resources =3D mt6358_rtc_resources, + .of_compatible =3D "mediatek,mt6358-rtc", + }, { + .name =3D "mt6358-sound", + .of_compatible =3D "mediatek,mt6358-sound" + }, { + .name =3D "mt6358-keys", + .num_resources =3D ARRAY_SIZE(mt6358_keys_resources), + .resources =3D mt6358_keys_resources, + .of_compatible =3D "mediatek,mt6358-keys" + }, +}; + static const struct mfd_cell mt6397_devs[] =3D { { .name =3D "mt6397-rtc", @@ -280,6 +300,14 @@ static const struct chip_data mt6359_core =3D { .irq_init =3D mt6358_irq_init, }; =20 +static const struct chip_data mt6366_core =3D { + .cid_addr =3D MT6358_SWCID, + .cid_shift =3D 8, + .cells =3D mt6366_devs, + .cell_size =3D ARRAY_SIZE(mt6366_devs), + .irq_init =3D mt6358_irq_init, +}; + static const struct chip_data mt6397_core =3D { .cid_addr =3D MT6397_CID, .cid_shift =3D 0, @@ -358,6 +386,9 @@ static const struct of_device_id mt6397_of_match[] =3D { }, { .compatible =3D "mediatek,mt6359", .data =3D &mt6359_core, + }, { + .compatible =3D "mediatek,mt6366", + .data =3D &mt6366_core, }, { .compatible =3D "mediatek,mt6397", .data =3D &mt6397_core, --=20 2.41.0.585.gd2178a4bd4-goog From nobody Thu Nov 14 05:42:51 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 080EDC0015E for ; Thu, 3 Aug 2023 07:54:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233819AbjHCHyr (ORCPT ); Thu, 3 Aug 2023 03:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231888AbjHCHxw (ORCPT ); Thu, 3 Aug 2023 03:53:52 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91ED58A69 for ; Thu, 3 Aug 2023 00:43:33 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-686efa1804eso433275b3a.3 for ; Thu, 03 Aug 2023 00:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048588; x=1691653388; 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; bh=jVtXI1HZxhBYq/0/uTELsRw0u0pAzWKlEP1Rn/MZ4jk=; b=PKwk4GEk3yopaHuENojxSNYlbNJmh6+WGq90OHBeQqMuCf/L03VfIqLe6JOtcSeJ2n 2cxjXwsxhbh5alr8Uz9LKnOIPqOSUMrBCQmXJ9m98Li81fZgf/f+GjqyTiMEcsW3R7LK jPJez4gRDjDFj7HtyUX/mJ4++B3sv8bJDHcSw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048588; x=1691653388; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jVtXI1HZxhBYq/0/uTELsRw0u0pAzWKlEP1Rn/MZ4jk=; b=dy+PUpoKEaHNeKxvp1t6/ZQRZHbiERukHEUeR+AHJ0mbQWlmo1a3EkSFCVlHIOyNZl SADAeybhpngdKP67gkStcGDjv9mrVWOWBcJSUFWpeVRmnaG7p+HjxbFOTrWN88Nrn61D 8vaRtTuCW3JPocCOx3zyHe70B/3lgu69Uku9XbK8FQri7fyz371+GKuNkb2yodhZSdm9 njAW+OhDp88ZooxLaAWQ4WnzJ9lPKOydypBMvggBfxJJEtaSUV2NLvbmMxJPkfsCbm0B 9NzwEJdntya0EH+lavHcsp0hFMQboeTjcFklsNWR3V3eJx8MrqbZpuc1zVVVZRwh8UXj QFTw== X-Gm-Message-State: ABy/qLZDif95I+21bXKUVBDYShDsi1DHp1mzUcqqvOOieBEvmYteBzhq +AS5Njrr/3buIBSe3g4108i6Yw== X-Google-Smtp-Source: APBJJlGwLafzFcT24plp42o/OZcYOgz8zEtjUf/9xsYA2D+hxTl0/0NE4IzHmiKxo9RnR9Rc36P5xg== X-Received: by 2002:a17:90b:8d2:b0:267:75ce:f6d9 with SMTP id ds18-20020a17090b08d200b0026775cef6d9mr14285008pjb.3.1691048588039; Thu, 03 Aug 2023 00:43:08 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:07 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Chen-Yu Tsai Subject: [PATCH 4/9] regulator: dt-bindings: mediatek: Add MT6366 PMIC Date: Thu, 3 Aug 2023 15:42:42 +0800 Message-ID: <20230803074249.3065586-5-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Zhiyong Tao The MediaTek MT6366 PMIC is similar to the MT6358 PMIC. It is designed to be paired with the MediaTek MT8186 SoC. It has 9 buck regulators and 29 LDO regulators, not counting ones that feed internally and basically have no controls. The regulators are named after their intended usage for the SoC and system design, thus not named generically as ldoX or dcdcX, but as vcn33 or vgpu. Add a binding document describing all the regulators and their supplies. Signed-off-by: Zhiyong Tao [wens@chromium.org: major rework and added commit message] Signed-off-by: Chen-Yu Tsai --- Changes since Zhiyong's last version (v4) [1]: - simplified regulator names - added descriptions to regulators - removed bogus regulators (*_sshub) - merged vcn33-wifi and vcn33-bt as vcn33 - added missing regulators (vm18, vmddr, vsram-core) - cut down examples to a handful of cases and made them complete - expanded commit message a lot [1] https://lore.kernel.org/linux-arm-kernel/20220823123745.14061-1-zhiyong= .tao@mediatek.com/ .../regulator/mediatek,mt6366-regulator.yaml | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt= 6366-regulator.yaml diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6366-re= gulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6366-= regulator.yaml new file mode 100644 index 000000000000..715c6ffcb3ab --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6366-regulator= .yaml @@ -0,0 +1,154 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/mediatek,mt6366-regulator.yam= l# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MT6366 Regulator from MediaTek Integrated + +maintainers: + - Zhiyong Tao + +description: | + Regulator part of the MT6366 PMIC. This node should be under the PMIC's + device node. + +properties: + compatible: + const: mediatek,mt6366-regulator + + vsys_ldo1-supply: + description: Supply for LDOs vfe28, vxo22, vcn28, vaux18, vaud28, vsim= 1, vusb, vbif28 + vsys_ldo2-supply: + description: Supply for LDOs vio28, vmc, vmch, vsim2 + vsys_ldo3-supply: + description: Supply for LDOs vcn33, vemc, vibr + vsys_vcore-supply: + description: Supply for buck regulator vcore + vsys_vdram1-supply: + description: Supply for buck regulator vdram1 + vsys_vgpu-supply: + description: Supply for buck regulator vgpu + vsys_vmodem-supply: + description: Supply for buck regulator vmodem + vsys_vpa-supply: + description: Supply for buck regulator vpa + vsys_vproc11-supply: + description: Supply for buck regulator vproc11 + vsys_vproc12-supply: + description: Supply for buck regulator vproc12 + vsys_vs1-supply: + description: Supply for buck regulator vs1 + vsys_vs2-supply: + description: Supply for buck regulator vs2 + vs1_ldo1-supply: + description: Supply for LDOs vrf18, vefuse, vcn18, vio18, vm18 + vs2_ldo1-supply: + description: Supply for LDOs vmddr, vdram2 + vs2_ldo2-supply: + description: Supply for LDOs vrf12, va12 + vs2_ldo3-supply: + description: Supply for LDOs vsram-core, vsram-gpu, vsram-others, vsra= m-proc11, vsram-proc12 + +patternProperties: + "^v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": + description: Buck regulators + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^v(a|rf)12": + description: LDOs with fixed 1.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^v(aux|io|rf)18": + description: LDOs with fixed 1.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^vxo22": + description: LDOs with fixed 2.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^v(aud|bif|cn|fe|io)28": + description: LDOs with fixed 2.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^vusb": + description: LDOs with fixed 3.0V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^vsram-(core|gpu|others|proc1[12])$": + description: LDOs with variable output + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^v(cn18|cn33|dram2|efuse|emc|ibr|m18|mc|mch|mddr|sim[12])$": + description: LDOs with variable output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include + + regulator { + compatible =3D "mediatek,mt6366-regulator"; + + vdram1 { + regulator-name =3D "pp1125_emi_vdd2"; + regulator-min-microvolt =3D <1125000>; + regulator-max-microvolt =3D <1125000>; + regulator-ramp-delay =3D <12500>; + regulator-enable-ramp-delay =3D <0>; + regulator-allowed-modes =3D ; + regulator-always-on; + }; + + vproc11 { + regulator-name =3D "ppvar_dvdd_proc_bc_mt6366"; + regulator-min-microvolt =3D <600000>; + regulator-max-microvolt =3D <1200000>; + regulator-ramp-delay =3D <6250>; + regulator-enable-ramp-delay =3D <200>; + regulator-allowed-modes =3D ; + regulator-always-on; + }; + + vmddr { + regulator-name =3D "pm0750_emi_vmddr"; + regulator-min-microvolt =3D <700000>; + regulator-max-microvolt =3D <750000>; + regulator-enable-ramp-delay =3D <325>; + regulator-always-on; + }; + + vsram-proc11 { + regulator-name =3D "pp0900_dvdd_sram_bc"; + regulator-min-microvolt =3D <850000>; + regulator-max-microvolt =3D <1120000>; + regulator-ramp-delay =3D <6250>; + regulator-enable-ramp-delay =3D <240>; + regulator-always-on; + }; + }; + +... --=20 2.41.0.585.gd2178a4bd4-goog From nobody Thu Nov 14 05:42:51 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F3FC0015E for ; Thu, 3 Aug 2023 07:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233911AbjHCHzB (ORCPT ); Thu, 3 Aug 2023 03:55:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232075AbjHCHxy (ORCPT ); Thu, 3 Aug 2023 03:53:54 -0400 Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A9055A3 for ; Thu, 3 Aug 2023 00:43:35 -0700 (PDT) Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6bca88c3487so602079a34.2 for ; Thu, 03 Aug 2023 00:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048590; x=1691653390; 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; bh=ttTbR1j+/xUSVj1m9QYTEHinFwJXH5eiMkSTOV5Zx9Q=; b=O0Fg8jGSOQxNurX5K/cocwWzhhmGlP+SoZ9j2TkdWpOjkJQ940tPxY7WFkw1Vz3TQ8 LIf08kB7uu2YQBNTCnx1JbC0QxaFUIoWGWc4cE/VRXZWVPXJIazlH/CDtHIopaQykjSe QB9cyp3tYHO0i+eX191Lm8RwrQmUuqWIYgmQg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048590; x=1691653390; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ttTbR1j+/xUSVj1m9QYTEHinFwJXH5eiMkSTOV5Zx9Q=; b=loYF8f1ffNqQd1Ct2w7rKNGeWtm4Y47fijsjZ3xoFL1BX+sOW4M0d/oMCj6atH8Ihg l3KvDCWKQu6FhtL9wTU2eSW7NuFu9lCaTg5B37OqD5rUfjmdQiGSyvYcscq8Hj6TS52h m8SA/0EMp7Wp8wR0erhIiXrx7K4bH6tB7uX+a0ZLRIlLJ4dVZF9jlr5u8PplknV6cySz QMvMKQhGEIHH8mU+s2AGOTIzmqaXLG+9y9XJAnaTj743KJMoelrLveXB4/ODHoBYp4b4 H8mOhtP971AGAmj1Vv/7q/AoWFPc3kBSy/ZVFRUwK3qISsyPgCGEL4cVS5dNbOxowjaz AbDw== X-Gm-Message-State: ABy/qLbQ8gMHcw4MRyrWBDWXbhifxGj/QwQdK7XYt7SIsdqOlAvNi+rM WTmW8rowhunuS2gYJ3UbB8S4dQ== X-Google-Smtp-Source: APBJJlH6h7AHwx9O6A3lMvf0B0FHj+xANqujVBGZZyfDjDg28uxf/qLAru3swZsFmXvK70w+22Zhlw== X-Received: by 2002:a05:6870:4211:b0:19f:6711:8e0a with SMTP id u17-20020a056870421100b0019f67118e0amr18641255oac.32.1691048590537; Thu, 03 Aug 2023 00:43:10 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:10 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 5/9] regulator: mt6358: fix and drop type prefix in MT6366 regulator node names Date: Thu, 3 Aug 2023 15:42:43 +0800 Message-ID: <20230803074249.3065586-6-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The new MT6366 binding does away with the type prefix ("buck_", "ldo_") in the regulator node names. This better matches the PMIC pin names. Remaining underscores in names are also replaced with hyphens. Drop the type prefixes and replace remaining underscores to match the MT6366 binding. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6358-regulator.c | 70 ++++++++++++++-------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt635= 8-regulator.c index 3cb2e6768e25..5a43a84c7a3e 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -536,68 +536,68 @@ static const struct mt6358_regulator_info mt6358_regu= lators[] =3D { =20 /* The array is indexed by id(MT6366_ID_XXX) */ static const struct mt6358_regulator_info mt6366_regulators[] =3D { - MT6366_BUCK("buck_vdram1", VDRAM1, 500000, 2087500, 12500, + MT6366_BUCK("vdram1", VDRAM1, 500000, 2087500, 12500, 0x7f, MT6358_BUCK_VDRAM1_DBG0, 0x7f, MT6358_VDRAM1_ANA_CON0, 8), - MT6366_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, + MT6366_BUCK("vcore", VCORE, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 1), - MT6366_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, + MT6366_BUCK("vpa", VPA, 500000, 3650000, 50000, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, MT6358_VPA_ANA_CON0, 3), - MT6366_BUCK("buck_vproc11", VPROC11, 500000, 1293750, 6250, + MT6366_BUCK("vproc11", VPROC11, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VPROC11_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 1), - MT6366_BUCK("buck_vproc12", VPROC12, 500000, 1293750, 6250, + MT6366_BUCK("vproc12", VPROC12, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VPROC12_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 2), - MT6366_BUCK("buck_vgpu", VGPU, 500000, 1293750, 6250, + MT6366_BUCK("vgpu", VGPU, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VGPU_ELR0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 2), - MT6366_BUCK("buck_vs2", VS2, 500000, 2087500, 12500, + MT6366_BUCK("vs2", VS2, 500000, 2087500, 12500, 0x7f, MT6358_BUCK_VS2_DBG0, 0x7f, MT6358_VS2_ANA_CON0, 8), - MT6366_BUCK("buck_vmodem", VMODEM, 500000, 1293750, 6250, + MT6366_BUCK("vmodem", VMODEM, 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VMODEM_DBG0, 0x7f, MT6358_VMODEM_ANA_CON0, 8), - MT6366_BUCK("buck_vs1", VS1, 1000000, 2587500, 12500, + MT6366_BUCK("vs1", VS1, 1000000, 2587500, 12500, 0x7f, MT6358_BUCK_VS1_DBG0, 0x7f, MT6358_VS1_ANA_CON0, 8), - MT6366_REG_FIXED("ldo_vrf12", VRF12, + MT6366_REG_FIXED("vrf12", VRF12, MT6358_LDO_VRF12_CON0, 0, 1200000), - MT6366_REG_FIXED("ldo_vio18", VIO18, + MT6366_REG_FIXED("vio18", VIO18, MT6358_LDO_VIO18_CON0, 0, 1800000), - MT6366_REG_FIXED("ldo_vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000), - MT6366_REG_FIXED("ldo_vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), - MT6366_REG_FIXED("ldo_vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), - MT6366_REG_FIXED("ldo_vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), - MT6366_REG_FIXED("ldo_vaux18", VAUX18, + MT6366_REG_FIXED("vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000), + MT6366_REG_FIXED("vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), + MT6366_REG_FIXED("vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), + MT6366_REG_FIXED("vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), + MT6366_REG_FIXED("vaux18", VAUX18, MT6358_LDO_VAUX18_CON0, 0, 1800000), - MT6366_REG_FIXED("ldo_vbif28", VBIF28, + MT6366_REG_FIXED("vbif28", VBIF28, MT6358_LDO_VBIF28_CON0, 0, 2800000), - MT6366_REG_FIXED("ldo_vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000), - MT6366_REG_FIXED("ldo_va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000), - MT6366_REG_FIXED("ldo_vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000), - MT6366_REG_FIXED("ldo_vaud28", VAUD28, + MT6366_REG_FIXED("vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000), + MT6366_REG_FIXED("va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000), + MT6366_REG_FIXED("vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000), + MT6366_REG_FIXED("vaud28", VAUD28, MT6358_LDO_VAUD28_CON0, 0, 2800000), - MT6366_LDO("ldo_vdram2", VDRAM2, vdram2, + MT6366_LDO("vdram2", VDRAM2, vdram2, MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10), - MT6366_LDO("ldo_vsim1", VSIM1, vsim, + MT6366_LDO("vsim1", VSIM1, vsim, MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00), - MT6366_LDO("ldo_vibr", VIBR, vibr, + MT6366_LDO("vibr", VIBR, vibr, MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00), - MT6366_LDO("ldo_vusb", VUSB, vusb, + MT6366_LDO("vusb", VUSB, vusb, MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700), - MT6366_LDO("ldo_vefuse", VEFUSE, vefuse, + MT6366_LDO("vefuse", VEFUSE, vefuse, MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00), - MT6366_LDO("ldo_vmch", VMCH, vmch_vemc, + MT6366_LDO("vmch", VMCH, vmch_vemc, MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700), - MT6366_LDO("ldo_vemc", VEMC, vmch_vemc, + MT6366_LDO("vemc", VEMC, vmch_vemc, MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700), - MT6366_LDO("ldo_vcn33", VCN33, vcn33, + MT6366_LDO("vcn33", VCN33, vcn33, MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300), - MT6366_LDO("ldo_vmc", VMC, vmc, + MT6366_LDO("vmc", VMC, vmc, MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00), - MT6366_LDO("ldo_vsim2", VSIM2, vsim, + MT6366_LDO("vsim2", VSIM2, vsim, MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), - MT6366_LDO1("ldo_vsram_proc11", VSRAM_PROC11, 500000, 1293750, 6250, + MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), - MT6366_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, + MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f), - MT6366_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, + MT6366_LDO1("vsram-gpu", VSRAM_GPU, 500000, 1293750, 6250, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), - MT6366_LDO1("ldo_vsram_proc12", VSRAM_PROC12, 500000, 1293750, 6250, + MT6366_LDO1("vsram-proc12", VSRAM_PROC12, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f), }; =20 --=20 2.41.0.585.gd2178a4bd4-goog From nobody Thu Nov 14 05:42:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ADA9C0015E for ; Thu, 3 Aug 2023 07:55:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233961AbjHCHzG (ORCPT ); Thu, 3 Aug 2023 03:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbjHCHyA (ORCPT ); Thu, 3 Aug 2023 03:54:00 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 729C88A6D for ; Thu, 3 Aug 2023 00:43:36 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-56c884e1d74so425651eaf.0 for ; Thu, 03 Aug 2023 00:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048593; x=1691653393; 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; bh=+PS0ssiIqsOqxPlpp2oSfbt7ntbtXB4pivkxkQJXtwM=; b=jZNiROXV1Y8OAEvmMlJLmEDbubZTXUi1T2+J6xGMw0OsiLZ15TB0HeZWqjYU46/CPe Teqr2XwZ/lAv6OY3i3Jv9wng9jqRbKm1aJXfstf/p8iTD5zQGvBWlfT7POHUxIzVoNWe 0q/NWoCYElzBGTk+rxrPiwwo8g72n8oUwfl7A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048593; x=1691653393; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+PS0ssiIqsOqxPlpp2oSfbt7ntbtXB4pivkxkQJXtwM=; b=l/UZ2gvNbsXPGjYiS9qrBvpyFjckMUoExV9QSukTn7DbUkJ0d6ZOYkiQTrF/OghNeo bhR64udW3XN2NcW/MLGOIpZjKchGrECwIEYEw9PXl3EsMlYGYztq6MgW4fmLw+4z84EP j2CAqff/dkrv/KFEBvqXTGpUygeosVi0GNbgtkwm63D95xDl7LTyWCPBmwiRCN03f7ag AYsYgaPihdFIMc5Zlu3DcDHYb4frLwfy7e1XK5wbARPJ6IOBTcp0GRZvGQipmZqRoa5k AuDdLaM1Q864SMS2H5HJJMnG/QHrpQjfCs4e9DSF8ZlwBYPsOR47ve4dMMKLoaeNoDu8 AYWQ== X-Gm-Message-State: ABy/qLb7DCMasI48j3DmxH0wbJzD+VGEpat6KYMxbz5tdGtZ4E0LM8rI XZ+JhxvCVI8L5GoLcnAPrSg7Eg== X-Google-Smtp-Source: APBJJlE6IfyO/d4f2Lyl/G/W5Sw2/2IqJiJ69cq+4LFRNpfCQclGstrDp6B/OrjWe6ZsXFSIcgnCEA== X-Received: by 2002:a05:6870:420d:b0:1bb:e381:e1f1 with SMTP id u13-20020a056870420d00b001bbe381e1f1mr20111422oac.9.1691048593034; Thu, 03 Aug 2023 00:43:13 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.43.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:12 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 6/9] regulator: mt6358: Make MT6366 vcn18 LDO configurable Date: Thu, 3 Aug 2023 15:42:44 +0800 Message-ID: <20230803074249.3065586-7-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The VCN18 regulator on the MT6366 (only) actually has a wide configurable range of voltages, even though its name suggests a fixed output voltage. Convert it from a fixed LDO to a configurable LDO. Its range of settings is the same as the VM18 regulator, which is missing and will be added in a subsequent patch. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6358-regulator.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt635= 8-regulator.c index 5a43a84c7a3e..f8cdfa992c23 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -324,6 +324,27 @@ static const struct linear_range vldo28_ranges[] =3D { REGULATOR_LINEAR_RANGE(3000000, 11, 21, 10000), }; =20 +static const unsigned int mt6366_vcn18_vm18_selectors[] =3D { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; +static const struct linear_range mt6366_vcn18_vm18_ranges[] =3D { + REGULATOR_LINEAR_RANGE(600000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(700000, 11, 21, 10000), + REGULATOR_LINEAR_RANGE(800000, 22, 32, 10000), + REGULATOR_LINEAR_RANGE(900000, 33, 43, 10000), + REGULATOR_LINEAR_RANGE(1000000, 44, 54, 10000), + REGULATOR_LINEAR_RANGE(1100000, 55, 65, 10000), + REGULATOR_LINEAR_RANGE(1200000, 66, 76, 10000), + REGULATOR_LINEAR_RANGE(1300000, 77, 87, 10000), + REGULATOR_LINEAR_RANGE(1400000, 88, 98, 10000), + REGULATOR_LINEAR_RANGE(1500000, 99, 109, 10000), + REGULATOR_LINEAR_RANGE(1600000, 110, 120, 10000), + REGULATOR_LINEAR_RANGE(1700000, 121, 131, 10000), + REGULATOR_LINEAR_RANGE(1800000, 132, 142, 10000), + REGULATOR_LINEAR_RANGE(1900000, 143, 153, 10000), + REGULATOR_LINEAR_RANGE(2000000, 154, 164, 10000), + REGULATOR_LINEAR_RANGE(2100000, 165, 175, 10000), +}; + static unsigned int mt6358_map_mode(unsigned int mode) { return mode =3D=3D MT6358_BUCK_MODE_AUTO ? @@ -558,7 +579,6 @@ static const struct mt6358_regulator_info mt6366_regula= tors[] =3D { MT6358_LDO_VRF12_CON0, 0, 1200000), MT6366_REG_FIXED("vio18", VIO18, MT6358_LDO_VIO18_CON0, 0, 1800000), - MT6366_REG_FIXED("vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000), MT6366_REG_FIXED("vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), MT6366_REG_FIXED("vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), MT6366_REG_FIXED("vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), @@ -591,6 +611,8 @@ static const struct mt6358_regulator_info mt6366_regula= tors[] =3D { MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00), MT6366_LDO("vsim2", VSIM2, vsim, MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), + MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18, + MT6358_LDO_VCN18_CON0, 0, MT6358_VCN18_ANA_CON0, 0xf00), MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250, --=20 2.41.0.585.gd2178a4bd4-goog From nobody Thu Nov 14 05:42:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3864C0015E for ; Thu, 3 Aug 2023 07:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234056AbjHCHzP (ORCPT ); Thu, 3 Aug 2023 03:55:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232458AbjHCHyC (ORCPT ); Thu, 3 Aug 2023 03:54:02 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 891D18A74 for ; Thu, 3 Aug 2023 00:43:39 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-26814f65d7fso322063a91.0 for ; Thu, 03 Aug 2023 00:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048595; x=1691653395; 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; bh=Iu4rM2I/GmlnQQPwmur/VaOJeKpYAYS3uqnVLSVAkjM=; b=Jg6ZstZLtDnzNK+FTsWfrGdfnLrYCheLA4U+moG9RozkQyJzLhuYuAaqyBd+mhpkui p43qPAmjKYMndlpDSz7kiP2lCv1iglRLQfteItLRCqh3WBWboK5dj0Jy/9yee9HfAJf8 FSjs8I1Nq0fpHqudcZ1A3DTmciO2EIpFB2ci4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048595; x=1691653395; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Iu4rM2I/GmlnQQPwmur/VaOJeKpYAYS3uqnVLSVAkjM=; b=E9b7187bP8AipLhdcAq7amjKFOSE+IJa91hfTlpoLOP9Bla1JCDveLHNt2Mt7cklwX 03oyTSAz8qy4huewgg6w5JIy1gpqwsdc5ojwYwen9FsC+/++/msCiLmr4k82ANli42zm S8fleT2X6O4e8XOPp6hUA8GFFPV1NE19KEgIvZCAJVFN5iI6DV5AoJ3FgHToDktRTIyr AWZ2h4DHCo1r1vUgm0rptTZGLvflDNj2gg6AiGFuzlEToaBQe22zi24sodvSv4J7eeJy UXWXzRJN9zrlkUNfMyTmERBYVabIChRFRMO5iIpH0TeARLCdipZXaBllmE5m974zDdN1 Q8Lg== X-Gm-Message-State: ABy/qLacJt9qVRmAccmPP9oVFIJY574enD8u7LujNJ/3RFOapoXsSkc1 kNYXxiZdxd1frp/7lxcQpo8VAw== X-Google-Smtp-Source: APBJJlH/CQiq937gaJVAM3Gqj1z9ytNIyA+ymTRQQbX6MefVR7FjKBDsEr+nCBoixWkckvkgumyUXg== X-Received: by 2002:a17:90a:6fa6:b0:268:2658:3b01 with SMTP id e35-20020a17090a6fa600b0026826583b01mr14987096pjk.39.1691048595511; Thu, 03 Aug 2023 00:43:15 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:15 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 7/9] regulator: mt6358: Add missing regulators for MT6366 Date: Thu, 3 Aug 2023 15:42:45 +0800 Message-ID: <20230803074249.3065586-8-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When support for the MT6366 PMIC regulators was added, it was assumed that it had the same functionality as MT6358. In reality there are differences. A few regulators have different ranges, or were renamed and repurposed, or removed altogether. Add the 3 regulators that were missing from the original submission. These are added for completeness. VSRAM_CORE is not used in existing projects. VM18 and VMDDR feed DRAM related consumers, and are not used in-kernel. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6358-regulator.c | 20 ++++++++++++++++++++ include/linux/regulator/mt6358-regulator.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt635= 8-regulator.c index f8cdfa992c23..c9fd5904d13f 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -324,6 +324,20 @@ static const struct linear_range vldo28_ranges[] =3D { REGULATOR_LINEAR_RANGE(3000000, 11, 21, 10000), }; =20 +static const unsigned int mt6366_vmddr_selectors[] =3D { 0, 1, 2, 3, 4, 5,= 6, 7, 9, 12 }; +static const struct linear_range mt6366_vmddr_ranges[] =3D { + REGULATOR_LINEAR_RANGE(600000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(700000, 11, 21, 10000), + REGULATOR_LINEAR_RANGE(800000, 22, 32, 10000), + REGULATOR_LINEAR_RANGE(900000, 33, 43, 10000), + REGULATOR_LINEAR_RANGE(1000000, 44, 54, 10000), + REGULATOR_LINEAR_RANGE(1100000, 55, 65, 10000), + REGULATOR_LINEAR_RANGE(1200000, 66, 76, 10000), + REGULATOR_LINEAR_RANGE(1300000, 77, 87, 10000), + REGULATOR_LINEAR_RANGE(1500000, 88, 98, 10000), + REGULATOR_LINEAR_RANGE(1800000, 99, 109, 10000), +}; + static const unsigned int mt6366_vcn18_vm18_selectors[] =3D { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; static const struct linear_range mt6366_vcn18_vm18_ranges[] =3D { @@ -613,6 +627,10 @@ static const struct mt6358_regulator_info mt6366_regul= ators[] =3D { MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18, MT6358_LDO_VCN18_CON0, 0, MT6358_VCN18_ANA_CON0, 0xf00), + MT6366_LDO("vm18", VM18, mt6366_vcn18_vm18, + MT6358_LDO_VM18_CON0, 0, MT6358_VM18_ANA_CON0, 0xf00), + MT6366_LDO("vmddr", VMDDR, mt6366_vmddr, + MT6358_LDO_VMDDR_CON0, 0, MT6358_VMDDR_ANA_CON0, 0xf00), MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250, @@ -621,6 +639,8 @@ static const struct mt6358_regulator_info mt6366_regula= tors[] =3D { MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), MT6366_LDO1("vsram-proc12", VSRAM_PROC12, 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f), + MT6366_LDO1("vsram-core", VSRAM_CORE, 500000, 1293750, 6250, + MT6358_LDO_VSRAM_CORE_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON5, 0x7f), }; =20 static int mt6358_sync_vcn33_setting(struct device *dev) diff --git a/include/linux/regulator/mt6358-regulator.h b/include/linux/reg= ulator/mt6358-regulator.h index c71a6a9fce7a..562386f9b80e 100644 --- a/include/linux/regulator/mt6358-regulator.h +++ b/include/linux/regulator/mt6358-regulator.h @@ -86,6 +86,9 @@ enum { MT6366_ID_VMC, MT6366_ID_VAUD28, MT6366_ID_VSIM2, + MT6366_ID_VM18, + MT6366_ID_VMDDR, + MT6366_ID_VSRAM_CORE, MT6366_ID_RG_MAX, }; =20 --=20 2.41.0.585.gd2178a4bd4-goog From nobody Thu Nov 14 05:42:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92FE0C001E0 for ; Thu, 3 Aug 2023 07:55:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234117AbjHCHzT (ORCPT ); Thu, 3 Aug 2023 03:55:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232733AbjHCHyE (ORCPT ); Thu, 3 Aug 2023 03:54:04 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89BCF8A75 for ; Thu, 3 Aug 2023 00:43:39 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-26824c32cfbso453807a91.1 for ; Thu, 03 Aug 2023 00:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048598; x=1691653398; 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; bh=QYtZMjXodhA5vRSSpPNu8uTEt7aziOrY4tK7YzdA+uo=; b=FKJIi/gsJl3JfcSap6E6Vt2r7mOW4TWAroqb1zmDVHvIuVtRumHoq+UEgQkMZwRhCF cXX/7AMV+cwFpQkAVo1HLKpCEYy5afTKgWP1Kz45xOPMx02fz9U7PCN8cAXmzjygHY8t E08p3Oda9vE94Uy0mBFaEuYKBYqqj4gU4JCZw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048598; x=1691653398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QYtZMjXodhA5vRSSpPNu8uTEt7aziOrY4tK7YzdA+uo=; b=Gfwt0texxobwmgigWL3EKUeEoSOXKGcamixvmALOwhmmifXJWFUNrl+GPiNHOQfUwT Toebuv+RBT3IGSpHylmB3D9E2IEjU+Z6xYd8GC1/iJOxtXw5PShapu80w8rYQVvhsgeL 4f9chFSz8D5x6ILZVwg1DmWmTq6rVTReKmHM5PsST1z+5eeecyCutuMd5TCgpvD11Qhh LKqEPg7HWWEAekLdBa0aKO3/LzT23Qcwuq00LbIa1W+JRXMDSec7NTZNP9eO87s0KG9v 4o4P+JEqheC46eQdzdtWx97fseJ/KL46PwrfXLWM861NxEjzKqNETwFRsLJLtNcpvP6m 3yhQ== X-Gm-Message-State: ABy/qLYvmVywp3HyhaLtFGuoZMjgp1KInTlByRHGSth5JxotOMvUcabu gmeH17EGA+Wirdr2HGk9gxvGvj+hi7jW8W7FPT4= X-Google-Smtp-Source: APBJJlF+1NPFptChmyQLuvlMDD23CL9DIJVTVJOQVWL4sdpBufIZ3RogUiIXTOX8sI4cCANaPO4mWQ== X-Received: by 2002:a17:90b:1910:b0:268:2f6:61c4 with SMTP id mp16-20020a17090b191000b0026802f661c4mr23605812pjb.12.1691048598049; Thu, 03 Aug 2023 00:43:18 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:17 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 8/9] regulator: mt6358: Add supply names for MT6366 regulators Date: Thu, 3 Aug 2023 15:42:46 +0800 Message-ID: <20230803074249.3065586-9-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The DT bindings for MT6366 regulator defines the supply names for the PMIC. Add support for them by adding .supply_name field settings for each regulator. The buck regulators each have their own supply whose name can be derived from the regulator name. The LDOs have shared supplies. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6358-regulator.c | 73 ++++++++++++++-------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt635= 8-regulator.c index c9fd5904d13f..b3de933c58b3 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -139,6 +139,7 @@ struct mt6358_regulator_info { [MT6366_ID_##vreg] =3D { \ .desc =3D { \ .name =3D #vreg, \ + .supply_name =3D "vsys_" match, \ .of_match =3D of_match_ptr(match), \ .ops =3D &mt6358_volt_range_ops, \ .type =3D REGULATOR_VOLTAGE, \ @@ -161,10 +162,11 @@ struct mt6358_regulator_info { .modeset_mask =3D BIT(_modeset_shift), \ } =20 -#define MT6366_LDO(match, vreg, volt_ranges, enreg, enbit, vosel, vosel_ma= sk) \ +#define MT6366_LDO(match, vreg, volt_ranges, supply, enreg, enbit, vosel, = vosel_mask) \ [MT6366_ID_##vreg] =3D { \ .desc =3D { \ .name =3D #vreg, \ + .supply_name =3D supply, \ .of_match =3D of_match_ptr(match), \ .ops =3D &mt6358_volt_table_ops, \ .type =3D REGULATOR_VOLTAGE, \ @@ -185,12 +187,13 @@ struct mt6358_regulator_info { .qi =3D BIT(15), \ } =20 -#define MT6366_LDO1(match, vreg, min, max, step, \ +#define MT6366_LDO1(match, vreg, supply, min, max, step, \ _da_vsel_reg, _da_vsel_mask, \ vosel, vosel_mask) \ [MT6366_ID_##vreg] =3D { \ .desc =3D { \ .name =3D #vreg, \ + .supply_name =3D supply, \ .of_match =3D of_match_ptr(match), \ .ops =3D &mt6358_volt_range_ops, \ .type =3D REGULATOR_VOLTAGE, \ @@ -210,11 +213,12 @@ struct mt6358_regulator_info { .qi =3D BIT(0), \ } =20 -#define MT6366_REG_FIXED(match, vreg, \ +#define MT6366_REG_FIXED(match, vreg, supply, \ enreg, enbit, volt) \ [MT6366_ID_##vreg] =3D { \ .desc =3D { \ .name =3D #vreg, \ + .supply_name =3D supply, \ .of_match =3D of_match_ptr(match), \ .ops =3D &mt6358_volt_fixed_ops, \ .type =3D REGULATOR_VOLTAGE, \ @@ -589,57 +593,52 @@ static const struct mt6358_regulator_info mt6366_regu= lators[] =3D { 0x7f, MT6358_BUCK_VMODEM_DBG0, 0x7f, MT6358_VMODEM_ANA_CON0, 8), MT6366_BUCK("vs1", VS1, 1000000, 2587500, 12500, 0x7f, MT6358_BUCK_VS1_DBG0, 0x7f, MT6358_VS1_ANA_CON0, 8), - MT6366_REG_FIXED("vrf12", VRF12, - MT6358_LDO_VRF12_CON0, 0, 1200000), - MT6366_REG_FIXED("vio18", VIO18, - MT6358_LDO_VIO18_CON0, 0, 1800000), - MT6366_REG_FIXED("vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), - MT6366_REG_FIXED("vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), - MT6366_REG_FIXED("vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), - MT6366_REG_FIXED("vaux18", VAUX18, - MT6358_LDO_VAUX18_CON0, 0, 1800000), - MT6366_REG_FIXED("vbif28", VBIF28, - MT6358_LDO_VBIF28_CON0, 0, 2800000), - MT6366_REG_FIXED("vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000), - MT6366_REG_FIXED("va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000), - MT6366_REG_FIXED("vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000), - MT6366_REG_FIXED("vaud28", VAUD28, - MT6358_LDO_VAUD28_CON0, 0, 2800000), - MT6366_LDO("vdram2", VDRAM2, vdram2, + MT6366_REG_FIXED("vrf12", VRF12, "vs2_ldo2", MT6358_LDO_VRF12_CON0, 0, 12= 00000), + MT6366_REG_FIXED("vio18", VIO18, "vs1_ldo1", MT6358_LDO_VIO18_CON0, 0, 18= 00000), + MT6366_REG_FIXED("vfe28", VFE28, "vsys_ldo1", MT6358_LDO_VFE28_CON0, 0, 2= 800000), + MT6366_REG_FIXED("vcn28", VCN28, "vsys_ldo1", MT6358_LDO_VCN28_CON0, 0, 2= 800000), + MT6366_REG_FIXED("vxo22", VXO22, "vsys_ldo1", MT6358_LDO_VXO22_CON0, 0, 2= 200000), + MT6366_REG_FIXED("vaux18", VAUX18, "vsys_ldo1", MT6358_LDO_VAUX18_CON0, 0= , 1800000), + MT6366_REG_FIXED("vbif28", VBIF28, "vsys_ldo1", MT6358_LDO_VBIF28_CON0, 0= , 2800000), + MT6366_REG_FIXED("vio28", VIO28, "vsys_ldo2", MT6358_LDO_VIO28_CON0, 0, 2= 800000), + MT6366_REG_FIXED("va12", VA12, "vs2_ldo2", MT6358_LDO_VA12_CON0, 0, 12000= 00), + MT6366_REG_FIXED("vrf18", VRF18, "vs1_ldo1", MT6358_LDO_VRF18_CON0, 0, 18= 00000), + MT6366_REG_FIXED("vaud28", VAUD28, "vsys_ldo1", MT6358_LDO_VAUD28_CON0, 0= , 2800000), + MT6366_LDO("vdram2", VDRAM2, vdram2, "vs2_ldo1", MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0x10), - MT6366_LDO("vsim1", VSIM1, vsim, + MT6366_LDO("vsim1", VSIM1, vsim, "vsys_ldo1", MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00), - MT6366_LDO("vibr", VIBR, vibr, + MT6366_LDO("vibr", VIBR, vibr, "vsys_ldo3", MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00), - MT6366_LDO("vusb", VUSB, vusb, + MT6366_LDO("vusb", VUSB, vusb, "vsys_ldo1", MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700), - MT6366_LDO("vefuse", VEFUSE, vefuse, + MT6366_LDO("vefuse", VEFUSE, vefuse, "vs1_ldo1", MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00), - MT6366_LDO("vmch", VMCH, vmch_vemc, + MT6366_LDO("vmch", VMCH, vmch_vemc, "vsys_ldo2", MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700), - MT6366_LDO("vemc", VEMC, vmch_vemc, + MT6366_LDO("vemc", VEMC, vmch_vemc, "vsys_ldo3", MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700), - MT6366_LDO("vcn33", VCN33, vcn33, + MT6366_LDO("vcn33", VCN33, vcn33, "vsys_ldo3", MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300), - MT6366_LDO("vmc", VMC, vmc, + MT6366_LDO("vmc", VMC, vmc, "vsys_ldo2", MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00), - MT6366_LDO("vsim2", VSIM2, vsim, + MT6366_LDO("vsim2", VSIM2, vsim, "vsys_ldo2", MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), - MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18, + MT6366_LDO("vcn18", VCN18, mt6366_vcn18_vm18, "vs1_ldo1", MT6358_LDO_VCN18_CON0, 0, MT6358_VCN18_ANA_CON0, 0xf00), - MT6366_LDO("vm18", VM18, mt6366_vcn18_vm18, + MT6366_LDO("vm18", VM18, mt6366_vcn18_vm18, "vs1_ldo1", MT6358_LDO_VM18_CON0, 0, MT6358_VM18_ANA_CON0, 0xf00), - MT6366_LDO("vmddr", VMDDR, mt6366_vmddr, + MT6366_LDO("vmddr", VMDDR, mt6366_vmddr, "vs2_ldo1", MT6358_LDO_VMDDR_CON0, 0, MT6358_VMDDR_ANA_CON0, 0xf00), - MT6366_LDO1("vsram-proc11", VSRAM_PROC11, 500000, 1293750, 6250, + MT6366_LDO1("vsram-proc11", VSRAM_PROC11, "vs2_ldo3", 500000, 1293750, 62= 50, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), - MT6366_LDO1("vsram-others", VSRAM_OTHERS, 500000, 1293750, 6250, + MT6366_LDO1("vsram-others", VSRAM_OTHERS, "vs2_ldo3", 500000, 1293750, 62= 50, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f), - MT6366_LDO1("vsram-gpu", VSRAM_GPU, 500000, 1293750, 6250, + MT6366_LDO1("vsram-gpu", VSRAM_GPU, "vs2_ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), - MT6366_LDO1("vsram-proc12", VSRAM_PROC12, 500000, 1293750, 6250, + MT6366_LDO1("vsram-proc12", VSRAM_PROC12, "vs2_ldo3", 500000, 1293750, 62= 50, MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f), - MT6366_LDO1("vsram-core", VSRAM_CORE, 500000, 1293750, 6250, + MT6366_LDO1("vsram-core", VSRAM_CORE, "vs2_ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_CORE_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON5, 0x7f), }; =20 --=20 2.41.0.585.gd2178a4bd4-goog From nobody Thu Nov 14 05:42:52 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77056C001E0 for ; Thu, 3 Aug 2023 07:55:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234137AbjHCHz3 (ORCPT ); Thu, 3 Aug 2023 03:55:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbjHCHyI (ORCPT ); Thu, 3 Aug 2023 03:54:08 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB2058A7D for ; Thu, 3 Aug 2023 00:43:42 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-563f8e8a53dso322783a12.3 for ; Thu, 03 Aug 2023 00:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691048600; x=1691653400; 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; bh=vrPeOXoKc2hUZA03cIawOYELY2pxQM3mW6RdAg6oP4Q=; b=B64w8cCq99lVMCbkJggf/D7Dt6lLV5K5zg7oC1ThIFLNH3t5f1k3gSs8+jSLNo/ka8 7PcdgmMrzsxU8npBb4uQYX9e7OPVdfd6aJDYBa6wJ8Z1u0I3jU5/6hkQVS71dHVk4JrU iDZQJbm63agTlZLMmk5l7hGyemkE7pqJogmMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691048600; x=1691653400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vrPeOXoKc2hUZA03cIawOYELY2pxQM3mW6RdAg6oP4Q=; b=FH/2xER6hodDxtv3OrYCqKDm0VbwKBjy1hqMQBjurgmx7iP75jgajfKR1FXVw/rCT6 y+VaJt+2+vpUIMMVddrZXy01eGJuDyZL3SjIVEbwEBnnKAyDKHbOtzc+0KYOvAkxy6hK IwS4QTKlpKU6rmwKHa4WJaWAAratzUCXHzP8breqTWsajNXj43DOj3apOnjOptCOX4mt 3Q0WY1ut4YgXj9n205L2Jb198kmpeGok/WhjDlkOTytyIMLhFrWmOiNKhk4sUzgd9YFE HbDZUuRvOVoC5lk4NPndQ87RPkHlANdOz1ckCLnWR1WwsiLNij2PMqbShpP+PlilS1TN OUwA== X-Gm-Message-State: ABy/qLa4u7iFAG0lLN6T9T78bRajLvE8W4C8cI4PFSQRn2lXmvSwIWod rl3YmGrHvLWdwUN0HMNwDkftww== X-Google-Smtp-Source: APBJJlFurYNnQLVV4RTU7su1Ey1Aj+eNI2+WPiuqHQ1LmYf3d/bpTlfIF23QfhrRuirChqwjNcAVsA== X-Received: by 2002:a17:90a:d78d:b0:268:1f64:cefc with SMTP id z13-20020a17090ad78d00b002681f64cefcmr13321482pju.49.1691048600567; Thu, 03 Aug 2023 00:43:20 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:6f3e:66ee:db46:473b]) by smtp.gmail.com with ESMTPSA id l11-20020a17090a72cb00b00262d079720bsm2095753pjk.29.2023.08.03.00.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 00:43:20 -0700 (PDT) From: Chen-Yu Tsai To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , Zhiyong Tao , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 9/9] soc: mediatek: pwrap: add support for MT6366 PMIC Date: Thu, 3 Aug 2023 15:42:47 +0800 Message-ID: <20230803074249.3065586-10-wenst@chromium.org> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog In-Reply-To: <20230803074249.3065586-1-wenst@chromium.org> References: <20230803074249.3065586-1-wenst@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The MT6366 PMIC is mostly, but not fully, compatible with MT6358. It has a different set of regulators. Specifically, it lacks the camera related VCAM* LDOs, but has additional VM18, VMDDR, and VSRAM_CORE LDOs. Add a separate compatible for the MT6366 PMIC. Signed-off-by: Chen-Yu Tsai --- drivers/soc/mediatek/mtk-pmic-wrap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mt= k-pmic-wrap.c index 11095b8de71a..e3c0e767033b 100644 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c @@ -2257,6 +2257,8 @@ static const struct of_device_id of_slave_match_tbl[]= =3D { { .compatible =3D "mediatek,mt6357", .data =3D &pmic_mt6357 }, { .compatible =3D "mediatek,mt6358", .data =3D &pmic_mt6358 }, { .compatible =3D "mediatek,mt6359", .data =3D &pmic_mt6359 }, + /* MT6366 is mostly compatible with MT6358, except for slightly different= regulators. */ + { .compatible =3D "mediatek,mt6366", .data =3D &pmic_mt6358 }, =20 /* The MT6380 PMIC only implements a regulator, so we bind it * directly instead of using a MFD. --=20 2.41.0.585.gd2178a4bd4-goog