Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350724
b: refs/heads/master
c: 3fe296c
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mike Turquette committed Jan 16, 2013
1 parent 732ca98 commit 61451a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 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: bddca8944a7ab6699984c4b1b677261eb1c8d819
refs/heads/master: 3fe296cf5a66a82bc9077865b89075ce813f7f5d
28 changes: 7 additions & 21 deletions trunk/drivers/clk/clk-max77686.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,34 @@ struct max77686_clk {
struct clk_lookup *lookup;
};

static struct max77686_clk *get_max77686_clk(struct clk_hw *hw)
static struct max77686_clk *to_max77686_clk(struct clk_hw *hw)
{
return container_of(hw, struct max77686_clk, hw);
}

static int max77686_clk_prepare(struct clk_hw *hw)
{
struct max77686_clk *max77686;
int ret;

max77686 = get_max77686_clk(hw);
if (!max77686)
return -ENOMEM;

ret = regmap_update_bits(max77686->iodev->regmap,
MAX77686_REG_32KHZ, max77686->mask, max77686->mask);
struct max77686_clk *max77686 = to_max77686_clk(hw);

return ret;
return regmap_update_bits(max77686->iodev->regmap,
MAX77686_REG_32KHZ, max77686->mask,
max77686->mask);
}

static void max77686_clk_unprepare(struct clk_hw *hw)
{
struct max77686_clk *max77686;

max77686 = get_max77686_clk(hw);
if (!max77686)
return;
struct max77686_clk *max77686 = to_max77686_clk(hw);

regmap_update_bits(max77686->iodev->regmap,
MAX77686_REG_32KHZ, max77686->mask, ~max77686->mask);
}

static int max77686_clk_is_enabled(struct clk_hw *hw)
{
struct max77686_clk *max77686;
struct max77686_clk *max77686 = to_max77686_clk(hw);
int ret;
u32 val;

max77686 = get_max77686_clk(hw);
if (!max77686)
return -ENOMEM;

ret = regmap_read(max77686->iodev->regmap,
MAX77686_REG_32KHZ, &val);

Expand Down

0 comments on commit 61451a8

Please sign in to comment.