From patchwork Thu Nov 19 19:20:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loc Ho X-Patchwork-Id: 7660861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9A457BF90C for ; Thu, 19 Nov 2015 19:22:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC1F1205F4 for ; Thu, 19 Nov 2015 19:22:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E859E205B4 for ; Thu, 19 Nov 2015 19:22:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZzUlX-0007qt-GL; Thu, 19 Nov 2015 19:21:07 +0000 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZzUlT-0007iG-9w for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2015 19:21:04 +0000 Received: by pabfh17 with SMTP id fh17so92820959pab.0 for ; Thu, 19 Nov 2015 11:20:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id; bh=a8nKLszZ02UGa62fUBi6CWSRQkLq25xettNhtkdLwf8=; b=mK5tnFl1Jmd79ts91bsGcfAYzeKiAM+859KY1sNYBICCZQB/hyXX+AyOJclvi37UdU gbPgJc1S6p75bFTHgCZayKjU6uKUbGQM8xtr1d+uVza7Zg+Ex5UA7N8Tx6xGNTHqY7KN /AJCSCdTZ/wed0n/yeBLlSfPvwAAsgGiY0d1M= 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; bh=a8nKLszZ02UGa62fUBi6CWSRQkLq25xettNhtkdLwf8=; b=Yyrd05Z6qQx/9V4gEaACGLyqXXcrqGVpX6Mjfg/4lrXIfpI009jlmLFuqau5MXWuMA GegabMS8QZQG1AM4BuQFTHAf6hNv96c8L6L/9LXJU6C2GbC9ftJ0TZJPdhe8VJRj6meo 8RemTfWPe8FV97HJQJ/A7oGj9aX/cm35wZUwqzr5GGEAPLjq1A0ySpaCZctXbQzveHNn 881ISU/3e4uuFWyNWOg58LHtmsYOx1DGxRL0bxqAqPQQGOi1Ht/78ceZZXKDMA7W21Cd ts+SqFmX/oF3/1yDfzdx95xICVgXL7c2M8iqtDd2Iadnh/KPfON16bvMc+K1hPaUg2jn 7E5A== X-Gm-Message-State: ALoCoQlhDFBt5mVbwFlJw8bGcMKvSrz6b1Q/2sZg8jwFmgNRM3Qp+aF5h5MIsOgbIXla04Fgnnjo X-Received: by 10.66.90.165 with SMTP id bx5mr12996525pab.25.1447960842347; Thu, 19 Nov 2015 11:20:42 -0800 (PST) Received: from localhost.localdomain ([198.137.200.11]) by smtp.gmail.com with ESMTPSA id by6sm12404167pab.25.2015.11.19.11.20.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Nov 2015 11:20:41 -0800 (PST) From: Loc Ho To: mturquette@baylibre.com, sboyd@codeaurora.org Subject: [PATCH] clk: xgene: Fix divider with non-zero shift value Date: Thu, 19 Nov 2015 12:20:30 -0700 Message-Id: <1447960830-8675-1-git-send-email-lho@apm.com> X-Mailer: git-send-email 1.7.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151119_112103_382632_DBEF6E75 X-CRM114-Status: GOOD ( 12.34 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@apm.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Loc Ho MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The X-Gene clock driver missed the divider shift operation when set the divider value. Signed-off-by: Loc Ho --- drivers/clk/clk-xgene.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c index 27c0da2..10224b0 100644 --- a/drivers/clk/clk-xgene.c +++ b/drivers/clk/clk-xgene.c @@ -351,7 +351,8 @@ static int xgene_clk_set_rate(struct clk_hw *hw, unsigned long rate, /* Set new divider */ data = xgene_clk_read(pclk->param.divider_reg + pclk->param.reg_divider_offset); - data &= ~((1 << pclk->param.reg_divider_width) - 1); + data &= ~((1 << pclk->param.reg_divider_width) - 1) + << pclk->param.reg_divider_shift; data |= divider; xgene_clk_write(data, pclk->param.divider_reg + pclk->param.reg_divider_offset);