Commit 5668f765 authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Jerome Brunet

clk: meson: meson8b: change references to the XTAL clock to use [fw_]name

The XTAL clock is an actual crystal which is mounted on the PCB. Thus
the meson8b clock controller driver should not provide the XTAL clock.

The meson8b clock controller driver must not use references to
the meson8b_xtal clock anymore before we can provide the XTAL clock
via OF. Replace the references to the meson8b_xtal.hw by using
clk_parent_data's .fw_name and .name = "xtal" (along with index = -1).
This makes the common clock framework use the clock provided via OF and
if that's not available it falls back to getting the clock by it's name
(which is then the clk_fixed_rate which we register in our driver).
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
parent 2accb4ee
...@@ -97,8 +97,10 @@ static struct clk_regmap meson8b_fixed_pll_dco = { ...@@ -97,8 +97,10 @@ static struct clk_regmap meson8b_fixed_pll_dco = {
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "fixed_pll_dco", .name = "fixed_pll_dco",
.ops = &meson_clk_pll_ro_ops, .ops = &meson_clk_pll_ro_ops,
.parent_hws = (const struct clk_hw *[]) { .parent_data = &(const struct clk_parent_data) {
&meson8b_xtal.hw .fw_name = "xtal",
.name = "xtal",
.index = -1,
}, },
.num_parents = 1, .num_parents = 1,
}, },
...@@ -162,8 +164,10 @@ static struct clk_regmap meson8b_hdmi_pll_dco = { ...@@ -162,8 +164,10 @@ static struct clk_regmap meson8b_hdmi_pll_dco = {
/* sometimes also called "HPLL" or "HPLL PLL" */ /* sometimes also called "HPLL" or "HPLL PLL" */
.name = "hdmi_pll_dco", .name = "hdmi_pll_dco",
.ops = &meson_clk_pll_ro_ops, .ops = &meson_clk_pll_ro_ops,
.parent_hws = (const struct clk_hw *[]) { .parent_data = &(const struct clk_parent_data) {
&meson8b_xtal.hw .fw_name = "xtal",
.name = "xtal",
.index = -1,
}, },
.num_parents = 1, .num_parents = 1,
}, },
...@@ -237,8 +241,10 @@ static struct clk_regmap meson8b_sys_pll_dco = { ...@@ -237,8 +241,10 @@ static struct clk_regmap meson8b_sys_pll_dco = {
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "sys_pll_dco", .name = "sys_pll_dco",
.ops = &meson_clk_pll_ops, .ops = &meson_clk_pll_ops,
.parent_hws = (const struct clk_hw *[]) { .parent_data = &(const struct clk_parent_data) {
&meson8b_xtal.hw .fw_name = "xtal",
.name = "xtal",
.index = -1,
}, },
.num_parents = 1, .num_parents = 1,
}, },
...@@ -631,9 +637,9 @@ static struct clk_regmap meson8b_cpu_in_sel = { ...@@ -631,9 +637,9 @@ static struct clk_regmap meson8b_cpu_in_sel = {
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "cpu_in_sel", .name = "cpu_in_sel",
.ops = &clk_regmap_mux_ops, .ops = &clk_regmap_mux_ops,
.parent_hws = (const struct clk_hw *[]) { .parent_data = (const struct clk_parent_data[]) {
&meson8b_xtal.hw, { .fw_name = "xtal", .name = "xtal", .index = -1, },
&meson8b_sys_pll.hw, { .hw = &meson8b_sys_pll.hw, },
}, },
.num_parents = 2, .num_parents = 2,
.flags = (CLK_SET_RATE_PARENT | .flags = (CLK_SET_RATE_PARENT |
...@@ -736,9 +742,9 @@ static struct clk_regmap meson8b_cpu_clk = { ...@@ -736,9 +742,9 @@ static struct clk_regmap meson8b_cpu_clk = {
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "cpu_clk", .name = "cpu_clk",
.ops = &clk_regmap_mux_ops, .ops = &clk_regmap_mux_ops,
.parent_hws = (const struct clk_hw *[]) { .parent_data = (const struct clk_parent_data[]) {
&meson8b_xtal.hw, { .fw_name = "xtal", .name = "xtal", .index = -1, },
&meson8b_cpu_scale_out_sel.hw, { .hw = &meson8b_cpu_scale_out_sel.hw, },
}, },
.num_parents = 2, .num_parents = 2,
.flags = (CLK_SET_RATE_PARENT | .flags = (CLK_SET_RATE_PARENT |
...@@ -758,12 +764,12 @@ static struct clk_regmap meson8b_nand_clk_sel = { ...@@ -758,12 +764,12 @@ static struct clk_regmap meson8b_nand_clk_sel = {
.name = "nand_clk_sel", .name = "nand_clk_sel",
.ops = &clk_regmap_mux_ops, .ops = &clk_regmap_mux_ops,
/* FIXME all other parents are unknown: */ /* FIXME all other parents are unknown: */
.parent_hws = (const struct clk_hw *[]) { .parent_data = (const struct clk_parent_data[]) {
&meson8b_fclk_div4.hw, { .hw = &meson8b_fclk_div4.hw, },
&meson8b_fclk_div3.hw, { .hw = &meson8b_fclk_div3.hw, },
&meson8b_fclk_div5.hw, { .hw = &meson8b_fclk_div5.hw, },
&meson8b_fclk_div7.hw, { .hw = &meson8b_fclk_div7.hw, },
&meson8b_xtal.hw, { .fw_name = "xtal", .name = "xtal", .index = -1, },
}, },
.num_parents = 5, .num_parents = 5,
.flags = CLK_SET_RATE_PARENT, .flags = CLK_SET_RATE_PARENT,
...@@ -1721,8 +1727,10 @@ static struct clk_regmap meson8b_hdmi_sys_sel = { ...@@ -1721,8 +1727,10 @@ static struct clk_regmap meson8b_hdmi_sys_sel = {
.name = "hdmi_sys_sel", .name = "hdmi_sys_sel",
.ops = &clk_regmap_mux_ro_ops, .ops = &clk_regmap_mux_ro_ops,
/* FIXME: all other parents are unknown */ /* FIXME: all other parents are unknown */
.parent_hws = (const struct clk_hw *[]) { .parent_data = &(const struct clk_parent_data) {
&meson8b_xtal.hw .fw_name = "xtal",
.name = "xtal",
.index = -1,
}, },
.num_parents = 1, .num_parents = 1,
.flags = CLK_SET_RATE_NO_REPARENT, .flags = CLK_SET_RATE_NO_REPARENT,
...@@ -1767,14 +1775,14 @@ static struct clk_regmap meson8b_hdmi_sys = { ...@@ -1767,14 +1775,14 @@ static struct clk_regmap meson8b_hdmi_sys = {
* muxed by a glitch-free switch on Meson8b and Meson8m2. Meson8 only * muxed by a glitch-free switch on Meson8b and Meson8m2. Meson8 only
* has mali_0 and no glitch-free mux. * has mali_0 and no glitch-free mux.
*/ */
static const struct clk_hw *meson8b_mali_0_1_parent_hws[] = { static const struct clk_parent_data meson8b_mali_0_1_parent_data[] = {
&meson8b_xtal.hw, { .fw_name = "xtal", .name = "xtal", .index = -1, },
&meson8b_mpll2.hw, { .hw = &meson8b_mpll2.hw, },
&meson8b_mpll1.hw, { .hw = &meson8b_mpll1.hw, },
&meson8b_fclk_div7.hw, { .hw = &meson8b_fclk_div7.hw, },
&meson8b_fclk_div4.hw, { .hw = &meson8b_fclk_div4.hw, },
&meson8b_fclk_div3.hw, { .hw = &meson8b_fclk_div3.hw, },
&meson8b_fclk_div5.hw, { .hw = &meson8b_fclk_div5.hw, },
}; };
static u32 meson8b_mali_0_1_mux_table[] = { 0, 2, 3, 4, 5, 6, 7 }; static u32 meson8b_mali_0_1_mux_table[] = { 0, 2, 3, 4, 5, 6, 7 };
...@@ -1789,8 +1797,8 @@ static struct clk_regmap meson8b_mali_0_sel = { ...@@ -1789,8 +1797,8 @@ static struct clk_regmap meson8b_mali_0_sel = {
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "mali_0_sel", .name = "mali_0_sel",
.ops = &clk_regmap_mux_ops, .ops = &clk_regmap_mux_ops,
.parent_hws = meson8b_mali_0_1_parent_hws, .parent_data = meson8b_mali_0_1_parent_data,
.num_parents = ARRAY_SIZE(meson8b_mali_0_1_parent_hws), .num_parents = ARRAY_SIZE(meson8b_mali_0_1_parent_data),
/* /*
* Don't propagate rate changes up because the only changeable * Don't propagate rate changes up because the only changeable
* parents are mpll1 and mpll2 but we need those for audio and * parents are mpll1 and mpll2 but we need those for audio and
...@@ -1844,8 +1852,8 @@ static struct clk_regmap meson8b_mali_1_sel = { ...@@ -1844,8 +1852,8 @@ static struct clk_regmap meson8b_mali_1_sel = {
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "mali_1_sel", .name = "mali_1_sel",
.ops = &clk_regmap_mux_ops, .ops = &clk_regmap_mux_ops,
.parent_hws = meson8b_mali_0_1_parent_hws, .parent_data = meson8b_mali_0_1_parent_data,
.num_parents = ARRAY_SIZE(meson8b_mali_0_1_parent_hws), .num_parents = ARRAY_SIZE(meson8b_mali_0_1_parent_data),
/* /*
* Don't propagate rate changes up because the only changeable * Don't propagate rate changes up because the only changeable
* parents are mpll1 and mpll2 but we need those for audio and * parents are mpll1 and mpll2 but we need those for audio and
...@@ -1944,8 +1952,10 @@ static struct clk_regmap meson8m2_gp_pll_dco = { ...@@ -1944,8 +1952,10 @@ static struct clk_regmap meson8m2_gp_pll_dco = {
.hw.init = &(struct clk_init_data){ .hw.init = &(struct clk_init_data){
.name = "gp_pll_dco", .name = "gp_pll_dco",
.ops = &meson_clk_pll_ops, .ops = &meson_clk_pll_ops,
.parent_hws = (const struct clk_hw *[]) { .parent_data = &(const struct clk_parent_data) {
&meson8b_xtal.hw .fw_name = "xtal",
.name = "xtal",
.index = -1,
}, },
.num_parents = 1, .num_parents = 1,
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment