From patchwork Mon Sep 25 13:17:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 13397793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72F0FCE7A97 for ; Mon, 25 Sep 2023 13:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L4XXyNiA+DCKsME6OJ9Ngi8D9IoSFut2ZfAhCI8wWSQ=; b=znngkQ9rjx5hKv VLpoT6v4h7/sp+3tJRD74ozJ66l+X5Ns9/Rj69PT14Q8oSxfHMo0Zzse4jrzpxwG9YRloo2NX+w6G zuhIULsILC4cxw/Na9a+jw7I0UsLsQJFHrQ0ps7kDYDAzEhHQqsF76oHcxWfULUmduyp0kigAdeoD TGjGVz8zo9aySfBGc6CA103YsYnZ22PQKFCIwZ6ARMxTYNR6NeFtEgHX03wLwUDa8vgnX/vwuZbnX VYtlVKYlYbCKIxgNNYsdgRArkBMhnd1jLkW+1r95EjyOl6s70485NJ3wfxffZ6g8TrSXP1PFH0bA/ y2d01Pq4UhjjPtzRLRSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qklTc-00EJVe-1a; Mon, 25 Sep 2023 13:18:16 +0000 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qklTP-00EJOM-1X for linux-arm-kernel@lists.infradead.org; Mon, 25 Sep 2023 13:18:04 +0000 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2c01d22f332so91287761fa.0 for ; Mon, 25 Sep 2023 06:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695647879; x=1696252679; darn=lists.infradead.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=Lchs3W0Fcg5wLySneyYbtLKdXcH2lJK3LwgMw+a35RZWZ2++5r3iqWoxeNOD2o3fUl xDZJD9a/dC20tqKgU/QiUJbiiB8P/iUNALuk9CZtemSdx9jPnMyIt5t+wI6YnI+0zhPD yR4cgMkTqZ72kBBR4o9g/03A1YMGXjhrSpWB2639yFeUMwkxkfRP4ijCniZ52vwLODVP 4wjj75eo1g2PtZfiFGfouMJ+/BhKFtjpGWiE2G2dw/GO2Os3r4/a4jlakSs96kym0A8f s5ODeoL/b2s3nkXmYbfylyLCqE2oxE0g04tjpi8/j+NSCm0ukm0WXGGl7ePUs/PBl/Kr 8yoA== 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=QyMRaJ0QtIairI7Psjd1K0rOQQlSnJDovSJpXcF7mWy5VKRd1aGOVbMtPf5IcSz2u8 tTrxsikdaPadGt4QHtwqlYsssSwnPY0LCWoDvOyB+EM7Z6UFh1/jEanit3ykfJIAr1Lf OQ8G5pbTGXJ3bw5G1RzSClQAWdmkAEKx69mZPiAYb/CyXE8AvHeVYiW6oF+8E28AfWNO HohHdY+0Q6UjQ80uXUdklHSG1I5uRtQf0amh/HC+ap649Fx/3TeT7Je5P8+1GEeVJDDE 7GckqWsA6XQ+aFxEoErvGICJcCK4n2HOOFLsmTscY55tvoyHgChQ34spemF3hpUM+5uE l0Kw== X-Gm-Message-State: AOJu0Yz7c9FvmiLVaZ8PRDksh7YaenT6BKZfSayB2Xk70CPgwRdLsjP6 BWc4H8M6yQtTxlybTZgmTPVlug== X-Google-Smtp-Source: AGHT+IHUeAveoKV6cgGDL1reWFsIV8ERcTryTKk6fC6YsXc7K93e96d8/uM2zJtwmknQMiaKXRIhQg== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230925_061803_511462_DDE00C3D X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; };