Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1471405pxm; Thu, 24 Feb 2022 03:58:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxj7All0IFZ2NaPs3AJGQ0o6WtpJKKAxa8avxcrEQ4FIA3zBBg9+sqQ5fnt6KcS9I+zPniA X-Received: by 2002:a17:907:98a5:b0:6ce:8c66:e75e with SMTP id ju5-20020a17090798a500b006ce8c66e75emr2071797ejc.239.1645703930541; Thu, 24 Feb 2022 03:58:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645703930; cv=none; d=google.com; s=arc-20160816; b=l2AiaQ7NW3IMF1hxJk2u6wyCPZClXMEQfHVpLIEw/S3cjwYzQ1G/BAZGpJofRs0U3i SH28Cj58JjlrsUqoqeBGUwka0hf7FXll3SjWyh+9kK6NQzsqCea2KFO2FXTIENxw/p26 yMmdMQZSI515KissR+U1gKx8C2xwkAFgWAyhWnn6UTxMoTjjVQ4j3BSjiNqCayA5Zjzh Hz1h7+IL31J/wL1Z7x2C7kTzRZcaKvq9rgHyatebFIww0lMAgPUJKzvr0AS7lZ1agklx tEJV3DwzutYuh757BATuvOJTFQExKV0SmJRwO09gOTjwbj+zqaIggJYioof5hyAY2V9L fJYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=QCM78YTn8/YVxRCZhQXtEB9THICvyOh286lVLbqQpaE=; b=OamxASZUilTIG06kd9nQvX4UyKg+Udu4+VfK+a5Ov7STIpVtBW4zStH/hZuWZSikw9 6/XIviN7SFwCpxB9GL3pPf7yvjIO+8IeoLxjFGtUa6dgBwKuE7nlz7N0bsdnv6bM1bUB p38gkLyBPt4wC8InnuGgDfqi2xrf1H/KLI/5DtX/qogpobHOi7u7vFjOZLezvzta74Vt eDKsDef6ElOWMCHQAAQcLRr4EKlS60lebvzgh2F5XX3RPbELbNfGgNWjIQH3lxBGUH3s sXrDcnMOnGpcWLvBSoRNgaLhx7gX1SPxOjEK2Tls0Jm8SmgjMpa7ThyiHe2YcmiXQGcA L24Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rkNBMDEf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di1si1694109ejc.910.2022.02.24.03.58.27; Thu, 24 Feb 2022 03:58:50 -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; dkim=pass header.i=@linaro.org header.s=google header.b=rkNBMDEf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbiBXJEA (ORCPT + 99 others); Thu, 24 Feb 2022 04:04:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232625AbiBXJD5 (ORCPT ); Thu, 24 Feb 2022 04:03:57 -0500 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDB83187E39 for ; Thu, 24 Feb 2022 01:03:27 -0800 (PST) Received: by mail-pj1-x102f.google.com with SMTP id em10-20020a17090b014a00b001bc3071f921so5117396pjb.5 for ; Thu, 24 Feb 2022 01:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QCM78YTn8/YVxRCZhQXtEB9THICvyOh286lVLbqQpaE=; b=rkNBMDEf/SqUajws9FmdO9tKxMTm17pN9iH5SFB3gRCwM2E/eKIRZYeJPNmzSHSaOn lQY9sO/8Lh9xsPcM21Be3q8LV+jNC3t5Shq3Wf+CHC2hs4Zr0++3/KHap3GXDNgMyRhV IIHAEfFwRnt6J3UTutGiUM6M6Nm6bNLWAOLmXMratd5dozz6PJ3ySy+BFTdOhAvgzIYM NAkwU21Z9Xvq0/Yh3VKrAd7o2FcKtHSCkAfaaLraoItjRSejXUzTq29jlNz2e5qC048e 6lsjUmkGODO9k+pvJ7+gkSlX6OrzKaCOD2MHIMkPZo4/ugAm7XYufKmfcLTC1dePgyH2 KRyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QCM78YTn8/YVxRCZhQXtEB9THICvyOh286lVLbqQpaE=; b=n1E9EjMvBeXzcFMj9k8U0TTMMJGRxPynaHdP6TbscomRGSQLfMLD8yboXo7+2PmHIj atoCDEJu0NYri+3SbA+54VzU0SfzmUpOu5uHSQs3qV9ObJVo4qa6TmyEKJJKsloXMlSE qWM+3GIv5Uzg8a6tulI+N/kjFOs4S56vH+ioVZuQIQtfTXUzmsdtizU6f8CjLUnfjcD7 yGv8Mx/aowliL6T4HQIhm9oX/x3oX+8aqsw2h8aigLN6vcl7BA2Ubw2RMAuq1PeLyHcV vB2tH+TGO+4n6fyFdEaGnKknc1VHSleUvnKSL6gMuVPF2omYv4R9KQGdVRg6UOs04Yco nLSw== X-Gm-Message-State: AOAM5327ScF1Vv7hPmsOzm/kRO9++kp5+ytGr3anjyzKsq8mAy1EgQTV eEdoq2clSCA2U2wpvu9nqza3/Q== X-Received: by 2002:a17:902:c20c:b0:150:11df:9918 with SMTP id 12-20020a170902c20c00b0015011df9918mr1526277pll.76.1645693407502; Thu, 24 Feb 2022 01:03:27 -0800 (PST) Received: from localhost ([223.184.83.228]) by smtp.gmail.com with ESMTPSA id g18sm2507892pfc.108.2022.02.24.01.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 01:03:27 -0800 (PST) Date: Thu, 24 Feb 2022 14:33:25 +0530 From: Viresh Kumar To: Lukasz Luba 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 Subject: Re: [PATCH v3 2/4] OPP: Add "opp-microwatt" supporting code Message-ID: <20220224090325.m4pl36ma3uettxvg@vireshk-i7> References: <20220224081131.27282-1-lukasz.luba@arm.com> <20220224081131.27282-3-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220224081131.27282-3-lukasz.luba@arm.com> User-Agent: NeoMutt/20180716-391-311a52 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 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. -- viresh