Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3763460imm; Thu, 17 May 2018 14:24:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrbTROkvO06HeIxnLhQqmCvsxJK8ZqBq4IHenAp6kNtaaP5QW8RGmPmLiVg7Eb/oElTP6JL X-Received: by 2002:a17:902:5a1:: with SMTP id f30-v6mr6560738plf.167.1526592279039; Thu, 17 May 2018 14:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526592279; cv=none; d=google.com; s=arc-20160816; b=ZpAsdCBgRDdSObHgXsAFoEw0mRA/asrmX2SYlUAvEwk9pUo5tO+r5LjgF9NqvtfkGY 4KBFVh13OkqNZQ5or8QF6hf50cmIeXhJ9s1RZ0NW1kb3ddjvyVa6qsnxFpkZhU7Tl0wJ MpPH0kh/scDJ/MCSwxK0cLZWRNt0oR3GNUEpzIs4VmkX12Specml1MtmG7X449idublt 1i1ulSxS3JgZPP0XboJiUlzBj/QvQrHxK9XG3WyVZlUNG2moqeRcJj5YPl6m9/aNtoIa vz1vttcbcFal7tD3vlCi0GwmmrfwBwd6OG07grBodhVzsMCAUUxtdevp4hsNyj5sWHSP 9mAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=rc59M7AE0Wqj1PlzyGE/nBLwUawdFhgzBYpPrFMpRo4=; b=luWlWfbyeagDIBN3Rn+x3CV8n7/l+aBaXHD24hLfYz7ib40b/EPXcOVTfMricRHi6K YZ5YZUjVvl99ObvTnl0hcojAPChdVgHu4kQ666Bi8fbX9+1yunfSl58YrxJzFzOi3ZdM TARXrCDEAyI2bfMITcOy7WaBjxm3A1PGOfY8CgId1rxBnLUb5aGkZxoSNujCIL5UItQR kFIrDwKq3yPJTIdesb+bE71G1YViGUI+HjQxdK0Ibkada9yDpupQX4ZNFqKx94vee+PU aPydfgOjWLBlw2IZR/s/5i4Jg74fTDCsGYEt7cZ6VweJZDu8SoXIw+y3P9SU86QLZ4v0 nO4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=arNzlmi4; dkim=fail header.i=@chromium.org header.s=google header.b=M9Tz6BSu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si4732882pgq.302.2018.05.17.14.24.24; Thu, 17 May 2018 14:24:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=arNzlmi4; dkim=fail header.i=@chromium.org header.s=google header.b=M9Tz6BSu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751061AbeEQVWx (ORCPT + 99 others); Thu, 17 May 2018 17:22:53 -0400 Received: from mail-vk0-f68.google.com ([209.85.213.68]:41437 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751231AbeEQVWu (ORCPT ); Thu, 17 May 2018 17:22:50 -0400 Received: by mail-vk0-f68.google.com with SMTP id 131-v6so3595731vkf.8 for ; Thu, 17 May 2018 14:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rc59M7AE0Wqj1PlzyGE/nBLwUawdFhgzBYpPrFMpRo4=; b=arNzlmi4+5dvGX/uOKPWlrvp+FSd3gQA11Zf3pIMWm9rIN/6ANm2h4CNv4NKJ5pFXq MMkqru4ygc5MRVKeFxig5H+9FVrhY414S+LL1UWnm0vubhcZQstSk35MV1bQVTaXxH/x njZsifesWs6PrJmD0u8oII9gIEL1lhrWzOXiArkrRvy8rzQgtePQ5FhvCbUNPM5z02WA UIqtWe1B4peoMM71zdvEdE3Zd7v9JF8MC9OdIoR7QJOmYFlD3wLbq8512bkLqn/ZMRfZ 1fIGqz3yiyESfHPIdoaD5Fl0s/WJyUEBBv53BRBlJHfLh+SFTQPgus1b7NEoTEFQNv2R DXVQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rc59M7AE0Wqj1PlzyGE/nBLwUawdFhgzBYpPrFMpRo4=; b=M9Tz6BSuYwXlcEYz9nbZeEcK18S9r/tMBqIF5Qzz6HSDpQK4r52wSxiR9/Aq9O0ddP BhyjQck9NkXlnaVNRWMJsIHrCuMhGf6Kr0PZu5A2SWC/mPjmBaUNF5wE0Bzu/ATwdXVn 4vtvltHYkw1REVGLvBTm3a8hj6H1ecRkMH0pQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rc59M7AE0Wqj1PlzyGE/nBLwUawdFhgzBYpPrFMpRo4=; b=G0nZdGRQKlunU8gEp0R0jTY6IJrOBaURiOZ0837jRR9Z7YCSeDJPTnAdsrOtQHFHmv 3/LA1SavIvgzxJMmK8UsWeIPqhr5LHCU9UNUEn0cLrSrB7mUG4YXwJAloCt2yu3dWSys LgezlAz6Bbhy8QtMjOfYhPu4lSu1tF5N1YF/Eck8753ujbJiMTHuH5m3I5On+6WS9PB9 ESJBNRE2TJlt7v8NXz9GBRVHxX5WjOafvR3OCzuFQdGERcbsXS6b7SO9YgxfD9S5kIXt JG4l+Cg68R+CUfLyZaRYiNS16cDbNAFzLvf+3QboXjQwnjO/Cw67zRDWHMZGUau51ghW PhTQ== X-Gm-Message-State: ALKqPwc+nUxvMNpWnuwFsmGpedFF5/DWZpOq/En3dOW9i5AgdobShvCn CyHOeR+pHDwz+fLYMT4dOUfXpXj8623+ZzfJdjUyXA== X-Received: by 2002:a1f:d304:: with SMTP id k4-v6mr5217433vkg.101.1526592168529; Thu, 17 May 2018 14:22:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.48.82 with HTTP; Thu, 17 May 2018 14:22:47 -0700 (PDT) In-Reply-To: <41d5df73ddac772551d2966e0752bb0c357b1ded.1526088081.git.collinsd@codeaurora.org> References: <41d5df73ddac772551d2966e0752bb0c357b1ded.1526088081.git.collinsd@codeaurora.org> From: Doug Anderson Date: Thu, 17 May 2018 14:22:47 -0700 X-Google-Sender-Auth: fiELKMz6TC64gOeGPhbuWc1lqoE Message-ID: Subject: Re: [PATCH v3 1/2] regulator: dt-bindings: add QCOM RPMh regulator bindings To: David Collins Cc: Mark Brown , Liam Girdwood , Rob Herring , Mark Rutland , linux-arm-msm@vger.kernel.org, Linux ARM , devicetree@vger.kernel.org, LKML , Rajendra Nayak , Stephen Boyd Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, May 11, 2018 at 7:28 PM, David Collins wrote: > +- qcom,regulator-initial-microvolt > + Usage: optional; VRM regulators only > + Value type: > + Definition: Specifies the initial voltage in microvolts to request for a > + VRM regulator. Now that Mark has landed the patch adding support for the -ENOTRECOVERABLE error code from get_voltage() / get_voltage_sel(), do we still need the qcom,regulator-initial-microvolt property? If this is really still needed, can it be moved to the regulator core? > +- regulator-initial-mode > + Usage: optional; VRM regulators only > + Value type: > + Definition: Specifies the initial mode to request for a VRM regulator. > + Supported values are RPMH_REGULATOR_MODE_* which are defined > + in [1] (i.e. 0 to 3). This property may be specified even > + if the regulator-allow-set-load property is not specified. Every time I read the above I wonder why you're documenting a standard regulator regulator property in your bindings. ...then I realize it's because you're doing it because you want to explicitly document what the valid modes are. I wonder if it makes sense to just put a reference somewhere else in this document to go look at the header file where these are all nicely documented. Speaking of documenting things like that, it might be worth finding somewhere in this doc to mention that the "bob" regulator on PMI8998 can support "regulator-allow-bypass". That tidbit got lost when we moved to the standard regulator bindings for bypass. > +- qcom,allowed-drms-modes > + Usage: required if regulator-allow-set-load is specified; > + VRM regulators only > + Value type: > + Definition: A list of integers specifying the PMIC regulator modes which > + can be configured at runtime based upon consumer load needs. > + Supported values are RPMH_REGULATOR_MODE_* which are defined > + in [1] (i.e. 0 to 3). Why is this still here? You moved it to the core regulator framework, right? It's still in your examples too. Shouldn't this be removed? It looks like the driver still needs this and it needs to be an exact duplicate of the common binding. That doesn't seem right... > +- qcom,drms-mode-max-microamps > + Usage: required if regulator-allow-set-load is specified; > + VRM regulators only > + Value type: > + Definition: A list of integers specifying the maximum allowed load > + current in microamps for each of the modes listed in > + qcom,allowed-drms-modes (matched 1-to-1 in order). Elements > + must be specified in order from lowest to highest value. Any reason this can't go into the regulator core? You'd basically just take the existing concept of rpmh_regulator_vrm_set_load() and put it in the core. > +- qcom,headroom-microvolt > + Usage: optional; VRM regulators only > + Value type: > + Definition: Specifies the headroom voltage in microvolts to request for > + a VRM regulator. RPMh hardware automatically ensures that > + the parent of this regulator outputs a voltage high enough > + to satisfy the requested headroom. Supported values are > + 0 to 511000. I'm curious: is this a voted-for value, or a global value? Said another way: the whole point of RPMh is that there may be more than one processor that needs the same rails, right? So the AP might request 1.1 V for a rail and the modem might request 1.3 V. RPMh would decide to pick the higher of those two (1.3 V), but if the modem said it no longer needs the rail it will drop down to 1.1 V. ...and as an example of why the headroom needs to be in hardware, if the source voltage was normally 1.4 V and the headroom was 200 mV then the hardware would need to know to bump up the source voltage to 1.5V during the period of of time that the modem wants the rail at 1.3V. So my question is: do the AP and modem in the above situation separately vote for headroom? How is it aggregated? ...or is it a global value and this sets the headroom for all clients of RPMh? It would be interesting to document this as it might help with figuring out how this value should be set. > diff --git a/include/dt-bindings/regulator/qcom,rpmh-regulator.h b/include/dt-bindings/regulator/qcom,rpmh-regulator.h > new file mode 100644 > index 0000000..4378c4b > --- /dev/null > +++ b/include/dt-bindings/regulator/qcom,rpmh-regulator.h > +/* > + * These mode constants may be used for regulator-initial-mode and > + * qcom,allowed-drms-modes properties of an RPMh regulator device tree node. Technically also for your new "regulator-allowed-modes". Maybe just say that they're used anywhere a regulator mode is needed in this driver and give regulator-initial-mode as an example? -Doug