Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1375090pxm; Thu, 24 Feb 2022 01:42:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAo/Rs9n2wiLuQBSOYOFVJMn6mVTNkPGA0CWlqRWlUypG6onvwQdEAaP6Cq+Y3dF4gtt1J X-Received: by 2002:a05:6402:510a:b0:413:1a1a:6f5c with SMTP id m10-20020a056402510a00b004131a1a6f5cmr1436634edd.430.1645695775638; Thu, 24 Feb 2022 01:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645695775; cv=none; d=google.com; s=arc-20160816; b=gvd0WHJkaI0AtMuZSCcfgYeUx37Pr1ltH/B02bbEMiWigtGwr4ljVfZW9zD3o36nQT WDBho7xMYoQKQgg/RU8fWql7wGugbLa6XBVF44KWXuc0cYeIsO2KT1gKjz/SNcUB7bJO 2PdF+WCLTMlT0GZSztSvbazKAiBpAz5UM/W8JiOxfnLNfdzTOaBTSqeCxUsrhwbokPmj jRUjJ1WVLdGUqNsmGfFwO3hLk5I0pNk7W087WCCaC2liHuVRG9sL7r9mjM6ceKgj0jAb mND/eUJrMdHJoWJGqLuAQmD1lJ4DKwfLMRSz50G8BCG9vgvNfb17kA+YBWB3aumnezAw XO+g== 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; bh=w2bXkPZVKbwy8ie7LgLgR0F7NaFWlnuUxDBEk6NWdFw=; b=uXS+xVfM6mov04YvwH6upzeQBGpAPMHe0Q4pgkhetnXUOY4Kg3hbjhltftgQvG2NB+ 6vym3w1P4S6s7sQgJoW14okzOT8gbO0DBTBojIXyhD5KGiitjf+/Hpc46HcJFVN55eJS C2ecYlxaj+rXHDb+UTFmp+To9ExSzZV108cCMGhenuc887IXtTHbRmFbELLm+q0xvrqZ E/lKkv+7HimZm8YzZQUYGphaZDylYLYaQryUMTuX+Nkh/j++cdPTgWkb9HEej5gI+KcC zkLDSGDSSZtDVoyGkrhpECMqbUK1rf9KhpvtpAKE2KDSdYEHzbdmAleJTnvzkmGir+Bi GMoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12si1350492edb.523.2022.02.24.01.42.30; Thu, 24 Feb 2022 01:42:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbiBXJf0 (ORCPT + 99 others); Thu, 24 Feb 2022 04:35:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231882AbiBXJfZ (ORCPT ); Thu, 24 Feb 2022 04:35:25 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D942285703; Thu, 24 Feb 2022 01:34:43 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C160CED1; Thu, 24 Feb 2022 01:34:42 -0800 (PST) Received: from [10.57.8.211] (unknown [10.57.8.211]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CE37C3F70D; Thu, 24 Feb 2022 01:34:40 -0800 (PST) Message-ID: Date: Thu, 24 Feb 2022 09:34:39 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 2/4] OPP: Add "opp-microwatt" supporting code Content-Language: en-US To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, rafael@kernel.org, daniel.lezcano@linaro.org, nm@ti.com, sboyd@kernel.org, mka@chromium.org, dianders@chromium.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org References: <20220224081131.27282-1-lukasz.luba@arm.com> <20220224081131.27282-3-lukasz.luba@arm.com> <20220224090325.m4pl36ma3uettxvg@vireshk-i7> From: Lukasz Luba In-Reply-To: <20220224090325.m4pl36ma3uettxvg@vireshk-i7> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/24/22 09:03, Viresh Kumar wrote: > On 24-02-22, 08:11, Lukasz Luba wrote: >> +/** >> + * dev_pm_opp_get_power() - Gets the power corresponding to an opp >> + * @opp: opp for which power has to be returned for >> + * >> + * Return: power in micro watt corresponding to the opp, else >> + * return 0 >> + * >> + * This is useful only for devices with single power supply. >> + */ >> +unsigned long dev_pm_opp_get_power(struct dev_pm_opp *opp) >> +{ >> + if (IS_ERR_OR_NULL(opp)) { >> + pr_err("%s: Invalid parameters\n", __func__); >> + return 0; >> + } >> + >> + return opp->supplies[0].u_watt; > > What about returning the total of all u_watts for this OPP here ? > Surely it doesn't make sense to do the same for voltage and current, > but power is different. > OK, I'll do the summation of all used supplies' power here.