Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355801
b: refs/heads/master
c: c64c65d
h: refs/heads/master
i:
  355799: 03648e1
v: v3
  • Loading branch information
Peter De Schrijver authored and Stephen Warren committed Feb 12, 2013
1 parent c127194 commit b19fcf8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 22ca335f6db9cf614696bbcb83eb0b80db7b4110
refs/heads/master: c64c65d494ade53fa41fb0b980381807743b5095
18 changes: 15 additions & 3 deletions trunk/drivers/clk/tegra/clk-super.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ static int clk_super_set_parent(struct clk_hw *hw, u8 index)
{
struct tegra_clk_super_mux *mux = to_clk_super_mux(hw);
u32 val, state;
int err = 0;
u8 parent_index, shift;
unsigned long flags = 0;

if (mux->lock)
spin_lock_irqsave(mux->lock, flags);

val = readl_relaxed(mux->reg);
state = val & SUPER_STATE_MASK;
Expand All @@ -92,8 +97,10 @@ static int clk_super_set_parent(struct clk_hw *hw, u8 index)
(index == mux->pllx_index))) {
parent_index = clk_super_get_parent(hw);
if ((parent_index == mux->div2_index) ||
(parent_index == mux->pllx_index))
return -EINVAL;
(parent_index == mux->pllx_index)) {
err = -EINVAL;
goto out;
}

val ^= SUPER_LP_DIV2_BYPASS;
writel_relaxed(val, mux->reg);
Expand All @@ -107,7 +114,12 @@ static int clk_super_set_parent(struct clk_hw *hw, u8 index)

writel_relaxed(val, mux->reg);
udelay(2);
return 0;

out:
if (mux->lock)
spin_unlock_irqrestore(mux->lock, flags);

return err;
}

const struct clk_ops tegra_clk_super_ops = {
Expand Down

0 comments on commit b19fcf8

Please sign in to comment.