From patchwork Tue Sep 19 10:43:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 141840 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3322575vqi; Tue, 19 Sep 2023 04:52:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHg7SyD6YBP3fuiDiMFkSBVXbHKcf8dWFaU+fwxpH8i8R3LUOphhmKxqdu3E0CQVYFYSxnZ X-Received: by 2002:a05:6358:2910:b0:142:ecad:c6e with SMTP id y16-20020a056358291000b00142ecad0c6emr13968555rwb.2.1695124331997; Tue, 19 Sep 2023 04:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695124331; cv=none; d=google.com; s=arc-20160816; b=PEoltX1bviZ7mdExz+VQKQBXbbQNVsWYH1KKySQtBa0yHGfXmtSXZvdF8qdQxGehll /D1cpuTfYic5vWIWet/XtaDbgYCRklqZB5/39sydGk2PN521Ub/TkUBu2cbkzOlWpk9R 4mmIJf5GEVa2uhlw65B+bzSvO8YaUd7s0p/JIGEUTqFF3PZuZqWx0HRmtSxjW6wJuWUS WMZRk0g31byueZpCl8I5MsyBnlPmJAxByyGh6PweUvG/gIym6OSeHVp+mam3kaXpdSC0 JKLtleQUyqgvRjp0YmJJnKZNY2+tXiNJCs7dcGSmc9wsl2aeXzjnepShmqmWTaC8c2Bm GGKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=roMXUVdcRuUMZfWgJQHOy3KXiY94dTO1sbgsCPHuaMo=; fh=n2yjpXT3iPVrMEKybqKmdY0gqjTPDWsgm06ivA2dX5w=; b=XvhZw3suqJ16JLtM13j3NGQI237EeKj48E+JZJzPEiIlSb8TBC9GiJSJ1lbTHvtfj+ TOy/E7tVBToIgmvxCXCSQ2juKgdQcTTZ5mpKaohHRc3184VTvcdvT1yFkDt96h0qjppK Pxr4hqre5qtwgzqzw+IZd5BzDAj+MGRn9I+7R6qPCpyMzY3ZdTXTkI33RAfFx+h6WxHE oxooFA/Wv+0RFhVhLRzzmbxcjpkmUZZT5vJAMtw6y4YzgSH97d3MBT+g67zAqBwfbU9W NMfVDd4hLOwoIIOxA/QCpERp0mEGk6dDo73RXdJGCcIEN+hKj1xTMGkgqv8WQwNsBHc8 /usQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UjPI7JOa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h38-20020a631226000000b0056950e1546asi8815609pgl.356.2023.09.19.04.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 04:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UjPI7JOa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 15DA18031F04; Tue, 19 Sep 2023 03:47:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231881AbjISKrk (ORCPT + 26 others); Tue, 19 Sep 2023 06:47:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231890AbjISKrd (ORCPT ); Tue, 19 Sep 2023 06:47:33 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48C8B129 for ; Tue, 19 Sep 2023 03:47:27 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1c43166b7e5so37263565ad.3 for ; Tue, 19 Sep 2023 03:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120446; x=1695725246; 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; bh=roMXUVdcRuUMZfWgJQHOy3KXiY94dTO1sbgsCPHuaMo=; b=UjPI7JOa8q9pVwx3Qf+QGU/XhBeSJCYRDJC7uce322v0a1eDmS7I5xldXQ3EpWObA2 FhTp/Zo9XPbcSiNfzT3J1bFVlfoF3H2PBHE8M8RcY+37Q9u8TwwHx6hlAedhzbPXjxEJ UStJ+At6ah7V9MAFwx3df//B6qw76NpfuCnZI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120446; x=1695725246; 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=roMXUVdcRuUMZfWgJQHOy3KXiY94dTO1sbgsCPHuaMo=; b=Iw9QH6mwd2xgzOLKeBi4sc84v6iMM8I5SurmuaFYXhvZztyTJqp5FO1sQdGQpEpFSp UrKeWpqvYXi5bQTSMGtG3r4gbW2XawxZGHDbbvjFq136/4zBaHVJ4hwU3p3TKdos6ClW s2nERn/QWCoBl6zMOzXQSJwlovwI8Yyfznr0ju5xmV2FHSerBSPK7qORQPLDnmfQ/Kgh /rCMijEeCZy3tmHldzNHt7+gQz8rwUyT7NkFHf0TuAW25Kqy5O9RPz/+6FWx4Bzg97nW AePwbUjckLceo5/PR2Ab5kHbe8ADOueTsQ7KUDiyw9X0MVorr+IEYLtLklneONvZhkMZ QI8A== X-Gm-Message-State: AOJu0YzYg/g+V2OHQLzEahUaSHWyWUHxV1cTt++djOyAtlDSqFMg8QoX bmf4QefVqJaWfpzFEyAczN2sqQ== X-Received: by 2002:a17:902:ea0a:b0:1c0:9b7c:f82a with SMTP id s10-20020a170902ea0a00b001c09b7cf82amr14897917plg.53.1695120446625; Tue, 19 Sep 2023 03:47:26 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:26 -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, Krzysztof Kozlowski Subject: [PATCH v3 01/12] dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC Date: Tue, 19 Sep 2023 18:43:44 +0800 Message-ID: <20230919104357.3971512-2-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:47:44 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777466691071891623 X-GMAIL-MSGID: 1777466691071891623 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 and VLDO28, but has additional VM18, VMDDR, and VSRAM_CORE LDOs. The PMICs contain a chip ID register that can be used to detect which exact model is preset, so it is possible to share a common base compatible string. Add a separate compatible for the MT6366 PMIC, with a fallback to the MT6358 PMIC. Fixes: 49be16305587 ("dt-bindings: mfd: Add compatible for the MediaTek MT6366 PMIC") Signed-off-by: Chen-Yu Tsai Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/mfd/mt6397.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/mt6397.txt b/Documentation/devicetree/bindings/mfd/mt6397.txt index 294693a8906c..10540aa7afa1 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", "mediatek,mt6358" for PMIC MT6366 "mediatek,mt6397" for PMIC MT6397 Optional subnodes: @@ -40,6 +41,7 @@ Optional subnodes: - compatible: "mediatek,mt6323-regulator" see ../regulator/mt6323-regulator.txt - compatible: "mediatek,mt6358-regulator" + - compatible: "mediatek,mt6366-regulator", "mediatek-mt6358-regulator" see ../regulator/mt6358-regulator.txt - compatible: "mediatek,mt6397-regulator" see ../regulator/mt6397-regulator.txt From patchwork Tue Sep 19 10:43:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 142065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3626429vqi; Tue, 19 Sep 2023 12:21:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDYRfXziLhdk+TNdZ+PSNpVOB1EFu01TFgjGpNRx39lhfUSNpA7qYPsV19yoC/gDOuqkN6 X-Received: by 2002:a05:6a21:3e0a:b0:14c:d105:2d16 with SMTP id bk10-20020a056a213e0a00b0014cd1052d16mr482598pzc.32.1695151300743; Tue, 19 Sep 2023 12:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695151300; cv=none; d=google.com; s=arc-20160816; b=fKUemkAQSAiiFO16bTdweeXyi9uvz64FyqPeZaoQHAM8r5KQp3hStRhMIjKnJ4N6VN wZK5cgWtIvpZe8CG5kNV3Be/lGWMxmFdB3/CsZMJeyEGSVikJRLSjsXtK4NRnDfqfh5S 5EMG4Ma3k8nxIAsoStQ4zYfeSJsvBOU55V4lVoiAkAtxh9a3+7DQ/kaJUAN58l9Z4HEg 2yesGrpZyuJN9FjKI9dePXinQ/D4YaBplAdI+NCleyeF32wDW6Ot0oBDj+a5wbuQiTqt 0kXtvnsYBXjqyAs6TTRZtQgz3v2um3TztuXq7KgcPnw/ge9gIapHP1jKf+meBNf8Lykp JDww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cWWr9tJkTGpmSZl1HYbndhbuM8BzxHdpYCoI6IJDPPY=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=lOX/3Akm9b1ZXNzyD0DHKiblcXcbvllYndZEHULYvcxNR5pO2gQu/gpJxYc47NHND3 IsY2v32aBHaCALP0Z3EwlkYQO8aAohFz6rqNr2Dkt9vSuNieowuc9u/CSO7hHekpp6qS npgmNWgpAZ+TLZZz0Y6uTsNmQCY7fxy3gMG6S+sVPqnvgjP/I7m6Y6qc+bq0303gUlEn HtTW/ovw//Ivxabo3x2rYkWUyjkArYE/e9CfkmWlg9gdKo0muGvlVWFXTnXsfY9im3lh 5L1wZ6bIH/HQ9X5Vxw/UKJ15Kg2DfF9am9DNlXV5geF7GkZvRz9E+aA+3mLkuF2ilYj6 4PVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=E70vQfMn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d2-20020a633602000000b00569cd6ead3asi415672pga.643.2023.09.19.12.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 12:21:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=E70vQfMn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5BADD809D452; Tue, 19 Sep 2023 03:47:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231899AbjISKrn (ORCPT + 26 others); Tue, 19 Sep 2023 06:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231859AbjISKri (ORCPT ); Tue, 19 Sep 2023 06:47:38 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5289123 for ; Tue, 19 Sep 2023 03:47:29 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1c44c7dbaf9so29530055ad.1 for ; Tue, 19 Sep 2023 03:47:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120449; x=1695725249; 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; bh=cWWr9tJkTGpmSZl1HYbndhbuM8BzxHdpYCoI6IJDPPY=; b=E70vQfMnlQ039f1xccLAM2mWD9jltPmvrvAj0vqbUQYr3PHFjHcHnO44wIqSwIcQgP 4Hu9uzwpezCnLMDF2XArQBfO39ZGxLz6BA1nDkglGj7y0cBkoXLe5q1ksfBThe2eGpfi W0I2MU9f0pET+No91pgMPD3308B4qZNj4NGv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120449; x=1695725249; 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=cWWr9tJkTGpmSZl1HYbndhbuM8BzxHdpYCoI6IJDPPY=; b=iRHT+YADphI1S1udRmt7h7O8Log6EW1K0t270FlD1UY64cSbdsZs3itkFOLWgMQSjn bj/uvFKdw2aXF7tLXrJ2c0ESCrty5gXsnmsNn9+iG0y/d4yTZMN6y/qb1b03Ch47jppo zxQcJUWA3lk3YJgeMjCyvl6Oegwy1jtgqi8xCNnV8yFlITSznnHKg8bbIRsU8C7ylbSf NEnaEUb+Tojunm+aXRXFJylV8NhEKhkqRt40noflx23rL4yWsshhWIaLd4QXbXVnxxL6 j0R5xQSISRftQb/r4jbmWBfCQjVISV9U+UqrqfFZlZvYaDTSTAYC49v3pP4l/Z+fpGnH ZeaQ== X-Gm-Message-State: AOJu0Yx0QvEZd5Y0rSzYRXn44eahj9EZvXTaKxkD6jdsWF9cGfGwRmhW G8yASPy0ro/KOsUrtI6ODEfyOg== X-Received: by 2002:a17:902:7796:b0:1bd:da96:dc70 with SMTP id o22-20020a170902779600b001bdda96dc70mr11145224pll.49.1695120449235; Tue, 19 Sep 2023 03:47:29 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:28 -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 v3 02/12] regulator: dt-bindings: mt6358: Convert to DT schema Date: Tue, 19 Sep 2023 18:43:45 +0800 Message-ID: <20230919104357.3971512-3-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:47:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777470638071474996 X-GMAIL-MSGID: 1777494970604034313 Convert this from the old style text based binding to the new DT schema style. This will make adding the MT6366 portion easier. The examples have been trimmed down considerably, and the remaining entries now match what is seen in actual device trees, minus some properties that aren't covered by the bindings yet, or don't make sense on their own. The original submitter seems to have left MediaTek, so instead the submitter and maintainer for the MT6366 binding is listed. Cc: Zhiyong Tao Signed-off-by: Chen-Yu Tsai --- Changes since v2: - Added missing end-of-string match to regulator names - regulator-coupled-* properties in example dropped - #include and regulator-allowed-modes moved to new patch .../regulator/mediatek,mt6358-regulator.yaml | 97 +++++ .../bindings/regulator/mt6358-regulator.txt | 350 ------------------ 2 files changed, 97 insertions(+), 350 deletions(-) create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml delete mode 100644 Documentation/devicetree/bindings/regulator/mt6358-regulator.txt diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml new file mode 100644 index 000000000000..5daef024de3e --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/mediatek,mt6358-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek MT6358 Regulator + +maintainers: + - Zhiyong Tao + +description: + Regulator node of the PMIC. This node should under the PMIC's device node. + All voltage regulators provided by the PMIC are described as sub-nodes of + this node. + +properties: + compatible: + const: mediatek,mt6358-regulator + +patternProperties: + "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": + description: Buck regulators + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(a|rf)12$": + description: LDOs with fixed 1.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v((aux|cn|io|rf)18|camio)$": + description: LDOs with fixed 1.8V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vxo22$": + description: LDOs with fixed 2.2V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_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 + + "^ldo_vusb$": + description: LDOs with fixed 3.0V output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_vsram_(gpu|others|proc1[12])$": + description: LDOs with variable output + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + + "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": + description: LDOs with variable output and 0~100/10mV tuning + type: object + $ref: regulator.yaml# + unevaluatedProperties: false + +required: + - compatible + +additionalProperties: false + +examples: + - | + regulator { + compatible = "mediatek,mt6358-regulator"; + + buck_vgpu { + regulator-name = "vgpu"; + regulator-min-microvolt = <625000>; + regulator-max-microvolt = <900000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <200>; + }; + + ldo_vsram_gpu { + regulator-name = "vsram_gpu"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1000000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <240>; + }; + }; + +... diff --git a/Documentation/devicetree/bindings/regulator/mt6358-regulator.txt b/Documentation/devicetree/bindings/regulator/mt6358-regulator.txt deleted file mode 100644 index b6384306db5c..000000000000 --- a/Documentation/devicetree/bindings/regulator/mt6358-regulator.txt +++ /dev/null @@ -1,350 +0,0 @@ -MediaTek MT6358 Regulator - -All voltage regulators provided by the MT6358 PMIC are described as the -subnodes of the MT6358 regulators node. Each regulator is named according -to its regulator type, buck_ and ldo_. The definition for each -of these nodes is defined using the standard binding for regulators at -Documentation/devicetree/bindings/regulator/regulator.txt. - -The valid names for regulators are:: -BUCK: - buck_vdram1, buck_vcore, buck_vpa, buck_vproc11, buck_vproc12, buck_vgpu, - buck_vs2, buck_vmodem, buck_vs1 -LDO: - ldo_vdram2, ldo_vsim1, ldo_vibr, ldo_vrf12, ldo_vio18, ldo_vusb, ldo_vcamio, - ldo_vcamd, ldo_vcn18, ldo_vfe28, ldo_vsram_proc11, ldo_vcn28, ldo_vsram_others, - ldo_vsram_gpu, ldo_vxo22, ldo_vefuse, ldo_vaux18, ldo_vmch, ldo_vbif28, - ldo_vsram_proc12, ldo_vcama1, ldo_vemc, ldo_vio28, ldo_va12, ldo_vrf18, - ldo_vcn33, ldo_vcama2, ldo_vmc, ldo_vldo28, ldo_vaud28, ldo_vsim2 - -Example: - - pmic { - compatible = "mediatek,mt6358"; - - mt6358regulator: mt6358regulator { - compatible = "mediatek,mt6358-regulator"; - - mt6358_vdram1_reg: buck_vdram1 { - regulator-compatible = "buck_vdram1"; - regulator-name = "vdram1"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <2087500>; - regulator-ramp-delay = <12500>; - regulator-enable-ramp-delay = <0>; - regulator-always-on; - }; - - mt6358_vcore_reg: buck_vcore { - regulator-name = "vcore"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <200>; - regulator-always-on; - }; - - mt6358_vpa_reg: buck_vpa { - regulator-name = "vpa"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <3650000>; - regulator-ramp-delay = <50000>; - regulator-enable-ramp-delay = <250>; - }; - - mt6358_vproc11_reg: buck_vproc11 { - regulator-name = "vproc11"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <200>; - regulator-always-on; - }; - - mt6358_vproc12_reg: buck_vproc12 { - regulator-name = "vproc12"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <200>; - regulator-always-on; - }; - - mt6358_vgpu_reg: buck_vgpu { - regulator-name = "vgpu"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <200>; - }; - - mt6358_vs2_reg: buck_vs2 { - regulator-name = "vs2"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <2087500>; - regulator-ramp-delay = <12500>; - regulator-enable-ramp-delay = <0>; - regulator-always-on; - }; - - mt6358_vmodem_reg: buck_vmodem { - regulator-name = "vmodem"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <900>; - regulator-always-on; - }; - - mt6358_vs1_reg: buck_vs1 { - regulator-name = "vs1"; - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <2587500>; - regulator-ramp-delay = <12500>; - regulator-enable-ramp-delay = <0>; - regulator-always-on; - }; - - mt6358_vdram2_reg: ldo_vdram2 { - regulator-name = "vdram2"; - regulator-min-microvolt = <600000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <3300>; - }; - - mt6358_vsim1_reg: ldo_vsim1 { - regulator-name = "vsim1"; - regulator-min-microvolt = <1700000>; - regulator-max-microvolt = <3100000>; - regulator-enable-ramp-delay = <540>; - }; - - mt6358_vibr_reg: ldo_vibr { - regulator-name = "vibr"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <3300000>; - regulator-enable-ramp-delay = <60>; - }; - - mt6358_vrf12_reg: ldo_vrf12 { - compatible = "regulator-fixed"; - regulator-name = "vrf12"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <1200000>; - regulator-enable-ramp-delay = <120>; - }; - - mt6358_vio18_reg: ldo_vio18 { - compatible = "regulator-fixed"; - regulator-name = "vio18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <2700>; - regulator-always-on; - }; - - mt6358_vusb_reg: ldo_vusb { - regulator-name = "vusb"; - regulator-min-microvolt = <3000000>; - regulator-max-microvolt = <3100000>; - regulator-enable-ramp-delay = <270>; - regulator-always-on; - }; - - mt6358_vcamio_reg: ldo_vcamio { - compatible = "regulator-fixed"; - regulator-name = "vcamio"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vcamd_reg: ldo_vcamd { - regulator-name = "vcamd"; - regulator-min-microvolt = <900000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vcn18_reg: ldo_vcn18 { - compatible = "regulator-fixed"; - regulator-name = "vcn18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vfe28_reg: ldo_vfe28 { - compatible = "regulator-fixed"; - regulator-name = "vfe28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vsram_proc11_reg: ldo_vsram_proc11 { - regulator-name = "vsram_proc11"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <240>; - regulator-always-on; - }; - - mt6358_vcn28_reg: ldo_vcn28 { - compatible = "regulator-fixed"; - regulator-name = "vcn28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vsram_others_reg: ldo_vsram_others { - regulator-name = "vsram_others"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <240>; - regulator-always-on; - }; - - mt6358_vsram_gpu_reg: ldo_vsram_gpu { - regulator-name = "vsram_gpu"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <240>; - }; - - mt6358_vxo22_reg: ldo_vxo22 { - compatible = "regulator-fixed"; - regulator-name = "vxo22"; - regulator-min-microvolt = <2200000>; - regulator-max-microvolt = <2200000>; - regulator-enable-ramp-delay = <120>; - regulator-always-on; - }; - - mt6358_vefuse_reg: ldo_vefuse { - regulator-name = "vefuse"; - regulator-min-microvolt = <1700000>; - regulator-max-microvolt = <1900000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vaux18_reg: ldo_vaux18 { - compatible = "regulator-fixed"; - regulator-name = "vaux18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vmch_reg: ldo_vmch { - regulator-name = "vmch"; - regulator-min-microvolt = <2900000>; - regulator-max-microvolt = <3300000>; - regulator-enable-ramp-delay = <60>; - }; - - mt6358_vbif28_reg: ldo_vbif28 { - compatible = "regulator-fixed"; - regulator-name = "vbif28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vsram_proc12_reg: ldo_vsram_proc12 { - regulator-name = "vsram_proc12"; - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1293750>; - regulator-ramp-delay = <6250>; - regulator-enable-ramp-delay = <240>; - regulator-always-on; - }; - - mt6358_vcama1_reg: ldo_vcama1 { - regulator-name = "vcama1"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3000000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vemc_reg: ldo_vemc { - regulator-name = "vemc"; - regulator-min-microvolt = <2900000>; - regulator-max-microvolt = <3300000>; - regulator-enable-ramp-delay = <60>; - regulator-always-on; - }; - - mt6358_vio28_reg: ldo_vio28 { - compatible = "regulator-fixed"; - regulator-name = "vio28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_va12_reg: ldo_va12 { - compatible = "regulator-fixed"; - regulator-name = "va12"; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <1200000>; - regulator-enable-ramp-delay = <270>; - regulator-always-on; - }; - - mt6358_vrf18_reg: ldo_vrf18 { - compatible = "regulator-fixed"; - regulator-name = "vrf18"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-enable-ramp-delay = <120>; - }; - - mt6358_vcn33_reg: ldo_vcn33 { - regulator-name = "vcn33"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3500000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vcama2_reg: ldo_vcama2 { - regulator-name = "vcama2"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3000000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vmc_reg: ldo_vmc { - regulator-name = "vmc"; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; - regulator-enable-ramp-delay = <60>; - }; - - mt6358_vldo28_reg: ldo_vldo28 { - regulator-name = "vldo28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <3000000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vaud28_reg: ldo_vaud28 { - compatible = "regulator-fixed"; - regulator-name = "vaud28"; - regulator-min-microvolt = <2800000>; - regulator-max-microvolt = <2800000>; - regulator-enable-ramp-delay = <270>; - }; - - mt6358_vsim2_reg: ldo_vsim2 { - regulator-name = "vsim2"; - regulator-min-microvolt = <1700000>; - regulator-max-microvolt = <3100000>; - regulator-enable-ramp-delay = <540>; - }; - }; - }; From patchwork Tue Sep 19 10:43:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 142127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3756531vqi; Tue, 19 Sep 2023 16:49:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1qL9hpZ409K4qCml3iEwAtxzDwV+IZENqMZ/bw+50vur3VfTeg+Z+EBBdcDwU+f0SBLkf X-Received: by 2002:a05:6a00:9a0:b0:690:d413:ee0f with SMTP id u32-20020a056a0009a000b00690d413ee0fmr1419053pfg.2.1695167357448; Tue, 19 Sep 2023 16:49:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695167357; cv=none; d=google.com; s=arc-20160816; b=UpPFQjKMxzAuM9tMIcgGRgw/kFV/xt7vcQvGD3iPRk+F3x4YLj/x1N3Y1aK/NKhYsl d8P2X54tKC0OIm5gw57ArYHfxGZGTcTYn0AA9MIqeTZpGwRqYTqn/aQ8gBWi0W5hFLZr 9sdqY7KENswZoBBfuzMy1rgYYGYrpBfhyYlQJ+tIEw1m5wjWuLSGU4st/ZicBrC4IMt1 d2h7BIKSCJ3VsMeJcuZHh2Kx72EDO2bEI7Db+SWX4hHUcT63G4KkQ+EHXNW+XQ87kbpt phyP+mQtyG08lvhVfgu6YYEVMNM7qbkBVbQ7mpKO5xmdn6xZBqDgDN3VzahLdlCfFGyD 3Qlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DfsDvbPSiwYQ6ykzK/+9gGTqaEflNO3ef5+ehoxsuns=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=X6CKpAG43kDaRgAjwqU+vZjV81A+xQpp6ulVqMp+1DNyajgXmy75h0MlFfXGDxqpZE 3DcKBi+CjhIE2Ei0k1WP4vQynCD8qkC36BmjT9tb3RTLNjRqXFSheiwWpfeEQuhHiqsv PDJ3WFgksj9IrqgUJ0dqvKNXfJzQUATpQbJXW7z+o4PV1HxPcsFKJFbDwqt4/6jbHsm7 azR5Bv6KQ5ADaioudKt8s4IBBNNYtDMt7ONXmqh3Nw/bjoqoGtdj7BeZiYa2NGewwsIK XlhFSG+oTTcwJ/LjpLBDenh8CPp84yV1Ffw9VHTxHhuhG2Lper/HUx3cMy8LW6HNdoNs dnog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nLVfyZne; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k184-20020a6384c1000000b00577680ccf1bsi1631940pgd.709.2023.09.19.16.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 16:49:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nLVfyZne; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4FA4680D7E41; Tue, 19 Sep 2023 03:47:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230145AbjISKrr (ORCPT + 26 others); Tue, 19 Sep 2023 06:47:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbjISKrj (ORCPT ); Tue, 19 Sep 2023 06:47:39 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64CB312B for ; Tue, 19 Sep 2023 03:47:32 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-690bc3f82a7so1005293b3a.0 for ; Tue, 19 Sep 2023 03:47:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120452; x=1695725252; 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; bh=DfsDvbPSiwYQ6ykzK/+9gGTqaEflNO3ef5+ehoxsuns=; b=nLVfyZneTcBJ/lTRGHVYuKIhZKV9MUSv/+e5lYgHPZIrNtLR1Q4Jp+e6/q4YqWg4cJ 9w/sAHM68WJnsjp0tw1+qejgP5qMnYJ0QXLvAsm/ftp+xnC8d2QnCp7I2jKZ19EP/J9d iBN6pqwtESAE+nAm7qvjfi3oi8FeSnlKetiDQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120452; x=1695725252; 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=DfsDvbPSiwYQ6ykzK/+9gGTqaEflNO3ef5+ehoxsuns=; b=jyTqU/aYQGWXaAOwUy0/uV66rPhgwIFIC2RqhMXhvzPZvay23GHBWhc7+432XPI9yv CAehncKM1la3yUEUTSh9lSmg3KP+io2o1uNuyB8YjEF4mg+UP64uztbGmNN5V2+ued4C byTy0cBJbWJLrkJoz7tD3VGgZhV+F078hSZqeW8z22vxMl8+HA1nz8fUD/4HvRm2W18B WqJRW60Y+5is2hX2tRtXw7f7/GtmBEztpmmT7jvMz9f5w0y8/BlFNIvDAbIWgSMu5Y8+ d/iO95TxKGaMnuq+LRNiJkCfDOoBDGaeKsA+MW2ZWDvxFaUiqZ1f8KaDO2U9MdFmwObQ 77Ww== X-Gm-Message-State: AOJu0YznvQAqtkQlk5xC3wSiBgACSc3d5ziuoklBDAxaCko4c4lZNwio GSBAlSCKge+7hMn5JFZyRYAObA== X-Received: by 2002:a05:6a21:498e:b0:142:aced:c643 with SMTP id ax14-20020a056a21498e00b00142acedc643mr10956371pzc.31.1695120451840; Tue, 19 Sep 2023 03:47:31 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:31 -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 v3 03/12] regulator: dt-bindings: mt6358: Add regulator-allowed-modes property Date: Tue, 19 Sep 2023 18:43:46 +0800 Message-ID: <20230919104357.3971512-4-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:47:54 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777511806744175576 X-GMAIL-MSGID: 1777511806744175576 The MT6358 PMIC allows changing operating modes for the buck regulators, but not the LDOs. Existing device trees and the Linux implementation already utilize this through the standard regulator-allowed-modes property. The values currently used in existing device trees are simply raw numbers. The values in the Linux driver are matching numbers defined with macros denoting the two supported modes. Turns out these two modes are common across parts of the larger MT63xx PMIC family. The MT6397 regulator binding already has macros for the two modes, with matching numbers. Codify the supported values for regulator-allowed-modes for the MT6358 in the device tree binding: 0 and 1 are supported for buck regulators, and the property should not be present for LDO regulators. Users should use the dt-bindings/regulator/mediatek,mt6397-regulator.h header for the macros, instead of using raw numbers. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - new patch .../regulator/mediatek,mt6358-regulator.yaml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index 5daef024de3e..62e8fa6b4306 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -23,48 +23,71 @@ patternProperties: description: Buck regulators type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: + description: | + Buck regulatpr operating modes allowed. Valid values below. + Users should use the macros from dt-bindings/regulator/mediatek,mt6397-regulator.h + 0 (MT6397_BUCK_MODE_AUTO): Auto PFM/PWM mode + 1 (MT6397_BUCK_MODE_FORCE_PWM): Forced PWM mode + items: + enum: [0, 1] unevaluatedProperties: false "^ldo_v(a|rf)12$": description: LDOs with fixed 1.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_v((aux|cn|io|rf)18|camio)$": description: LDOs with fixed 1.8V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_vxo22$": description: LDOs with fixed 2.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_v(aud|bif|cn|fe|io)28$": description: LDOs with fixed 2.8V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_vusb$": description: LDOs with fixed 3.0V output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_vsram_(gpu|others|proc1[12])$": description: LDOs with variable output type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": description: LDOs with variable output and 0~100/10mV tuning type: object $ref: regulator.yaml# + properties: + regulator-allowed-modes: false unevaluatedProperties: false required: @@ -74,6 +97,8 @@ additionalProperties: false examples: - | + #include + regulator { compatible = "mediatek,mt6358-regulator"; @@ -83,6 +108,8 @@ examples: regulator-max-microvolt = <900000>; regulator-ramp-delay = <6250>; regulator-enable-ramp-delay = <200>; + regulator-allowed-modes = ; }; ldo_vsram_gpu { From patchwork Tue Sep 19 10:43:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 142002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3548272vqi; Tue, 19 Sep 2023 10:13:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7SDakhIUBKtU1lsQw73Zr97YxheY4muds33dinc40NRYYEQl4KlfuvrURhszgIrl/vcO6 X-Received: by 2002:a05:6a00:14c2:b0:690:3793:17e5 with SMTP id w2-20020a056a0014c200b00690379317e5mr321655pfu.4.1695143586471; Tue, 19 Sep 2023 10:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695143586; cv=none; d=google.com; s=arc-20160816; b=W8D0UpSE+eIfIU1KR9tbDjJ/6sCHpPTzrJ0KYIwOmlnUJo3rvVF+K2dOgqe+tuxyPx DWSPUxQVVT/hd1xx/z9Zxn+JyQJ1i1QS0qW16IBRU60iuCJTiqyML2+lrspWETNSRyqv nFuqcek32b+w2Id5GOjiU+PTsrNeVxCLdWnyPCNC7DYYunIKHjUjjv2B3AmJESE4lvMA xF4rozjp5vmJRBlYX/5hbUrqHS/jeOFbBJUIzeZk7wmaJ6fcxAn9ofmntQVkriP0Oubq z+xu0xgX+seBhR4XYZojsMB3zvJxIGO/ucmw8gNr7KccI9MI/UQlVzK7JrAYBk47HoTu oCFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BSYY97oVgPZ5kb8TuDqHkXyCfyuOKBglbVv/457JBMY=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=R2GiQUaR1JukZA7Nx2uT1lOJwFL1zwxfch6WePARc2BJZsNSr5NfA53i62Ff4QngAa yaFDdQGB939yfC2NdIBuAemeSAlrjVXqemcTZ6HoMyIh2sXqai6AQfcSZKtDUrdi4aGo r5/HylOKhmJPHVjV7KvbbRbs3GKhho1J8rCd//gwA7so+qBcCJCOXxgczP8Yd7Tv4+Ip HrrwIRc98cvTcImIReRSBtrprl+9Bwvuoyq9DECwqG2L8xKmMo2hZCEWOeXbYAF7O785 chM/jiMs3KE7Vz2Me/VRwQDz5PCMQq/0RSHdh5oGtOIfWg2wYGDf9a8CNKwlknQkEz7d Qzuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cRB+Fyg+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id r201-20020a632bd2000000b0057823b96685si2323866pgr.681.2023.09.19.10.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 10:13:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cRB+Fyg+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E56D1819802F; Tue, 19 Sep 2023 03:48:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231949AbjISKrz (ORCPT + 26 others); Tue, 19 Sep 2023 06:47:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231810AbjISKrk (ORCPT ); Tue, 19 Sep 2023 06:47:40 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA5AC133 for ; Tue, 19 Sep 2023 03:47:34 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1c46b30a1ceso22021365ad.3 for ; Tue, 19 Sep 2023 03:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120454; x=1695725254; 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; bh=BSYY97oVgPZ5kb8TuDqHkXyCfyuOKBglbVv/457JBMY=; b=cRB+Fyg+q4cb0QH9ABSJaM+9ir+R6imGfBSqciQxsbna5lw9aTYb0Qmkmi/sAEFj8r QkSth+dHRy1y0QOm13mpCtAqBfJz8gsnjQA6xGndBmtR5BFcZV3pd06jip3AGW5iS7HA wrW+0VLskk+qLVZwqyw7gCLK94+9swqGY9ogI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120454; x=1695725254; 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=BSYY97oVgPZ5kb8TuDqHkXyCfyuOKBglbVv/457JBMY=; b=BH5CAp3zL5GFFVTvockjcKtb2/Ghb9AZxunu42EVEbHrq4geqtajaBvbrBnAdR9tfP wnDoC4TiXvu3NYN8T6oOdfonYnM+W78TvXjkEmvcwFvYILEl2pG9go7Wk556ZjyxC7J7 gzFXVK6ZBKSU7H92uzaXVXBBxkq9WT+6SmiWGM49oQBrezj5nEA0yclXOtX0z94B6h2w G+P4yBv0zQ8LGVYCn3oAmi3piQ+xJBgGAsH7WWQ+LBOG3GWjomgdsy2GNDMyzdWtRUl+ ui7kBX97nQ8lVtyeBPSYFm2nuSK+V0PBB5E6Y1ao+AwwznVebtzZt1UMhGmEPgsR0NyH AeIw== X-Gm-Message-State: AOJu0YyqmFCvujqxC6SsQvBK2zBDBDicpPTmzoLIQUwM9ALzBLcbs/JD HldVjU0zGSisYromxXZf+75jBg== X-Received: by 2002:a17:902:be0a:b0:1c3:90c7:b99d with SMTP id r10-20020a170902be0a00b001c390c7b99dmr9899813pls.41.1695120454418; Tue, 19 Sep 2023 03:47:34 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:34 -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 v3 04/12] regulator: dt-bindings: mt6358: Add regulator supplies Date: Tue, 19 Sep 2023 18:43:47 +0800 Message-ID: <20230919104357.3971512-5-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777486881484013952 X-GMAIL-MSGID: 1777486881484013952 The MT6358 PMIC has various regulator power supply pins that should be supplied from external power sources or routed from one of its outputs. Add these regulator supplies to the binding. The names are the actual names from the datasheet, with hyphens replacing underscores. Signed-off-by: Chen-Yu Tsai --- .../regulator/mediatek,mt6358-regulator.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index 62e8fa6b4306..c5f336318ec2 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -18,6 +18,41 @@ properties: compatible: const: mediatek,mt6358-regulator + vsys-ldo1-supply: + description: Supply for LDOs vfe28, vxo22, vcn28, vaux18, vaud28, vsim1, vusb, vbif28 + vsys-ldo2-supply: + description: Supply for LDOs vldo28, vio28, vmc, vmch, vsim2 + vsys-ldo3-supply: + description: Supply for LDOs vcn33, vcama1, vcama2, 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, vcamio, vio18 + vs2-ldo1-supply: + description: Supply for LDOs vdram2 + vs2-ldo2-supply: + description: Supply for LDOs vrf12, va12 + vs2-ldo3-supply: + description: Supply for LDOs vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 + vs2-ldo4-supply: + description: Supply for LDO vcamd + patternProperties: "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": description: Buck regulators From patchwork Tue Sep 19 10:43:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 141987 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3510458vqi; Tue, 19 Sep 2023 09:17:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhAkwCeuvGBPEbFZDGBYS0UmScRB2l6ScdQBkOul0dbPvVGHkRPrMdwlrOXK7D0LWf/ZiB X-Received: by 2002:a17:903:4285:b0:1c3:4565:225 with SMTP id ju5-20020a170903428500b001c345650225mr12656467plb.10.1695140239368; Tue, 19 Sep 2023 09:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695140239; cv=none; d=google.com; s=arc-20160816; b=tl0CGMD/E4ZmjN/yHcDIsFL238F3DVa1ruzL0yp3JkOR95kyN4CjT1Jozabaa3UthL s7bpnnriqKWhkfUJt4dGU+qWNcXgNJLdrmgxeWwqE43mrHAoZQP3xiThGEMsTOEvTf0P 6XBJaEpTWKUd+D54N1i2B8SRlBp6M4rp3KqmWMkLXAOY9zv/xvBbg2gEFIKCl+0wGTui O+BQt+ki8mCMeZ/gOLJOCLaP3T8GOmt1EIO4H3Me/hwI/18AehHGe9QxAAOR1iJ4CUrj lSmfzUq2F0MuVfQTH7iQIohR1M1m4X8tB/HKojaQqp2pOwaDVvXrjVV9sZzz7enuD7ab la5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c9zFZh0h9p1kqtm0gG5rSkGty3VYPPZg4qkioRraJ/c=; fh=TlO5KlKappqSrmqhP9zwp2vC20iYAyktNq5CSxppUkc=; b=X2MK44h4zhs17TdOl5/0ujEiYjrkc1h/my7BOT3lK8gerAPKDdAketT311HdLJjXbJ swhTCBDvPFJuatkbpdU05MKGnisRDOg3eX0GzWDZvT75b5fMtvDFDTwcuv8OyNfCF+8q ztqpfBk6p6Oq6v3uBRR3zlUOy47yeVhoG/ILq4heZG70GPSszJhbEH4Gks5jxw7wn1i2 iPcuJaQAkT+vjnIJZ7pVq23Z9tadVpVoFTTH3fsOLtSDzpsXPIm+wPoFUja+TQQhR7gD lYzpFdoSblcsrJjlMzkEzbm2+PQR1bcJmahynbmT8tzLUVo5HjnYGzwzcnCtA8aJOM8c 4kvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=myfoGqli; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m3-20020a1709026bc300b001b876d46162si9873843plt.38.2023.09.19.09.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 09:17:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=myfoGqli; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 77CFB802D3D0; Tue, 19 Sep 2023 03:48:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231933AbjISKr7 (ORCPT + 26 others); Tue, 19 Sep 2023 06:47:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231916AbjISKrq (ORCPT ); Tue, 19 Sep 2023 06:47:46 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A46FA13A for ; Tue, 19 Sep 2023 03:47:37 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1c46b30a1ceso22021665ad.3 for ; Tue, 19 Sep 2023 03:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120457; x=1695725257; 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; bh=c9zFZh0h9p1kqtm0gG5rSkGty3VYPPZg4qkioRraJ/c=; b=myfoGqli94TBKfLh/E5g4h5z+yuXWyrJQNYQhmmNrTRsbOiqvUQyUh55/olyMQ19G4 DjFmZf/+Y6++esgX8mFYlekBuvP8ZS/+D5KVkoLm+2sFfmViPWo7f6dCuc9zGGsKQXmG s1iyo7Y/x/ETS3Fyc5aRJkPivi+bjDBALUzi0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120457; x=1695725257; 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=c9zFZh0h9p1kqtm0gG5rSkGty3VYPPZg4qkioRraJ/c=; b=cUWmX4lbR+uX/Nw6w8fCAmo/fVghsibvvpNAASF9XiLhmqbw6HLNQ3VHd0nUCnYQQh FLHumCl2oZ32WBcuZQMIN2zVLAWS/VxdmlwzTISChKviXQCPSJ02PDd/koSIbQ/LJbQJ 9bE6VbvxqxGFFKeO3p7UIPQBdlwMiBv0BH4ggpGHPmmei+WUx5JrGW4ANP9x0zNeEzOo iR5qChG8ERITtK2j+5zby1LVPaE93mha9iHF+Suv64WAXP4m07P4FsZAwC/BNayX+q3A WIFUAOufDRgNt0NFyHLjafaQs4PTk0xikUxWdhQsFc7fYZVbpES+XlnvXhLrmOHHwpmI QGdg== X-Gm-Message-State: AOJu0YwhIeq25tUwSIfhkgLmpcuvwWYHQadrtIf25j4lWdpMpjcIuGig QxQyuprAi0aXZGwF++1Dj6PrqQ== X-Received: by 2002:a17:902:e74d:b0:1bd:c931:8c47 with SMTP id p13-20020a170902e74d00b001bdc9318c47mr10812191plf.68.1695120457075; Tue, 19 Sep 2023 03:47:37 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:36 -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 v3 05/12] regulator: dt-bindings: mt6358: Add MT6366 PMIC Date: Tue, 19 Sep 2023 18:43:48 +0800 Message-ID: <20230919104357.3971512-6-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777483371462938686 X-GMAIL-MSGID: 1777483371462938686 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. The differences compared to the MT6358 are minimal: - Regulators removed: VCAMA1, VCAMA2, VCAMD, VCAMIO, VLDO28 - Regulators added: VM18, VMDDR, VSRAM_CORE 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 v2: - Merged all the propertyPatterns together; the if-then sections now only block out invalid properties Changes since v1: - Replaced underscores in supply names to hyphens - Merged with MT6358 regulator binding - Added MT6358 fallback compatible to MT6366 regulator 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,mt6358-regulator.yaml | 120 +++++++++++++++--- 1 file changed, 104 insertions(+), 16 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml index c5f336318ec2..05e381899d08 100644 --- a/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml @@ -16,14 +16,18 @@ description: properties: compatible: - const: mediatek,mt6358-regulator + oneOf: + - const: mediatek,mt6358-regulator + - items: + - const: mediatek,mt6366-regulator + - const: mediatek,mt6358-regulator vsys-ldo1-supply: description: Supply for LDOs vfe28, vxo22, vcn28, vaux18, vaud28, vsim1, vusb, vbif28 vsys-ldo2-supply: - description: Supply for LDOs vldo28, vio28, vmc, vmch, vsim2 + description: Supply for LDOs vldo28 (MT6358 only), vio28, vmc, vmch, vsim2 vsys-ldo3-supply: - description: Supply for LDOs vcn33, vcama1, vcama2, vemc, vibr + description: Supply for LDOs vcn33, vcama[12] (MT6358 only), vemc, vibr vsys-vcore-supply: description: Supply for buck regulator vcore vsys-vdram1-supply: @@ -43,18 +47,20 @@ properties: vsys-vs2-supply: description: Supply for buck regulator vs2 vs1-ldo1-supply: - description: Supply for LDOs vrf18, vefuse, vcn18, vcamio, vio18 + description: + Supply for LDOs vrf18, vefuse, vcn18, vcamio (MT6358 only), vio18, vm18 (MT6366 only) vs2-ldo1-supply: - description: Supply for LDOs vdram2 + description: Supply for LDOs vdram2, vmddr (MT6366 only) vs2-ldo2-supply: description: Supply for LDOs vrf12, va12 vs2-ldo3-supply: - description: Supply for LDOs vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 + description: + Supply for LDOs vsram-core (MT6366 only), vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 vs2-ldo4-supply: description: Supply for LDO vcamd patternProperties: - "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": + "^(buck_)?v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": description: Buck regulators type: object $ref: regulator.yaml# @@ -69,7 +75,7 @@ patternProperties: enum: [0, 1] unevaluatedProperties: false - "^ldo_v(a|rf)12$": + "^(ldo_)?v(a|rf)12$": description: LDOs with fixed 1.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -77,15 +83,16 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_v((aux|cn|io|rf)18|camio)$": - description: LDOs with fixed 1.8V output and 0~100/10mV tuning + "^(ldo_)?v((aux|cn|io|rf)18|camio)$": + description: + LDOs with fixed 1.8V output and 0~100/10mV tuning (vcn18 on MT6366 has variable output) type: object $ref: regulator.yaml# properties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_vxo22$": + "^(ldo_)?vxo22$": description: LDOs with fixed 2.2V output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -93,7 +100,7 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_v(aud|bif|cn|fe|io)28$": + "^(ldo_)?v(aud|bif|cn|fe|io)28$": description: LDOs with fixed 2.8V output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -101,7 +108,7 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_vusb$": + "^(ldo_)?vusb$": description: LDOs with fixed 3.0V output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -109,7 +116,7 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_vsram_(gpu|others|proc1[12])$": + "^(ldo_)?vsram[_-](core|gpu|others|proc1[12])$": description: LDOs with variable output type: object $ref: regulator.yaml# @@ -117,7 +124,7 @@ patternProperties: regulator-allowed-modes: false unevaluatedProperties: false - "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": + "^(ldo_)?v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|m18|mc|mch|mddr|sim[12])$": description: LDOs with variable output and 0~100/10mV tuning type: object $ref: regulator.yaml# @@ -130,11 +137,50 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + const: mediatek,mt6358-regulator + then: + patternProperties: + # Old regulator node name scheme (with prefix and underscores) only + # ([^y-] is used to avoid matching -supply + "^(? - regulator { + mt6358-regulator { compatible = "mediatek,mt6358-regulator"; buck_vgpu { @@ -156,4 +202,46 @@ examples: }; }; + mt6366-regulator { + compatible = "mediatek,mt6366-regulator", "mediatek,mt6358-regulator"; + + vdram1 { + regulator-name = "pp1125_emi_vdd2"; + regulator-min-microvolt = <1125000>; + regulator-max-microvolt = <1125000>; + regulator-ramp-delay = <12500>; + regulator-enable-ramp-delay = <0>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + vproc11 { + regulator-name = "ppvar_dvdd_proc_bc_mt6366"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1200000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <200>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + vmddr { + regulator-name = "pm0750_emi_vmddr"; + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <750000>; + regulator-enable-ramp-delay = <325>; + regulator-always-on; + }; + + vsram-proc11 { + regulator-name = "pp0900_dvdd_sram_bc"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1120000>; + regulator-ramp-delay = <6250>; + regulator-enable-ramp-delay = <240>; + regulator-always-on; + }; + }; ... From patchwork Tue Sep 19 10:43:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 142727 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4609043vqi; Wed, 20 Sep 2023 21:53:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELK4f3BBj3FuA2uH818H4ashHyY4gimZoMxLShRVxEfiwwMN9W8wax/6BYtxD4KeAHd1EP X-Received: by 2002:a05:6358:99a1:b0:13c:eea2:d021 with SMTP id j33-20020a05635899a100b0013ceea2d021mr4361045rwb.9.1695271983251; Wed, 20 Sep 2023 21:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695271983; cv=none; d=google.com; s=arc-20160816; b=E64eljIE15ORmv+boJdBO/dZ6bfYL+nkMeT9mPFPQSbJMS8bH0txBnH1D9nPCW1koh IZJJd6gh5tbjMqiA8Yw5mVF9OmwLl5Flbp/kFA6U2qhiDayAzcFqYByPZm0I36+rEk21 a14/ax6+MDu5c15iQmQtwJdoMsodvr08Db0omHeny7JVbf9VV8uhkRLiqjheFvVbyITl vFIblzWuh1oygRZdoAchutSquVvCCu3GvwFI0yigIM8pq+HHbcdDxBC6ZCObFnWxrFIZ 4k5K8uzlaK8nc9hIOR9CGn5nJbITyRwkYVl7UEsneb1/OvKQfi7sEY/Xi7T1NSguWv77 XXyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3xQUn/IJIaVFS0x99xumnipF7RzW+wF0bxWwjg0oCIk=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=IcCDsRblyLvlIo8I8bLxVAUNEtVcQFphukSxb1BDmkbE2HO1tJSzre4iVuJEH1Xp26 ixrveeyA1DZweK21mcSADDcGscmJxIXtHSxil6tE0ias9oSbibDUi9KAr+9PaP47+C8Y 9+FgRaa9qtXq1Xu8zjnPlw+ir7gTn/+3zpmNChP67vjGn3CCYmk0uVj2ti1YQ1XtgPVK b1xnbm9yS5BdoKyEG/rZnc/OaQ6kQ8gvNx6MEabOOaFmwpFnEr12fc7SM9sozNFzjHGk /8ly2V8yic/CACHVQxgNHP1T8KaiGUgBwzDpnU/kg+Xsz2NxqNeZv2KoCxpll8lNrmZD WDag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HPZ3QuhO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id m16-20020a63fd50000000b00563dfffe7b9si571656pgj.810.2023.09.20.21.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 21:53:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HPZ3QuhO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 18B7F807FC1D; Tue, 19 Sep 2023 03:48:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231991AbjISKsE (ORCPT + 26 others); Tue, 19 Sep 2023 06:48:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231937AbjISKry (ORCPT ); Tue, 19 Sep 2023 06:47:54 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B44E188 for ; Tue, 19 Sep 2023 03:47:40 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1c453379020so21264905ad.1 for ; Tue, 19 Sep 2023 03:47:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120459; x=1695725259; 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; bh=3xQUn/IJIaVFS0x99xumnipF7RzW+wF0bxWwjg0oCIk=; b=HPZ3QuhOK8hf4Vk5Qx7kdD+K5prsC9/0Y2aVrjzjVsxNFbu9joD2Ou0lZqDqAnavy0 YOQSbKM6L+WLCiA0/hlxq+inTIT7aBwsJnit2V+GLmppHUnVHIScGsa9RUTefOL21fwW Zl/BDv+eI6zSzpRl6xHhaghkdECFJWScLhtTU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120459; x=1695725259; 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=3xQUn/IJIaVFS0x99xumnipF7RzW+wF0bxWwjg0oCIk=; b=EniMLJnNWCHvotwAWyjAmFJzR3/KCirRnelcfEshpO9LLpA0HeZBx1yWn1XzN3HnXf FUWjyebZLN+Khq15HpttingPbXWHmvidMwu2zS291PhNJHFxINB3yEI42K4NL1zuWV3Q NyfmDdUxflj7HzwtSIzVl+FG+eFgiF6ijbRmTat3w902IklhGkAimh4sSAS0h/HPqjLQ T+T7a+L/H/Nw8PcuDmfSQkuAAvrIIcYicP6z2aazX46dbe1YAOPOtpzveTkC8B0psOhK yvOtFuK+xxB4hwhgswuNvnMfQcWiZndFuPElVfmMBzdGSCvd1VJod71xh3hQSTIVc/r5 tLqw== X-Gm-Message-State: AOJu0Yx5UxC1LwemPixC/9gVd/WWMrJJPVF68LOB3uuykmMZMqM1OQSB zlLi+FY6RGvPqbWHJLvhRPpajQ== X-Received: by 2002:a17:903:1cd:b0:1bf:650b:14fb with SMTP id e13-20020a17090301cd00b001bf650b14fbmr11811076plh.42.1695120459673; Tue, 19 Sep 2023 03:47:39 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:39 -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 v3 06/12] regulator: mt6358: Use mt6397-regulator.h binding header for buck mode macros Date: Tue, 19 Sep 2023 18:43:49 +0800 Message-ID: <20230919104357.3971512-7-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777558343087156066 X-GMAIL-MSGID: 1777621515059479997 The (undocumented) possible values for the buck operating modes on the MT6358 are the same as those on the MT6397, both for the device tree bindings and the actual hardware register values. Reuse the macros for the MT6397 PMIC in the MT6358 regulator driver by including the mt6397-regulator.h binding header and replacing the existing macros. This aligns it with other PMIC. Signed-off-by: Chen-Yu Tsai --- Changes since v2: - new patch drivers/regulator/mt6358-regulator.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index 4a6ad0ccf03b..c312e79a0a39 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -13,8 +13,7 @@ #include #include -#define MT6358_BUCK_MODE_AUTO 0 -#define MT6358_BUCK_MODE_FORCE_PWM 1 +#include /* * MT6358 regulators' information @@ -326,7 +325,7 @@ static const struct linear_range vldo28_ranges[] = { static unsigned int mt6358_map_mode(unsigned int mode) { - return mode == MT6358_BUCK_MODE_AUTO ? + return mode == MT6397_BUCK_MODE_AUTO ? REGULATOR_MODE_NORMAL : REGULATOR_MODE_FAST; } @@ -374,10 +373,10 @@ static int mt6358_regulator_set_mode(struct regulator_dev *rdev, switch (mode) { case REGULATOR_MODE_FAST: - val = MT6358_BUCK_MODE_FORCE_PWM; + val = MT6397_BUCK_MODE_FORCE_PWM; break; case REGULATOR_MODE_NORMAL: - val = MT6358_BUCK_MODE_AUTO; + val = MT6397_BUCK_MODE_AUTO; break; default: return -EINVAL; @@ -408,9 +407,9 @@ static unsigned int mt6358_regulator_get_mode(struct regulator_dev *rdev) } switch ((regval & info->modeset_mask) >> (ffs(info->modeset_mask) - 1)) { - case MT6358_BUCK_MODE_AUTO: + case MT6397_BUCK_MODE_AUTO: return REGULATOR_MODE_NORMAL; - case MT6358_BUCK_MODE_FORCE_PWM: + case MT6397_BUCK_MODE_FORCE_PWM: return REGULATOR_MODE_FAST; default: return -EINVAL; From patchwork Tue Sep 19 10:43:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 142047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3592885vqi; Tue, 19 Sep 2023 11:24:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFV1TnJgdX0ybeFnmQiFYQ/DrP5t7j1u1HO4FovGaQey28cKhKxiO4TGiu1u+83cYyeYWFe X-Received: by 2002:a17:90b:1d12:b0:274:4fb:360a with SMTP id on18-20020a17090b1d1200b0027404fb360amr531280pjb.16.1695147845028; Tue, 19 Sep 2023 11:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695147845; cv=none; d=google.com; s=arc-20160816; b=oQz/N3x4vZa0K6FIRJNecooSu8OoPLf3XY88CYMSj5iOr9Kfhylpmm0Xf+5q4rtSiB m5BkSThG4rUYrNNhTu+XGh1D6Stov4qSI6sk2z81igp4JLbYVE4TSDR3EBDgsfIIevQJ MA8gUwEzRLD/St8Pb3azIq/sDnZAepu2aJYF5wWsxH9hH1OqzA5CwFYk4yBg04/HABh9 m4QeqUXJ81Ajl4VmxbD50P+WXHlaoe90RMhxcwqOiXjBb7D7y3r6LBt0i00GAQ5hax18 C7YoHrM4qMljRpzxDn3C+KzUXHLXWPtUaZD7ozjuhtUdQX5zxFWil7Rfm09nFK4Bg+G/ zKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=33njgdq8G3NHqXynkC8S5kwx5qDX5FCAM+ernV99xw4=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=eRV/qUu80QC5dKiefi91Zwhh6B8bvBaqKfW9EGKGnvKc7+vI7HCCotC4eZ0oRbLE/P wD6bHkj9cV3o9QDDBj1rIYVZMIfVEzlcq2wCROzHiZ6WNe+WzyKKerbJQ09TjRjXqNDH KZOBSFUJVvOLfaLsgl62Hed+1dFFOH/n+uLcuSBrMXz5C+kLDWaZbTkOLIaLTJ+wCUTc DYTM0vtmnuGF5JWOWEGeaTLsvL5roTLB6X7zNSYzrKkeFAtpkGFuPKbAB5U5QQizY5P4 haD3bv59zo+zni66OEYbW+p4LoElOcCUIpAlijYmxXbr1eU4FnLyAz8F8xRHkVL7G8aM XF3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YR2a8e7s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id hi1-20020a17090b30c100b0026b3842b062si111496pjb.0.2023.09.19.11.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 11:24:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YR2a8e7s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A68058057E5F; Tue, 19 Sep 2023 03:48:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232045AbjISKsP (ORCPT + 26 others); Tue, 19 Sep 2023 06:48:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbjISKr4 (ORCPT ); Tue, 19 Sep 2023 06:47:56 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6EDA198 for ; Tue, 19 Sep 2023 03:47:42 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1c0c6d4d650so49566005ad.0 for ; Tue, 19 Sep 2023 03:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120462; x=1695725262; 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; bh=33njgdq8G3NHqXynkC8S5kwx5qDX5FCAM+ernV99xw4=; b=YR2a8e7s31ULyp+hIZbNNs2QMgOVBb9Q838Jyvp1RL7CCtd+D0by2lLSQpCqr4CB+S mlj36GcWd7FFlsFv5OOkFaQm5Y5CWasiFWTPmf3ya2zmjlk1i2vnz4hO5Pdr1wE3lx1q zFMisvqdvO672OTp1AQm62x41dqsk9eOewOlA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120462; x=1695725262; 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=33njgdq8G3NHqXynkC8S5kwx5qDX5FCAM+ernV99xw4=; b=FK+tIz/jVpNxxb3WDrD3N34eqdGGbaQyRhzeP5NXJCcY67DtMamZK1HBfOqfpVxXda kBV6ylNmtu2dh92GEet47Rts73HzagfIe4dyeLJ2IFuHhGq2pgAmk2qBIhNXLMi4nRr0 fSJEQPGj4vVRILx0RZzpokfLzS4k4PmwRk4YpouAB6FT8mG38kKg6cfQDQ84radQIVVW /VyebJ3Ss+NNM3qC9JX4+cHfRfM1K723MhRd9y7N51AlLRL/oRgBzAYmjfvgTTLj/uUf PyTalORqMkqkU33RBkwatPE8An595o+NN/k0xraIOUK0r2pkWK7yqOKF/NiySOJRc3oy BqUA== X-Gm-Message-State: AOJu0YynezjLz0HA85iLE3/p7z8/3qrzJ72x9431vpWQ8RMmMNgVHtHc fqUL8b3it2AOme55oYBf48KF3A== X-Received: by 2002:a17:902:f809:b0:1bf:8779:e045 with SMTP id ix9-20020a170902f80900b001bf8779e045mr10264450plb.50.1695120462313; Tue, 19 Sep 2023 03:47:42 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:41 -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 v3 07/12] regulator: mt6358: Add supply names for MT6358 regulators Date: Tue, 19 Sep 2023 18:43:50 +0800 Message-ID: <20230919104357.3971512-8-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777491346750593650 X-GMAIL-MSGID: 1777491346750593650 The DT bindings for MT6358 regulator now defines the supply names for the PMIC. Add support for them by adding .supply_name field settings for each regulator. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- drivers/regulator/mt6358-regulator.c | 106 +++++++++++++-------------- 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index c312e79a0a39..cdb776d30a6d 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -33,12 +33,13 @@ struct mt6358_regulator_info { #define to_regulator_info(x) container_of((x), struct mt6358_regulator_info, desc) -#define MT6358_BUCK(match, vreg, min, max, step, \ - vosel_mask, _da_vsel_reg, _da_vsel_mask, \ - _modeset_reg, _modeset_shift) \ +#define MT6358_BUCK(match, vreg, supply, min, max, step, \ + vosel_mask, _da_vsel_reg, _da_vsel_mask, \ + _modeset_reg, _modeset_shift) \ [MT6358_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_range_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -61,10 +62,11 @@ struct mt6358_regulator_info { .modeset_mask = BIT(_modeset_shift), \ } -#define MT6358_LDO(match, vreg, volt_ranges, enreg, enbit, vosel, vosel_mask) \ +#define MT6358_LDO(match, vreg, supply, volt_ranges, enreg, enbit, vosel, vosel_mask) \ [MT6358_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_table_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -85,12 +87,12 @@ struct mt6358_regulator_info { .qi = BIT(15), \ } -#define MT6358_LDO1(match, vreg, min, max, step, \ - _da_vsel_reg, _da_vsel_mask, \ - vosel, vosel_mask) \ +#define MT6358_LDO1(match, vreg, supply, min, max, step, \ + _da_vsel_reg, _da_vsel_mask, vosel, vosel_mask) \ [MT6358_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_range_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -110,11 +112,11 @@ struct mt6358_regulator_info { .qi = BIT(0), \ } -#define MT6358_REG_FIXED(match, vreg, \ - enreg, enbit, volt) \ +#define MT6358_REG_FIXED(match, vreg, supply, enreg, enbit, volt) \ [MT6358_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_fixed_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -457,79 +459,73 @@ static const struct regulator_ops mt6358_volt_fixed_ops = { /* The array is indexed by id(MT6358_ID_XXX) */ static const struct mt6358_regulator_info mt6358_regulators[] = { - MT6358_BUCK("buck_vdram1", VDRAM1, 500000, 2087500, 12500, + MT6358_BUCK("buck_vdram1", VDRAM1, "vsys-vdram1", 500000, 2087500, 12500, 0x7f, MT6358_BUCK_VDRAM1_DBG0, 0x7f, MT6358_VDRAM1_ANA_CON0, 8), - MT6358_BUCK("buck_vcore", VCORE, 500000, 1293750, 6250, + MT6358_BUCK("buck_vcore", VCORE, "vsys-vcore", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VCORE_DBG0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 1), - MT6358_BUCK("buck_vpa", VPA, 500000, 3650000, 50000, + MT6358_BUCK("buck_vpa", VPA, "vsys-vpa", 500000, 3650000, 50000, 0x3f, MT6358_BUCK_VPA_DBG0, 0x3f, MT6358_VPA_ANA_CON0, 3), - MT6358_BUCK("buck_vproc11", VPROC11, 500000, 1293750, 6250, + MT6358_BUCK("buck_vproc11", VPROC11, "vsys-vproc11", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VPROC11_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 1), - MT6358_BUCK("buck_vproc12", VPROC12, 500000, 1293750, 6250, + MT6358_BUCK("buck_vproc12", VPROC12, "vsys-vproc12", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VPROC12_DBG0, 0x7f, MT6358_VPROC_ANA_CON0, 2), - MT6358_BUCK("buck_vgpu", VGPU, 500000, 1293750, 6250, + MT6358_BUCK("buck_vgpu", VGPU, "vsys-vgpu", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VGPU_ELR0, 0x7f, MT6358_VCORE_VGPU_ANA_CON0, 2), - MT6358_BUCK("buck_vs2", VS2, 500000, 2087500, 12500, + MT6358_BUCK("buck_vs2", VS2, "vsys-vs2", 500000, 2087500, 12500, 0x7f, MT6358_BUCK_VS2_DBG0, 0x7f, MT6358_VS2_ANA_CON0, 8), - MT6358_BUCK("buck_vmodem", VMODEM, 500000, 1293750, 6250, + MT6358_BUCK("buck_vmodem", VMODEM, "vsys-vmodem", 500000, 1293750, 6250, 0x7f, MT6358_BUCK_VMODEM_DBG0, 0x7f, MT6358_VMODEM_ANA_CON0, 8), - MT6358_BUCK("buck_vs1", VS1, 1000000, 2587500, 12500, + MT6358_BUCK("buck_vs1", VS1, "vsys-vs1", 1000000, 2587500, 12500, 0x7f, MT6358_BUCK_VS1_DBG0, 0x7f, MT6358_VS1_ANA_CON0, 8), - MT6358_REG_FIXED("ldo_vrf12", VRF12, - MT6358_LDO_VRF12_CON0, 0, 1200000), - MT6358_REG_FIXED("ldo_vio18", VIO18, - MT6358_LDO_VIO18_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vcamio", VCAMIO, - MT6358_LDO_VCAMIO_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vcn18", VCN18, MT6358_LDO_VCN18_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vfe28", VFE28, MT6358_LDO_VFE28_CON0, 0, 2800000), - MT6358_REG_FIXED("ldo_vcn28", VCN28, MT6358_LDO_VCN28_CON0, 0, 2800000), - MT6358_REG_FIXED("ldo_vxo22", VXO22, MT6358_LDO_VXO22_CON0, 0, 2200000), - MT6358_REG_FIXED("ldo_vaux18", VAUX18, - MT6358_LDO_VAUX18_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vbif28", VBIF28, - MT6358_LDO_VBIF28_CON0, 0, 2800000), - MT6358_REG_FIXED("ldo_vio28", VIO28, MT6358_LDO_VIO28_CON0, 0, 2800000), - MT6358_REG_FIXED("ldo_va12", VA12, MT6358_LDO_VA12_CON0, 0, 1200000), - MT6358_REG_FIXED("ldo_vrf18", VRF18, MT6358_LDO_VRF18_CON0, 0, 1800000), - MT6358_REG_FIXED("ldo_vaud28", VAUD28, - MT6358_LDO_VAUD28_CON0, 0, 2800000), - MT6358_LDO("ldo_vdram2", VDRAM2, vdram2, + MT6358_REG_FIXED("ldo_vrf12", VRF12, "vs2-ldo2", MT6358_LDO_VRF12_CON0, 0, 1200000), + MT6358_REG_FIXED("ldo_vio18", VIO18, "vs1-ldo1", MT6358_LDO_VIO18_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vcamio", VCAMIO, "vs1-ldo1", MT6358_LDO_VCAMIO_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vcn18", VCN18, "vs1-ldo1", MT6358_LDO_VCN18_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vfe28", VFE28, "vsys-ldo1", MT6358_LDO_VFE28_CON0, 0, 2800000), + MT6358_REG_FIXED("ldo_vcn28", VCN28, "vsys-ldo1", MT6358_LDO_VCN28_CON0, 0, 2800000), + MT6358_REG_FIXED("ldo_vxo22", VXO22, "vsys-ldo1", MT6358_LDO_VXO22_CON0, 0, 2200000), + MT6358_REG_FIXED("ldo_vaux18", VAUX18, "vsys-ldo1", MT6358_LDO_VAUX18_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vbif28", VBIF28, "vsys-ldo1", MT6358_LDO_VBIF28_CON0, 0, 2800000), + MT6358_REG_FIXED("ldo_vio28", VIO28, "vsys-ldo2", MT6358_LDO_VIO28_CON0, 0, 2800000), + MT6358_REG_FIXED("ldo_va12", VA12, "vs2-ldo2", MT6358_LDO_VA12_CON0, 0, 1200000), + MT6358_REG_FIXED("ldo_vrf18", VRF18, "vs1-ldo1", MT6358_LDO_VRF18_CON0, 0, 1800000), + MT6358_REG_FIXED("ldo_vaud28", VAUD28, "vsys-ldo1", MT6358_LDO_VAUD28_CON0, 0, 2800000), + MT6358_LDO("ldo_vdram2", VDRAM2, "vs2-ldo1", vdram2, MT6358_LDO_VDRAM2_CON0, 0, MT6358_LDO_VDRAM2_ELR0, 0xf), - MT6358_LDO("ldo_vsim1", VSIM1, vsim, + MT6358_LDO("ldo_vsim1", VSIM1, "vsys-ldo1", vsim, MT6358_LDO_VSIM1_CON0, 0, MT6358_VSIM1_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vibr", VIBR, vibr, + MT6358_LDO("ldo_vibr", VIBR, "vsys-ldo3", vibr, MT6358_LDO_VIBR_CON0, 0, MT6358_VIBR_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vusb", VUSB, vusb, + MT6358_LDO("ldo_vusb", VUSB, "vsys-ldo1", vusb, MT6358_LDO_VUSB_CON0_0, 0, MT6358_VUSB_ANA_CON0, 0x700), - MT6358_LDO("ldo_vcamd", VCAMD, vcamd, + MT6358_LDO("ldo_vcamd", VCAMD, "vs2-ldo4", vcamd, MT6358_LDO_VCAMD_CON0, 0, MT6358_VCAMD_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vefuse", VEFUSE, vefuse, + MT6358_LDO("ldo_vefuse", VEFUSE, "vs1-ldo1", vefuse, MT6358_LDO_VEFUSE_CON0, 0, MT6358_VEFUSE_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vmch", VMCH, vmch_vemc, + MT6358_LDO("ldo_vmch", VMCH, "vsys-ldo2", vmch_vemc, MT6358_LDO_VMCH_CON0, 0, MT6358_VMCH_ANA_CON0, 0x700), - MT6358_LDO("ldo_vcama1", VCAMA1, vcama, + MT6358_LDO("ldo_vcama1", VCAMA1, "vsys-ldo3", vcama, MT6358_LDO_VCAMA1_CON0, 0, MT6358_VCAMA1_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vemc", VEMC, vmch_vemc, + MT6358_LDO("ldo_vemc", VEMC, "vsys-ldo2", vmch_vemc, MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700), - MT6358_LDO("ldo_vcn33", VCN33, vcn33, + MT6358_LDO("ldo_vcn33", VCN33, "vsys-ldo3", vcn33, MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300), - MT6358_LDO("ldo_vcama2", VCAMA2, vcama, + MT6358_LDO("ldo_vcama2", VCAMA2, "vsys-ldo3", vcama, MT6358_LDO_VCAMA2_CON0, 0, MT6358_VCAMA2_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vmc", VMC, vmc, + MT6358_LDO("ldo_vmc", VMC, "vsys-ldo2", vmc, MT6358_LDO_VMC_CON0, 0, MT6358_VMC_ANA_CON0, 0xf00), - MT6358_LDO("ldo_vldo28", VLDO28, vldo28, + MT6358_LDO("ldo_vldo28", VLDO28, "vsys-ldo2", vldo28, MT6358_LDO_VLDO28_CON0_0, 0, MT6358_VLDO28_ANA_CON0, 0x300), - MT6358_LDO("ldo_vsim2", VSIM2, vsim, + MT6358_LDO("ldo_vsim2", VSIM2, "vsys-ldo2", vsim, MT6358_LDO_VSIM2_CON0, 0, MT6358_VSIM2_ANA_CON0, 0xf00), - MT6358_LDO1("ldo_vsram_proc11", VSRAM_PROC11, 500000, 1293750, 6250, + MT6358_LDO1("ldo_vsram_proc11", VSRAM_PROC11, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC11_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON0, 0x7f), - MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, 500000, 1293750, 6250, + MT6358_LDO1("ldo_vsram_others", VSRAM_OTHERS, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_OTHERS_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON2, 0x7f), - MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, 500000, 1293750, 6250, + MT6358_LDO1("ldo_vsram_gpu", VSRAM_GPU, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_GPU_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON3, 0x7f), - MT6358_LDO1("ldo_vsram_proc12", VSRAM_PROC12, 500000, 1293750, 6250, + MT6358_LDO1("ldo_vsram_proc12", VSRAM_PROC12, "vs2-ldo3", 500000, 1293750, 6250, MT6358_LDO_VSRAM_PROC12_DBG0, 0x7f00, MT6358_LDO_VSRAM_CON1, 0x7f), }; From patchwork Tue Sep 19 10:43:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 142051 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3599792vqi; Tue, 19 Sep 2023 11:36:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBVY+wqzV9+6leo//z1jXa1XD2S46DOKkxl4zUzmFkaoexsCEJ445dE9ZXUc9cvWdsWbHD X-Received: by 2002:a05:6a20:3d8d:b0:14b:887a:6d70 with SMTP id s13-20020a056a203d8d00b0014b887a6d70mr447335pzi.15.1695148609606; Tue, 19 Sep 2023 11:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695148609; cv=none; d=google.com; s=arc-20160816; b=Z5MbvxVz8BKMcmVixyA3LEQpylChSW93yIXVmr0Y/wH+CZb4+UVoscRys8cA/ByCIX f4Q5wlVSL1RyPxp0IglEH/uBeyJg5pc/6omnPRZohPFAQkxx7zD2M8ZLVhqQDd+aWyQG xdWiIXYGHAJcF6+69MhOUOz+b78WR84OPkISdAI/XunmJxUuAYl3tmKi7m4v+g+/8WPi 6Pist9I6dEhP9uZZvyRqgDjdAJNgte0w027Pu4h+wnd7NaJYwrzGkLHiZMzcfMP4MpdD 3VmN/D/sSiAvLW1QbHrAIZ3jrUEhhuB965Mn60i8sXzCTeMiGxnGF9FGnwMhWc4uSrA+ ZO2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fYMqOhouQ/NFO/zChpCpAVYsC7sfn9gM3yv9sT3Wz5Q=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=cRpMdeYa0HtuFZqGpwcQ/hEZIGrVsFS1SjGTXSwKAt5zQOJZCEuFNIvfzVYyrES1Og DlIr0rh1Zk5GqpEH+aWoRVgnwuAd9SDCTZ1T7H/V5Z8JFNATGUz5LyNiucp7DznwqIYY hkwnlyI7K2WfRZ2QCj3RGTHl7QU6Fz7ok6l/V0LiE745PN2UAWgQFv5VYGRfU7xwhLzr h5EAbklyGf1pQb1/X/iygCSOQLLrbApTGMt129Ej/s4oNzho1wHq+I5cQlM2kHBcU+iU o9rYdLXWLAFcEcnMiqWO7QMr3I+UOy8vwDSfILrVjPq+70EIAv2XHvJ/LmzQkL1N2VyO yZzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P5QBR23Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h184-20020a6383c1000000b005775c7e503csi1302862pge.116.2023.09.19.11.36.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 11:36:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P5QBR23Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D799580BEF2D; Tue, 19 Sep 2023 03:49:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231958AbjISKsa (ORCPT + 26 others); Tue, 19 Sep 2023 06:48:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231969AbjISKr5 (ORCPT ); Tue, 19 Sep 2023 06:47:57 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B92F11B0 for ; Tue, 19 Sep 2023 03:47:45 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bf55a81eeaso40582745ad.0 for ; Tue, 19 Sep 2023 03:47:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120465; x=1695725265; 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; bh=fYMqOhouQ/NFO/zChpCpAVYsC7sfn9gM3yv9sT3Wz5Q=; b=P5QBR23YyIBisa+cZMWNaPRcI6V0RELYVR7rA+crTFSyx/19IM0y+h9y1g8sWKR5IO j+p/EVPHVdoGsnE3Cs6uOBYXXovrjo3uqGQ70VzkhYq/5HTWVEWpdXLVd9iTO3nNg7Y3 k6PXJYznjdx7OGN2ZLN433jhhE7xykBa9c0v0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120465; x=1695725265; 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=fYMqOhouQ/NFO/zChpCpAVYsC7sfn9gM3yv9sT3Wz5Q=; b=scRwv9iYZ5h8lu9UVeJCVZgIZQPyKV4nNsesbPdEKMp5cR2Cte6g3EEDA9ibSj6emu aQ94ahjhGpsJ/IufSiFS5u1BXfL+Vig7ap3dDqb6merTF8UD6rQdbFPLYI31CHAYF1UB HHgS/N+9I4NKJyUm/+GT4iUNLIfjW3zGXGEkbR+RFHR0PO5nesj39BzON1jv9tGPqm/h EZGLFa3G7q13D72ku7W18whn/UFLGPoT44DfGFjk0V9Ma/h34Cq+VOKMrfWhpkTOXgS0 /PWSW3CJfZMZ8Cgq45GWKZTBUMZBAD9HSB/QJDftFyA/AsZdNGb8BITo85RfyFTYjfy7 T0CQ== X-Gm-Message-State: AOJu0Yyld4BR22TrNqNaWCpzOZ7Gyusv+TEVgNhNkNRgLJCOfO/gF51k M5Hq9A59sKxJjI/cxKBjCXiEIQ== X-Received: by 2002:a17:903:4294:b0:1c0:e6e1:4a11 with SMTP id ju20-20020a170903429400b001c0e6e14a11mr8140549plb.54.1695120465064; Tue, 19 Sep 2023 03:47:45 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:44 -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 v3 08/12] regulator: mt6358: fix and drop type prefix in MT6366 regulator node names Date: Tue, 19 Sep 2023 18:43:51 +0800 Message-ID: <20230919104357.3971512-9-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:49:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777492148580690585 X-GMAIL-MSGID: 1777492148580690585 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/mt6358-regulator.c index cdb776d30a6d..7122ad43be6e 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -531,68 +531,68 @@ static const struct mt6358_regulator_info mt6358_regulators[] = { /* The array is indexed by id(MT6366_ID_XXX) */ static const struct mt6358_regulator_info mt6366_regulators[] = { - 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), }; From patchwork Tue Sep 19 10:43:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 141818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3298470vqi; Tue, 19 Sep 2023 04:08:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYd6p/LgT3GoNSjYS1WV+Pny3QGzdrHvraFDy6YmE2rqbYTVAriySX5GSbHBlfLIqefdmy X-Received: by 2002:a05:6a20:7d92:b0:15a:592c:131a with SMTP id v18-20020a056a207d9200b0015a592c131amr11027879pzj.30.1695121686028; Tue, 19 Sep 2023 04:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695121686; cv=none; d=google.com; s=arc-20160816; b=y4D3X7sJHc5e56PSu8Yx9qHcZsH/cwKq7bpag96ODxspoXKV3dgkzFuYTCrXVhxGG1 Hpr7E1dPZBu7eFjVcB3ihKcV4W9eI0FGmMGRXmpkkNaTgIlKMt520sfWwHatzgKkBke2 Kh55z8C4Kd173mbChhow0JXh55YcBnFzjWlsCuXFbEJh5b81cPENt2QosLYc0hJbV3p0 LDly9Ia+Jc74jmZMx82DwcuavBUXQT0fHXZBtGMzOx8bwcFx6lqCEw+hzRiAJOtsv56Z 1tP6+xWImcz0ElpJmyRiQczfRK1awcyj3X/Db7FQJDeztwFYhkrubeCkUbeiiGdkBzSe UBLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dgL7bVCmTeXSAUxRJPsWW6VflSxwxTKu8gD+M41yTns=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=xkWn4+4/vIbv8pnNn3YXEytOQMjtN4sXuqZJOzc733OFR1tGBtP2Hr0gpe6yyrMIKo R+26Vi2xjfK1HcBZm4tKWv258BjkZCFwBH6/N0zfyaTC4jPc3VULpCTqOWaxfrYrDJSm +/8dhAj1qrkvWEX99NeV3OChIw9S6wNo16rwd12a4nmZ3TYeZMvXUhcKjtGkBgNF0zSB UeCq1aV1ZIdUEGmcYwNHcf34aHFTVi/VsxPreuNEp3yqqf1r7bxyfT5J6Xgo+uKReJ/o C1p5ggZ9kN0xozmN28AyKWVD1pXkz+b9HpkUNOYxkmWMVMEHz1mBi+RRljNKSDnaca8J /heQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FhvzI2NS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z16-20020a656650000000b00577723d24b0si6548960pgv.46.2023.09.19.04.08.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 04:08:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FhvzI2NS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1CD90801B64F; Tue, 19 Sep 2023 03:48:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231917AbjISKs0 (ORCPT + 26 others); Tue, 19 Sep 2023 06:48:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231928AbjISKr6 (ORCPT ); Tue, 19 Sep 2023 06:47:58 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DE78CCF for ; Tue, 19 Sep 2023 03:47:48 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1c43b4b02c1so26016155ad.3 for ; Tue, 19 Sep 2023 03:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120467; x=1695725267; 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; bh=dgL7bVCmTeXSAUxRJPsWW6VflSxwxTKu8gD+M41yTns=; b=FhvzI2NSK1EAajnK3SXAcuVLKuQ5B8vpp14VRnZPEOmRzKnSsG95ONvPnYDYM9jAAL QHsIeL7xjureJleYDlwJ+U7oY/Jq9WmlUtxUoM2qWgk3AKWwcZYVY5XKgOTgyVh9gXoB WB8lS8jZjNDz4z+SjaQO+tWLpc/iSnw9b2WE0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120467; x=1695725267; 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=dgL7bVCmTeXSAUxRJPsWW6VflSxwxTKu8gD+M41yTns=; b=PjYAXAFQuJvyAI4XZkldtfCP8Ej6k+leK0HczxIdQw14UXA/5h9PK0Pmghvf2VqcyS FGzZtmJTimejb8oaATUT7RfeOI4vQIbIsaQuxtCpm1r0lb1ByihcBAvKlIKHn6bI7olJ 5mSp1rgIxXCVYt8bdL2rq4OGVbZPo6IPavYNOo/13dTF4qJe/Uj3aRmlVsZAxTEqzR4/ mmAHN+sVWBp6Vk1ZM+EV+LnGjkJQi/oIcGr2uM1tQi6quU3T/BtJtOICojnq2fGbsB94 iEm0hbL3pjgRMxIIQgpCaLCGDGHncSHbDD2hHkY0WsKe5RAA8tK2qb1OIESJFMmRvdw9 /aHg== X-Gm-Message-State: AOJu0YzSl3DW7OaehE0RHTW3VgtU+mGcimtPmY+5AnOIHuageglQPBTn tBB/TMV9m+NXNEQY61SV3b/C3Rg2J8dnszFCOXM= X-Received: by 2002:a17:902:db0b:b0:1c4:5c05:c3c9 with SMTP id m11-20020a170902db0b00b001c45c05c3c9mr7490890plx.56.1695120467676; Tue, 19 Sep 2023 03:47:47 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:47 -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 v3 09/12] regulator: mt6358: Make MT6366 vcn18 LDO configurable Date: Tue, 19 Sep 2023 18:43:52 +0800 Message-ID: <20230919104357.3971512-10-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777463916921437726 X-GMAIL-MSGID: 1777463916921437726 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 --- Changes since v2: - Linear range selector values fixed Angelo's reviewed-by was dropped. drivers/regulator/mt6358-regulator.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index 7122ad43be6e..fdd4710d57d8 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -325,6 +325,27 @@ static const struct linear_range vldo28_ranges[] = { REGULATOR_LINEAR_RANGE(3000000, 0, 10, 10000), }; +static const unsigned int mt6366_vcn18_vm18_selectors[] = { + 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[] = { + REGULATOR_LINEAR_RANGE(600000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(700000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(800000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(900000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1000000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1100000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1200000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1300000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1400000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1500000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1600000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1700000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1800000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1900000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(2000000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(2100000, 0, 10, 10000), +}; + static unsigned int mt6358_map_mode(unsigned int mode) { return mode == MT6397_BUCK_MODE_AUTO ? @@ -553,7 +574,6 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { 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), @@ -586,6 +606,8 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { 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, From patchwork Tue Sep 19 10:43:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 141888 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3377594vqi; Tue, 19 Sep 2023 06:16:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5jZdyPkeNli3wI++VzvR/e4+mCrIBUouv60jwizAUKuaXDCj2dS+y9Ve1qc93CjePE5cD X-Received: by 2002:a05:6a20:e120:b0:14c:c521:74ba with SMTP id kr32-20020a056a20e12000b0014cc52174bamr13583913pzb.14.1695129408066; Tue, 19 Sep 2023 06:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695129408; cv=none; d=google.com; s=arc-20160816; b=JBH0USfbKJrleLpIPvA0a4365VRBwIbq4AecytIjroGc02jKLmjo8pTcPYkU7YhDEt sV7QnLFfvWbJJt2y0YwDzerTeRSOBhM36cjTjZRZejZxknk2K6QhwPE+bHyQPsQALhkG GL6Nqoat+LK1i2F9z8rK9jGcHSiJhVJyBZ38Qmh+uTOC5YUyw9qDZsftOYgIVchuCSAy d2oGPoY8KsdbnqkKNQPPCzfca4NiOm+v9D9bhv0Sw85AlxhjUklsiKrm7rUMH//DTunq mV7wbBBtxb5VdJyvXL0yEUehBHSLzes1AxCqDg9oWHwyCx+Rq+wPPKW42h6odARydupT gjxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tf1PJ0q6TPVMk350o6dx+lktk/58er+x6Zb73ZYfynQ=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=hIJLHnzUXTSfGfxaQkimCFKReM2e0ogUGcomyYtarNNgSU9gcwrlBCgWDjP0wNb3fY afLMQ54l4aVwp4gLwsdkACO5Mw+doQpN77rI6+LNKW9NjP+SsON2tSlXUf3HPYrIfGzi zJ3r5opTRZgdoaAmYn4ioClfqgYA1pdBRrOUw/YpbiUMiOTf8LQQdx8mq/FtegWl7tpg f54E6rjSO41epZ7dqgRgM+WfxLQIcZb4rdT5PfiEDeoY+/804sbda9ii1k9KLl/B75Ru 6SvUhKnWbHrB6oyFPfAvhX3knu1acDmUHWGNHwLsbJ7TxAUoka8+UnNHLkDp15cwRr+b EeMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Q/ggL1H9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q30-20020a63f95e000000b00569362d6cebsi9737631pgk.2.2023.09.19.06.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 06:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Q/ggL1H9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4F4DA8051169; Tue, 19 Sep 2023 03:48:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbjISKsW (ORCPT + 26 others); Tue, 19 Sep 2023 06:48:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232011AbjISKsL (ORCPT ); Tue, 19 Sep 2023 06:48:11 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DA3F12B for ; Tue, 19 Sep 2023 03:47:51 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c3d6d88231so43951485ad.0 for ; Tue, 19 Sep 2023 03:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120470; x=1695725270; 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; bh=Tf1PJ0q6TPVMk350o6dx+lktk/58er+x6Zb73ZYfynQ=; b=Q/ggL1H9YqY9EGTcsvmkUi8w7Awtqozat/PxD3Z7TgY4A4eHnKXxQPKFhzUCAmH7sg 9C74koxkR4tM1dtbVaLc0r8xRBUWtjm6I4iNOk15+6i1N/sJiMYreu5NxFHVh4NlcLgM E5agIEjVhaiZBOUmogv4LzAxNQ2Pt6IdrZf/M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120470; x=1695725270; 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=Tf1PJ0q6TPVMk350o6dx+lktk/58er+x6Zb73ZYfynQ=; b=ISx9BUP+pW9UDmw2pFI63HOxYOxrLIqrKVJBc/XZL4jXeLXiztziSjuhtSrQ5b1ET+ BUiAV5JDOlfrirBLsy0Nqj/6HuTh6q0xDp7U2VhqttinVV9meCqQ0o7aZDaUXEd8wkFh 7zcTdtOOXJvbPQkZ8N8s/w2CXlBRpx9LPH9d1iSxuoZtsHqbjdWnIyRgCyQuUjVH2goy enlePoJbgVs15cmF+apxR27QtdP5XHekUnReVReakrDslj+cKkl0JrLLb5n/w987oldt GPXWEu/682uw+WOlScFT98qkg6Z1n/58nIrUiGyLJtXFMFS2Y0d0xldBjzp8q8RTRIxY YP1Q== X-Gm-Message-State: AOJu0Yz5fd4WGx1+Rj8cT0iP4mTmPYhfPnrGlJMNnyLiGAOlBoTCFzrn F7s0ujcF3rQ94ZxrMXFUut/rvQ== X-Received: by 2002:a17:903:41c4:b0:1c0:bcbc:d5d with SMTP id u4-20020a17090341c400b001c0bcbc0d5dmr12153313ple.61.1695120470286; Tue, 19 Sep 2023 03:47:50 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:49 -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 v3 10/12] regulator: mt6358: Add missing regulators for MT6366 Date: Tue, 19 Sep 2023 18:43:53 +0800 Message-ID: <20230919104357.3971512-11-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777472014484334458 X-GMAIL-MSGID: 1777472014484334458 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 Acked-by: Lee Jones Reviewed-by: AngeloGioacchino Del Regno --- Changes since v2: - Linear range selector values fixed Angelo's reviewed-by was dropped. drivers/regulator/mt6358-regulator.c | 20 ++++++++++++++++++++ include/linux/mfd/mt6358/registers.h | 17 +++++++++++++++++ include/linux/regulator/mt6358-regulator.h | 3 +++ 3 files changed, 40 insertions(+) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index fdd4710d57d8..4e7891e514b6 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -325,6 +325,20 @@ static const struct linear_range vldo28_ranges[] = { REGULATOR_LINEAR_RANGE(3000000, 0, 10, 10000), }; +static const unsigned int mt6366_vmddr_selectors[] = { 0, 1, 2, 3, 4, 5, 6, 7, 9, 12 }; +static const struct linear_range mt6366_vmddr_ranges[] = { + REGULATOR_LINEAR_RANGE(600000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(700000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(800000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(900000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1000000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1100000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1200000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1300000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1500000, 0, 10, 10000), + REGULATOR_LINEAR_RANGE(1800000, 0, 10, 10000), +}; + static const unsigned int mt6366_vcn18_vm18_selectors[] = { 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[] = { @@ -608,6 +622,10 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { 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, @@ -616,6 +634,8 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { 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), }; static int mt6358_sync_vcn33_setting(struct device *dev) diff --git a/include/linux/mfd/mt6358/registers.h b/include/linux/mfd/mt6358/registers.h index 5ea2590be710..d83e87298ac4 100644 --- a/include/linux/mfd/mt6358/registers.h +++ b/include/linux/mfd/mt6358/registers.h @@ -294,4 +294,21 @@ #define MT6358_AUD_TOP_INT_CON0 0x2228 #define MT6358_AUD_TOP_INT_STATUS0 0x2234 +/* + * 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__ */ diff --git a/include/linux/regulator/mt6358-regulator.h b/include/linux/regulator/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, }; From patchwork Tue Sep 19 10:43:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 141860 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3347300vqi; Tue, 19 Sep 2023 05:31:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJlE3NjUoV/rAcOYwzZpBKlXh6Vg8khPVz502cbcsMaUZ8fslT+eKwPh6ppy54EHcNzxMC X-Received: by 2002:a92:cda8:0:b0:34f:f256:9982 with SMTP id g8-20020a92cda8000000b0034ff2569982mr5940774ild.6.1695126689256; Tue, 19 Sep 2023 05:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695126689; cv=none; d=google.com; s=arc-20160816; b=vHX1ekJiR3TKdOL9r3sfUrtLyM3YB5LubYcmzUONT6N1PxDF4sIOAiPCYNKvt+DZU6 BdkEC+y0elnA+oIYjnJb58W/8tNkI2tAaLYjkJKIRdUL9N0Z6KlWEu4kEo7hECqUBATn rWWNLlBw1IAmBCuH+7EqzPaIZ10dlJcMmh1PWbCBLZ/4WQrAT8Yvnb4kZw9LhDVUK2lX o/+QcbDljD9v6Vh58FS2PIqF3L+vexfcHW+KW2+1uDd16pGb+4g3Pg+aXzGB6Px+gCif ENnXNTnl5uDQSq6XfVkrFhSl4v61JrF9D1xD/C7DdDnPxJ5VVHT6M+s6yU3GJLSYYnWS PItw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+wGYSKJ+LCREMj4ZZPD+f0Pekeht6gsRJzvaQhiRmgU=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=wkHodaq2L+0CyBhN6nMAKtpg1rVG45l+epKduK8oO7bHJ2qk69RgyApLez7Rec/+PH h77SbVsOF0tTuIgfwb33Fpo+ZcCbXNFGXO4pA4o1Rob5foGNvCF7W0zf8Xj+04YlqKGH vqqw3BDl5DZX7cQPqDYl2/3X+7GJjHDZ1gnEo9FVqycJ3heQq8YGSKFpZJaLUZweSIPd q5h4pdIsuZmykVeZETIZUPutwHmpSvWK2lK+6UhDcun95NlaDyQAqm/r/6zWiCXWJjtQ s3XX9ko60KNS2CfNw233qPVdSkr3ajS9d+BKYRh+ws1t+F+QtjQbDuDqIL5kxedYFv34 l0wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="i/Zi+RnM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l187-20020a6391c4000000b0056c2f508898si1577097pge.725.2023.09.19.05.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 05:31:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="i/Zi+RnM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5C13180FA9C2; Tue, 19 Sep 2023 03:48:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232020AbjISKsf (ORCPT + 26 others); Tue, 19 Sep 2023 06:48:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232025AbjISKsM (ORCPT ); Tue, 19 Sep 2023 06:48:12 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93A5A181 for ; Tue, 19 Sep 2023 03:47:53 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-53482b44007so3792125a12.2 for ; Tue, 19 Sep 2023 03:47:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120473; x=1695725273; 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; bh=+wGYSKJ+LCREMj4ZZPD+f0Pekeht6gsRJzvaQhiRmgU=; b=i/Zi+RnMMWwqHRAi5eyMP8BEVDcrPYf6JAK/AvjUUIaJi3DI5FDbihVH9zRZfmzg4e c0uKqm5hQ647b9LcFMrrH6CZ0bh7lj15045qIHBjV4M6EoVUfTAcGdS25jBeNvjr9Lts oURKuZIgyAimVdfq3aXOPfCN95FkoWyfs7PZU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120473; x=1695725273; 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=+wGYSKJ+LCREMj4ZZPD+f0Pekeht6gsRJzvaQhiRmgU=; b=F0ZdcZFKezzsCmt1oZJKsdHF5AUcH3Q8po6fG8ldp7tRWqM20UOBJl2xeJOVOWW4Jv otU2JKBf2mzYQcNtQFGFv8lsblTr3P2q3e9LXytYYp6ciKfOxb8WN+ZA89m8C15m5BJW wuzIF3xSoTROC92QRKIx3g5Rse66FHF0PwLXZ+dIxvOh8K9ri2gID8Is8oYZRujEETEp I0eV6LnO/gw6mdzIguRUJB5P9Lc4EIEMwyvgYkGSpydFgkMMBj9neBRezKKI4uzarH3P LjmC+HOkYKnQIYY0OnZRiVDkg4iHfDUDh8Keh5tEySrccOI7WReZjdthFr9ldPX0XYO+ X87A== X-Gm-Message-State: AOJu0YysN3Fh3C5kZrerEQ4L2MaJ1OLbJthiofL55Y6bLYjbvdLg2eJe 3c/w37s0D3uI+R9X+pY4ISMYM9mLs4Y1GNxsFJc= X-Received: by 2002:a05:6a21:6d88:b0:15b:2125:890f with SMTP id wl8-20020a056a216d8800b0015b2125890fmr7209933pzb.37.1695120472905; Tue, 19 Sep 2023 03:47:52 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:52 -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 v3 11/12] regulator: mt6358: Add supply names for MT6366 regulators Date: Tue, 19 Sep 2023 18:43:54 +0800 Message-ID: <20230919104357.3971512-12-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:38 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777469162874452115 X-GMAIL-MSGID: 1777469162874452115 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 --- Changes since v2: none Changes since v1: - Replaced underscores in supply names with hyphens - Reflowed a couple macros for readability drivers/regulator/mt6358-regulator.c | 77 +++++++++++++--------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6358-regulator.c index 4e7891e514b6..58ee93aa2a34 100644 --- a/drivers/regulator/mt6358-regulator.c +++ b/drivers/regulator/mt6358-regulator.c @@ -140,6 +140,7 @@ struct mt6358_regulator_info { [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = "vsys-" match, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_range_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -162,10 +163,11 @@ struct mt6358_regulator_info { .modeset_mask = BIT(_modeset_shift), \ } -#define MT6366_LDO(match, vreg, volt_ranges, enreg, enbit, vosel, vosel_mask) \ +#define MT6366_LDO(match, vreg, volt_ranges, supply, enreg, enbit, vosel, vosel_mask) \ [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_table_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -186,12 +188,12 @@ struct mt6358_regulator_info { .qi = BIT(15), \ } -#define MT6366_LDO1(match, vreg, min, max, step, \ - _da_vsel_reg, _da_vsel_mask, \ - vosel, vosel_mask) \ +#define MT6366_LDO1(match, vreg, supply, min, max, step, \ + _da_vsel_reg, _da_vsel_mask, vosel, vosel_mask) \ [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_range_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -211,11 +213,11 @@ struct mt6358_regulator_info { .qi = BIT(0), \ } -#define MT6366_REG_FIXED(match, vreg, \ - enreg, enbit, volt) \ +#define MT6366_REG_FIXED(match, vreg, supply, enreg, enbit, volt) \ [MT6366_ID_##vreg] = { \ .desc = { \ .name = #vreg, \ + .supply_name = supply, \ .of_match = of_match_ptr(match), \ .ops = &mt6358_volt_fixed_ops, \ .type = REGULATOR_VOLTAGE, \ @@ -584,57 +586,52 @@ static const struct mt6358_regulator_info mt6366_regulators[] = { 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, 1200000), + MT6366_REG_FIXED("vio18", VIO18, "vs1-ldo1", MT6358_LDO_VIO18_CON0, 0, 1800000), + MT6366_REG_FIXED("vfe28", VFE28, "vsys-ldo1", MT6358_LDO_VFE28_CON0, 0, 2800000), + MT6366_REG_FIXED("vcn28", VCN28, "vsys-ldo1", MT6358_LDO_VCN28_CON0, 0, 2800000), + MT6366_REG_FIXED("vxo22", VXO22, "vsys-ldo1", MT6358_LDO_VXO22_CON0, 0, 2200000), + 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, 2800000), + MT6366_REG_FIXED("va12", VA12, "vs2-ldo2", MT6358_LDO_VA12_CON0, 0, 1200000), + MT6366_REG_FIXED("vrf18", VRF18, "vs1-ldo1", MT6358_LDO_VRF18_CON0, 0, 1800000), + 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, 6250, 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, 6250, 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, 6250, 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), }; From patchwork Tue Sep 19 10:43:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 141889 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3380861vqi; Tue, 19 Sep 2023 06:21:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVh6jZTrHEXhtuuT/6lxr1ANSw0yBGrWRWfcRcgKfnJUiU04tK4PVPCfAEgrSCtWcPNEsr X-Received: by 2002:a17:90b:128a:b0:268:b66b:d9f6 with SMTP id fw10-20020a17090b128a00b00268b66bd9f6mr8537912pjb.18.1695129676188; Tue, 19 Sep 2023 06:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695129676; cv=none; d=google.com; s=arc-20160816; b=efOpL5nS94x1U1magDy3RKoPcZI7z1sYGOpgGlwqdUy2s4NoZI3zhVa/C50ulU3XF5 XWFJ1Y37z/JR+tU0mgZ9ZNCL2iMWvf6rhNIxGpFJPtFhJLebDZDwE6jtRDBvhq5zdTya nUC8UrAOJdoD4tMBboGnIa8+mgR9fdXQJUi4ZroJeSyUOWttIyPTOsgbGtYPm0P+gp60 dXj0uu84LZjR6ZeBGLDTnydv0iD7H8kIQw+/JAhyngWdi37HfPWGpZZQiuuAh1DSvTiJ eqOW3O8HGntFXzW0Lp3MWdxGV2YCywKBwoyjAHjntZAIjAdQNuDfa8lX6zSAmvpss3MS y0yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O1tYjsJDu+C5E5OW4y5pouEu7mxQQfBFwdkXqrO1cX8=; fh=V9OHkENDB80hqt4mznI/iuUuuKxIjmAW9KtwlmjCzec=; b=CjGSsgjC2vu6vTQOPFU9Hg5NDkKeSaXNtSSySysYvWNCQUzDbUby+OkVpfhpWSHR0B +8Y2cpQ+G1O+i3TAFSD+ZteJi+Ma/vKtxYXdDxUy3OLPVF59J5Jfb7rHuXl393MNnuyL ImDYJHS/elJNj1ljzEzwJTl/Jk4fVcQ/5soTeRYRpr6jyxQ62Av3emcW20NtNMfahYk6 mfq1AI7ctQIbnTiVcCL5lo/uhyfI4or1NZiGdVhIaWG9aV0/nF9zlNhgsqVhuoH5mmUY 3+NzgjHq3vJV6vppBDE8pGEZ8H+WOYi7eAQntWj+27rG3Ekm5lkgzu5KFuMknZb6nnYU uSsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bK4R9Mcx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id v14-20020a17090abb8e00b002766354b7b2si3554885pjr.153.2023.09.19.06.21.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 06:21:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bK4R9Mcx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 100EC80BEB2B; Tue, 19 Sep 2023 03:48:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232049AbjISKso (ORCPT + 26 others); Tue, 19 Sep 2023 06:48:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231908AbjISKsO (ORCPT ); Tue, 19 Sep 2023 06:48:14 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39095CE9 for ; Tue, 19 Sep 2023 03:47:56 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1bf5c314a57so39923665ad.1 for ; Tue, 19 Sep 2023 03:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695120475; x=1695725275; 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; bh=O1tYjsJDu+C5E5OW4y5pouEu7mxQQfBFwdkXqrO1cX8=; b=bK4R9McxLmMeTD1ojNdkPrYJrn8DuWzXbffMB9CMzt7GisT6/YjP72764tRLRufV/e RmAKkZPNz/SA1dUPk6RGjXpGdtdWulooWLADmpHDw/PokDkpEKCMKUzZi24HmMRzPRd8 RrT6eS0aUY3Y44wWF+pZd23UyELTrHDlHApEc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695120475; x=1695725275; 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=O1tYjsJDu+C5E5OW4y5pouEu7mxQQfBFwdkXqrO1cX8=; b=rVMbKTtM8JC4S9hHUHe+1aX0DD+08NabJsoLsy8N22r2GzXZS2B994yLAxe/ZjEzcI OkUpLJN1DfzjamS1mhXKCpDHYZNBaKmuCkvqabIbgIjUy6xnHKsnjgrXMRcnTLPhT1Mb GNqO74d+at7aLW4ydkI0zmBibiD0hVNtWC8k7WFY0XJEKWrncK4hosm4aUyTURZK7fb5 uz1SVogjYo7t84AlK3agyuGudzmHutCkIK4v0PFpM5E3spCQFKyq0AcWaCqBHjZKsDDR L3TbnX6ElsTKeqn7WXDAz1xmzGuNiHJdUILSIlYC5TtUerklyURdVvjObn8ivqYcQJeW o0Ug== X-Gm-Message-State: AOJu0YyFDEsIuVrUYvCzSLuSQVs2fphaIauWTg6qD7I6Sk/QLkh3Z2zA zlDNoOq8kuPR0/PIiZX7ZdlHPg== X-Received: by 2002:a17:902:ecc5:b0:1bf:13a7:d3ef with SMTP id a5-20020a170902ecc500b001bf13a7d3efmr11054107plh.66.1695120475653; Tue, 19 Sep 2023 03:47:55 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:40a:900d:e731:5a43]) by smtp.gmail.com with ESMTPSA id c10-20020a170902d48a00b001bc445e249asm6719578plg.124.2023.09.19.03.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:47:55 -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 v3 12/12] arm64: dts: mediatek: mt8183-kukui: Add PMIC regulator supplies Date: Tue, 19 Sep 2023 18:43:55 +0800 Message-ID: <20230919104357.3971512-13-wenst@chromium.org> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog In-Reply-To: <20230919104357.3971512-1-wenst@chromium.org> References: <20230919104357.3971512-1-wenst@chromium.org> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 03:48:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777472295384746195 X-GMAIL-MSGID: 1777472295384746195 The PMIC regulator node is missing regulator supplies. Now that the binding supports them, add all the power rail supplies. Most of them are fed from a system-wide semi-regulated power rail. A couple LDOs are fed from the PMIC's own buck regulator outputs. Signed-off-by: Chen-Yu Tsai --- .../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi index 6ce16a265e05..d48c66cc8c18 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -103,6 +103,14 @@ pp3300_alw: regulator6 { regulator-max-microvolt = <3300000>; }; + /* system wide semi-regulated power rail from charger */ + reg_vsys: regulator-vsys { + compatible = "regulator-fixed"; + regulator-name = "vsys"; + regulator-always-on; + regulator-boot-on; + }; + reserved_memory: reserved-memory { #address-cells = <2>; #size-cells = <2>; @@ -404,6 +412,26 @@ &mt6358codec { Avdd-supply = <&mt6358_vaud28_reg>; }; +&mt6358regulator { + vsys-ldo1-supply = <®_vsys>; + vsys-ldo2-supply = <®_vsys>; + vsys-ldo3-supply = <®_vsys>; + vsys-vcore-supply = <®_vsys>; + vsys-vdram1-supply = <®_vsys>; + vsys-vgpu-supply = <®_vsys>; + vsys-vmodem-supply = <®_vsys>; + vsys-vpa-supply = <®_vsys>; + vsys-vproc11-supply = <®_vsys>; + vsys-vproc12-supply = <®_vsys>; + vsys-vs1-supply = <®_vsys>; + vsys-vs2-supply = <®_vsys>; + vs1-ldo1-supply = <&mt6358_vs1_reg>; + vs2-ldo1-supply = <&mt6358_vdram1_reg>; + vs2-ldo2-supply = <&mt6358_vs2_reg>; + vs2-ldo3-supply = <&mt6358_vs2_reg>; + vs2-ldo4-supply = <&mt6358_vs2_reg>; +}; + &mt6358_vgpu_reg { regulator-min-microvolt = <625000>; regulator-max-microvolt = <900000>;