From patchwork Tue Jan 23 06:39:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 190748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp154925dyi; Mon, 22 Jan 2024 22:41:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSqX56+1OeVF6kiV9dk0SGJGMh6OKTOyUqerpASko16g7tL6N6xzH/snAXS89kRNRtm2aX X-Received: by 2002:a17:902:900a:b0:1d7:67ff:3e06 with SMTP id a10-20020a170902900a00b001d767ff3e06mr1493438plp.45.1705992092307; Mon, 22 Jan 2024 22:41:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705992092; cv=pass; d=google.com; s=arc-20160816; b=ajq8Fid9ydbKowRE50eFWRh5Q7loOEDLmZAVw4K2uUl6oGoGEDc+UTycgZJ7OoQfPi VHnDSOIWFPngk0QUiRP0r6MBKdQnuXZtYriZ8aFYpBdAJ8XcySq/rBE2vF7v7fbglLXH l8n+UhgKqAYHh5Gc2O+nSjLbk93xfLJHh3k8FySq6ZcCRAabOYTZ701oXuoYfx2ZvuZV Mln9r2xAiPH/jEFqqi2QeTEXeIrn09QSxm0CX7xmb6LrI2uGnKnx5D2beNN+rchpm9K/ JZDhBwHL6ossxep8vC/vL0xllxzKN4HRBt26SLatEiYUGjpapNn2DLPPl2BAQ9Xr+PiR Qu6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Iwio5HJQpvc8muMFO1anj17hxV7JwhZHGw2QVILfq9g=; fh=7qi+xIeZ1h17dpI3Dlgth49KArnkB4L17C+Bfk2LVGI=; b=KSR5AtnAAYQlY3FpRrrSF5jf4gmLYzuqrWiGMN9JebBMruApGTyAvlkph5cnu+IfjB 8KzPZFbBG0h+kayH3eqRcRcrTjq0oLb57gVxtrHj4GrSMbs+UeaRK7DjOTLggos+N4B7 w0YnHO1npXBrijlEJqEeSdENelNys0bZh8CCZnGSiXfjpA5NLFTAacXt3j/T/D5AGu5X pjHAUe3HEBeQPoPavbTTbZbQzogJ2DzgDhBLKsVnmmhplC8FBRQ3wJuMsX9SKEs0U2jW R+SvCUieQau1xiXXbs24uh1ecjSCJz6DOL2Zo4UZjfMPRpOLbNVQIFGaFG3e+cjzV96f ATbg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lWqVz/x8"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-34799-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34799-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f6-20020a170902e98600b001d74398161esi4049082plb.391.2024.01.22.22.41.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 22:41:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34799-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lWqVz/x8"; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-34799-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34799-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5C195B2254D for ; Tue, 23 Jan 2024 06:40:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C56C524B2; Tue, 23 Jan 2024 06:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="lWqVz/x8" Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E0D851010 for ; Tue, 23 Jan 2024 06:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705991980; cv=none; b=Zxj8K6x5JoqgptYwnuraEALhT1dZwYPorXqMbUsjPU7xmPlDGzb87PhtGxCYJX1XcMqtv4yNTHBEEmUrfJm+ze36LWj7cMgWxEniS/gQEwzcBKb1MJyEJMKvD2lwxGo5yokI63lEwprHTTqLOB90h7rZgCpfdxpcoSYv/Xi/NTo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705991980; c=relaxed/simple; bh=97fUsI3syBIh9/BxtfH9kv6054fMXX9A+KQKCKVBfXI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=AISrIYDdxx9FrJH9NOOtynHe0V/+i47gRUgm1IGNhkjtSAHZ6czBw3ZCP2eXgPPpRwxFqTScpkUkjTJA0JMMjhmKb3AjvgnAYkcIsOThsHItQw9CYbvLkAtIB8Jr/XyTZe5LS0Vi2H0s1NCXgyQO6IC6n7wDOE3hRixJSYPIe5w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=lWqVz/x8; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-5ce74ea4bf2so2519822a12.0 for ; Mon, 22 Jan 2024 22:39:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705991978; x=1706596778; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Iwio5HJQpvc8muMFO1anj17hxV7JwhZHGw2QVILfq9g=; b=lWqVz/x8tATAlQVo2yotw/ouuLHyeh1mRMSy2Lt/0VERuXzRE/t9d8RjnV60awJWg9 nFukiYrq9i8T+9T1EtQQwEuLZus5AG9bh5W0C2IC7K7is9tSs9DZmNUtmTVjO0G9vN1N CyabPGvxsNFedVeRJcY/UOcDD2iGBSI+Smrvlsng9/+j9JnnZaQWct6Ilki4SeLj4vyT 3bMi6k9IZ1hGNdJAFsVsWi+gcl2M/nE0CwXUqyEW9IIUvml121OkJAGtjzMQLd8ELlAf +D7Q2plp75LedHHOI/+sSKNJ6tUbDA3qERJk2/4If3YTkke68oQuTTO+cXctBo0YbxUu fVMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705991978; x=1706596778; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Iwio5HJQpvc8muMFO1anj17hxV7JwhZHGw2QVILfq9g=; b=RrpiI726EOPFmdbQEzTrwGfhG8R5WoVHWAd3T26/hghQgaKhB+OG3hpfePB6hy856r ddBxMu06rqA6VnSm3ftb3PP0CTrsTPPIojjPlGVRD84aDKqOGyI40NJaI5Rkwan0Ry3n E1nbekszb3aiBagt5nVwEGx4KZ3H9SsypuqOZ9yh+IuRM4BLIImnNVXqHYK4YCBaw/kV DB4SPA4xkpO8fc/LzjzLdiWKJZYb9X9GuzR6ONv6JplZbzo5r5pahTi00oa4jd1q/dwM 1962cragcxSp/m2HDSef6tWdOiOLLuuwWqWc3LVp3nxl3GABWnGM0ybj4qIUpRuP2Gzf qYUg== X-Gm-Message-State: AOJu0YwmiySO1ku9vSjkRUnIJz57EPc4DzhjEwTGDts6G3gSK2LPSF0V 1CSjfiPMkpUXIAfKxVrAfctXp3Xls9Bf95ffvwXisM2p5oCRc0w6lLIhz78L2Pc= X-Received: by 2002:a05:6a20:9f9b:b0:199:4910:fe5b with SMTP id mm27-20020a056a209f9b00b001994910fe5bmr6333136pzb.54.1705991978692; Mon, 22 Jan 2024 22:39:38 -0800 (PST) Received: from localhost ([122.172.81.83]) by smtp.gmail.com with ESMTPSA id ls30-20020a056a00741e00b006dbe42b8f75sm2530831pfb.220.2024.01.22.22.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 22:39:38 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: Move dev_pm_opp_{init|free}_cpufreq_table() to pm_opp.h Date: Tue, 23 Jan 2024 12:09:34 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788862364322082448 X-GMAIL-MSGID: 1788862364322082448 Move the declaration of functions defined in the OPP core to pm_opp.h. These were added to cpufreq.h as it was the only user of the APIs, but that was a mistake perhaps. Fix it. Signed-off-by: Viresh Kumar --- Will take it via the OPP tree. include/linux/cpufreq.h | 20 -------------------- include/linux/pm_opp.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index afda5f24d3dd..8ff3e79727d8 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -694,26 +694,6 @@ struct cpufreq_frequency_table { * order */ }; -#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) -int dev_pm_opp_init_cpufreq_table(struct device *dev, - struct cpufreq_frequency_table **table); -void dev_pm_opp_free_cpufreq_table(struct device *dev, - struct cpufreq_frequency_table **table); -#else -static inline int dev_pm_opp_init_cpufreq_table(struct device *dev, - struct cpufreq_frequency_table - **table) -{ - return -EINVAL; -} - -static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, - struct cpufreq_frequency_table - **table) -{ -} -#endif - /* * cpufreq_for_each_entry - iterate over a cpufreq_frequency_table * @pos: the cpufreq_frequency_table * to use as a loop cursor. diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 76dcb7f37bcd..f1ac8bde09cb 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -16,6 +16,7 @@ #include struct clk; +struct cpufreq_frequency_table; struct regulator; struct dev_pm_opp; struct device; @@ -444,6 +445,21 @@ static inline int dev_pm_opp_sync_regulators(struct device *dev) #endif /* CONFIG_PM_OPP */ +#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) +int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table); +void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table); +#else +static inline int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table) +{ + return -EINVAL; +} + +static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table) +{ +} +#endif + + #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) int dev_pm_opp_of_add_table(struct device *dev); int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);