From patchwork Tue Feb 8 14:52:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Satya Priya Kakitapalli \(Temp\)" X-Patchwork-Id: 540834 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 31F71C433EF for ; Tue, 8 Feb 2022 14:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378486AbiBHOy5 (ORCPT ); Tue, 8 Feb 2022 09:54:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378535AbiBHOyz (ORCPT ); Tue, 8 Feb 2022 09:54:55 -0500 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9047BC0612B9; Tue, 8 Feb 2022 06:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644332089; x=1675868089; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=g9kql/hsklTzU+6PF+PhoobhgtTUfK4IfIjF8oYQwSs=; b=Cn4WYgYByVemMahhYmk8yt88771yY/a68ghRgGI1Khohb5BcjSTmUyjt DLDHHZbhYuqOD7xyZW4YQ9D9RURBYTAuCdZzJUd6Lp49lojY6z53YW3yU ASPoudK+TVcKi9N6/JsI/LhXNh00/BI60rS6OCbOQ60A+NHdzpfm3Vr46 8=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 08 Feb 2022 06:54:49 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 06:54:48 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 8 Feb 2022 06:54:48 -0800 Received: from c-skakit-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 8 Feb 2022 06:54:43 -0800 From: Satya Priya To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski CC: Lee Jones , Liam Girdwood , Mark Brown , Das Srinagesh , , , , , , , , Satya Priya Subject: [PATCH V5 1/6] dt-bindings: regulator: Add pm8008 regulator bindings Date: Tue, 8 Feb 2022 20:22:15 +0530 Message-ID: <1644331940-18986-2-git-send-email-quic_c_skakit@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644331940-18986-1-git-send-email-quic_c_skakit@quicinc.com> References: <1644331940-18986-1-git-send-email-quic_c_skakit@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add bindings for pm8008 pmic regulators. Signed-off-by: Satya Priya Reviewed-by: Rob Herring --- Changes in V2: - Moved this patch before "mfd: pm8008: Add pm8008 regulator node" to resolve dtschema errors. Removed regulator-min-microvolt and regulator-max-microvolt properties. Changes in V3: - As per Rob's comments added standard unit suffix for mindropout property, added blank lines where required and added description for reg property. Changes in V4: - Changed compatible string to "com,pm8008-regulators" - Moved "regulator-min-dropout-voltage-microvolt" to regulator.yaml as separate patch. Changes in V5: - Removed the separate compatible for pm8008 regulator driver. - Moved the supply nodes to chip level. - Removed min-dropout property. .../bindings/regulator/qcom,pm8008-regulator.yaml | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml diff --git a/Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml new file mode 100644 index 0000000..0098845 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/qcom,pm8008-regulator.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/qcom,pm8008-regulator.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies, Inc. PM8008 Regulator bindings + +maintainers: + - Satya Priya + +description: + Qualcomm Technologies, Inc. PM8008 is an I2C controlled PMIC + containing 7 LDO regulators. + +patternProperties: + "^LDO[1-7]$": + type: object + $ref: "regulator.yaml#" + description: PM8008 regulator peripherals of PM8008 regulator device + + properties: + regulator-name: true + + required: + - regulator-name + + unevaluatedProperties: false + +additionalProperties: false +... From patchwork Tue Feb 8 14:52:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Satya Priya Kakitapalli \(Temp\)" X-Patchwork-Id: 540833 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 BB6E3C433F5 for ; Tue, 8 Feb 2022 14:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378605AbiBHOzA (ORCPT ); Tue, 8 Feb 2022 09:55:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378595AbiBHOy7 (ORCPT ); Tue, 8 Feb 2022 09:54:59 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA399C061577; Tue, 8 Feb 2022 06:54:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644332098; x=1675868098; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=5dRQGDipgzG85fnnJW6YhBgbg3GmCvCXADVQXynNwsQ=; b=DC5PpZrPNIF+ZCBv4d2LwlJgv+Qv/k7oaGpaTIM8kaN8zy9801I6IA2z A8jFXEXVn2y7gqJf7bEEX8/SSGu2Vvdqg40ONx2ki7MngO7I5Vnb3CS6p B7xzdaea88mWZ0s4UJfBym25CP6dtMlnw2ieoxOPut2EFIDkL2WWa01r+ c=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 08 Feb 2022 06:54:58 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 06:54:58 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 8 Feb 2022 06:54:58 -0800 Received: from c-skakit-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 8 Feb 2022 06:54:53 -0800 From: Satya Priya To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski CC: Lee Jones , Liam Girdwood , Mark Brown , Das Srinagesh , , , , , , , , Satya Priya Subject: [PATCH V5 3/6] mfd: pm8008: Add mfd cell struct to register LDOs Date: Tue, 8 Feb 2022 20:22:17 +0530 Message-ID: <1644331940-18986-4-git-send-email-quic_c_skakit@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644331940-18986-1-git-send-email-quic_c_skakit@quicinc.com> References: <1644331940-18986-1-git-send-email-quic_c_skakit@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Register mfd cell ID and name for each of the 7 pm8008 LDOs to probe them through mfd driver without needing a separate compatible for regulator driver. Also, add a different compatible for the mfd node that contains regulators to make sure that the LDOs are registered with the correct mfd device. Signed-off-by: Satya Priya --- Changes in V5: - Changes newly added from V5. drivers/mfd/qcom-pm8008.c | 59 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c index c472d7f..e8569cc 100644 --- a/drivers/mfd/qcom-pm8008.c +++ b/drivers/mfd/qcom-pm8008.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,37 @@ #define INT_EN_CLR_OFFSET 0x16 #define INT_LATCHED_STS_OFFSET 0x18 +static const struct mfd_cell pm8008_regulator_devs[] = { + { + .name = "qcom,pm8008-regulators", + .id = 0, + }, + { + .name = "qcom,pm8008-regulators", + .id = 1, + }, + { + .name = "qcom,pm8008-regulators", + .id = 2, + }, + { + .name = "qcom,pm8008-regulators", + .id = 3, + }, + { + .name = "qcom,pm8008-regulators", + .id = 4, + }, + { + .name = "qcom,pm8008-regulators", + .id = 5, + }, + { + .name = "qcom,pm8008-regulators", + .id = 6, + }, +}; + enum { PM8008_MISC, PM8008_TEMP_ALARM, @@ -35,6 +67,17 @@ enum { PM8008_NUM_PERIPHS, }; +enum { + PM8008_INFRA, + PM8008_REGULATORS, +}; + +static const struct of_device_id pm8008_match[] = { + { .compatible = "qcom,pm8008", .data = (void *)PM8008_INFRA}, + { .compatible = "qcom,pm8008-regulators", .data = (void *)PM8008_REGULATORS}, + { }, +}; + #define PM8008_PERIPH_0_BASE 0x900 #define PM8008_PERIPH_1_BASE 0x2400 #define PM8008_PERIPH_2_BASE 0xC000 @@ -221,6 +264,7 @@ static int pm8008_probe(struct i2c_client *client) { int rc; struct pm8008_data *chip; + const struct of_device_id *id; chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); if (!chip) @@ -239,14 +283,19 @@ static int pm8008_probe(struct i2c_client *client) dev_err(chip->dev, "Failed to probe irq periphs: %d\n", rc); } + id = of_match_node(pm8008_match, chip->dev->of_node); + if (id->data == (void *)PM8008_REGULATORS) { + rc = mfd_add_devices(chip->dev, 0, pm8008_regulator_devs, + ARRAY_SIZE(pm8008_regulator_devs), NULL, 0, NULL); + if (rc) { + dev_err(chip->dev, "Failed to add children: %d\n", rc); + return rc; + } + } + return devm_of_platform_populate(chip->dev); } -static const struct of_device_id pm8008_match[] = { - { .compatible = "qcom,pm8008", }, - { }, -}; - static struct i2c_driver pm8008_mfd_driver = { .driver = { .name = "pm8008", From patchwork Tue Feb 8 14:52:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Satya Priya Kakitapalli \(Temp\)" X-Patchwork-Id: 540832 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 2412FC433F5 for ; Tue, 8 Feb 2022 14:55:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378831AbiBHOzS (ORCPT ); Tue, 8 Feb 2022 09:55:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378846AbiBHOzQ (ORCPT ); Tue, 8 Feb 2022 09:55:16 -0500 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 225C1C03FEF8; Tue, 8 Feb 2022 06:55:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644332114; x=1675868114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Yk6+mIAqQXnUtLkl5ADbRsIGvIy+eYl6I/IwK+2zswc=; b=V1xUOyS2mb9FYEMDvymlQNOsVoEEKbHroiwNoCabeYV7rd1HqkErDrVG A+7Rb8EaKdq6Bxk2Nm1YAmikjJM+yWwoMFmRUwh5ABtGs9whnu8ze5pcA x62gx5bIN8YYmCbjOLM4ZCy+7/wrZpMXavyvU370BcWWaHt6ZCsfOBaPz o=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 08 Feb 2022 06:55:14 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 06:55:13 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 8 Feb 2022 06:55:13 -0800 Received: from c-skakit-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Tue, 8 Feb 2022 06:55:08 -0800 From: Satya Priya To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski CC: Lee Jones , Liam Girdwood , Mark Brown , Das Srinagesh , , , , , , , , Satya Priya Subject: [PATCH V5 6/6] arm64: dts: qcom: sc7280: Add pm8008 support for sc7280-idp Date: Tue, 8 Feb 2022 20:22:20 +0530 Message-ID: <1644331940-18986-7-git-send-email-quic_c_skakit@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1644331940-18986-1-git-send-email-quic_c_skakit@quicinc.com> References: <1644331940-18986-1-git-send-email-quic_c_skakit@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add pm8008_infra and pm8008_regulators support for sc7280 idp. Signed-off-by: Satya Priya --- Changes in V2: - As per Stephen's comments, replaced '_' with '-' for node names. Changes in V3: - Changed the regulator node names as l1, l2 etc - Changed "pm8008-regulators" to "regulators" - Changed "qcom,min-dropout-voltage" to "regulator-min-dropout-voltage-microvolt" Changes in V4: - Moved all common stuff to pm8008.dtsi and added board specific configurations here. Changes in V5: - Changed the node names as per pm8008.dtsi - Moved supply nodes to chip level (mfd node). - Removed the regulator-mindropout property. arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 66 ++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi index ecbf2b8..371ad19 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi @@ -263,6 +263,62 @@ }; }; +&i2c1 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + #include "pm8008.dtsi" +}; + +&pm8008_infra { + pinctrl-names = "default"; + pinctrl-0 = <&pm8008_active>; +}; + +&pm8008_regulators { + vdd_l1_l2-supply = <&vreg_s8b_1p2>; + vdd_l3_l4-supply = <&vreg_s1b_1p8>; + vdd_l5-supply = <&vreg_bob>; + vdd_l6-supply = <&vreg_bob>; + vdd_l7-supply = <&vreg_bob>; +}; + +&pm8008_l1 { + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <1300000>; +}; + +&pm8008_l2 { + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <1250000>; +}; + +&pm8008_l3 { + regulator-min-microvolt = <1650000>; + regulator-max-microvolt = <3000000>; +}; + +&pm8008_l4 { + regulator-min-microvolt = <1504000>; + regulator-max-microvolt = <1600000>; +}; + +&pm8008_l5 { + regulator-min-microvolt = <2600000>; + regulator-max-microvolt = <3000000>; +}; + +&pm8008_l6 { + regulator-min-microvolt = <2600000>; + regulator-max-microvolt = <3000000>; +}; + +&pm8008_l7 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3544000>; +}; + &qfprom { vcc-supply = <&vreg_l1c_1p8>; }; @@ -375,6 +431,16 @@ drive-strength = <2>; }; +&pm8350c_gpios { + pm8008_active: pm8008_active { + pins = "gpio4"; + function = "normal"; + bias-disable; + output-high; + power-source = <0>; + }; +}; + &qspi_cs0 { bias-disable; };