Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755455AbbBBNhL (ORCPT ); Mon, 2 Feb 2015 08:37:11 -0500 Received: from mga11.intel.com ([192.55.52.93]:44927 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933181AbbBBNhH (ORCPT ); Mon, 2 Feb 2015 08:37:07 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,506,1418112000"; d="scan'208";a="660308118" From: Heikki Krogerus To: Mike Turquette Cc: Stephen Boyd , linux-kernel@vger.kernel.org Subject: [PATCH] clk: fractional-divider: support for divider bypassing Date: Mon, 2 Feb 2015 15:37:04 +0200 Message-Id: <1422884224-21748-1-git-send-email-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1008 Lines: 31 If the divider or multiplier values values are 0 in the register, bypassing the divider and returning the parent clock rate in clk_fd_recalc_rate(). Signed-off-by: Heikki Krogerus --- drivers/clk/clk-fractional-divider.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c index dc91da7..34d6c51 100644 --- a/drivers/clk/clk-fractional-divider.c +++ b/drivers/clk/clk-fractional-divider.c @@ -36,6 +36,9 @@ static unsigned long clk_fd_recalc_rate(struct clk_hw *hw, m = (val & fd->mmask) >> fd->mshift; n = (val & fd->nmask) >> fd->nshift; + if (!n || !m) + return parent_rate; + ret = (u64)parent_rate * m; do_div(ret, n); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/