diff options
| -rw-r--r-- | drivers/clk/meson/gxbb.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 65f2599e5243..ecf9a8f6281c 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #include "gxbb.h" | 16 | #include "gxbb.h" |
| 17 | #include "clk-regmap.h" | 17 | #include "clk-regmap.h" |
| 18 | 18 | ||
| 19 | #define IN_PREFIX "ee-in-" | ||
| 20 | |||
| 19 | static DEFINE_SPINLOCK(meson_clk_lock); | 21 | static DEFINE_SPINLOCK(meson_clk_lock); |
| 20 | 22 | ||
| 21 | static const struct pll_params_table gxbb_gp0_pll_params_table[] = { | 23 | static const struct pll_params_table gxbb_gp0_pll_params_table[] = { |
| @@ -118,7 +120,7 @@ static struct clk_regmap gxbb_fixed_pll_dco = { | |||
| 118 | .hw.init = &(struct clk_init_data){ | 120 | .hw.init = &(struct clk_init_data){ |
| 119 | .name = "fixed_pll_dco", | 121 | .name = "fixed_pll_dco", |
| 120 | .ops = &meson_clk_pll_ro_ops, | 122 | .ops = &meson_clk_pll_ro_ops, |
| 121 | .parent_names = (const char *[]){ "xtal" }, | 123 | .parent_names = (const char *[]){ IN_PREFIX "xtal" }, |
| 122 | .num_parents = 1, | 124 | .num_parents = 1, |
| 123 | }, | 125 | }, |
| 124 | }; | 126 | }; |
| @@ -148,7 +150,7 @@ static struct clk_fixed_factor gxbb_hdmi_pll_pre_mult = { | |||
| 148 | .hw.init = &(struct clk_init_data){ | 150 | .hw.init = &(struct clk_init_data){ |
| 149 | .name = "hdmi_pll_pre_mult", | 151 | .name = "hdmi_pll_pre_mult", |
| 150 | .ops = &clk_fixed_factor_ops, | 152 | .ops = &clk_fixed_factor_ops, |
| 151 | .parent_names = (const char *[]){ "xtal" }, | 153 | .parent_names = (const char *[]){ IN_PREFIX "xtal" }, |
| 152 | .num_parents = 1, | 154 | .num_parents = 1, |
| 153 | }, | 155 | }, |
| 154 | }; | 156 | }; |
| @@ -241,7 +243,7 @@ static struct clk_regmap gxl_hdmi_pll_dco = { | |||
| 241 | .hw.init = &(struct clk_init_data){ | 243 | .hw.init = &(struct clk_init_data){ |
| 242 | .name = "hdmi_pll_dco", | 244 | .name = "hdmi_pll_dco", |
| 243 | .ops = &meson_clk_pll_ro_ops, | 245 | .ops = &meson_clk_pll_ro_ops, |
| 244 | .parent_names = (const char *[]){ "xtal" }, | 246 | .parent_names = (const char *[]){ IN_PREFIX "xtal" }, |
| 245 | .num_parents = 1, | 247 | .num_parents = 1, |
| 246 | /* | 248 | /* |
| 247 | * Display directly handle hdmi pll registers ATM, we need | 249 | * Display directly handle hdmi pll registers ATM, we need |
| @@ -378,7 +380,7 @@ static struct clk_regmap gxbb_sys_pll_dco = { | |||
| 378 | .hw.init = &(struct clk_init_data){ | 380 | .hw.init = &(struct clk_init_data){ |
| 379 | .name = "sys_pll_dco", | 381 | .name = "sys_pll_dco", |
| 380 | .ops = &meson_clk_pll_ro_ops, | 382 | .ops = &meson_clk_pll_ro_ops, |
| 381 | .parent_names = (const char *[]){ "xtal" }, | 383 | .parent_names = (const char *[]){ IN_PREFIX "xtal" }, |
| 382 | .num_parents = 1, | 384 | .num_parents = 1, |
| 383 | }, | 385 | }, |
| 384 | }; | 386 | }; |
| @@ -439,7 +441,7 @@ static struct clk_regmap gxbb_gp0_pll_dco = { | |||
| 439 | .hw.init = &(struct clk_init_data){ | 441 | .hw.init = &(struct clk_init_data){ |
| 440 | .name = "gp0_pll_dco", | 442 | .name = "gp0_pll_dco", |
| 441 | .ops = &meson_clk_pll_ops, | 443 | .ops = &meson_clk_pll_ops, |
| 442 | .parent_names = (const char *[]){ "xtal" }, | 444 | .parent_names = (const char *[]){ IN_PREFIX "xtal" }, |
| 443 | .num_parents = 1, | 445 | .num_parents = 1, |
| 444 | }, | 446 | }, |
| 445 | }; | 447 | }; |
| @@ -491,7 +493,7 @@ static struct clk_regmap gxl_gp0_pll_dco = { | |||
| 491 | .hw.init = &(struct clk_init_data){ | 493 | .hw.init = &(struct clk_init_data){ |
| 492 | .name = "gp0_pll_dco", | 494 | .name = "gp0_pll_dco", |
| 493 | .ops = &meson_clk_pll_ops, | 495 | .ops = &meson_clk_pll_ops, |
| 494 | .parent_names = (const char *[]){ "xtal" }, | 496 | .parent_names = (const char *[]){ IN_PREFIX "xtal" }, |
| 495 | .num_parents = 1, | 497 | .num_parents = 1, |
| 496 | }, | 498 | }, |
| 497 | }; | 499 | }; |
| @@ -789,7 +791,7 @@ static struct clk_regmap gxbb_mpll2 = { | |||
| 789 | 791 | ||
| 790 | static u32 mux_table_clk81[] = { 0, 2, 3, 4, 5, 6, 7 }; | 792 | static u32 mux_table_clk81[] = { 0, 2, 3, 4, 5, 6, 7 }; |
| 791 | static const char * const clk81_parent_names[] = { | 793 | static const char * const clk81_parent_names[] = { |
| 792 | "xtal", "fclk_div7", "mpll1", "mpll2", "fclk_div4", | 794 | IN_PREFIX "xtal", "fclk_div7", "mpll1", "mpll2", "fclk_div4", |
| 793 | "fclk_div3", "fclk_div5" | 795 | "fclk_div3", "fclk_div5" |
| 794 | }; | 796 | }; |
| 795 | 797 | ||
| @@ -852,7 +854,7 @@ static struct clk_regmap gxbb_sar_adc_clk_sel = { | |||
| 852 | .name = "sar_adc_clk_sel", | 854 | .name = "sar_adc_clk_sel", |
| 853 | .ops = &clk_regmap_mux_ops, | 855 | .ops = &clk_regmap_mux_ops, |
| 854 | /* NOTE: The datasheet doesn't list the parents for bit 10 */ | 856 | /* NOTE: The datasheet doesn't list the parents for bit 10 */ |
| 855 | .parent_names = (const char *[]){ "xtal", "clk81", }, | 857 | .parent_names = (const char *[]){ IN_PREFIX "xtal", "clk81", }, |
| 856 | .num_parents = 2, | 858 | .num_parents = 2, |
| 857 | }, | 859 | }, |
| 858 | }; | 860 | }; |
| @@ -891,7 +893,7 @@ static struct clk_regmap gxbb_sar_adc_clk = { | |||
| 891 | */ | 893 | */ |
| 892 | 894 | ||
| 893 | static const char * const gxbb_mali_0_1_parent_names[] = { | 895 | static const char * const gxbb_mali_0_1_parent_names[] = { |
| 894 | "xtal", "gp0_pll", "mpll2", "mpll1", "fclk_div7", | 896 | IN_PREFIX "xtal", "gp0_pll", "mpll2", "mpll1", "fclk_div7", |
| 895 | "fclk_div4", "fclk_div3", "fclk_div5" | 897 | "fclk_div4", "fclk_div3", "fclk_div5" |
| 896 | }; | 898 | }; |
| 897 | 899 | ||
| @@ -1153,7 +1155,7 @@ static struct clk_regmap gxbb_32k_clk = { | |||
| 1153 | }; | 1155 | }; |
| 1154 | 1156 | ||
| 1155 | static const char * const gxbb_32k_clk_parent_names[] = { | 1157 | static const char * const gxbb_32k_clk_parent_names[] = { |
| 1156 | "xtal", "cts_slow_oscin", "fclk_div3", "fclk_div5" | 1158 | IN_PREFIX "xtal", "cts_slow_oscin", "fclk_div3", "fclk_div5" |
| 1157 | }; | 1159 | }; |
| 1158 | 1160 | ||
| 1159 | static struct clk_regmap gxbb_32k_clk_sel = { | 1161 | static struct clk_regmap gxbb_32k_clk_sel = { |
| @@ -1172,7 +1174,7 @@ static struct clk_regmap gxbb_32k_clk_sel = { | |||
| 1172 | }; | 1174 | }; |
| 1173 | 1175 | ||
| 1174 | static const char * const gxbb_sd_emmc_clk0_parent_names[] = { | 1176 | static const char * const gxbb_sd_emmc_clk0_parent_names[] = { |
| 1175 | "xtal", "fclk_div2", "fclk_div3", "fclk_div5", "fclk_div7", | 1177 | IN_PREFIX "xtal", "fclk_div2", "fclk_div3", "fclk_div5", "fclk_div7", |
| 1176 | 1178 | ||
| 1177 | /* | 1179 | /* |
| 1178 | * Following these parent clocks, we should also have had mpll2, mpll3 | 1180 | * Following these parent clocks, we should also have had mpll2, mpll3 |
| @@ -2138,7 +2140,7 @@ static struct clk_regmap gxbb_hdmi_tx = { | |||
| 2138 | /* HDMI Clocks */ | 2140 | /* HDMI Clocks */ |
| 2139 | 2141 | ||
| 2140 | static const char * const gxbb_hdmi_parent_names[] = { | 2142 | static const char * const gxbb_hdmi_parent_names[] = { |
| 2141 | "xtal", "fclk_div4", "fclk_div3", "fclk_div5" | 2143 | IN_PREFIX "xtal", "fclk_div4", "fclk_div3", "fclk_div5" |
| 2142 | }; | 2144 | }; |
| 2143 | 2145 | ||
| 2144 | static struct clk_regmap gxbb_hdmi_sel = { | 2146 | static struct clk_regmap gxbb_hdmi_sel = { |
| @@ -2285,7 +2287,7 @@ static struct clk_regmap gxbb_vdec_hevc = { | |||
| 2285 | static u32 mux_table_gen_clk[] = { 0, 4, 5, 6, 7, 8, | 2287 | static u32 mux_table_gen_clk[] = { 0, 4, 5, 6, 7, 8, |
| 2286 | 9, 10, 11, 13, 14, }; | 2288 | 9, 10, 11, 13, 14, }; |
| 2287 | static const char * const gen_clk_parent_names[] = { | 2289 | static const char * const gen_clk_parent_names[] = { |
| 2288 | "xtal", "vdec_1", "vdec_hevc", "mpll0", "mpll1", "mpll2", | 2290 | IN_PREFIX "xtal", "vdec_1", "vdec_hevc", "mpll0", "mpll1", "mpll2", |
| 2289 | "fclk_div4", "fclk_div3", "fclk_div5", "fclk_div7", "gp0_pll", | 2291 | "fclk_div4", "fclk_div3", "fclk_div5", "fclk_div7", "gp0_pll", |
| 2290 | }; | 2292 | }; |
| 2291 | 2293 | ||
| @@ -3085,6 +3087,7 @@ static const struct of_device_id clkc_match_table[] = { | |||
| 3085 | static int gxbb_clkc_probe(struct platform_device *pdev) | 3087 | static int gxbb_clkc_probe(struct platform_device *pdev) |
| 3086 | { | 3088 | { |
| 3087 | const struct clkc_data *clkc_data; | 3089 | const struct clkc_data *clkc_data; |
| 3090 | struct clk_hw *input; | ||
| 3088 | struct regmap *map; | 3091 | struct regmap *map; |
| 3089 | int ret, i; | 3092 | int ret, i; |
| 3090 | struct device *dev = &pdev->dev; | 3093 | struct device *dev = &pdev->dev; |
| @@ -3100,6 +3103,14 @@ static int gxbb_clkc_probe(struct platform_device *pdev) | |||
| 3100 | return PTR_ERR(map); | 3103 | return PTR_ERR(map); |
| 3101 | } | 3104 | } |
| 3102 | 3105 | ||
| 3106 | input = meson_clk_hw_register_input(dev, "xtal", IN_PREFIX "xtal", 0); | ||
| 3107 | if (IS_ERR(input)) { | ||
| 3108 | ret = PTR_ERR(input); | ||
| 3109 | if (ret != -EPROBE_DEFER) | ||
| 3110 | dev_err(dev, "failed to get input clock"); | ||
| 3111 | return ret; | ||
| 3112 | } | ||
| 3113 | |||
| 3103 | /* Populate regmap for the common regmap backed clocks */ | 3114 | /* Populate regmap for the common regmap backed clocks */ |
| 3104 | for (i = 0; i < ARRAY_SIZE(gx_clk_regmaps); i++) | 3115 | for (i = 0; i < ARRAY_SIZE(gx_clk_regmaps); i++) |
| 3105 | gx_clk_regmaps[i]->map = map; | 3116 | gx_clk_regmaps[i]->map = map; |
