Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4381153rdb; Mon, 11 Dec 2023 18:45:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPSNTCP9SS9TqyCT5jTSybjSM4fEodTacRYkgq1eafbbFTQ0So7BwWLHj45oH1f3CnTRdw X-Received: by 2002:a05:6808:10d2:b0:3b8:33dd:f964 with SMTP id s18-20020a05680810d200b003b833ddf964mr6955830ois.39.1702349149560; Mon, 11 Dec 2023 18:45:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702349149; cv=none; d=google.com; s=arc-20160816; b=jT8W2j+baF7TZdXqjDD8aT9qe6rMt6CzfnuRV7S+GZoKrHgev4aqn+VkA9HIXLVbGs DGnQCsh5/loe2vny6HWgKUy91Lf46CEF+FEOPttMlsJQfORf9nCJQkeV2076TvY1EWgC WAFWNxZjxzqodR+fuJtxo8Ah2lj8C6yL4h0LXgEwsB6mcCHa3RMs1QFnWaiOPSBaimlh aX7HLmyJ/IfY5bH/qrTJMIbqu2F6vcY6h2Ay+Yw9ojw4sf8q80HnKBWRJDKGuPhvEhgb KJdDtJk8cueDEi1rFWspzYuVBuXOzsoyVUaO72zhuZ00Mz4XaDnNmMufCnfae5sPzi8z wh0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JrEO67lajTGW8YcWpp+GMjeHTeTZ0xsoLSkntHgPSUQ=; fh=cTaET7pnlBuKEFBfplmhIu/3DTlUPRNtrLczjUOLxqA=; b=TK8sEG0zxKGQ1F1y9XzT4MJxgmv2zONNyGzedy39cq/tC86MZr5Ff7MaxESMWRkF2+ mrw3iS3YUtyA+vTmVfofzpeq70DHyQqw8QT2Kb/FmLSf59u0cKnREVxTZa25pqWLzwmi HlTahGHlvt5LnVDT/z7LPNaxBN7+GqQR3sAZGiIcKQ1mUDLpdRmbs8YLU5hwJFJWgYAU +HH0/gun2a8l3RhUow2v47RdOXN+xUGPuHZ2Mz34IytlV7Mvx6oLcNb2j1n9BzTrJOPI jsguxd7UcQNTD9MtqLfLCq2VPrpBH3HehHILiFDD+XAHZg8Or7WU9HBERnzVQY8z2hnU 2AIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NluAA8zP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id r7-20020a6560c7000000b005c65e697bb3si6765831pgv.518.2023.12.11.18.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 18:45:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NluAA8zP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1AB07807E406; Mon, 11 Dec 2023 18:45:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231149AbjLLCo4 (ORCPT + 99 others); Mon, 11 Dec 2023 21:44:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231142AbjLLCoz (ORCPT ); Mon, 11 Dec 2023 21:44:55 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D9D0B5; Mon, 11 Dec 2023 18:45:01 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BC1d3UL013078; Tue, 12 Dec 2023 02:44:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=JrEO67lajTGW8YcWpp+GMjeHTeTZ0xsoLSkntHgPSUQ=; b=Nl uAA8zPyZvy0vxBTwUc4ZAbPyG4cf2R9b4ZTrdWSsihsPXT7s/Fv2N8K8mlV1j/Sp FczTVwhib+4J8R56Ifdw7bRzMvlL/YhDjUPJkVjwjy5FPkuGx9dF6YdBm99XMVwa Olo2gElwjsa8ofC/78vBZezTzOynqPnNpVtDtyIpxpTl+F3H/10WH+hG9LLxMDjw uJw7IQ3p62kgCDQl/GG27wPZyFbQt8iGFP3AsUug8oT1yXBNfPtZOoqLH0ouGToP fxHp7kjtS+bCrU2IHeerjjw/s6tXCzgUw8/AFYnt/G/ZQ3PNym/cqc0QlQxhkeFt 1cgDRitYLmkA7+6MSTSQ== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3uxa8jgh68-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 02:44:57 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BC2iujs030930 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Dec 2023 02:44:56 GMT Received: from [10.47.206.1] (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 11 Dec 2023 18:44:53 -0800 Message-ID: Date: Mon, 11 Dec 2023 18:44:52 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 3/4] regulator: qcom-rpmh: add support for pm8010 regulators Content-Language: en-US To: , Andy Gross , "Bjorn Andersson" , Konrad Dybcio , Liam Girdwood , Mark Brown , "Rob Herring" , Krzysztof Kozlowski , Conor Dooley , CC: Krzysztof Kozlowski , , , , , References: <20231211-pm8010-regulator-v1-0-571e05fb4ecc@quicinc.com> <20231211-pm8010-regulator-v1-3-571e05fb4ecc@quicinc.com> From: David Collins In-Reply-To: <20231211-pm8010-regulator-v1-3-571e05fb4ecc@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: U6pyP53BWKuClDFlxFWERVMTcPo_TH4_ X-Proofpoint-ORIG-GUID: U6pyP53BWKuClDFlxFWERVMTcPo_TH4_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 impostorscore=0 clxscore=1015 phishscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312120021 X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 11 Dec 2023 18:45:12 -0800 (PST) On 12/10/23 19:17, Fenglin Wu via B4 Relay wrote: > From: Fenglin Wu > > Add RPMH regulators exposed by Qualcomm Technologies, Inc. PM8010 > PMIC. It has 7 LDOs with 3 different types, LDO1 - LDO2 are L502 > NMOS LDOs, LDO5 and LDO7 are L502 PMOS LDOs, LDO3/LDO4/LDO6 are > L502 PMOS LDO for low noise applications. Also, LDO3 - LDO7 don't > support LPM. > > Suggested-by: David Collins > Signed-off-by: Fenglin Wu Reviewed-by: David Collins > --- > drivers/regulator/qcom-rpmh-regulator.c | 62 +++++++++++++++++++++++++++++++++ > 1 file changed, 62 insertions(+) > > diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c > index 43b45feb02e6..80e304711345 100644 > --- a/drivers/regulator/qcom-rpmh-regulator.c > +++ b/drivers/regulator/qcom-rpmh-regulator.c > @@ -511,6 +511,14 @@ static const int pmic_mode_map_pmic5_ldo[REGULATOR_MODE_STANDBY + 1] = { > [REGULATOR_MODE_FAST] = -EINVAL, > }; > > +static const int pmic_mode_map_pmic5_ldo_hpm[REGULATOR_MODE_STANDBY + 1] = { Minor: This is fine as-is. However, it might be a bit better with the name: "pmic_mode_map_pmic5_ldo_hpm_only". > + [REGULATOR_MODE_INVALID] = -EINVAL, > + [REGULATOR_MODE_STANDBY] = -EINVAL, > + [REGULATOR_MODE_IDLE] = -EINVAL, > + [REGULATOR_MODE_NORMAL] = PMIC5_LDO_MODE_HPM, > + [REGULATOR_MODE_FAST] = -EINVAL, > +}; > + > static unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int rpmh_mode) > { > unsigned int mode; > @@ -733,6 +741,33 @@ static const struct rpmh_vreg_hw_data pmic5_pldo515_mv = { > .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, > }; > > +static const struct rpmh_vreg_hw_data pmic5_pldo502 = { > + .regulator_type = VRM, > + .ops = &rpmh_regulator_vrm_ops, > + .voltage_ranges = (struct linear_range[]) { > + REGULATOR_LINEAR_RANGE(1504000, 0, 255, 8000), > + }, > + .n_linear_ranges = 1, > + .n_voltages = 256, > + .pmic_mode_map = pmic_mode_map_pmic5_ldo_hpm, > + .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, > +}; > + > +static const struct rpmh_vreg_hw_data pmic5_pldo502ln = { > + .regulator_type = VRM, > + .ops = &rpmh_regulator_vrm_ops, > + .voltage_ranges = (struct linear_range[]) { > + REGULATOR_LINEAR_RANGE(1800000, 0, 2, 200000), > + REGULATOR_LINEAR_RANGE(2608000, 3, 28, 16000), > + REGULATOR_LINEAR_RANGE(3104000, 29, 30, 96000), > + REGULATOR_LINEAR_RANGE(3312000, 31, 31, 0), > + }, > + .n_linear_ranges = 4, > + .n_voltages = 32, > + .pmic_mode_map = pmic_mode_map_pmic5_ldo_hpm, > + .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, > +}; > + > static const struct rpmh_vreg_hw_data pmic5_nldo = { > .regulator_type = VRM, > .ops = &rpmh_regulator_vrm_drms_ops, > @@ -759,6 +794,19 @@ static const struct rpmh_vreg_hw_data pmic5_nldo515 = { > .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, > }; > > +static const struct rpmh_vreg_hw_data pmic5_nldo502 = { > + .regulator_type = VRM, > + .ops = &rpmh_regulator_vrm_drms_ops, > + .voltage_ranges = (struct linear_range[]) { > + REGULATOR_LINEAR_RANGE(528000, 0, 127, 8000), > + }, > + .n_linear_ranges = 1, > + .n_voltages = 128, > + .hpm_min_load_uA = 30000, > + .pmic_mode_map = pmic_mode_map_pmic5_ldo, > + .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, > +}; > + > static const struct rpmh_vreg_hw_data pmic5_hfsmps510 = { > .regulator_type = VRM, > .ops = &rpmh_regulator_vrm_ops, > @@ -1210,6 +1258,16 @@ static const struct rpmh_vreg_init_data pm8009_1_vreg_data[] = { > {} > }; > > +static const struct rpmh_vreg_init_data pm8010_vreg_data[] = { > + RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo502, "vdd-l1-l2"), > + RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo502, "vdd-l1-l2"), > + RPMH_VREG("ldo3", "ldo%s3", &pmic5_pldo502ln, "vdd-l3-l4"), > + RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo502ln, "vdd-l3-l4"), > + RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo502, "vdd-l5"), > + RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo502ln, "vdd-l6"), > + RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo502, "vdd-l7"), > +}; > + > static const struct rpmh_vreg_init_data pm6150_vreg_data[] = { > RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), > RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"), > @@ -1525,6 +1583,10 @@ static const struct of_device_id __maybe_unused rpmh_regulator_match_table[] = { > .compatible = "qcom,pm8009-1-rpmh-regulators", > .data = pm8009_1_vreg_data, > }, > + { > + .compatible = "qcom,pm8010-rpmh-regulators", > + .data = pm8010_vreg_data, > + }, > { > .compatible = "qcom,pm8150-rpmh-regulators", > .data = pm8150_vreg_data, >