Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1366103rdh; Mon, 25 Sep 2023 10:25:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEG1u/r/kcm52gFe26ALP6+671FWE6TBBpMOOZ93bmoQk3FgtycYIqppLk8SW+fnzE64tQj X-Received: by 2002:a17:902:dac8:b0:1c6:25c2:e78e with SMTP id q8-20020a170902dac800b001c625c2e78emr1667133plx.24.1695662714488; Mon, 25 Sep 2023 10:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695662714; cv=none; d=google.com; s=arc-20160816; b=qjxW1Q09t0TfTjavYqTd43J3nXF067fu9adMWeKhn4fTVAAuVOBqIyx8+tTkqP6yyv YZlr5OxvYmE/r6bjx0JmNlvVtBvW4wF6xKZIpufZqlc7zeVqzvdcDL9zWVBHOOBVNB7+ DcgWKE/Mj7O/Q1JQNRANgzEcklf98vUn8BL1V/vjR2s/nPaMvLEwK7A9oNEdyVcuRYIf DPJ0d6EUxofbEpOHhIicAuLXZmQ1XAHdr1eHvf8P5ZFFz2PEEcjTU0pNpJE7Jqhvx1qI 5W8Jo/UoCbV/TOMGoBqcUvC6mE5z+sDn5LLxO6zykU0KAOJvlXwTQbaHqOB2ieOPofLJ qjfQ== 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=SfkqeVqdpd6l51oQ+egV78dBLzEOf1KilkGCosg+Yiw=; fh=0iKC8n1xKtkvw+5RDzSud32j7h9ilf6Mvh4d+L1hSv0=; b=Sp3/N6youjInsbdAC4YuXIrm38As7gI2PrLWYJBnmjJaYpor+QuhsuhgmxvhfAZ1Sm 0NEQFKkixyq/ZQDHdc2wCNw4iGbLkdz6nzQFfHl0ru6dbgTPs96EhQTIGBA1CAoYJ1W9 30wrXMFTVQVDJ7VgI60px1Srxil0yekqNLdalCPpC//jeN6OQO3gWDj4liPZgaWYsP1N e4aavwCEkttt6cR9fKXWC8P06R3CSrn8H0N/DWXuEhgERoPvzJBbt15Ui7NY9YyhqMfZ OXgY23gCF4e0LZciE6+0F7KAyMzwWCZqhgPe90PT4NSlz0YNHqQPlJN/nFXib3WBsjyg En3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u41YYv22; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d10-20020a170902654a00b001bb993ef74bsi5303047pln.540.2023.09.25.10.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 10:25:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u41YYv22; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C7960811F10C; Mon, 25 Sep 2023 06:18:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231773AbjIYNSR (ORCPT + 99 others); Mon, 25 Sep 2023 09:18:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231778AbjIYNSJ (ORCPT ); Mon, 25 Sep 2023 09:18:09 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 493E710F for ; Mon, 25 Sep 2023 06:18:01 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-503012f4e71so9254947e87.0 for ; Mon, 25 Sep 2023 06:18:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695647879; x=1696252679; darn=vger.kernel.org; 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=SfkqeVqdpd6l51oQ+egV78dBLzEOf1KilkGCosg+Yiw=; b=u41YYv22g50xb8QpjwJtG24W6Fxy/ctgkC7vFmFK+TY2Z8G5K7EPTcPkT3ReJAdA2r wyixSiblBxYPY3ZcxH7K0GCYJs+ax/9Z62qiQiLa7Lx3Nl1uQgMShzQx418z4UGN8kiy 4Y4rEdXh8L2zeXZu+LrPd4Um9X3awI7CxBPa6oPujM+wJ150Mc5cKSPbr8ywIMMjzYfr aSuBmPDvoPkGorB/Jj7UzXcdzrwsXtUwCB4n43nfqQ3pzfF8VG/103B23S/3+woqq8yi z8sLoWJYNXIlciNsc0VF8QeycK2ZDIHjGwwXEVjKf+PmGP2KegpvTbYf1HCtYylQGPrN ctDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695647879; x=1696252679; 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=SfkqeVqdpd6l51oQ+egV78dBLzEOf1KilkGCosg+Yiw=; b=dZKlsJCpg41d8ljL09eKxCa7ldDNAzW54G1Ooo9hScR2p1PrucORcrscENgaieYQTh G1kSJAbJUpfMhMCbF/40wiglI3V4xMTrsPMWpkTeEatC9i8fNB3sTeh7VWyiikkAA8hn Px8vBtcIezaEqzDQkHIHMYRL1Aw5s+nBKTuVV2DvhewpEEyy6CCNZEwpsWNJB2FQZ5Rc eyl87vQdmIJrQBtdGfFzq8QeD7X+yAk+RcLHtFmZRWuJa8sFo30G+qS4YunwCMI3kdWZ RRm3OzdCuM6DooLA3DtMeMs2afICLlAMcXVRCFCE/WxFfoMAy2mVYwLLvn76QPZPPJza lByA== X-Gm-Message-State: AOJu0YwIphvpXekJ/+H7EX6zJGJO17SUyqmR3Cij9oklG0k3JDq6arFi /z2euIudZcRmp5+bGWzh0N6kbg== X-Received: by 2002:a05:6512:3d15:b0:502:d973:3206 with SMTP id d21-20020a0565123d1500b00502d9733206mr3663580lfv.6.1695647879531; Mon, 25 Sep 2023 06:17:59 -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 m29-20020a056512015d00b004fe10276bbfsm1823583lfo.296.2023.09.25.06.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 06:17:59 -0700 (PDT) From: Ulf Hansson To: Sudeep Holla , Cristian Marussi , Viresh Kumar , "Rafael J . Wysocki" Cc: Nishanth Menon , Stephen Boyd , 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 4/9] OPP: Extend dev_pm_opp_data with a level Date: Mon, 25 Sep 2023 15:17:10 +0200 Message-Id: <20230925131715.138411-5-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925131715.138411-1-ulf.hansson@linaro.org> References: <20230925131715.138411-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 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 06:18:15 -0700 (PDT) Let's extend the dev_pm_opp_data with a level variable, to allow users to specify a corresponding level (performance state) 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 54b6138e1189..ca8d1304b508 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2035,6 +2035,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev, /* populate the opp table */ new_opp->rates[0] = data->freq; + new_opp->level = data->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 a8ee93ba41d8..9ad168f4cbf1 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