From patchwork Mon Sep 19 04:38:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keguang Zhang X-Patchwork-Id: 9338509 X-Patchwork-Delegate: sboyd@codeaurora.org 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 0EBCC60CF5 for ; Mon, 19 Sep 2016 04:39:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F291128DA6 for ; Mon, 19 Sep 2016 04:39:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE90928EF7; Mon, 19 Sep 2016 04:39:35 +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 891BF28F7C for ; Mon, 19 Sep 2016 04:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934266AbcISEjd (ORCPT ); Mon, 19 Sep 2016 00:39:33 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34968 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936361AbcISEjZ (ORCPT ); Mon, 19 Sep 2016 00:39:25 -0400 Received: by mail-pf0-f196.google.com with SMTP id 6so3687874pfl.2; Sun, 18 Sep 2016 21:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Zbys2TN4oO80r3FVBn4g3G85fYi1PFofP8BA4NSdeiY=; b=C8oeLnHCLCAUMakqD9DOUxX/BLWpKDBCrJtBKHWSzK3LO784zs6HjEAvYMUA51YueR RnsKCSnOhti225ntYe+wKn3tG+NTt1gAfk813X002QfHuOsiWI+mesDSqn+Ax5dBQzWt uVbUsSmMekFvr93f6asqvMz1mbQgixBrCTJnwBc9/EdcQZaJXr7NBBqqo9XAHegAqLsc GDpr2y+lQtdVACfmZmRlgdTBUGo3WgrJLdlcSqOdTeBWpKHHZ3fHcuxr2rSrJ3xQMg11 VhmxqCCRY/v2fOnsp++5Pzs8X3fkKwQKE3mDCpVJRHjqenO8z2rM4ony2O8sIX9UOzQv XrQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Zbys2TN4oO80r3FVBn4g3G85fYi1PFofP8BA4NSdeiY=; b=amOKu3wwIUxFtoPhHpM+mnl8cI3sb7uaX2acyTa7My+FRI5w0lOYZzpNeCEi4KhSpP ap4RxJzl4CMUBl1jaXelKH3auGg8SfVLhrDt7Ob4+7YinRr7l9fWM216Xcq7CxVp4dMf NxsmT3lGgq8iJSdcD5UD54hrgxWwkSgYecHCclYQxjFVtgNKopSbFwwoeKQHb1FlmR9M pulIg7rzWnmjFAWbxt6LsBp0VxjgRvio/f4zKz4YtSoXEtjLLDUHkTlgakTMHXreJSsl KWG1TM+c0UDSgx7nJhxn2hh4yDuaJrh6I+2OorDf/YXirvBM1fEmLOz5YDVvmNyqx47i P81g== X-Gm-Message-State: AE9vXwN/L3boalty4gMPVFlU7PK2dyuriNWtPRQoKekXrvBkvNIs6cZu1jyxBEPj735Qdw== X-Received: by 10.98.28.146 with SMTP id c140mr39270988pfc.158.1474259964539; Sun, 18 Sep 2016 21:39:24 -0700 (PDT) Received: from localhost.localdomain ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id p7sm19598950paa.3.2016.09.18.21.39.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 18 Sep 2016 21:39:23 -0700 (PDT) From: Keguang Zhang To: linux-clk@vger.kernel.org, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Cc: Michael Turquette , Stephen Boyd , Kelvin Cheung Subject: [PATCH V1 3/3] clk: Loongson1: Make use of GENMASK Date: Mon, 19 Sep 2016 12:38:56 +0800 Message-Id: <1474259936-9657-4-git-send-email-keguang.zhang@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1474259936-9657-1-git-send-email-keguang.zhang@gmail.com> References: <1474259936-9657-1-git-send-email-keguang.zhang@gmail.com> 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: Kelvin Cheung Make use of GENMASK instead of open coding the equivalent operation, and update the PLL formula. Signed-off-by: Kelvin Cheung --- drivers/clk/loongson1/clk-loongson1b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/loongson1/clk-loongson1b.c b/drivers/clk/loongson1/clk-loongson1b.c index 4b3d9d2..f36a97e 100644 --- a/drivers/clk/loongson1/clk-loongson1b.c +++ b/drivers/clk/loongson1/clk-loongson1b.c @@ -26,7 +26,7 @@ static unsigned long ls1x_pll_recalc_rate(struct clk_hw *hw, u32 pll, rate; pll = __raw_readl(LS1X_CLK_PLL_FREQ); - rate = 12 + (pll & 0x3f) + (((pll >> 8) & 0x3ff) >> 10); + rate = 12 + (pll & GENMASK(5, 0)); rate *= OSC; rate >>= 1;