Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp705133rwd; Wed, 7 Jun 2023 06:00:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4FqIU9bJI1sV4BflMlsGngKqmOvgPlD2QpfzuPbDOosZt/w+nHPYh1nTKhYBWTmkTqqkYA X-Received: by 2002:a9d:75c7:0:b0:6b2:84eb:31c7 with SMTP id c7-20020a9d75c7000000b006b284eb31c7mr6111805otl.9.1686142824021; Wed, 07 Jun 2023 06:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686142823; cv=none; d=google.com; s=arc-20160816; b=KN/WxSDkiBoWRJwoAJXnYlJa0+u1xb5DAjlw0Bvt6VNzuwDYh1IcVyNVX5sDrjG3+k lZzrocw8e3u3+gxRIj6ZkgDEiOfa6NQk7cPeL5y636NbTVj9m4mjg9totBieX/s0Qbsz onIqQlMb0/Tx8HleH2zg3fsSdbOa6gbyjyv3geo1SoF1bei+1SsJmMJTLOVL+3jd+J7L oTfKEIGCTziN+tvIBMz0DPXTGHz5We9YxoNgECIRzlUdeyrcLR+Y99x98pgDu2ubzCzF hFqWbEMQpNf4JsVAiOhOSIShw7/crqxctyl6Kuu9baqLc6AVGtz8N65erdxumgvRnRrl xfXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=soNRO/BUZIJbMO0tj7YT3q6ZRWzbCDnTXsUpvBRWu2A=; b=l516f3zCTrmEqWW4LNpfETQhRywKXTBGJPjskUBSAFd7p/sTsiDu5rLxQoPxGIa9aB GSmhhQHGMmOViguLfrrznFj8MAoUt8twHcjQCKZMdlJ7GggFQz1650o9J43SE9uGkPAg fnCj8/2JxXGYoG1aDXetHzc97UVlzz0YXEAaF2jsG2CRfqy4oRkTWRest4npjusCIPwa DVmS4RwnuT7mI3pf/vgvTRzvtn/0X9TZ/akels+tC4We7YT2vbKDkBG8c5sYwDyjRtDo 7Ix6n+x90s64waF9nRn53+D/Wq/PRmLtXpCRufOOgYxP6xWdqRQhJwZNDxkP+oJl8mxa XpXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itpQPjGA; 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 u72-20020a63794b000000b0053f24deef11si8819191pgc.318.2023.06.07.06.00.07; Wed, 07 Jun 2023 06:00:23 -0700 (PDT) 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=itpQPjGA; 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 S239164AbjFGMrs (ORCPT + 99 others); Wed, 7 Jun 2023 08:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241037AbjFGMrZ (ORCPT ); Wed, 7 Jun 2023 08:47:25 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11D671FD0 for ; Wed, 7 Jun 2023 05:47:13 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f642a24555so888043e87.3 for ; Wed, 07 Jun 2023 05:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686142031; x=1688734031; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=soNRO/BUZIJbMO0tj7YT3q6ZRWzbCDnTXsUpvBRWu2A=; b=itpQPjGA5TElmgt1urTONLMv9mjtGtb7S9Z5uyIb+OWowKNKt7+MSj9qAl4FLFJJlP ifnyOMTir9GkU8jjOGGLXDEimE5gB5HKNFycDQMCCA6T0l/6qzFVaX7pO64y2MvJswiy w/ueTkJHOv1UbOsnFRcA5MrsDh0VldxAZ/ptP01UqLLfpjaK3URAiQ1N0vpG39S3v/f3 0ztubSa4eWOX6A+sJIYvnChwpDAA4wucYwcCemf71lEMjGE+6VgzNdkGZwv779uJ0Pxl cqdD0gdokH5LgttK4zcKO/B1LtKwtsdZq5SvRqpW5uRObXQwQdeNSrZdc7b8pBlFeCxa 6LGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686142031; x=1688734031; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=soNRO/BUZIJbMO0tj7YT3q6ZRWzbCDnTXsUpvBRWu2A=; b=CrSoqYE2LgtvCrkti1S8asG8p9sAfMku3p1TdSc2MMwhrpWejnwRGX599bkHz9xpYz 4NHH7lSi6TQfEYdDRM2UyMgrPzpDZTwk8aDdP1LcUAjhc493+sXS2u1h2bnz/5adzJ+g ottjLD3QTzeaUJHKu1EgH50G7azKva3NUENX8DsC96dJA5tsviZzzMW+yM+yL1hOyF0H 8LODTbrGs0p7Rg0k+3AtFHkECmSWxup18Wvrm4JrNsz7Hh9Cu4aSJJsDOON10hsgPSVZ V+ouoWnWGfqFwPthkfncuuF98wdmYWi8w0D6t4TkB3+lAfBo+zAjC+kOq40exomsuhCy 100Q== X-Gm-Message-State: AC+VfDxieWlt4CcpOeVfI/ezYfVP4bzWQw4zqx5rl71jvcIaE/3TIDJj I5Wu9fTYoEtbHlcgLvTv6+9d7A== X-Received: by 2002:ac2:4195:0:b0:4f4:c973:c97d with SMTP id z21-20020ac24195000000b004f4c973c97dmr1907711lfh.25.1686142031157; Wed, 07 Jun 2023 05:47:11 -0700 (PDT) Received: from uffe-tuxpro14.. (h-94-254-63-18.NA.cust.bahnhof.se. [94.254.63.18]) by smtp.gmail.com with ESMTPSA id z7-20020a19f707000000b004f4b3e9e0cesm1781708lfe.297.2023.06.07.05.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 05:47:10 -0700 (PDT) From: Ulf Hansson To: Sudeep Holla , Cristian Marussi , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Nikunj Kela , Prasad Sodagudi , Alexandre Torgue , Ulf Hansson , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/16] OPP: Extend dev_pm_opp_data with performance level Date: Wed, 7 Jun 2023 14:46:24 +0200 Message-Id: <20230607124628.157465-13-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607124628.157465-1-ulf.hansson@linaro.org> References: <20230607124628.157465-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,URIBL_BLOCKED autolearn=unavailable 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 Let's extend the dev_pm_opp_data with a level variable, to allow users to specify a corresponding performance level for a dynamically added OPP. Signed-off-by: Ulf Hansson --- drivers/opp/core.c | 1 + include/linux/pm_opp.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 0e6ee2980f88..79b4b44ced3e 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1954,6 +1954,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev, /* populate the opp table */ new_opp->rates[0] = opp->freq; + new_opp->level = opp->level; tol = u_volt * opp_table->voltage_tolerance_v1 / 100; new_opp->supplies[0].u_volt = u_volt; new_opp->supplies[0].u_volt_min = u_volt - tol; diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 305cd87b394c..2c6f67736579 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -94,10 +94,12 @@ struct dev_pm_opp_config { /** * struct dev_pm_opp_data - The data to use to initialize an OPP. + * @level: The performance level for the OPP. * @freq: The clock rate in Hz for the OPP. * @u_volt: The voltage in uV for the OPP. */ struct dev_pm_opp_data { + unsigned int level; unsigned long freq; unsigned long u_volt; }; -- 2.34.1