diff options
author | Stephen Boyd <sboyd@kernel.org> | 2018-10-19 01:41:21 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2018-10-19 01:41:21 +0300 |
commit | 8a69f1d4707a69faab58d9735c2cb1898140124a (patch) | |
tree | 1f4e1f45a596a63baec951c42b9e62914f585737 /drivers/clk/ti/mux.c | |
parent | cc2adbe370f190fb13531ba1f55a9b0d9dc8828a (diff) | |
parent | a72d785021cb92cc0abd4bb3d75607c82150fade (diff) | |
download | linux-8a69f1d4707a69faab58d9735c2cb1898140124a.tar.xz |
Merge branch 'clk-ti' into clk-next
* clk-ti:
clk: ti: Prepare for remove of OF node name
clk: Clean up suspend/resume coding style
clk: ti: Add functions to save/restore clk context
clk: clk: Add clk_gate_restore_context function
clk: Add functions to save/restore clock context en-masse
clk: ti: dra7: add new clkctrl data
clk: ti: dra7xx: rename existing clkctrl data as compat data
clk: ti: am43xx: add new clkctrl data for am43xx
clk: ti: am43xx: rename existing clkctrl data as compat data
clk: ti: am33xx: add new clkctrl data for am33xx
clk: ti: am33xx: rename existing clkctrl data as compat data
clk: ti: clkctrl: replace dashes from clkdm name with underscore
clk: ti: clkctrl: support multiple clkctrl nodes under a cm node
dt-bindings: clock: dra7xx: add clkctrl indices for new data layout
dt-bindings: clock: am43xx: add clkctrl indices for new data layout
dt-bindings: clock: am33xx: add clkctrl indices for new data layout
Diffstat (limited to 'drivers/clk/ti/mux.c')
-rw-r--r-- | drivers/clk/ti/mux.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c index 18be7eb51546..883bdde94d04 100644 --- a/drivers/clk/ti/mux.c +++ b/drivers/clk/ti/mux.c @@ -91,10 +91,39 @@ static int ti_clk_mux_set_parent(struct clk_hw *hw, u8 index) return 0; } +/** + * clk_mux_save_context - Save the parent selcted in the mux + * @hw: pointer struct clk_hw + * + * Save the parent mux value. + */ +static int clk_mux_save_context(struct clk_hw *hw) +{ + struct clk_omap_mux *mux = to_clk_omap_mux(hw); + + mux->saved_parent = ti_clk_mux_get_parent(hw); + return 0; +} + +/** + * clk_mux_restore_context - Restore the parent in the mux + * @hw: pointer struct clk_hw + * + * Restore the saved parent mux value. + */ +static void clk_mux_restore_context(struct clk_hw *hw) +{ + struct clk_omap_mux *mux = to_clk_omap_mux(hw); + + ti_clk_mux_set_parent(hw, mux->saved_parent); +} + const struct clk_ops ti_clk_mux_ops = { .get_parent = ti_clk_mux_get_parent, .set_parent = ti_clk_mux_set_parent, .determine_rate = __clk_mux_determine_rate, + .save_context = clk_mux_save_context, + .restore_context = clk_mux_restore_context, }; static struct clk *_register_mux(struct device *dev, const char *name, |