From patchwork Tue Sep 20 02:22:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Acayan X-Patchwork-Id: 12981243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BB4DC54EE9 for ; Tue, 20 Sep 2022 02:23:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbiITCXA (ORCPT ); Mon, 19 Sep 2022 22:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbiITCW7 (ORCPT ); Mon, 19 Sep 2022 22:22:59 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26D0D27FD5; Mon, 19 Sep 2022 19:22:58 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id q83so1135943iod.7; Mon, 19 Sep 2022 19:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=7dW6VpENbb1lICYD4oA1HcN6j82dt3EkdyA3uGV6oeg=; b=YcXNI59uj7Oh4U2GXLfezpHNMxu1yWLDkELOXi75g3bMLyAxOuARuYTeEasv7uQ/Z2 XRVAz80ITzVfWAF5pJ7IKA2SD9UcLKsf4zljRsIozAr90SmMDZIWHLBCjExQPmH6rARY AWvhmNMgI5D8rIGfwAcHkXJSKmuSTtBG/BTty+RF6K1lV0e6ah/ntvxNrB+tZY5Yu+dq B8zzb/oA3fgiavkUa2isYWd7zUNtX/u3I7wuLw1VthvhJl3jXJcy1EgeGVJYQKBOHylk VEiGwYTAU01iMf9GBltrLEG5zSV/5ey9/RMaF+2cJeb8X++Xg5dT9Tssa0+NByKyN2ix idWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=7dW6VpENbb1lICYD4oA1HcN6j82dt3EkdyA3uGV6oeg=; b=bGRWmPogZ8XnD0M+W2dvFWJ8N42YdCBPvOVu49IJ5vJwJlFryAw9qMJU4mqksf/EOU vNLvwc6FRlwfLY5ghZz7kRd9OEankTV4PuTUctqqQgvp6JMOu952DJZt5/eA4psirVJ0 vy/h9CHsy6JgmIEG5m/l5pdYZr13QEK1CcoOXhiomDceJ+ztZwtvNdprnplA8VCfvFm/ eYvnhoUQyiGBQU17yLfPxs1Bw6qORr+HdTWIdaiuxcNO9nTQQ728o1a0hJ6tcRPBUgTw P5jN5V3SlhAGTLAABLnmyUMKNZQG7xxlB0HEniSn2sEA5xEelxS0qE9yV+DybG38IJ4j rqVA== X-Gm-Message-State: ACrzQf2RKNMvNk68xvVXAmaVzkJAc3SgdbP6iOhKpFqtAduMLaF5Rgps aNNcrswY5jwlrrP+g/zhx2XueZ62QGY= X-Google-Smtp-Source: AMsMyM48VBzf1cUR6Rtz1xX1z9VkXONog/nhTQHKtfRF1naKcKFjCpJGc77EC90ZrFMUnJwkhCZxlA== X-Received: by 2002:a05:6638:3d09:b0:357:34bc:7ec8 with SMTP id cl9-20020a0566383d0900b0035734bc7ec8mr9570732jab.238.1663640577359; Mon, 19 Sep 2022 19:22:57 -0700 (PDT) Received: from localhost ([2607:fea8:a2e2:2d00::58d4]) by smtp.gmail.com with UTF8SMTPSA id r18-20020a92c5b2000000b002de7ceafb4esm189031ilt.20.2022.09.19.19.22.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 19:22:56 -0700 (PDT) From: Richard Acayan To: linux-arm-msm@vger.kernel.org Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Subject: [PATCH 1/2] dt-bindings: regulator: qcom,rpmh: add pm660 and pm660l pmics Date: Mon, 19 Sep 2022 22:22:50 -0400 Message-Id: <20220920022251.3073-2-mailingradian@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220920022251.3073-1-mailingradian@gmail.com> References: <20220920022251.3073-1-mailingradian@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The SDM670 uses RPMh for managing the PM660 and PM660L. Document RPMh support for the PMIC. Link: https://android.googlesource.com/kernel/msm/+/58064f13c0a436a82c35f2e3b5a122d874ae5846%5E%21/#F0 Signed-off-by: Richard Acayan --- .../regulator/qcom,rpmh-regulator.yaml | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml index 92ff4d59ba20..90c3bda31c23 100644 --- a/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml @@ -37,6 +37,8 @@ description: | For PM6150, smps1 - smps5, ldo1 - ldo19 For PM6150L, smps1 - smps8, ldo1 - ldo11, bob For PM6350, smps1 - smps5, ldo1 - ldo22 + For PM660, smps1 - smps6, ldo1 - ldo3, ldo5 - ldo19 + For PM660L, smps1 - smps3, smps5, ldo1 - ldo8, bob For PM7325, smps1 - smps8, ldo1 - ldo19 For PM8005, smps1 - smps4 For PM8009, smps1 - smps2, ldo1 - ldo7 @@ -57,6 +59,8 @@ properties: - qcom,pm6150-rpmh-regulators - qcom,pm6150l-rpmh-regulators - qcom,pm6350-rpmh-regulators + - qcom,pm660-rpmh-regulators + - qcom,pm660l-rpmh-regulators - qcom,pm7325-rpmh-regulators - qcom,pm8005-rpmh-regulators - qcom,pm8009-rpmh-regulators @@ -148,6 +152,38 @@ allOf: patternProperties: "^vdd-s[1-8]-supply$": true + - if: + properties: + compatible: + enum: + - qcom,pm660-rpmh-regulators + then: + properties: + vdd-l1-l6-l7-supply: true + vdd-l2-l3-supply: true + vdd-l5-supply: true + vdd-l8-l9-l10-l11-l12-l13-l14-supply: true + vdd-l15-l16-l17-l18-l19-supply: true + patternProperties: + "^vdd-s[1-6]-supply$": true + + - if: + properties: + compatible: + enum: + - qcom,pm660l-rpmh-regulators + then: + properties: + vdd-bob-supply: + description: BOB regulator parent supply phandle. + vdd-l1-l9-l10-supply: true + vdd-l2-supply: true + vdd-l3-l5-l7-l8-supply: true + vdd-l4-l6-supply: true + vdd-s3-s4-supply: true + patternProperties: + "^vdd-s[125]-supply$": true + - if: properties: compatible: From patchwork Tue Sep 20 02:22:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Acayan X-Patchwork-Id: 12981244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 767D1C6FA8B for ; Tue, 20 Sep 2022 02:23:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230039AbiITCXC (ORCPT ); Mon, 19 Sep 2022 22:23:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbiITCXB (ORCPT ); Mon, 19 Sep 2022 22:23:01 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F38F564EB; Mon, 19 Sep 2022 19:23:00 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id d8so1116815iof.11; Mon, 19 Sep 2022 19:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=8x7bkc+/nQ4Gak6zOOVzdJShWFx0m/P34PcdoTGcao4=; b=OL7qEhJTZnN+gWYCxVCS18sCZJ8NTcPcifnsJu+7nj+TuVMBBYNePAB+6/aPYoLlTb 6+SvqGKan6uoabZZ9SQoX2wnJmb/1WaGdGZfgYhyncHezs8E1tDyvKTaY/aLvXd9sANw W3BT4/x4cLW3BZv6LNYiUgRojdapOh7RJLZBX8JnnKhYlGnz2QiTe/HJCyZ6KH3fgj+0 dHpEBzF3lSArpuAxE505C/8t4FS/xSFEL5dxDyvirJ7313GUwnSVgQi317Bv6XyVcdYI 4iuqkD24iPMDoNo5fsJj/ZePuWgh0i708+B33XofxLjFvFehI0JKC79XLQzZclkE9Ub2 N3bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=8x7bkc+/nQ4Gak6zOOVzdJShWFx0m/P34PcdoTGcao4=; b=NqIh70lx9pMny1PGF+uyQZinQzv92g1i48my+4AjHy83ifnoVtORROwlCvnKAEm5Kd DKP+51ULqzp7GRnGRouCUizEaOrt/7vpoT+4nxWPw8Gae9Mcv51BpvDGqwj78kl6IE8a H4h1/0m8lWbToR7IoWCZADxzKfqBZ1PV2xaCXgZ3R6I5Zq6cvsFxtGmPmGTUXR/S27uO GzOuyihku3xG7ziD76To41YJo1msNs/8qcXU3IIs1Xo4AdQMCV2bOoJfpQxaNxESTZ1Y ZNAYaAzBiET2j+ImqRR3e1wuXte4DMv5d/UtVeB+wKMEEJgZUVVN+UjFnBx6weUBs3Lo z03w== X-Gm-Message-State: ACrzQf0EwW95Icu5evHsfjEeGuhCpnkUeIlmZzdO0nFM04HmOzR8jcgP cKONn+wOC0akeDbkMBNVvBY6RH0VCxw= X-Google-Smtp-Source: AMsMyM6tsed5DiqEZaok3vRWT+2TLAyaogXIwQVo5tjsRbevCvVfzDafGzKAS/A+SI7/mh2HlQJvAQ== X-Received: by 2002:a05:6602:13c3:b0:6a3:41bd:b99 with SMTP id o3-20020a05660213c300b006a341bd0b99mr2759963iov.103.1663640579636; Mon, 19 Sep 2022 19:22:59 -0700 (PDT) Received: from localhost ([2607:fea8:a2e2:2d00::58d4]) by smtp.gmail.com with UTF8SMTPSA id e6-20020a028606000000b0035ae4c019d1sm159215jai.28.2022.09.19.19.22.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 19:22:59 -0700 (PDT) From: Richard Acayan To: linux-arm-msm@vger.kernel.org Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Subject: [PATCH 2/2] regulator: qcom-rpmh: add pm660 and pm660l pmics Date: Mon, 19 Sep 2022 22:22:51 -0400 Message-Id: <20220920022251.3073-3-mailingradian@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220920022251.3073-1-mailingradian@gmail.com> References: <20220920022251.3073-1-mailingradian@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The SDM630 and SDM660 both use RPM (not RPMh) for managing the PM660 and PM660L. The SDM670 uses RPMh to manage them as PMIC 4s. To support the SDM670, add the PM660 and PM660L to the RPMh regulator driver. Link: https://android.googlesource.com/kernel/msm/+/58064f13c0a436a82c35f2e3b5a122d874ae5846%5E%21/#F0 Link: https://android.googlesource.com/kernel/msm/+/f676d3d24f9d802bfe63369167c4a8cc162b8950%5E%21/#F3 Signed-off-by: Richard Acayan --- drivers/regulator/qcom-rpmh-regulator.c | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c index b2debde79361..4158ff126a67 100644 --- a/drivers/regulator/qcom-rpmh-regulator.c +++ b/drivers/regulator/qcom-rpmh-regulator.c @@ -1198,6 +1198,52 @@ static const struct rpmh_vreg_init_data pmr735a_vreg_data[] = { {} }; +static const struct rpmh_vreg_init_data pm660_vreg_data[] = { + RPMH_VREG("smps1", "smp%s1", &pmic4_ftsmps426, "vdd-s1"), + RPMH_VREG("smps2", "smp%s2", &pmic4_ftsmps426, "vdd-s2"), + RPMH_VREG("smps3", "smp%s3", &pmic4_ftsmps426, "vdd-s3"), + RPMH_VREG("smps4", "smp%s4", &pmic4_hfsmps3, "vdd-s4"), + RPMH_VREG("smps5", "smp%s5", &pmic4_hfsmps3, "vdd-s5"), + RPMH_VREG("smps6", "smp%s6", &pmic4_hfsmps3, "vdd-s6"), + RPMH_VREG("ldo1", "ldo%s1", &pmic4_nldo, "vdd-l1-l6-l7"), + RPMH_VREG("ldo2", "ldo%s2", &pmic4_nldo, "vdd-l2-l3"), + RPMH_VREG("ldo3", "ldo%s3", &pmic4_nldo, "vdd-l2-l3"), + /* ldo4 is inaccessible on PM660 */ + RPMH_VREG("ldo5", "ldo%s5", &pmic4_nldo, "vdd-l5"), + RPMH_VREG("ldo6", "ldo%s6", &pmic4_nldo, "vdd-l1-l6-l7"), + RPMH_VREG("ldo7", "ldo%s7", &pmic4_nldo, "vdd-l1-l6-l7"), + RPMH_VREG("ldo8", "ldo%s8", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), + RPMH_VREG("ldo9", "ldo%s9", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), + RPMH_VREG("ldo10", "ldo%s10", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), + RPMH_VREG("ldo11", "ldo%s11", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), + RPMH_VREG("ldo12", "ldo%s12", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), + RPMH_VREG("ldo13", "ldo%s13", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), + RPMH_VREG("ldo14", "ldo%s14", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), + RPMH_VREG("ldo15", "ldo%s15", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), + RPMH_VREG("ldo16", "ldo%s16", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), + RPMH_VREG("ldo17", "ldo%s17", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), + RPMH_VREG("ldo18", "ldo%s18", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), + RPMH_VREG("ldo19", "ldo%s19", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), + {} +}; + +static const struct rpmh_vreg_init_data pm660l_vreg_data[] = { + RPMH_VREG("smps1", "smp%s1", &pmic4_ftsmps426, "vdd-s1"), + RPMH_VREG("smps2", "smp%s2", &pmic4_ftsmps426, "vdd-s2"), + RPMH_VREG("smps3", "smp%s3", &pmic4_ftsmps426, "vdd-s3-s4"), + RPMH_VREG("smps5", "smp%s5", &pmic4_ftsmps426, "vdd-s5"), + RPMH_VREG("ldo1", "ldo%s1", &pmic4_nldo, "vdd-l1-l9-l10"), + RPMH_VREG("ldo2", "ldo%s2", &pmic4_pldo, "vdd-l2"), + RPMH_VREG("ldo3", "ldo%s3", &pmic4_pldo, "vdd-l3-l5-l7-l8"), + RPMH_VREG("ldo4", "ldo%s4", &pmic4_pldo, "vdd-l4-l6"), + RPMH_VREG("ldo5", "ldo%s5", &pmic4_pldo, "vdd-l3-l5-l7-l8"), + RPMH_VREG("ldo6", "ldo%s6", &pmic4_pldo, "vdd-l4-l6"), + RPMH_VREG("ldo7", "ldo%s7", &pmic4_pldo, "vdd-l3-l5-l7-l8"), + RPMH_VREG("ldo8", "ldo%s8", &pmic4_pldo, "vdd-l3-l5-l7-l8"), + RPMH_VREG("bob", "bob%s1", &pmic4_bob, "vdd-bob"), + {} +}; + static int rpmh_regulator_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1320,6 +1366,14 @@ static const struct of_device_id __maybe_unused rpmh_regulator_match_table[] = { .compatible = "qcom,pmr735a-rpmh-regulators", .data = pmr735a_vreg_data, }, + { + .compatible = "qcom,pm660-rpmh-regulators", + .data = pm660_vreg_data, + }, + { + .compatible = "qcom,pm660l-rpmh-regulators", + .data = pm660l_vreg_data, + }, {} }; MODULE_DEVICE_TABLE(of, rpmh_regulator_match_table);