From patchwork Tue Apr 24 06:07:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10358677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F4AC601BE for ; Tue, 24 Apr 2018 06:08:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60DB528B8C for ; Tue, 24 Apr 2018 06:08:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5598F28BDA; Tue, 24 Apr 2018 06:08:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08E2228B8C for ; Tue, 24 Apr 2018 06:08:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756213AbeDXGI0 (ORCPT ); Tue, 24 Apr 2018 02:08:26 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:40291 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756208AbeDXGIZ (ORCPT ); Tue, 24 Apr 2018 02:08:25 -0400 Received: by mail-pf0-f194.google.com with SMTP id f189so2245143pfa.7 for ; Mon, 23 Apr 2018 23:08:25 -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=WJUC6XeR6FAzawrBGixqPEcqYbV4w00vw6FiMaOqXnw=; b=RTsWvb2gFI4hcwbW6l6f8ITyji5e/1507Mn7rC7Eo/1cJxGY8QpPv52HwSecM32ikh K6icj1G8ymXPMG7yA8t/d1EfjQP/W6nyVGCR6kUny+8+kAHpRrNv7J+714F+li4LLCCT VDCixLZ+Vcddufgg5T6Y5qz94l6KdqQn2eO8I= 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=WJUC6XeR6FAzawrBGixqPEcqYbV4w00vw6FiMaOqXnw=; b=WroVjIrSIP107QfplKVKSB+0IPsp0o+OW6rk2eUc91dNPX1avXlhzjxHKRtlrpmf2I WWur5pC3UXJV2/W6dyH5jBN3wghMIA/OTMpcn98J/Cu6pbM+V0Tf9ZC+sL5XH0P+SDjI B33FarTwSp23cRLeBTF+b4+GVmMiq1diQudDIYvzz4ggE4w7gwhz60pP126pqQrdMwhb 5T+uAyDRZ81+/l2UfX8XoCJkMMJAkaNwFXFBlJTp0xJ0zsZux1trr+N3D2c+F45ix3U5 y+vq21w6RlmvZwQhT9HwmAedTSKL09+vNwE5Omdsq8crf6MDpIs9d0YwuZ229z96FLr3 Tt9A== X-Gm-Message-State: ALQs6tBG63SW7+32IeyQyPBd4kRRN+FRsOVom46KShO0lQuhGvo8gUdJ Pm79F1Z1FDQH48vg10jgWnMS4A== X-Google-Smtp-Source: AIpwx4/DtMgv/TWSRwL5bcLKjsEyBxV0rnyTgYAdF/+6gCTf1Z938K5AuKnzEYbKVRVw/QToVQIliw== X-Received: by 10.99.120.202 with SMTP id t193mr19344138pgc.255.1524550105295; Mon, 23 Apr 2018 23:08:25 -0700 (PDT) Received: from localhost ([122.172.61.40]) by smtp.gmail.com with ESMTPSA id o88sm30049575pfk.91.2018.04.23.23.08.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 23:08:24 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Miquel Raynal Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot Subject: [PATCH 1/3] cpufreq: dt: Allow platform specific suspend/resume callbacks Date: Tue, 24 Apr 2018 11:37:34 +0530 Message-Id: <031b87c0dd05625c83ac920a8da661e72afb4b02.1524549644.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 X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/cpufreq/cpufreq-dt.c | 10 ++++++++-- drivers/cpufreq/cpufreq-dt.h | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) 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__ */