Skip to content

Commit

Permalink
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/clk/linux

Pull clk fixes from Michael Turquette:
 "Fix a bug in the at91 clk driver, two compile time warnings in sunxi
  clk drivers, and one bug in a sunxi clk driver introduced in the 4.7
  merge window"

* tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
  clk: at91: fix clk_programmable_set_parent()
  clk: sunxi: remove unused variable
  clk: sunxi: display: Add per-clock flags
  clk: sunxi: tcon-ch1: Do not return a negative error in get_parent
  • Loading branch information
Linus Torvalds committed Jul 23, 2016
2 parents a933f80 + f96423f commit 62cd69d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/clk/at91/clk-programmable.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int clk_programmable_set_parent(struct clk_hw *hw, u8 index)
struct clk_programmable *prog = to_clk_programmable(hw);
const struct clk_programmable_layout *layout = prog->layout;
unsigned int mask = layout->css_mask;
unsigned int pckr = 0;
unsigned int pckr = index;

if (layout->have_slck_mck)
mask |= AT91_PMC_CSSMCK_MCK;
Expand Down
5 changes: 4 additions & 1 deletion drivers/clk/sunxi/clk-sun4i-display.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ struct sun4i_a10_display_clk_data {

u8 width_div;
u8 width_mux;

u32 flags;
};

struct reset_data {
Expand Down Expand Up @@ -166,7 +168,7 @@ static void __init sun4i_a10_display_init(struct device_node *node,
data->has_div ? &div->hw : NULL,
data->has_div ? &clk_divider_ops : NULL,
&gate->hw, &clk_gate_ops,
0);
data->flags);
if (IS_ERR(clk)) {
pr_err("%s: Couldn't register the clock\n", clk_name);
goto free_div;
Expand Down Expand Up @@ -232,6 +234,7 @@ static const struct sun4i_a10_display_clk_data sun4i_a10_tcon_ch0_data __initcon
.offset_rst = 29,
.offset_mux = 24,
.width_mux = 2,
.flags = CLK_SET_RATE_PARENT,
};

static void __init sun4i_a10_tcon_ch0_setup(struct device_node *node)
Expand Down
4 changes: 0 additions & 4 deletions drivers/clk/sunxi/clk-sun4i-tcon-ch1.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,11 @@ static int tcon_ch1_is_enabled(struct clk_hw *hw)
static u8 tcon_ch1_get_parent(struct clk_hw *hw)
{
struct tcon_ch1_clk *tclk = hw_to_tclk(hw);
int num_parents = clk_hw_get_num_parents(hw);
u32 reg;

reg = readl(tclk->reg) >> TCON_CH1_SCLK2_MUX_SHIFT;
reg &= reg >> TCON_CH1_SCLK2_MUX_MASK;

if (reg >= num_parents)
return -EINVAL;

return reg;
}

Expand Down

0 comments on commit 62cd69d

Please sign in to comment.