Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928AbbDGHql (ORCPT ); Tue, 7 Apr 2015 03:46:41 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:53734 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbbDGHqi (ORCPT ); Tue, 7 Apr 2015 03:46:38 -0400 X-AuditID: cbfee691-f79ca6d00000456a-b6-55238b5b04eb From: Joonyoung Shim To: linux-clk@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mturquette@linaro.org, sboyd@codeaurora.org, haojian.zhuang@gmail.com, james.hogan@imgtec.com, jy0922.shim@samsung.com Subject: [PATCH 2/2] clk: divider: fix to set parent rate from CLK_DIVIDER_READ_ONLY flag Date: Tue, 07 Apr 2015 16:46:46 +0900 Message-id: <1428392806-14538-2-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1428392806-14538-1-git-send-email-jy0922.shim@samsung.com> References: <1428392806-14538-1-git-send-email-jy0922.shim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRmVeSWpSXmKPExsWyRsSkSDe6WznUYM1Ba4sL68wt3s17wWzx 4t5FFouPPfdYLS7vmsNm8XTCRTaLH2e6WRzYPS739TJ57Jx1l92jZ+cZRo871/awefRtWcXo 8XmTXABbFJdNSmpOZllqkb5dAldGc9sWloLFHBW37sxga2D8wtbFyMkhIWAicad1ISOELSZx 4d56oDgXh5DAUkaJ3xOOs8MU/bvwjgUiMZ1RorX/ADOE84NR4vjjxWDtbAJ6Ene2HWcCsUUE ZCVuHfsJNopZYBajxNw1i8H2CQtES1ydfZoFxGYRUJXomzYRrJlXwF1iwf1uJoh1chInj01m BbE5BTwkLp1pAKsXAqq5/PAO2BkSAvPYJfqm32GCGCQg8W3yIaAEB1BCVmITyHUgcyQlDq64 wTKBUXgBI8MqRtHUguSC4qT0IlO94sTc4tK8dL3k/NxNjMCQP/3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tO185dl9Y9/OjKtK2vFnhtPJLTrne7L3T/9NNT+TdYHTi7vuwPX/rnjMdrCxzO9F5T 2+ec8efNlWU6m60mR88SPFe45qWPzhM3rVOlZj4Mb/6Gh8fyK7EUZyQaajEXFScCAFmRN6G+ AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 36 The round_rate callback function will returns alway same parent clk rate of divider with CLK_DIVIDER_READ_ONLY flag. If be used CLK_SET_RATE_PARENT flag with CLK_DIVIDER_READ_ONLY flag, then never change parent clk rate anymore. >From this case, this patch allows to change parent clk rate. Signed-off-by: Joonyoung Shim --- drivers/clk/clk-divider.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index ce34d29a..37e285e 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -352,6 +352,11 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate, bestdiv = readl(divider->reg) >> divider->shift; bestdiv &= div_mask(divider->width); bestdiv = _get_div(divider->table, bestdiv, divider->flags); + + if ((__clk_get_flags(hw->clk) & CLK_SET_RATE_PARENT)) + *prate = __clk_round_rate(__clk_get_parent(hw->clk), + rate); + return DIV_ROUND_UP(*prate, bestdiv); } -- 1.9.1 -- 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/