Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2113353pxb; Sat, 28 Aug 2021 05:02:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY+SjIsLK14j0qOvb0HqHSb3LaKIAR9I6OrUklL8gip6Kel6SjNm6Byn/X2M0F1f6FlK+3 X-Received: by 2002:a17:906:8481:: with SMTP id m1mr15303412ejx.459.1630152173446; Sat, 28 Aug 2021 05:02:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630152173; cv=none; d=google.com; s=arc-20160816; b=vxZXWDYeXi27c5+BIHyJN1l01gTtZiA38wrhaSE97c3ufPt1N0VE9iUtt2SpOgz7PD Ypf7PjH5wDRuD+36rbMYNWGTEF37ysyjIyxO7xy+ES3o/qkHrCvQnH7TP/+08uvakpGX vCqwl8L4hY48VlOKqFfX6TnGqFcq0TgL/BFGqDHz2lPqlSEhEIYUF1Yb1yv+EiQoiE9q n1CojN+b06gMyzzEntcm/+u8teXtZozgDNbo1SzG3fNLtACRarcxYof7dmwbrKl0rHxy 10c6uu7kIZtjMILDL7Hb36NKsPto8szn0JYUD2Qy7t2NBEK5pWgyO7bUNKLQouF2ZFKq WYoA== 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=iLBmY1lddKz7uTq3806Ths/k/ddF0DAc5W9kpbb8u9s=; b=j766yRUwe6xFBfrYbqNr9sKrKEL7GLF7bfy817mYqr5jZn+IYGmzNpnwTwoN7c1YsP LTHkvpOCMwM49246jtNmCASvlMrok8KIHS6cx1gsNKlitn3+wDo75gzEKQxBZjxGXNaX RCYcqX5L0RoQ3x1GazcRPx5k++Wdv6OHCZQem0Jv+TzG6EwRQJVQrRGi5Brwff+ScJY1 O0r4SUHk7iEisnvN7oclmruI6hqmA9uiCE/06uMnChr/gfyawDm/WCHfTVdqBiU340t+ SsRx3QdoQL0AnGukKg6QqPTAErQU0dF2qqkxP7nMj/DrCb6Yp5VSSeqxKtkUTHuaHDYi 6k9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="QlH85/uP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr15si10199612ejc.400.2021.08.28.05.02.27; Sat, 28 Aug 2021 05:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="QlH85/uP"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234196AbhH1L6C (ORCPT + 99 others); Sat, 28 Aug 2021 07:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234099AbhH1L57 (ORCPT ); Sat, 28 Aug 2021 07:57:59 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E89CC0613D9; Sat, 28 Aug 2021 04:57:08 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id s25so14028019edw.0; Sat, 28 Aug 2021 04:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iLBmY1lddKz7uTq3806Ths/k/ddF0DAc5W9kpbb8u9s=; b=QlH85/uPOCnjjN/jADGyKpUeAw1fcOJXg7DJ4/l9SbWgA3oRa8sGTKgU2ZAWicq24T WIpIqNc3UWp4Zjx7mehBYovw+PMwnkMNfRNB7mTvY69/ZSxkhnff3SFY6RFKFYA3bh9e Ox75QLHn89eXXpojQyE/dMkNqZ3VG8r3woTRP5SwuhtE+YVvP9XRks3Cgabj4+lLjcFj bUQAhSRJgJdrNykMfpdOzoY3qUjYR2OAR7wS32CbMjth9rkYkwQnl4oR2nrMt3bM6HE4 Nl9LM9GrU4l5Htux2UzWm/UgFQiKlZbMAuI2KeCvznRf841DTepW1LPAPqXfM5xZGYNw iXdg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=iLBmY1lddKz7uTq3806Ths/k/ddF0DAc5W9kpbb8u9s=; b=Vlvr+a22rCZ2UL9dVd8rPISYh2R4RC4v0gnxflK2oCvPv/M4zAUV3BVXHAI1M0zA+B hgdY8suU751XMfFSEoAmJR3zMIpQ/MgTN0oD40T4ech9sWOFmVlIAlyFNjgHWuYR6NYL 06bixQAVNeIsrG85FOHRKMSYi/q1f1PpNislWRSUI1BOqbGpnU4rzu21M8SbdRhLQHw+ +NQB3xd/5z6Wy40cmkI3jOoI1DGyyPcB0eXovWrq3q3ZVdk+VUcpGOrU21hpv7uQjcBX 2LYc/0+LJxVY+Ncm2MmuJWnTIj7mqdqG2Z9hx5tmHe3DvCCW1usThBQ5s2aOyteqd6Wu zLbQ== X-Gm-Message-State: AOAM531iyG+DjjHDyoADEGMhqENLUHhl4Ykx8x/RxPKJeGVO1adtvikQ MGE75jzkXNw6Z4tlIf9YVsA= X-Received: by 2002:a50:c94d:: with SMTP id p13mr14934833edh.246.1630151827044; Sat, 28 Aug 2021 04:57:07 -0700 (PDT) Received: from localhost (178-169-161-196.razgrad.ddns.bulsat.com. [178.169.161.196]) by smtp.gmail.com with ESMTPSA id l18sm2873411edr.83.2021.08.28.04.57.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Aug 2021 04:57:06 -0700 (PDT) From: Iskren Chernev To: Bjorn Andersson , Mark Brown Cc: Andy Gross , Liam Girdwood , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Iskren Chernev Subject: [RFC PATCH 2/2] regulator: qcom_smd: Add PM6125 regulator support Date: Sat, 28 Aug 2021 14:56:54 +0300 Message-Id: <20210828115654.647548-3-iskren.chernev@gmail.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210828115654.647548-1-iskren.chernev@gmail.com> References: <20210828115654.647548-1-iskren.chernev@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for PM6125 regulator which is found on SM4250/6115 SoCs. NOTE: The sources haven't been determined, so currently each regulator has it's own source. Signed-off-by: Iskren Chernev --- drivers/regulator/qcom_smd-regulator.c | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index 198fcc6551f6..e97086d95774 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c @@ -666,6 +666,15 @@ static const struct regulator_desc pm660l_bob = { .ops = &rpm_bob_ops, }; +static const struct regulator_desc pm6125_ftsmps = { + .linear_ranges = (struct linear_range[]) { + REGULATOR_LINEAR_RANGE(300000, 0, 268, 4000), + }, + .n_linear_ranges = 1, + .n_voltages = 269, + .ops = &rpm_smps_ldo_ops, +}; + static const struct regulator_desc pms405_hfsmps3 = { .linear_ranges = (struct linear_range[]) { REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000), @@ -1148,6 +1157,42 @@ static const struct rpm_regulator_data rpm_pm660l_regulators[] = { { } }; +static const struct rpm_regulator_data rpm_pm6125_regulators[] = { + { "s1", QCOM_SMD_RPM_SMPA, 1, &pm6125_ftsmps, "vdd_s1" }, + { "s2", QCOM_SMD_RPM_SMPA, 2, &pm6125_ftsmps, "vdd_s2" }, + { "s3", QCOM_SMD_RPM_SMPA, 3, &pm6125_ftsmps, "vdd_s3" }, + { "s4", QCOM_SMD_RPM_SMPA, 4, &pm6125_ftsmps, "vdd_s4" }, + { "s5", QCOM_SMD_RPM_SMPA, 5, &pm8998_hfsmps, "vdd_s5" }, + { "s6", QCOM_SMD_RPM_SMPA, 6, &pm8998_hfsmps, "vdd_s6" }, + { "s7", QCOM_SMD_RPM_SMPA, 7, &pm8998_hfsmps, "vdd_s7" }, + { "s8", QCOM_SMD_RPM_SMPA, 8, &pm6125_ftsmps, "vdd_s8" }, + { "l1", QCOM_SMD_RPM_LDOA, 1, &pm660_nldo660, "vdd_l1" }, + { "l2", QCOM_SMD_RPM_LDOA, 2, &pm660_nldo660, "vdd_l2" }, + { "l3", QCOM_SMD_RPM_LDOA, 3, &pm660_nldo660, "vdd_l3" }, + { "l4", QCOM_SMD_RPM_LDOA, 4, &pm660_nldo660, "vdd_l4" }, + { "l5", QCOM_SMD_RPM_LDOA, 5, &pm660_pldo660, "vdd_l5" }, + { "l6", QCOM_SMD_RPM_LDOA, 6, &pm660_nldo660, "vdd_l6" }, + { "l7", QCOM_SMD_RPM_LDOA, 7, &pm660_nldo660, "vdd_l7" }, + { "l8", QCOM_SMD_RPM_LDOA, 8, &pm660_nldo660, "vdd_l8" }, + { "l9", QCOM_SMD_RPM_LDOA, 9, &pm660_ht_lvpldo, "vdd_l5" }, + { "l10", QCOM_SMD_RPM_LDOA, 10, &pm660_ht_lvpldo, "vdd_l10" }, + { "l11", QCOM_SMD_RPM_LDOA, 11, &pm660_ht_lvpldo, "vdd_l11" }, + { "l12", QCOM_SMD_RPM_LDOA, 12, &pm660_ht_lvpldo, "vdd_l12" }, + { "l13", QCOM_SMD_RPM_LDOA, 13, &pm660_ht_lvpldo, "vdd_l13" }, + { "l14", QCOM_SMD_RPM_LDOA, 14, &pm660_ht_lvpldo, "vdd_l14" }, + { "l15", QCOM_SMD_RPM_LDOA, 15, &pm660_pldo660, "vdd_l15" }, + { "l16", QCOM_SMD_RPM_LDOA, 16, &pm660_ht_lvpldo, "vdd_l16" }, + { "l17", QCOM_SMD_RPM_LDOA, 17, &pm660_nldo660, "vdd_l17" }, + { "l18", QCOM_SMD_RPM_LDOA, 18, &pm660_nldo660, "vdd_l18" }, + { "l19", QCOM_SMD_RPM_LDOA, 19, &pm660_pldo660, "vdd_l19" }, + { "l20", QCOM_SMD_RPM_LDOA, 20, &pm660_pldo660, "vdd_l20" }, + { "l21", QCOM_SMD_RPM_LDOA, 21, &pm660_pldo660, "vdd_l21" }, + { "l22", QCOM_SMD_RPM_LDOA, 22, &pm660_pldo660, "vdd_l22" }, + { "l23", QCOM_SMD_RPM_LDOA, 23, &pm660_pldo660, "vdd_l23" }, + { "l24", QCOM_SMD_RPM_LDOA, 24, &pm660_pldo660, "vdd_l24" }, + { } +}; + 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" }, @@ -1182,6 +1227,7 @@ static const struct of_device_id rpm_of_match[] = { { .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators }, { .compatible = "qcom,rpm-pm660-regulators", .data = &rpm_pm660_regulators }, { .compatible = "qcom,rpm-pm660l-regulators", .data = &rpm_pm660l_regulators }, + { .compatible = "qcom,rpm-pm6125-regulators", .data = &rpm_pm6125_regulators }, { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators }, { .compatible = "qcom,rpm-pmi8994-regulators", .data = &rpm_pmi8994_regulators }, { .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators }, -- 2.33.0