diff options
| author | Michael Turquette <mturquette@baylibre.com> | 2016-07-21 20:30:54 -0400 |
|---|---|---|
| committer | Michael Turquette <mturquette@baylibre.com> | 2016-07-21 20:30:54 -0400 |
| commit | d22527fed2f094c2e4f9a66f35b68a090c3d906a (patch) | |
| tree | 4c234f16ec9ca21c48e33ae0edd373d3b6b5d52a /drivers/clk/sunxi | |
| parent | b328d2c110ad7b45af9cde2bce70803df28e9553 (diff) | |
| parent | f96423f483b1a7854270335b319e8d1cdd6f3585 (diff) | |
Merge branch 'clk-fixes' into clk-next
Diffstat (limited to 'drivers/clk/sunxi')
| -rw-r--r-- | drivers/clk/sunxi/clk-sun4i-display.c | 5 | ||||
| -rw-r--r-- | drivers/clk/sunxi/clk-sun4i-tcon-ch1.c | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/clk/sunxi/clk-sun4i-display.c b/drivers/clk/sunxi/clk-sun4i-display.c index 445a7498d6df..9780fac6d029 100644 --- a/drivers/clk/sunxi/clk-sun4i-display.c +++ b/drivers/clk/sunxi/clk-sun4i-display.c | |||
| @@ -33,6 +33,8 @@ struct sun4i_a10_display_clk_data { | |||
| 33 | 33 | ||
| 34 | u8 width_div; | 34 | u8 width_div; |
| 35 | u8 width_mux; | 35 | u8 width_mux; |
| 36 | |||
| 37 | u32 flags; | ||
| 36 | }; | 38 | }; |
| 37 | 39 | ||
| 38 | struct reset_data { | 40 | struct reset_data { |
| @@ -166,7 +168,7 @@ static void __init sun4i_a10_display_init(struct device_node *node, | |||
| 166 | data->has_div ? &div->hw : NULL, | 168 | data->has_div ? &div->hw : NULL, |
| 167 | data->has_div ? &clk_divider_ops : NULL, | 169 | data->has_div ? &clk_divider_ops : NULL, |
| 168 | &gate->hw, &clk_gate_ops, | 170 | &gate->hw, &clk_gate_ops, |
| 169 | 0); | 171 | data->flags); |
| 170 | if (IS_ERR(clk)) { | 172 | if (IS_ERR(clk)) { |
| 171 | pr_err("%s: Couldn't register the clock\n", clk_name); | 173 | pr_err("%s: Couldn't register the clock\n", clk_name); |
| 172 | goto free_div; | 174 | goto free_div; |
| @@ -232,6 +234,7 @@ static const struct sun4i_a10_display_clk_data sun4i_a10_tcon_ch0_data __initcon | |||
| 232 | .offset_rst = 29, | 234 | .offset_rst = 29, |
| 233 | .offset_mux = 24, | 235 | .offset_mux = 24, |
| 234 | .width_mux = 2, | 236 | .width_mux = 2, |
| 237 | .flags = CLK_SET_RATE_PARENT, | ||
| 235 | }; | 238 | }; |
| 236 | 239 | ||
| 237 | static void __init sun4i_a10_tcon_ch0_setup(struct device_node *node) | 240 | static void __init sun4i_a10_tcon_ch0_setup(struct device_node *node) |
diff --git a/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c b/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c index 98a4582de56a..b6d29d1bedca 100644 --- a/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c +++ b/drivers/clk/sunxi/clk-sun4i-tcon-ch1.c | |||
| @@ -79,15 +79,11 @@ static int tcon_ch1_is_enabled(struct clk_hw *hw) | |||
| 79 | static u8 tcon_ch1_get_parent(struct clk_hw *hw) | 79 | static u8 tcon_ch1_get_parent(struct clk_hw *hw) |
| 80 | { | 80 | { |
| 81 | struct tcon_ch1_clk *tclk = hw_to_tclk(hw); | 81 | struct tcon_ch1_clk *tclk = hw_to_tclk(hw); |
| 82 | int num_parents = clk_hw_get_num_parents(hw); | ||
| 83 | u32 reg; | 82 | u32 reg; |
| 84 | 83 | ||
| 85 | reg = readl(tclk->reg) >> TCON_CH1_SCLK2_MUX_SHIFT; | 84 | reg = readl(tclk->reg) >> TCON_CH1_SCLK2_MUX_SHIFT; |
| 86 | reg &= reg >> TCON_CH1_SCLK2_MUX_MASK; | 85 | reg &= reg >> TCON_CH1_SCLK2_MUX_MASK; |
| 87 | 86 | ||
| 88 | if (reg >= num_parents) | ||
| 89 | return -EINVAL; | ||
| 90 | |||
| 91 | return reg; | 87 | return reg; |
| 92 | } | 88 | } |
| 93 | 89 | ||
