From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753300AbbCKKkB (ORCPT ); Wed, 11 Mar 2015 06:40:01 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:38821 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751562AbbCKKhq (ORCPT ); Wed, 11 Mar 2015 06:37:46 -0400 From: Tomeu Vizoso To: linux-tegra@vger.kernel.org Cc: Mikko Perttunen , Tomeu Vizoso , Mike Turquette , Stephen Boyd , linux-kernel@vger.kernel.org Subject: [PATCH v7 12/18] clk: Expose clk_hw_reparent to providers Date: Wed, 11 Mar 2015 11:34:25 +0100 Message-Id: <1426070126-26910-13-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426070126-26910-1-git-send-email-tomeu.vizoso@collabora.com> References: <1426070126-26910-1-git-send-email-tomeu.vizoso@collabora.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To be used by clock implementations for switching to a new parent during rate change. Signed-off-by: Tomeu Vizoso --- drivers/clk/clk.c | 8 ++++++++ include/linux/clk-provider.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index eb01529..f793025 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1968,6 +1968,14 @@ static void clk_core_reparent(struct clk_core *clk, __clk_recalc_rates(clk, POST_RATE_CHANGE); } +void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent) +{ + if (!hw) + return; + + clk_core_reparent(hw->core, !new_parent ? NULL : new_parent->core); +} + /** * clk_has_parent - check if a clock is a possible parent for another * @clk: clock source diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 5591ea7..28abf1b 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -589,6 +589,7 @@ long __clk_mux_determine_rate_closest(struct clk_hw *hw, unsigned long rate, unsigned long max_rate, unsigned long *best_parent_rate, struct clk_hw **best_parent_p); +void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent); static inline void __clk_hw_set_clk(struct clk_hw *dst, struct clk_hw *src) { -- 2.1.0