Lines Matching +full:clk +full:- +full:div
1 // SPDX-License-Identifier: GPL-2.0+
8 #include <linux/clk.h>
9 #include <linux/clk-provider.h>
13 #include "meson-mx-sdhc.h"
19 struct clk_divider div; member
34 { .div = 6, .val = 5, },
35 { .div = 8, .val = 7, },
36 { .div = 9, .val = 8, },
37 { .div = 10, .val = 9, },
38 { .div = 12, .val = 11, },
39 { .div = 16, .val = 15, },
40 { .div = 18, .val = 17, },
41 { .div = 34, .val = 33, },
42 { .div = 142, .val = 141, },
43 { .div = 850, .val = 849, },
44 { .div = 2126, .val = 2125, },
45 { .div = 4096, .val = 4095, },
68 hw->init = &init; in meson_mx_sdhc_clk_hw_register()
93 return -ENOMEM; in meson_mx_sdhc_register_clkc()
95 clkc_data->src_sel.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
96 clkc_data->src_sel.mask = 0x3; in meson_mx_sdhc_register_clkc()
97 clkc_data->src_sel.shift = 16; in meson_mx_sdhc_register_clkc()
101 &clkc_data->src_sel.hw); in meson_mx_sdhc_register_clkc()
105 clkc_data->div.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
106 clkc_data->div.shift = 0; in meson_mx_sdhc_register_clkc()
107 clkc_data->div.width = 12; in meson_mx_sdhc_register_clkc()
108 clkc_data->div.table = meson_mx_sdhc_div_table; in meson_mx_sdhc_register_clkc()
109 div_parent.hw = &clkc_data->src_sel.hw; in meson_mx_sdhc_register_clkc()
110 ret = meson_mx_sdhc_clk_hw_register(dev, "div", &div_parent, 1, in meson_mx_sdhc_register_clkc()
112 &clkc_data->div.hw); in meson_mx_sdhc_register_clkc()
116 clkc_data->mod_clk_en.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
117 clkc_data->mod_clk_en.bit_idx = 15; in meson_mx_sdhc_register_clkc()
119 &clkc_data->div.hw, in meson_mx_sdhc_register_clkc()
120 &clkc_data->mod_clk_en.hw); in meson_mx_sdhc_register_clkc()
124 clkc_data->tx_clk_en.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
125 clkc_data->tx_clk_en.bit_idx = 14; in meson_mx_sdhc_register_clkc()
127 &clkc_data->div.hw, in meson_mx_sdhc_register_clkc()
128 &clkc_data->tx_clk_en.hw); in meson_mx_sdhc_register_clkc()
132 clkc_data->rx_clk_en.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
133 clkc_data->rx_clk_en.bit_idx = 13; in meson_mx_sdhc_register_clkc()
135 &clkc_data->div.hw, in meson_mx_sdhc_register_clkc()
136 &clkc_data->rx_clk_en.hw); in meson_mx_sdhc_register_clkc()
140 clkc_data->sd_clk_en.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
141 clkc_data->sd_clk_en.bit_idx = 12; in meson_mx_sdhc_register_clkc()
143 &clkc_data->div.hw, in meson_mx_sdhc_register_clkc()
144 &clkc_data->sd_clk_en.hw); in meson_mx_sdhc_register_clkc()
149 * TODO: Replace clk_hw.clk with devm_clk_hw_get_clk() once that is in meson_mx_sdhc_register_clkc()
152 clk_bulk_data[0].clk = clkc_data->mod_clk_en.hw.clk; in meson_mx_sdhc_register_clkc()
153 clk_bulk_data[1].clk = clkc_data->sd_clk_en.hw.clk; in meson_mx_sdhc_register_clkc()
154 clk_bulk_data[2].clk = clkc_data->tx_clk_en.hw.clk; in meson_mx_sdhc_register_clkc()
155 clk_bulk_data[3].clk = clkc_data->rx_clk_en.hw.clk; in meson_mx_sdhc_register_clkc()