From patchwork Sun May 15 20:31:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12850087 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 66E47C433F5 for ; Sun, 15 May 2022 20:31:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231969AbiEOUbY (ORCPT ); Sun, 15 May 2022 16:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbiEOUbX (ORCPT ); Sun, 15 May 2022 16:31:23 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EC532BE5; Sun, 15 May 2022 13:31:22 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id g6so25221459ejw.1; Sun, 15 May 2022 13:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GMH39Son2N3gZ9c/oeFLwOmolsOkBedh777nxOuqfek=; b=ICNuozQdrKs9S7QW4c7BmzeSDmB6P5eSXxchDKGIniTnOy9u6UXnhLsLw06CAeFl35 uU4YG5BYBnA8tlQzkDNgjEu5qF1AFJj8HCdiwMzY6I5uc8cBL6JyC5jRFfRAVVjJm1Fn m8lK6UslYi8crDNayf8bv+RCUyk7sFme0sdXzIEvOh65pwhGcKVk6bFxHmnLtyeJzT7b YBd9w+9sNPXw3e47DOOwbDYGsTIgMqXkzTgvYpkfeh2S0pc3gKxKVQzRsT3TSTyZDFrg 9OT0H+64hSrJ8iZObQ4VouvaCfXl3RWSBcYfGMQusyeLvGZbx4kLMz4yyif0tYyMg+od bGzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GMH39Son2N3gZ9c/oeFLwOmolsOkBedh777nxOuqfek=; b=fEtjlNHCfwCvSN0vTGrXK+GBKRwwkLEtoSR1b0xgjipDZp5gaTfJOkmkMgZGCx0wqv 0PRaWSYyfD2fykBWe2n7yYzI9soM7HKcNw6qkv6GDqr2x8EWZ/u2XAEkBU+yPtGaEH3F kwR3hFElXBzkEiik0FUN9OOcBDMqwpz2SUdlOPUcKhNgyzM1g8Qdkg3rOn88jtH1H396 sfl5cEUBPiVQMlNFyzp/IbQEj1s6UrLWqLbi0S+Bpq9tfqDThSHxmovCl7wHxBy8NcA5 o6dC97A84ON0lTL6PTzTQNdMgd+WF3WLOysMmct7PFnczP2wBDSnhOKl7UUlvy1OKLZf y/6g== X-Gm-Message-State: AOAM531pAHnQQMuaOC+RPO18DF+D6kEpw4cBoPeCZAml9Z+K+U/wnESB iNm6ge2rAw2qcM0W9ofRCh8= X-Google-Smtp-Source: ABdhPJzwjb3a5SuYFnXIm2M/C54wSpppovcGlUDKCA+/oHrU+JHpmN1eQxv2BMUB5VucaTIsEAW8SA== X-Received: by 2002:a17:906:5006:b0:6ce:3762:c72e with SMTP id s6-20020a170906500600b006ce3762c72emr12588246ejj.30.1652646680755; Sun, 15 May 2022 13:31:20 -0700 (PDT) Received: from fedora.robimarko.hr (dh207-98-105.xnet.hr. [88.207.98.105]) by smtp.googlemail.com with ESMTPSA id ze16-20020a170906ef9000b006f3ef214e4esm2944884ejb.180.2022.05.15.13.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 May 2022 13:31:20 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Robert Marko Subject: [PATCH 1/6] dt-bindings: regulator: qcom,spmi-regulator: Convert to dtschema Date: Sun, 15 May 2022 22:31:13 +0200 Message-Id: <20220515203118.474684-1-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Convert the bindings of Qualcomm SPMI regulators to DT schema. Signed-off-by: Robert Marko --- I am aware that syscon alone is not really acceptable, its converted directly from the old text bindings. There is also the issue of some MSM8994, MSM8996 and APQ8096 devices using '#address-cells', '#size-cells', some even defining reg property for regulators. Any advice on how to solve these issues is appreciated. --- .../regulator/qcom,spmi-regulator.yaml | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml diff --git a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml new file mode 100644 index 000000000000..f7da310f1845 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml @@ -0,0 +1,176 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/qcom,spmi-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm SPMI Regulators + +maintainers: + - Robert Marko + +properties: + compatible: + enum: + - qcom,pm660-regulators + - qcom,pm660l-regulators + - qcom,pm8004-regulators + - qcom,pm8005-regulators + - qcom,pm8226-regulators + - qcom,pm8841-regulators + - qcom,pm8916-regulators + - qcom,pm8941-regulators + - qcom,pm8950-regulators + - qcom,pm8994-regulators + - qcom,pmi8994-regulators + - qcom,pms405-regulators + + qcom,saw-reg: + description: Reference to syscon node defining the SAW registers + $ref: "/schemas/types.yaml#/definitions/phandle" + +allOf: + - if: + properties: + compatible: + contains: + enum: + - qcom,pm8941-regulators + then: + properties: + interrupts: + items: + - description: Over-current protection interrupt for 5V S1 + - description: Over-current protection interrupt for 5V S2 + interrupt-names: + items: + - const: ocp-5vs1 + - const: ocp-5vs2 + +patternProperties: + ".*-supply$": + description: Input supply phandle(s) for this node + $ref: "/schemas/types.yaml#/definitions/phandle" + + "^((s|l|lvs|5vs)[0-9]*)$": + description: List of regulators and its properties + $ref: regulator.yaml# + + properties: + qcom,ocp-max-retries: + description: + Maximum number of times to try toggling a voltage switch off and + back on as a result of consecutive over current events + $ref: "/schemas/types.yaml#/definitions/uint32" + + qcom,ocp-retry-delay: + description: + Time to delay in milliseconds between each voltage switch toggle + after an over current event takes place + $ref: "/schemas/types.yaml#/definitions/uint32" + + qcom,pin-ctrl-enable: + description: + Bit mask specifying which hardware pins should be used to enable the + regulator, if any. + Supported bits are + 0 = ignore all hardware enable signals + BIT(0) = follow HW0_EN signal + BIT(1) = follow HW1_EN signal + BIT(2) = follow HW2_EN signal + BIT(3) = follow HW3_EN signal + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 15 + + qcom,pin-ctrl-hpm: + description: + Bit mask specifying which hardware pins should be used to force the + regulator into high power mode, if any. + Supported bits are + 0 = ignore all hardware enable signals + BIT(0) = follow HW0_EN signal + BIT(1) = follow HW1_EN signal + BIT(2) = follow HW2_EN signal + BIT(3) = follow HW3_EN signal + BIT(4) = follow PMIC awake state + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 31 + + qcom,vs-soft-start-strength: + description: + This property sets the soft start strength for voltage switch type + regulators. + Supported values are + 0 = 0.05 uA + 1 = 0.25 uA + 2 = 0.55 uA + 3 = 0.75 uA + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 3 + + qcom,saw-slave: + description: SAW controlled gang slave. Will not be configured. + type: boolean + + qcom,saw-leader: + description: + SAW controlled gang leader. Will be configured as SAW regulator. + type: boolean + + unevaluatedProperties: false + +unevaluatedProperties: false + +required: + - compatible + +examples: + - | + regulators { + compatible = "qcom,pm8941-regulators"; + vdd_l1_l3-supply = <&s1>; + + s1: s1 { + regulator-min-microvolt = <1300000>; + regulator-max-microvolt = <1400000>; + }; + + l1: l1 { + regulator-min-microvolt = <1225000>; + regulator-max-microvolt = <1300000>; + }; + }; + + - | + saw3: syscon@9a10000 { + compatible = "syscon"; + reg = <0x9a10000 0x1000>; + }; + + regulators { + compatible = "qcom,pm8994-regulators"; + qcom,saw-reg = <&saw3>; + + s8 { + qcom,saw-slave; + }; + + s9 { + qcom,saw-slave; + }; + + s10 { + qcom,saw-slave; + }; + + pm8994_s11_saw: s11 { + qcom,saw-leader; + regulator-always-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1140000>; + }; + }; +... From patchwork Sun May 15 20:31:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12850089 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 2EC43C433F5 for ; Sun, 15 May 2022 20:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236745AbiEOUb3 (ORCPT ); Sun, 15 May 2022 16:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233179AbiEOUbZ (ORCPT ); Sun, 15 May 2022 16:31:25 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB095FB5; Sun, 15 May 2022 13:31:23 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id y21so15979028edo.2; Sun, 15 May 2022 13:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oIDUTK5KnimKV7JPutWUmQpjQBhC0JH0W89/0KDYnjU=; b=JPX+v4vULFUBp68FIay0x+aQNSp90Bl4RKUV5uiaMUeZLnWH6Rrd4mqjDDt6R/HBAd UWcOCQeRoPHZ8hYIycyTKf9vssyyUGae6CHYB7WObBe0trf8+e8pzL1f6yHLGoU+ZU2h 5bTfxbOOPyUcYxdPUtuE62ohQZU8jAcG0rWSam6EpW7/1NiR0uHnG6LfU542eGys1KjG yek5OvDviVsOE+0X875PU64L5UEp98fxT1abvOwfCEu2PH8nGpzgP7RHSNqfqyGY6jcz FXWji9zfC0hHpgZteZ6wKFutF7zMNkGbkt+MopgoKPTscEgcW9aFtxLghRHV/W/vbttZ HXBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oIDUTK5KnimKV7JPutWUmQpjQBhC0JH0W89/0KDYnjU=; b=xzYFdlBx6uyssX6cIPI79jAscpm6wh7bGwFB2X2RfphtZEZnCrsf6ZXlH7es5OPgdl G1JBD1os/mG/SYbysKtDOVXeBAxrZvqz1EOXeElafR7LX+9F44KVQqjf37ce79JUztQK ozMdVRzjECxKUTA7fpgyt4HT2LaURAiJe4Y+C9YsvpotbZoavbFlcSVFrerekPdUqMu8 DwWU45R9WbXW2taaFL6Yk1Ew5VQ4gfkjpipHQ6wr03bZ1SYAbvrwOmmHQ54FuKxZwij4 ujV6OShKh8K2yNl+UHo4IGrFLT8G0V39NIKaIVMETL9B3NsczlpUrHJdInacQMUE5DdB aYjg== X-Gm-Message-State: AOAM532kS9KsnJCjAE4yTJ6bevcgAEnyO4n+364UuRDQXsXHwJ4MJWcn Ys/v4bEO4T2Jn6EQDHFD+Ow= X-Google-Smtp-Source: ABdhPJzhYQx51/jgjxFRkreUSKfXrtPv1emyMvjQDq7CKL4SZgBgjJBcRXXxZ0bl/lN2DGl/wK0ZZg== X-Received: by 2002:a05:6402:2926:b0:42a:ab8a:edf2 with SMTP id ee38-20020a056402292600b0042aab8aedf2mr4363780edb.190.1652646682298; Sun, 15 May 2022 13:31:22 -0700 (PDT) Received: from fedora.robimarko.hr (dh207-98-105.xnet.hr. [88.207.98.105]) by smtp.googlemail.com with ESMTPSA id ze16-20020a170906ef9000b006f3ef214e4esm2944884ejb.180.2022.05.15.13.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 May 2022 13:31:21 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Robert Marko Subject: [PATCH 2/6] regulator: qcom_spmi: add support for HT_P150 Date: Sun, 15 May 2022 22:31:14 +0200 Message-Id: <20220515203118.474684-2-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220515203118.474684-1-robimarko@gmail.com> References: <20220515203118.474684-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org HT_P150 is a LDO PMOS regulator based on LV P150 using HFS430 layout found in PMP8074 and PMS405 PMIC-s. Both PMP8074 and PMS405 define the programmable range as 1.616V to 3.304V but the actual MAX output voltage depends on the exact LDO in each of the PMIC-s. It has a max current of 150mA, voltage step of 8mV. Signed-off-by: Robert Marko --- drivers/regulator/qcom_spmi-regulator.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c index 02bfce981150..38bbc70241ae 100644 --- a/drivers/regulator/qcom_spmi-regulator.c +++ b/drivers/regulator/qcom_spmi-regulator.c @@ -164,6 +164,7 @@ enum spmi_regulator_subtype { SPMI_REGULATOR_SUBTYPE_ULT_HF_CTL3 = 0x0f, SPMI_REGULATOR_SUBTYPE_ULT_HF_CTL4 = 0x10, SPMI_REGULATOR_SUBTYPE_HFS430 = 0x0a, + SPMI_REGULATOR_SUBTYPE_HT_P150 = 0x35, }; enum spmi_common_regulator_registers { @@ -544,6 +545,10 @@ static struct spmi_voltage_range hfs430_ranges[] = { SPMI_VOLTAGE_RANGE(0, 320000, 320000, 2040000, 2040000, 8000), }; +static struct spmi_voltage_range ht_p150_ranges[] = { + SPMI_VOLTAGE_RANGE(0, 1616000, 1616000, 3304000, 3304000, 8000), +}; + static DEFINE_SPMI_SET_POINTS(pldo); static DEFINE_SPMI_SET_POINTS(nldo1); static DEFINE_SPMI_SET_POINTS(nldo2); @@ -564,6 +569,7 @@ static DEFINE_SPMI_SET_POINTS(nldo660); static DEFINE_SPMI_SET_POINTS(ht_lvpldo); static DEFINE_SPMI_SET_POINTS(ht_nldo); static DEFINE_SPMI_SET_POINTS(hfs430); +static DEFINE_SPMI_SET_POINTS(ht_p150); static inline int spmi_vreg_read(struct spmi_regulator *vreg, u16 addr, u8 *buf, int len) @@ -1458,6 +1464,7 @@ static const struct regulator_ops spmi_hfs430_ops = { static const struct spmi_regulator_mapping supported_regulators[] = { /* type subtype dig_min dig_max ltype ops setpoints hpm_min */ + SPMI_VREG(LDO, HT_P150, 0, INF, HFS430, hfs430, ht_p150, 10000), SPMI_VREG(BUCK, GP_CTL, 0, INF, SMPS, smps, smps, 100000), SPMI_VREG(BUCK, HFS430, 0, INF, HFS430, hfs430, hfs430, 10000), SPMI_VREG(LDO, N300, 0, INF, LDO, ldo, nldo1, 10000), From patchwork Sun May 15 20:31:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12850088 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 D21B7C433F5 for ; Sun, 15 May 2022 20:31:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234875AbiEOUb2 (ORCPT ); Sun, 15 May 2022 16:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233281AbiEOUb0 (ORCPT ); Sun, 15 May 2022 16:31:26 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DB082BE5; Sun, 15 May 2022 13:31:25 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id i40so939992eda.7; Sun, 15 May 2022 13:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ENgyZIarJt3vx0WIXiC6L0+jAAX3vWhh6cAjsl5a67I=; b=SZFpiN8zhdmdVfDFONWVxa4X3LiXAkoHxyC9IzvkoFe/QoZrcetJZU/JXmQm9HXQFv NMfbWmRekKmuE2oBEVR75w6N5bj/4fcNfg7gIDcubWs2i1I9W7lqvcgkF/rGjadNkCEL T/VLOLtlg/GHcJ8KkqMOnSSjIkaTVI/8/IShYt0W5W3CHsm9OAXxWDPW/DTao27c0rE/ hmjhujBCw9T1Py27mX8WsyE7UwS3nyKSqwrwIgD1rblF00lBhBJkx3p3CJ8/uV+JbreC rHzHgLKRK75KXGFUjWrO1wNRPNA2yToiiqPorpRuh9VKum5QPJGKZvQLp5ynZY7xTrQ4 Fzhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ENgyZIarJt3vx0WIXiC6L0+jAAX3vWhh6cAjsl5a67I=; b=kbK0YYbum+ueBk8BdQalngSjvRvu3jV2nUrOBcrFQcIilkQUfX1oAFsmaxvP3saKBr rBCGPJuY34mZszvF9Qt/iXZcFD1S2MZ8bg9NDzyIFZlBUcHbfYl97NBtSOW3/MMZd3dX drGAuGFsfHsRrAVTBcOg9Sd9acqOpO3Z7V6Cz+O1heB/cHM8jW6o9mQ5yUPdtG9EHyqw Or/OjTRGWsahkmVuWvM8HTjXDpho3TN/g4nvDSZHr46ggd0bMzfVqWy8/pOHf8cPinCq iBUjyp/JFuI9Z3ZtyeHhVKa+YecH3iJljxi+QngKVJycexlbXUJducZC0TbKwDzfffQ4 QRvQ== X-Gm-Message-State: AOAM531n7yR7XKzvBeoPMz+lC2ODDc3pa4zhBcyaxoOD0+AGoThL+TcQ QaUte+5II4QZ1M8oc8gKWsw= X-Google-Smtp-Source: ABdhPJwmuEMVFMd3pOhbiXip1TKJdHQndx6BAJa7uGYqCpSA87Jir89Hbfu2jtrHA9DhPU4RPnqLnA== X-Received: by 2002:a05:6402:c90:b0:42a:98c7:3fe with SMTP id cm16-20020a0564020c9000b0042a98c703femr7851455edb.270.1652646683799; Sun, 15 May 2022 13:31:23 -0700 (PDT) Received: from fedora.robimarko.hr (dh207-98-105.xnet.hr. [88.207.98.105]) by smtp.googlemail.com with ESMTPSA id ze16-20020a170906ef9000b006f3ef214e4esm2944884ejb.180.2022.05.15.13.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 May 2022 13:31:23 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Robert Marko Subject: [PATCH 3/6] dt-bindings: regulator: qcom,spmi-regulator: add PMP8074 PMIC Date: Sun, 15 May 2022 22:31:15 +0200 Message-Id: <20220515203118.474684-3-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220515203118.474684-1-robimarko@gmail.com> References: <20220515203118.474684-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Document the PMP8074 PMIC compatible. Signed-off-by: Robert Marko --- .../devicetree/bindings/regulator/qcom,spmi-regulator.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml index f7da310f1845..960e61661bc8 100644 --- a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml +++ b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml @@ -23,6 +23,7 @@ properties: - qcom,pm8950-regulators - qcom,pm8994-regulators - qcom,pmi8994-regulators + - qcom,pmp8074-regulators - qcom,pms405-regulators qcom,saw-reg: From patchwork Sun May 15 20:31:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12850090 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 70006C4332F for ; Sun, 15 May 2022 20:31:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237998AbiEOUbc (ORCPT ); Sun, 15 May 2022 16:31:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234191AbiEOUb1 (ORCPT ); Sun, 15 May 2022 16:31:27 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB05E5FEC; Sun, 15 May 2022 13:31:26 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id fd25so3355819edb.3; Sun, 15 May 2022 13:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DzxGK66oNP5EqUefEbuvx65uQZvfKjOjhE65FjoDOMc=; b=hoKt9d8+dKND6Y6Bwsc8ypDLly19+Ewi/s13gjFFKg67ZgbfWM+I8A8eJQ4bJhwNw3 NZ1IDZPxtmBRBIlzAiefyAtajH2ZmXa+Ut+d5Y+7sHoSQD0xkFd6YK8c36hJ4rxGTqlm /IfM3fFQXty9jCWH83xiSPU/zexhOZnWRaI4yyQw8u2Pd7/izbovPn3FPp1W8H7u+pv9 MBgz4DtiFyIccF5tGPCZoSPt2fES4ZWesMtg1uEJzeg2XKXH++i6RT/JcXOQ+VjdKjF3 yglYZ4i+acrqy627qTQRy4swy8RytTXqhjdAZwNeSngYEWB+BF7WzxD5os2f81dTbnjh genQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DzxGK66oNP5EqUefEbuvx65uQZvfKjOjhE65FjoDOMc=; b=L7qp3oAafX/afOZCH4MZvqh5O0cjgJUSXL6NOuTK8g0XL6cx5eRZyf5rRjfCPCblKn jRbegtBgq74EXYoZD8g/PFVAAh/+gEohtlGa0nWePQTwGqlpoXzxfQqzb0BMryC0NZBB WBVcGGvy1JxLbHxAPTKYWp0xW7Lhl+RGVOdyvhoJiF3Qf8rpwmSD7izLcQoPrrrVi5YJ N7QR0qH4Qrv/3DQReMFt1SaZ45CQ9cQXkPjMKQk/IH/Gb0TMY8ESYx82rfoXi48NydPI S9BpevNODK46jvIByvYfVqcUluRE0ZI8rOlKAt4qdyNIEFWowjL6sgTnMbgcZdvoEPYf vh7w== X-Gm-Message-State: AOAM533M69bOAO39D/c6n2ifRsojtgbgo18zhPVuLPGz+ZTY/ke/idYZ jj80B81pW6XHrSQFDXPQbsdc75n0XpA= X-Google-Smtp-Source: ABdhPJyb74RJcWIEYubGmbz8xaQt2Fz2l8jFS1qtV6F7iSnoqELAjmlPQcyYwdu8RxTezVJrLvKbYA== X-Received: by 2002:a05:6402:90d:b0:428:bda9:3e6b with SMTP id g13-20020a056402090d00b00428bda93e6bmr9829164edz.132.1652646685338; Sun, 15 May 2022 13:31:25 -0700 (PDT) Received: from fedora.robimarko.hr (dh207-98-105.xnet.hr. [88.207.98.105]) by smtp.googlemail.com with ESMTPSA id ze16-20020a170906ef9000b006f3ef214e4esm2944884ejb.180.2022.05.15.13.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 May 2022 13:31:25 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Robert Marko Subject: [PATCH 4/6] regulator: qcom_spmi: Add support for PMP8074 regulators Date: Sun, 15 May 2022 22:31:16 +0200 Message-Id: <20220515203118.474684-4-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220515203118.474684-1-robimarko@gmail.com> References: <20220515203118.474684-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org PMP8074 is a companion PMIC for the Qualcomm IPQ8074 WiSoC-s. It features 5 HF-SMPS and 13 LDO regulators. This commit adds support for S3 and S4 HF-SMPS buck regulators of the HFS430 type and LDO11 of the HT_P150 type. S3 is the CPU cluster voltage supply, S4 supplies the UBI32 NPU cores and LDO11 is the SDIO/eMMC I/O voltage regulator required for high speeds. Signed-off-by: Robert Marko --- drivers/regulator/qcom_spmi-regulator.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c index 38bbc70241ae..696b088aae40 100644 --- a/drivers/regulator/qcom_spmi-regulator.c +++ b/drivers/regulator/qcom_spmi-regulator.c @@ -2137,6 +2137,13 @@ static const struct spmi_regulator_data pms405_regulators[] = { { } }; +static const struct spmi_regulator_data pmp8074_regulators[] = { + { "s3", 0x1a00, "vdd_s3"}, + { "s4", 0x1d00, "vdd_s4"}, + { "l11", 0x4a00, "vdd_l10_l11_l12_l13"}, + { } +}; + static const struct of_device_id qcom_spmi_regulator_match[] = { { .compatible = "qcom,pm8004-regulators", .data = &pm8004_regulators }, { .compatible = "qcom,pm8005-regulators", .data = &pm8005_regulators }, @@ -2150,6 +2157,7 @@ static const struct of_device_id qcom_spmi_regulator_match[] = { { .compatible = "qcom,pm660-regulators", .data = &pm660_regulators }, { .compatible = "qcom,pm660l-regulators", .data = &pm660l_regulators }, { .compatible = "qcom,pms405-regulators", .data = &pms405_regulators }, + { .compatible = "qcom,pmp8074-regulators", .data = &pmp8074_regulators }, { } }; MODULE_DEVICE_TABLE(of, qcom_spmi_regulator_match); From patchwork Sun May 15 20:31:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12850091 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 82AB1C433FE for ; Sun, 15 May 2022 20:31:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238580AbiEOUbd (ORCPT ); Sun, 15 May 2022 16:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235295AbiEOUb3 (ORCPT ); Sun, 15 May 2022 16:31:29 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69E482BE5; Sun, 15 May 2022 13:31:28 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id i19so25145258eja.11; Sun, 15 May 2022 13:31:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6l0wEsNTNKfaV6zwlBqgwcxJ/BycnrD93GoqTYwraw4=; b=eJQDMuXDs0P8Yd1vlhcMTfVvKQf+3HUD8ARLmrREpOaNRrsVbevUByGuT0/nc+vyTd FY3MN0Rh9BMLLUUHhxlHGHTLJhYJ9aIerY7jMuO2YGXDlIREAuOMb7o4CCO7hvDTqGOe YNFTZx/I6HkK41yeZUWSD2OKOznbPRjN/A13mJ3dZKgyWO1YWBdCZxr2ituTqf8yo0Dj 7/5zZl3okvwaJU8tv+6NX55ySC44Ebxf+w+S71gZgCYCnivsSJmCW4FRfnf+Fdba8/qK IwAgtb6ImbIWKpInr8WC3vjL/0sAjBOB+ZCCF1mOlh04gaDFtBhgGe9RX2Nr0M+Ssxfa QnfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6l0wEsNTNKfaV6zwlBqgwcxJ/BycnrD93GoqTYwraw4=; b=zJIGuKM+3DveMOzaRJlkrKJjnoQEnybMWEKULYgEyL3iRIg+qIf4lOCFp667oqsa6Z iyCcMd1kTUBn0M1fI/nVDqz8gPyrpdmZPJPOs4IfsvYGShllMR24BOap/sZvi8AArWgj Q9sGfnGcG0OnGZHE1MhB8X6qrtqKzkwAKi2nQDqzUnWgULifQ12HrSYeDiJJdDj6ML0E f6oWeou7L9LGzuK+azOlyEw9DdKSzpp2mm14+7dUf/T0YzOnJjTumvYflzbMuThrtcu2 i1/k1TkQcZVDiG2/Ry0pLyuIa/seGz/+K4KSn1r0Q2nmc30UhX9VmmTpc2un30iUPiyI R6SQ== X-Gm-Message-State: AOAM531+8D1H3FKyMqTjETvqxiHuptPyrCUNB79b9DIqKhrs2IzZqpTT W+9lpLc4ittCq0smUAnJ7cA= X-Google-Smtp-Source: ABdhPJwqo5T+h7bMBIp9nWmIFVLUI0DqUBugAbUWghlzPMtBIdV+nRGVJXTgci94XSuBWxjYfZ6aKA== X-Received: by 2002:a17:907:3faa:b0:6f4:da62:6729 with SMTP id hr42-20020a1709073faa00b006f4da626729mr12199093ejc.747.1652646686931; Sun, 15 May 2022 13:31:26 -0700 (PDT) Received: from fedora.robimarko.hr (dh207-98-105.xnet.hr. [88.207.98.105]) by smtp.googlemail.com with ESMTPSA id ze16-20020a170906ef9000b006f3ef214e4esm2944884ejb.180.2022.05.15.13.31.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 May 2022 13:31:26 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Robert Marko Subject: [PATCH 5/6] arm64: dts: ipq8074: add SPMI PMP8074 PMIC regulators Date: Sun, 15 May 2022 22:31:17 +0200 Message-Id: <20220515203118.474684-5-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220515203118.474684-1-robimarko@gmail.com> References: <20220515203118.474684-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org PMP8074 is used in IPQ8074 and provides S3 for cores, S4 for UBI core and LDO11 for SDIO/eMMC. So, lets add the nodes in preparation for DVFS later. Signed-off-by: Robert Marko --- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/ipq8074.dtsi b/arch/arm64/boot/dts/qcom/ipq8074.dtsi index dbe23793e4d9..906468ee990e 100644 --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi @@ -5,6 +5,7 @@ #include #include +#include / { model = "Qualcomm Technologies, Inc. IPQ8074"; @@ -421,6 +422,39 @@ spmi_bus: spmi@200f000 { interrupt-controller; #interrupt-cells = <4>; cell-index = <0>; + + pmic@1 { + compatible ="qcom,spmi-pmic"; + reg = <0x1 SPMI_USID>; + #address-cells = <1>; + #size-cells = <0>; + + regulators { + compatible = "qcom,pmp8074-regulators"; + + s3: s3 { + regulator-name = "vdd_s3"; + regulator-min-microvolt = <592000>; + regulator-max-microvolt = <1064000>; + regulator-always-on; + regulator-boot-on; + }; + + s4: s4 { + regulator-name = "vdd_s4"; + regulator-min-microvolt = <712000>; + regulator-max-microvolt = <992000>; + regulator-always-on; + regulator-boot-on; + }; + + l11: l11 { + regulator-name = "l11"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + }; + }; + }; }; sdhc_1: sdhci@7824900 { From patchwork Sun May 15 20:31:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Marko X-Patchwork-Id: 12850092 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 B551DC4332F for ; Sun, 15 May 2022 20:31:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238591AbiEOUbe (ORCPT ); Sun, 15 May 2022 16:31:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238049AbiEOUbc (ORCPT ); Sun, 15 May 2022 16:31:32 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86C85DED3; Sun, 15 May 2022 13:31:31 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id ch13so25114957ejb.12; Sun, 15 May 2022 13:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PaTZIap6SATi669kRyhjyKwcnCOv+7U1T4zX6WeFaro=; b=KmLWDVd5X6xcpiaKXRDi2fjsPUutyKu7aXWvR0erkdVmVwIPnh5jxx13W7egdt06BW ny7XRP69ZsA8OcyVUFatbEP0+tnWSLV2/WJv9OdgJphAlOlTdJufKW2x+BlarZeI9zNX baD0ZFDU2/ClXBJ0rkGX5y+P1KaOz8MuOmPY5wuljk/X4BD/rJqAD5nWMuyjSocUdaP1 x2+QrkyzWC7LA7F40+pCc9RKjp3hWt1VNwIQu6/MTcHI+nge2h5BrcaeGQO7M2QtY7kw 1gbkStCmV8rxj5ohpaKB4Q/2UCGWiHjCwu/x4ut1BaAFw//hlS33ocAzJ9v9Ry06tD3T nhKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PaTZIap6SATi669kRyhjyKwcnCOv+7U1T4zX6WeFaro=; b=Q4OYg5VmNKB2jnvFGERFcdqISaigUFq9qHilUarXJ2xq2+5c3x+95ML97rfpi2xkdh ryXsUQ5j89i5Y8F0gmtgNEN90ciKKYeGrdcfB+z0Zv9t6qKi5tz8gm/KGe3M6unbVXFG 8t/UzJZA+FkEo2UbGJoZyRlwKOob5BcxNl08tZ2LsiXvR3BefCmBk8baAivv2QlYgt7Q KDBlf4Qwo8JIHkWhvkcvhBKFX7OPFrMV92FydH8EeZdH68aULhFouWtQi/nyhxCL8tk+ Y0pAvSVe8RH5KUeytqUF127+RVHVPmh43pGrsNfuPnlrS8UHWHbCTClVZgPuyaqgnvgP HpbA== X-Gm-Message-State: AOAM530nuQrbgBWMM0sGF3Y0T8hZb0dhP4mKr/KuSR4t99YboMnec30x qwqtZI7q7eSnQgGElSiXdE8= X-Google-Smtp-Source: ABdhPJzD011Sni2n7zKQi+0xlen0WN3fa8JAf3yBeuqk+YEjslKTDCk6c5kmwvg/aVtYdqWwzdcXUA== X-Received: by 2002:a17:907:7d93:b0:6fe:21d9:4230 with SMTP id oz19-20020a1709077d9300b006fe21d94230mr5858712ejc.42.1652646690026; Sun, 15 May 2022 13:31:30 -0700 (PDT) Received: from fedora.robimarko.hr (dh207-98-105.xnet.hr. [88.207.98.105]) by smtp.googlemail.com with ESMTPSA id ze16-20020a170906ef9000b006f3ef214e4esm2944884ejb.180.2022.05.15.13.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 May 2022 13:31:29 -0700 (PDT) From: Robert Marko To: agross@kernel.org, bjorn.andersson@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Robert Marko Subject: [PATCH 6/6] arm64: dts: ipq8074: add VQMMC supply Date: Sun, 15 May 2022 22:31:18 +0200 Message-Id: <20220515203118.474684-6-robimarko@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220515203118.474684-1-robimarko@gmail.com> References: <20220515203118.474684-1-robimarko@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org SDHCI controller claims DDR, HS200 and HS400 1.8V support, however it cannot achieve those using the 2.95V I/O that is the default set by firmware. Since we know have access to the PMP8074 PMIC provided LDO that provides the I/O voltage set it as VQMMC supply so that higher speeds can actually be achieved. Signed-off-by: Robert Marko --- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/ipq8074.dtsi b/arch/arm64/boot/dts/qcom/ipq8074.dtsi index 906468ee990e..2e8765aa8f37 100644 --- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi @@ -476,6 +476,8 @@ sdhc_1: sdhci@7824900 { mmc-hs400-1_8v; bus-width = <8>; + vqmmc-supply = <&l11>; + status = "disabled"; };