From patchwork Tue Apr 24 09:39:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 134058 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2011055lji; Tue, 24 Apr 2018 02:39:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpK7NbOOCQLPRFiTDKmfffO/5OZ9xbYXDpC0gm9Gd0WPk6I3XYSSsl2QLxg1Qz9MuAjpKi9 X-Received: by 10.98.174.19 with SMTP id q19mr3497895pff.155.1524562797030; Tue, 24 Apr 2018 02:39:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524562797; cv=none; d=google.com; s=arc-20160816; b=kwq+qT192ABNROp4VCayIgw8dd1j4cTqQtByiUpBlyXVxntye1y8U+2BDxCMr/wiJw MVhNdpxaHORMJITE/4CDSZ65riLzDdxkdTOhWc6OdZw19YJCg7hLQYp0dFrKxrvsL34B 7HjvQnQPboyT96XWei6m8usoObHDBdSy/9oOhqwFj8NpNXRn7lsLVaqxRhjfZMIbc/A1 zNLtuQiyDUHu6a8JSTtPYi+CGcZaJWlndcEUNpgdWVH4HLANifZ5KXzbfmtaVEG7/KGT lnC4XORiCjhGD1aZw2y4HJ8EZ8uSIxB5S50qsLbKvGewbzN9m8KzK+9BNfopizcnwMh9 at/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=KWWUmJiLNpNSPX5mV1xGbZockPPfYejV3aX3lkA0Q1E=; b=fQi9YCdam6U2aA8xWrJgzOKyVcU+z5iJUcHVQWt248HFnEb/W0rlpaUge3UnZeknNY tqpKZiMAXE3jPOuVF9dZnuwfjnmRfzX+qgoTDztjrxKgPCbjSHxTqwsrwuSgn1YB+ujC BSmzYg/VT4YQMWreZQK/csWrfbQQJH1tZl2FByBxELh7YQxDNBMutTeVE+fPdT3rF2AS M9pfBELxWO7mixW1h9+go3XImSNRlVnCevv+guDQ8Ztf/KT5DeAB65pNTzkcX2cPtnO2 Dggt1iuDpL5FR1wsGLmShp0x+LPst2QiTdkuQ5Rqm0HUDYtdyxzGBRJwMasBREgCTcOD Tnfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HlCgB5NY; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m18si11109785pgu.352.2018.04.24.02.39.56; Tue, 24 Apr 2018 02:39:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HlCgB5NY; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1752276AbeDXJjz (ORCPT + 11 others); Tue, 24 Apr 2018 05:39:55 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34407 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751994AbeDXJjx (ORCPT ); Tue, 24 Apr 2018 05:39:53 -0400 Received: by mail-pf0-f193.google.com with SMTP id a14so1280306pfi.1 for ; Tue, 24 Apr 2018 02:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=KWWUmJiLNpNSPX5mV1xGbZockPPfYejV3aX3lkA0Q1E=; b=HlCgB5NYOW28agxszk5GpjYBUntgUp6KCdatg06iDioRP/Da1/10ZhsAaZUf+tSSiq iFgHIB61PdLZ8gP97eDynmlDSzA1++lA/2LTn8eYU/qv14egF8k9Hs0T837kLk/x2pLl Iq5ue9sZdK6elWhKQ+ME2VzgeSeSA7EAG4YT0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=KWWUmJiLNpNSPX5mV1xGbZockPPfYejV3aX3lkA0Q1E=; b=r9abczmGiKNCITXhTy22KFAxEnWKkGsIx2kbQLEx1okMQpC+B4xNU74G6WGo0jx+SG H/mA7rBm8gKgp6Ocad4hoSgUjW3g/sDmN1a/Odlm3l9fEJlCU/oAds0OuEpvWVquHzNy MZJDH+3nWfyhhe7kwGvcT8kR6kt+Mu78kq0FAUW/mIO5AiuxlRodyIks40evWMnrdlnX uROU9v5976FzAwZeSTWnxq4o0yTKbK3saziQ/AqOjnlO1CUnyRHGfkxXuBBSGrTUjvG9 WNmX0BiSqN5juMS7ACnFF0A/Emu0nkwVqwQEaiFCGYkzasbbwu/kssk4SxEmMhlCIn31 Xnww== X-Gm-Message-State: ALQs6tCb4qlz3SVn2l0mtiZHxxY58tGPPuOYXhkOUPY+XzzWNXR3delZ nyMLTznvj2pwCWjdbrlXjd69ja1dB+c= X-Received: by 10.98.156.7 with SMTP id f7mr23305978pfe.104.1524562792899; Tue, 24 Apr 2018 02:39:52 -0700 (PDT) Received: from localhost ([122.172.61.40]) by smtp.gmail.com with ESMTPSA id a3sm21551405pgc.2.2018.04.24.02.39.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 02:39:52 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Miquel Raynal Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot Subject: [PATCH V3 1/3] cpufreq: dt: Allow platform specific suspend/resume callbacks Date: Tue, 24 Apr 2018 15:09:45 +0530 Message-Id: <012d28b80a343dd3cf2dc369f0f9cca2699536e2.1524561482.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Platforms may need to implement platform specific suspend/resume hooks. Update cpufreq-dt driver's platform data to contain those for such platforms. Signed-off-by: Viresh Kumar Tested-by: Miquel Raynal --- drivers/cpufreq/cpufreq-dt.c | 10 ++++++++-- drivers/cpufreq/cpufreq-dt.h | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 190ea0dccb79..0a9ebf00be46 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -346,8 +346,14 @@ static int dt_cpufreq_probe(struct platform_device *pdev) if (ret) return ret; - if (data && data->have_governor_per_policy) - dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY; + if (data) { + if (data->have_governor_per_policy) + dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY; + + dt_cpufreq_driver.resume = data->resume; + if (data->suspend) + dt_cpufreq_driver.suspend = data->suspend; + } ret = cpufreq_register_driver(&dt_cpufreq_driver); if (ret) diff --git a/drivers/cpufreq/cpufreq-dt.h b/drivers/cpufreq/cpufreq-dt.h index 54d774e46c43..d5aeea13433e 100644 --- a/drivers/cpufreq/cpufreq-dt.h +++ b/drivers/cpufreq/cpufreq-dt.h @@ -12,8 +12,13 @@ #include +struct cpufreq_policy; + struct cpufreq_dt_platform_data { bool have_governor_per_policy; + + int (*suspend)(struct cpufreq_policy *policy); + int (*resume)(struct cpufreq_policy *policy); }; #endif /* __CPUFREQ_DT_H__ */