Lines Matching +full:clk +full:- +full:phase +full:-
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
7 #include <linux/clk-provider.h>
8 #include "clkc-audio.h"
12 * The phase of mst_sclk clock output can be controlled independently
16 * If necessary, we can still control the phase in the tdm block
20 meson_clk_triphase_data(struct clk_regmap *clk) in meson_clk_triphase_data() argument
22 return (struct meson_clk_triphase_data *)clk->data; in meson_clk_triphase_data()
27 struct clk_regmap *clk = to_clk_regmap(hw); in meson_clk_triphase_sync() local
28 struct meson_clk_triphase_data *tph = meson_clk_triphase_data(clk); in meson_clk_triphase_sync()
31 /* Get phase 0 and sync it to phase 1 and 2 */ in meson_clk_triphase_sync()
32 val = meson_parm_read(clk->map, &tph->ph0); in meson_clk_triphase_sync()
33 meson_parm_write(clk->map, &tph->ph1, val); in meson_clk_triphase_sync()
34 meson_parm_write(clk->map, &tph->ph2, val); in meson_clk_triphase_sync()
39 struct clk_regmap *clk = to_clk_regmap(hw); in meson_clk_triphase_get_phase() local
40 struct meson_clk_triphase_data *tph = meson_clk_triphase_data(clk); in meson_clk_triphase_get_phase()
43 /* Phase are in sync, reading phase 0 is enough */ in meson_clk_triphase_get_phase()
44 val = meson_parm_read(clk->map, &tph->ph0); in meson_clk_triphase_get_phase()
46 return meson_clk_degrees_from_val(val, tph->ph0.width); in meson_clk_triphase_get_phase()
51 struct clk_regmap *clk = to_clk_regmap(hw); in meson_clk_triphase_set_phase() local
52 struct meson_clk_triphase_data *tph = meson_clk_triphase_data(clk); in meson_clk_triphase_set_phase()
55 val = meson_clk_degrees_to_val(degrees, tph->ph0.width); in meson_clk_triphase_set_phase()
56 meson_parm_write(clk->map, &tph->ph0, val); in meson_clk_triphase_set_phase()
57 meson_parm_write(clk->map, &tph->ph1, val); in meson_clk_triphase_set_phase()
58 meson_parm_write(clk->map, &tph->ph2, val); in meson_clk_triphase_set_phase()