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"
17 struct clk_divider div; member
32 { .div = 6, .val = 5, },
33 { .div = 8, .val = 7, },
34 { .div = 9, .val = 8, },
35 { .div = 10, .val = 9, },
36 { .div = 12, .val = 11, },
37 { .div = 16, .val = 15, },
38 { .div = 18, .val = 17, },
39 { .div = 34, .val = 33, },
40 { .div = 142, .val = 141, },
41 { .div = 850, .val = 849, },
42 { .div = 2126, .val = 2125, },
43 { .div = 4096, .val = 4095, },
66 hw->init = &init; in meson_mx_sdhc_clk_hw_register()
91 return -ENOMEM; in meson_mx_sdhc_register_clkc()
93 clkc_data->src_sel.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
94 clkc_data->src_sel.mask = 0x3; in meson_mx_sdhc_register_clkc()
95 clkc_data->src_sel.shift = 16; in meson_mx_sdhc_register_clkc()
99 &clkc_data->src_sel.hw); in meson_mx_sdhc_register_clkc()
103 clkc_data->div.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
104 clkc_data->div.shift = 0; in meson_mx_sdhc_register_clkc()
105 clkc_data->div.width = 12; in meson_mx_sdhc_register_clkc()
106 clkc_data->div.table = meson_mx_sdhc_div_table; in meson_mx_sdhc_register_clkc()
107 div_parent.hw = &clkc_data->src_sel.hw; in meson_mx_sdhc_register_clkc()
108 ret = meson_mx_sdhc_clk_hw_register(dev, "div", &div_parent, 1, in meson_mx_sdhc_register_clkc()
110 &clkc_data->div.hw); in meson_mx_sdhc_register_clkc()
114 clkc_data->mod_clk_en.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
115 clkc_data->mod_clk_en.bit_idx = 15; in meson_mx_sdhc_register_clkc()
117 &clkc_data->div.hw, in meson_mx_sdhc_register_clkc()
118 &clkc_data->mod_clk_en.hw); in meson_mx_sdhc_register_clkc()
122 clkc_data->tx_clk_en.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
123 clkc_data->tx_clk_en.bit_idx = 14; in meson_mx_sdhc_register_clkc()
125 &clkc_data->div.hw, in meson_mx_sdhc_register_clkc()
126 &clkc_data->tx_clk_en.hw); in meson_mx_sdhc_register_clkc()
130 clkc_data->rx_clk_en.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
131 clkc_data->rx_clk_en.bit_idx = 13; in meson_mx_sdhc_register_clkc()
133 &clkc_data->div.hw, in meson_mx_sdhc_register_clkc()
134 &clkc_data->rx_clk_en.hw); in meson_mx_sdhc_register_clkc()
138 clkc_data->sd_clk_en.reg = base + MESON_SDHC_CLKC; in meson_mx_sdhc_register_clkc()
139 clkc_data->sd_clk_en.bit_idx = 12; in meson_mx_sdhc_register_clkc()
141 &clkc_data->div.hw, in meson_mx_sdhc_register_clkc()
142 &clkc_data->sd_clk_en.hw); in meson_mx_sdhc_register_clkc()
147 * TODO: Replace clk_hw.clk with devm_clk_hw_get_clk() once that is in meson_mx_sdhc_register_clkc()
150 clk_bulk_data[0].clk = clkc_data->mod_clk_en.hw.clk; in meson_mx_sdhc_register_clkc()
151 clk_bulk_data[1].clk = clkc_data->sd_clk_en.hw.clk; in meson_mx_sdhc_register_clkc()
152 clk_bulk_data[2].clk = clkc_data->tx_clk_en.hw.clk; in meson_mx_sdhc_register_clkc()
153 clk_bulk_data[3].clk = clkc_data->rx_clk_en.hw.clk; in meson_mx_sdhc_register_clkc()