From patchwork Wed Apr 19 17:46:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Kaneko X-Patchwork-Id: 9688501 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 7871D602DC for ; Wed, 19 Apr 2017 17:48:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ECB528354 for ; Wed, 19 Apr 2017 17:48:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63B15283E2; Wed, 19 Apr 2017 17:48:07 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 A22A428387 for ; Wed, 19 Apr 2017 17:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968770AbdDSRsF (ORCPT ); Wed, 19 Apr 2017 13:48:05 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:36649 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968685AbdDSRsE (ORCPT ); Wed, 19 Apr 2017 13:48:04 -0400 Received: by mail-io0-f195.google.com with SMTP id x86so5617356ioe.3; Wed, 19 Apr 2017 10:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yjLLzXwvbiBpgDxWOdPgxqcAYcz7xfW58lpWU7p7/N8=; b=TJw4BPya1zCvd6POLXsOGat6Vrq7PADJ/kTNSWeDsMMgwEkzhQFAliQOl/8w2VFEEU aPdHPbkbYcVhrOHr+FjdhRXzIf+2yL1Zo/36krkyvQTAzcb6VDeu6OogPUH9IsDBRJfV /pFz43GI9INOhaDvaJQXOaIJIiaXqDdh/qtZ+cBiRxGH6o6A3I6Qr2t3auCX9AZyM0Fx 5NT9EnBWLFsP5ics2mGBVrJm+x6p7NGeex+N84YB44BFMDxYac0WtNBVEOogM4Y2bZj3 j/Qts+HouruKNJb2QYfKSuHjT4DFIOOcQjHiTRNDCFHFtedz3CCR5qEVIBSQfNU6JtFi /Kbg== 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; bh=yjLLzXwvbiBpgDxWOdPgxqcAYcz7xfW58lpWU7p7/N8=; b=PTmD34jhChkEeDlkvcFaj5mdx7+uX2FVRAdfJ8P2+g1+g9Nv6THOQcr+/nYRAnwvfZ BMQMGBrppuWQH1jJMRLBrV81pl9JyWAFZ1C/W84pnE36fOeI6eITImnQeLliPyH8FGap 721/Ye+77wR/+4DDkxfrZrliPrYFLUU2M5CKcnsizPzD/f4AGTzPZyGBdXgbuVJlbJLK Ft89tiv6jjLYnDGSQQ/Zr8gfY5AVegUqpyNs7UwRGXoSjxumhHalsYFtZyh+8obGH5cb ixl02UY7dsYy8CQPU/copSQqeMKEYttDq+d+1Ge3q7trFOYYOaIjg7rPcf0La7FKkv43 l1MA== X-Gm-Message-State: AN3rC/42+vQQghb40imDWyiVHNOOxgOpTLonVk1cdrsTqwXP1eUVQm0f /jV7/N4uPru6dA== X-Received: by 10.99.160.1 with SMTP id r1mr4023167pge.37.1492624083303; Wed, 19 Apr 2017 10:48:03 -0700 (PDT) Received: from localhost.localdomain (KD118152108246.ppp-bb.dion.ne.jp. [118.152.108.246]) by smtp.gmail.com with ESMTPSA id x68sm5760574pgx.57.2017.04.19.10.48.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Apr 2017 10:48:02 -0700 (PDT) From: Yoshihiro Kaneko To: linux-clk@vger.kernel.org Cc: Michael Turquette , Stephen Boyd , Geert Uytterhoeven , Simon Horman , Magnus Damm , linux-renesas-soc@vger.kernel.org Subject: [PATCH] clk: cs2000: Add cs2000_set_saved_rate Date: Thu, 20 Apr 2017 02:46:31 +0900 Message-Id: <1492624001-3758-11-git-send-email-ykaneko0929@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Gaku Inami This patch adds the common function to reset the clk rate in order to be able to use it in other cases. Signed-off-by: Gaku Inami Signed-off-by: Hiroyuki Yokoyama Signed-off-by: Yoshihiro Kaneko Acked-by: Kuninori Morimoto --- This patch is based on the clk-next branch of linux-clk tree. drivers/clk/clk-cs2000-cp.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c index 4df38c5..5b3516d 100644 --- a/drivers/clk/clk-cs2000-cp.c +++ b/drivers/clk/clk-cs2000-cp.c @@ -324,6 +324,15 @@ static int cs2000_set_rate(struct clk_hw *hw, return __cs2000_set_rate(priv, ch, rate, parent_rate); } +static int cs2000_set_saved_rate(struct cs2000_priv *priv) +{ + int ch = 0; /* it uses ch0 only at this point */ + + return __cs2000_set_rate(priv, ch, + priv->saved_rate, + priv->saved_parent_rate); +} + static int cs2000_enable(struct clk_hw *hw) { struct cs2000_priv *priv = hw_to_priv(hw); @@ -516,11 +525,8 @@ static int cs2000_probe(struct i2c_client *client, static int cs2000_resume(struct device *dev) { struct cs2000_priv *priv = dev_get_drvdata(dev); - int ch = 0; /* it uses ch0 only at this point */ - return __cs2000_set_rate(priv, ch, - priv->saved_rate, - priv->saved_parent_rate); + return cs2000_set_saved_rate(priv); } static const struct dev_pm_ops cs2000_pm_ops = {