From patchwork Thu Sep 20 01:40:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 147074 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1376577ljw; Wed, 19 Sep 2018 18:38:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbvW1TcrDXfej25N6hfuEK4PQX37MoCjvcv+e/4clPfXf7q5PbIqfsZLOn3geiOEzQ0+KzK X-Received: by 2002:a17:902:b688:: with SMTP id c8-v6mr37100916pls.114.1537407485638; Wed, 19 Sep 2018 18:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537407485; cv=none; d=google.com; s=arc-20160816; b=tQjnGeIBXqMQfq6ljlTd1IKapdTYvsOvVJl1DhEOqNffL7GCi3THRmPlyOy2zQi8Og /nnPKsDC3pSd5osxzr0faxzufMk3qiqOZsDwpH/Hwv9/g7KdCufGvxc/uRPXGJ4GGJKe IlhvEsuuLKxyN9DOwsVkv7e63x5nyE4i8DKKsamI9IFigvMa31LBmwj5ASg2Sw8v6MK7 SywY4ncQ+ANvv+LjINDGOg27mGlQ5tVyvWaA7l8HSl7EEMOLYt/qyd6WcRBsXFgNYmnr kcljoOfuBK/zrNZ7kecNv+CFgCNmixkRJ+4qy7i6w2PQBO7pszvtfCyMxSQ8j199EkTt 7gFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=FLPwzN4T2S6MfpJnysgQHqsb5+qmQyHpMhTvk7cYcS8=; b=e1rAMgfb/FW0Xyz5SX4xFUdUVyA/bu7uTSO+A1aOcUrhuzosjIe/rvXXHlGh+rJ51/ 7ijHJbnUcE7Huuar5a8gZRZuWOeq2fyXKFUSS+tE/uEbk5EeJwhNHm8bepjwjw/ZsrF6 ZSlwRXOSXhvv/cBZV7EyH/FfhIk51fmRhA6rGdsia4HuX19vE02JWHEes+DA4tsh7p/e EdWd0/Rl2U4lQh0opub77Kk/q3wPfPOWx3ycZcw/WgzfL/BelsGrrt+d5V+IWCX104N/ j8zM/b/0iTRaL+CktrFZDPwM+nBVYBXEiUgqjIhFucoZbK0imPz6Ce0InXteGevHEtRB gxPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BhAI0jd+; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x16-v6si21759129pgf.311.2018.09.19.18.38.05; Wed, 19 Sep 2018 18:38:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BhAI0jd+; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725993AbeITHSq (ORCPT + 6 others); Thu, 20 Sep 2018 03:18:46 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33121 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726006AbeITHSq (ORCPT ); Thu, 20 Sep 2018 03:18:46 -0400 Received: by mail-pf1-f193.google.com with SMTP id d4-v6so3560064pfn.0 for ; Wed, 19 Sep 2018 18:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=FLPwzN4T2S6MfpJnysgQHqsb5+qmQyHpMhTvk7cYcS8=; b=BhAI0jd+3wGEGErERXBTcUUqIUcboFp4Vh++pnky7Roe+D4RHF2EYMMoWDq0ruTciu 2iF+ZUq5w7tvbWsx+A1rR3KLJc3U8fr1lWSyq/NqWXGxcwiWyiN6OkMhVuGYDfn1Wfea RJLCM6uk3RVhckY2ljK6ZZ3F1opaDFAEaGsLo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FLPwzN4T2S6MfpJnysgQHqsb5+qmQyHpMhTvk7cYcS8=; b=PXJ5Cp++yQHkJ+Gr/Tt/GGBvUwYEWaOQDQXGYe5Lqw/fCrYdcoOA61w7t1SsxrBp1H ed2MwUhQD1TX8Ywkmop915mFmxj/TGuBRCwTMfnxak0FNbVhe39BPib/BVKAYeT2TfE3 HZf3ab4qJnnkDGuNesYPygtlE9c1bmyfCr/AqIYGYhHcAVTaHMYtLwTqsMg2zFlPix3A ZCbPMpHk9HD2iywDDGQlZXqf9zH8JIDejVOFi1YUhBJvWIsjfw1aLUhD8xelablOJlfr isjx8zt89dmiHxiVSJQvOjd9sty5x77vY3syUWgAlzwvZ7fNRYZG6veV8eB6oclxqSOv mujw== X-Gm-Message-State: APzg51Asc6qmSqYvDbKOv0Izw3EafQZCf1OiAneszH4/vr6yGqZXO6Wu CM1P01FShdMZpDQ+1VIh+ssXTw== X-Received: by 2002:a62:6711:: with SMTP id b17-v6mr38811893pfc.243.1537407483784; Wed, 19 Sep 2018 18:38:03 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id e7-v6sm28813229pgc.55.2018.09.19.18.38.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 18:38:03 -0700 (PDT) From: Bjorn Andersson To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] regulators: qcom: Add PMS405 regulators Date: Wed, 19 Sep 2018 18:40:20 -0700 Message-Id: <20180920014020.14408-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.18.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The PMS405 provdies 5 SMPS regulators and 13 LDOs, add these to the RPM regulator driver. Signed-off-by: Bjorn Andersson --- .../regulator/qcom,smd-rpm-regulator.txt | 23 ++++++ drivers/regulator/qcom_smd-regulator.c | 77 +++++++++++++++++++ 2 files changed, 100 insertions(+) -- 2.18.0 Reviewed-by: Vinod Koul diff --git a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt index 58a1d97972f5..45025b5b67f6 100644 --- a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt @@ -26,6 +26,7 @@ Regulator nodes are identified by their compatible: "qcom,rpm-pm8998-regulators" "qcom,rpm-pma8084-regulators" "qcom,rpm-pmi8998-regulators" + "qcom,rpm-pms405-regulators" - vdd_s1-supply: - vdd_s2-supply: @@ -188,6 +189,24 @@ Regulator nodes are identified by their compatible: Definition: reference to regulator supplying the input pin, as described in the data sheet +- vdd_s1-supply: +- vdd_s2-supply: +- vdd_s3-supply: +- vdd_s4-supply: +- vdd_s5-supply: +- vdd_l1_l2-supply: +- vdd_l3_l8-supply: +- vdd_l4-supply: +- vdd_l5_l6-supply: +- vdd_l7-supply: +- vdd_l3_l8-supply: +- vdd_l9-supply: +- vdd_l10_l11_l12_l13-supply: + Usage: optional (pms405 only) + Value type: + Definition: reference to regulator supplying the input pin, as + described in the data sheet + The regulator node houses sub-nodes for each regulator within the device. Each sub-node is identified using the node's name, with valid values listed for each of the pmics below. @@ -222,6 +241,10 @@ pma8084: pmi8998: bob +pms405: + s1, s2, s3, s4, s5, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, + l13 + The content of each sub-node is defined by the standard binding for regulators - see regulator.txt. diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index fe2fb36803e0..f5bca77d67c1 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c @@ -420,6 +420,60 @@ static const struct regulator_desc pmi8998_bob = { .ops = &rpm_bob_ops, }; +static const struct regulator_desc pms405_hfsmps3 = { + .linear_ranges = (struct regulator_linear_range[]) { + REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000), + }, + .n_linear_ranges = 1, + .n_voltages = 216, + .ops = &rpm_smps_ldo_ops, +}; + +static const struct regulator_desc pms405_nldo300 = { + .linear_ranges = (struct regulator_linear_range[]) { + REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000), + }, + .n_linear_ranges = 1, + .n_voltages = 128, + .ops = &rpm_smps_ldo_ops, +}; + +static const struct regulator_desc pms405_nldo1200 = { + .linear_ranges = (struct regulator_linear_range[]) { + REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000), + }, + .n_linear_ranges = 1, + .n_voltages = 128, + .ops = &rpm_smps_ldo_ops, +}; + +static const struct regulator_desc pms405_pldo50 = { + .linear_ranges = (struct regulator_linear_range[]) { + REGULATOR_LINEAR_RANGE(1664000, 0, 128, 16000), + }, + .n_linear_ranges = 1, + .n_voltages = 129, + .ops = &rpm_smps_ldo_ops, +}; + +static const struct regulator_desc pms405_pldo150 = { + .linear_ranges = (struct regulator_linear_range[]) { + REGULATOR_LINEAR_RANGE(1664000, 0, 128, 16000), + }, + .n_linear_ranges = 1, + .n_voltages = 129, + .ops = &rpm_smps_ldo_ops, +}; + +static const struct regulator_desc pms405_pldo600 = { + .linear_ranges = (struct regulator_linear_range[]) { + REGULATOR_LINEAR_RANGE(1256000, 0, 98, 8000), + }, + .n_linear_ranges = 1, + .n_voltages = 99, + .ops = &rpm_smps_ldo_ops, +}; + struct rpm_regulator_data { const char *name; u32 type; @@ -661,6 +715,28 @@ static const struct rpm_regulator_data rpm_pmi8998_regulators[] = { {} }; +static const struct rpm_regulator_data rpm_pms405_regulators[] = { + { "s1", QCOM_SMD_RPM_SMPA, 1, &pms405_hfsmps3, "vdd_s1" }, + { "s2", QCOM_SMD_RPM_SMPA, 2, &pms405_hfsmps3, "vdd_s2" }, + { "s3", QCOM_SMD_RPM_SMPA, 3, &pms405_hfsmps3, "vdd_s3" }, + { "s4", QCOM_SMD_RPM_SMPA, 4, &pms405_hfsmps3, "vdd_s4" }, + { "s5", QCOM_SMD_RPM_SMPA, 5, &pms405_hfsmps3, "vdd_s5" }, + { "l1", QCOM_SMD_RPM_LDOA, 1, &pms405_nldo1200, "vdd_l1_l2" }, + { "l2", QCOM_SMD_RPM_LDOA, 2, &pms405_nldo1200, "vdd_l1_l2" }, + { "l3", QCOM_SMD_RPM_LDOA, 3, &pms405_nldo1200, "vdd_l3_l8" }, + { "l4", QCOM_SMD_RPM_LDOA, 4, &pms405_nldo300, "vdd_l4" }, + { "l5", QCOM_SMD_RPM_LDOA, 5, &pms405_pldo600, "vdd_l5_l6" }, + { "l6", QCOM_SMD_RPM_LDOA, 6, &pms405_pldo600, "vdd_l5_l6" }, + { "l7", QCOM_SMD_RPM_LDOA, 7, &pms405_pldo150, "vdd_l7" }, + { "l8", QCOM_SMD_RPM_LDOA, 8, &pms405_nldo1200, "vdd_l3_l8" }, + { "l9", QCOM_SMD_RPM_LDOA, 9, &pms405_nldo1200, "vdd_l9" }, + { "l10", QCOM_SMD_RPM_LDOA, 10, &pms405_pldo50, "vdd_l10_l11_l12_l13" }, + { "l11", QCOM_SMD_RPM_LDOA, 11, &pms405_pldo150, "vdd_l10_l11_l12_l13" }, + { "l12", QCOM_SMD_RPM_LDOA, 12, &pms405_pldo150, "vdd_l10_l11_l12_l13" }, + { "l13", QCOM_SMD_RPM_LDOA, 13, &pms405_pldo150, "vdd_l10_l11_l12_l13" }, + {} +}; + static const struct of_device_id rpm_of_match[] = { { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators }, { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators }, @@ -669,6 +745,7 @@ static const struct of_device_id rpm_of_match[] = { { .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators }, { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators }, { .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators }, + { .compatible = "qcom,rpm-pms405-regulators", .data = &rpm_pms405_regulators }, {} }; MODULE_DEVICE_TABLE(of, rpm_of_match);