Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp958342pxb; Wed, 3 Mar 2021 22:31:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxl1p60GMnzGqT3k4Lyh/bjU/U0ui3z02M4LFo0STy9cW7z0O3AmqHuru2uSMcMfBlLr2nD X-Received: by 2002:a05:6402:c0f:: with SMTP id co15mr2595094edb.373.1614839496786; Wed, 03 Mar 2021 22:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839496; cv=none; d=google.com; s=arc-20160816; b=RZdOX6ysLdZm4PtdyJX7MmrSaIuqambnBodXeX880Q9+ISn0U/HttRjUl8eoAKMXco 1nxLk/BEXCoFX6r4cjPPWtRdoqHC/R5yMUvXCS/xkcoYxmgS6/LGL1tM8Vh+liy+HKXe 3kXjpp/S6j+FKCZqyZRjhQMaMOYwfmYL5lFVlQAdiu101Zl6xXI2/FbxOf125d/W5ZzT qYmFxWK6WiqsTVxyaTxWbGZkRHGsEG6mLz6UJD/ALorWjf69YW9TQI4lpp16FEivfTLX w4waN1KC3YuyKIdmMxHzh5zaj/Asu4bRaaijV/Wlf4iyAeoyxywaRX2vDByS/02mvhnt mRFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=kee+UA5TXDxvMB3TFGxW28m2UMdaJ7A/2xkNq7z3cSI=; b=oaDwmp/hW6xF5sBzhm1yt/v5q9QSOFP2rpuYTUdJcOBZGt1N2KnAChi6pxleanvVAI uhurV0a/YFhnJ+ECSriVNj7UNhWbB0QuFNihVK15QMfHaHHLusaV8Gy9qulbYiy5FgyB yCDAaNMbT20k4D0nQZlk9FCrS16hyfXanmdGDN++lW0X0inn8kFt2OdIwH+zMt5Kr0JM nVW12SxGIZlvVa1qNS5NCmr17mAQH0bTKqhD9+vCfGGm7EjKeYyCaHrlrH9BikOi87JB pDPjhLmpH9hWiF2gmpg0/2tePcU7UJc6IwEsb2aza1bpEmF6M5woRO8V/urq1ja7YS24 KM8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e39Nchv7; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si575137ede.102.2021.03.03.22.31.14; Wed, 03 Mar 2021 22:31:36 -0800 (PST) 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=@linaro.org header.s=google header.b=e39Nchv7; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1579322AbhCBQrA (ORCPT + 99 others); Tue, 2 Mar 2021 11:47:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351396AbhCBOWg (ORCPT ); Tue, 2 Mar 2021 09:22:36 -0500 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6F98C061756 for ; Tue, 2 Mar 2021 06:21:44 -0800 (PST) Received: by mail-qk1-x72f.google.com with SMTP id 130so5646501qkh.11 for ; Tue, 02 Mar 2021 06:21:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kee+UA5TXDxvMB3TFGxW28m2UMdaJ7A/2xkNq7z3cSI=; b=e39Nchv77l+ynKsrYV05zsC5z6zsQblBBCkMmlCS0Nk+KaVDCB7xnU776iswNZ+lJA KYt7RKxTtg9tW6RB8dcmff+/5t2frXj84KX4KVfcYsHAvRnn67wHMXFL2Aehc1ZUR37B zho9/jeXrsuXN3M2c70W+Rz743MlIx81J6TuVip6IyC6KNC/GAeToDGubkFzNtJBJoBE gDzfPEQBw/uOjc+RbxIJsb3OKomRA9ox20taLtf/blzILY0c8JLoMvSjuvt004rIF08p MSycZQbp52LGriNe7wP3/hWWtcnrwP7QnltVP3CXMvxzcFBBAdJA2xrd5FrkMULrckDA s7wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=kee+UA5TXDxvMB3TFGxW28m2UMdaJ7A/2xkNq7z3cSI=; b=ajhxhnu/YvdKqcwWwBOjuBNE3o96CxeXgmS/IudRSCiLS1K4ebiC6vtefAptJ6xIGn rfpUh75v02k7y13IFD/oDU3vExJIcj4zni7XR/OfDSdYgpis13zKzAZx/oH7qn8SMwvh Y6yrb2r84gI+XlYag5/DrkIRfBhAcDNspewIyM7CBiV4s4TZMugbk3fK9pGdwps2XZpY K+mVmctBSRoBwINBZVRZ6BC4GvJ2O1MNkRURh9ZqRCb1NC7er7fArwkCP4KZSFdNBCZL C4HvaTOQ720U74DCEofpWlOrm4dWNQ1NGADZpzcL/lNWtvBnESZ9trk1YoYs7PhIiCzW DqjQ== X-Gm-Message-State: AOAM531A0u2edKA14yQ9tH36Co6z1Bim5hbCfAM0mp4UIVQyDt84bZyL ppKMwbSq4Z+YSF0QUBPSTrYtVFhLEsHgRBLiNxRXMb6FuAGNVQ== X-Received: by 2002:a37:a016:: with SMTP id j22mr7975243qke.486.1614694903823; Tue, 02 Mar 2021 06:21:43 -0800 (PST) MIME-Version: 1.0 References: <1614155592-14060-1-git-send-email-skakit@codeaurora.org> <1614155592-14060-4-git-send-email-skakit@codeaurora.org> <50151f4b-298c-f0ee-a88f-7bdd945ad249@linaro.org> <51390b828a5d534e308460098f1b9af0@codeaurora.org> In-Reply-To: From: Dmitry Baryshkov Date: Tue, 2 Mar 2021 17:21:32 +0300 Message-ID: Subject: Re: [PATCH 3/7] regulator: qcom-rpmh: Correct the pmic5_hfsmps515 buck To: satya priya Cc: Andy Gross , Bjorn Andersson , Liam Girdwood , Mark Brown , Rob Herring , Rajendra Nayak , "open list:DRM DRIVER FOR MSM ADRENO GPU" , open list , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , kgunda@codeaurora.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, 1 Mar 2021 at 13:37, wrote: > > On 2021-02-26 15:57, Dmitry Baryshkov wrote: > > On Fri, 26 Feb 2021 at 09:59, wrote: > >> > >> Hi, > >> > >> On 2021-02-25 16:39, Dmitry Baryshkov wrote: > >> > On 24/02/2021 11:33, satya priya wrote: > >> >> Correct the REGULATOR_LINEAR_RANGE and n_voltges for > >> >> pmic5_hfsmps515 buck. > >> >> > >> >> Signed-off-by: satya priya > >> >> --- > >> >> drivers/regulator/qcom-rpmh-regulator.c | 4 ++-- > >> >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> >> > >> >> diff --git a/drivers/regulator/qcom-rpmh-regulator.c > >> >> b/drivers/regulator/qcom-rpmh-regulator.c > >> >> index 79a554f..36542c3 100644 > >> >> --- a/drivers/regulator/qcom-rpmh-regulator.c > >> >> +++ b/drivers/regulator/qcom-rpmh-regulator.c > >> >> @@ -726,8 +726,8 @@ static const struct rpmh_vreg_hw_data > >> >> pmic5_ftsmps510 =3D { > >> >> static const struct rpmh_vreg_hw_data pmic5_hfsmps515 =3D { > >> >> .regulator_type =3D VRM, > >> >> .ops =3D &rpmh_regulator_vrm_ops, > >> >> - .voltage_range =3D REGULATOR_LINEAR_RANGE(2800000, 0, 4, 16000= ), > >> >> - .n_voltages =3D 5, > >> >> + .voltage_range =3D REGULATOR_LINEAR_RANGE(320000, 0, 235, 1600= 0), > >> >> + .n_voltages =3D 236, > >> > > >> > I've checked the docs for pm8009, the chip which also uses hfsmps515 > >> > regulators. The pdf clearly states that the 'Output voltage operatin= g > >> > range' is from 2.8 V to 2.85 V. > >> > > >> > So we'd probably need to define different versions of HFS515 regulat= or > >> > data (like I had to create for pm8009-1). > >> > > >> > > >> > >> The min-max voltages for S1C (PM8350c) regulator are 2190000-2210000uV > >> for sc7280(kodiak), so we had to modify this buck to support this > >> regulator. > >> > >> AFAIK, this struct defines the HW constraints of a regulator, but the > >> platform specific min-max values can be controlled from DT files. So, > >> can't we modify it like above instead of adding a new definition? the > >> new min_uV value (32000) is anyway not exceeding the old value > >> (2800000) > >> right? please correct me if wrong. > > > > As far as I understand for other regulators we put 'output voltage > > limitations' from the docs into the regulator definition and further > > constrain it by the platform device tree. Please correct me if I'm > > wrong. > > I see that for most of the regulators, these specifications are specific > to regulator buck (like HFS515) but not chipset specific, we set the > chipset specific(like pm8009/pm8350c) requirements from DT files. > > For example: > pmic5_nldo regulator spec mentions LLIMIT=3D 0.32V and ULIMIT =3D1.304V w= ith > step 8mV > > .voltage_range =3D REGULATOR_LINEAR_RANGE(320000, 0, 123, 8000), > max output voltage supported by this regulator is 123*8000 + 320000 =3D > 1304000mV which is same as mentioned in the regulator spec. > > > For pm8009 the data from the datasheet matches the regulators defined > > in the source file. Unfortunately I don't have kodiak specs at hand. > > From the HFS515 spec I got below info > "HFS510 and lower max output voltage is limited to 2.04V max, and > Yoda(pm8009) requirement was 2.4V for IOT PA and 2.85V for camera > application. Hence, HFS515 added a new register and corresponding HW > changes to support the higher voltage. Table 5=E2=80=9124 shows the new > FB_RANGE bit. When configured to 0 the buck works as earlier where Vout > max =3D 2.04V in 8mV steps, but when configured to 1 the buck range > doubles and can now support a Vout max =3D 4.08V in 16mV steps." > > As per above, the max output voltage supported by HFS515 buck is 4.08V > (which is kodiak pm8350c pmic's requirement). > So, we have modified the buck data to support pm8350c(palani) along with > pm8009(yoda). I'd still prefer to have two different regulator types (as we did for pm8009 P=3D0 and P=3D1 variants). However it's probably up to the maintainers to decide. --=20 With best wishes Dmitry