Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149170
b: refs/heads/master
c: c068303
h: refs/heads/master
v: v3
  • Loading branch information
Tony Lindgren authored and Russell King committed Jun 4, 2009
1 parent 170a959 commit 3dc18b6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 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: 5926a295bb78272b3f648f62febecd19a1b6a6ca
refs/heads/master: c0683039207226afcffbe0fbf6a1caaee77a37b0
18 changes: 18 additions & 0 deletions trunk/arch/arm/common/clkdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,24 @@ struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
}
EXPORT_SYMBOL(clkdev_alloc);

int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
struct device *dev)
{
struct clk *r = clk_get(dev, id);
struct clk_lookup *l;

if (IS_ERR(r))
return PTR_ERR(r);

l = clkdev_alloc(r, alias, alias_dev_name);
clk_put(r);
if (!l)
return -ENODEV;
clkdev_add(l);
return 0;
}
EXPORT_SYMBOL(clk_add_alias);

/*
* clkdev_drop - remove a clock dynamically allocated
*/
Expand Down
17 changes: 0 additions & 17 deletions trunk/arch/arm/mach-pxa/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,3 @@ void clks_register(struct clk_lookup *clks, size_t num)
for (i = 0; i < num; i++)
clkdev_add(&clks[i]);
}

int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
struct device *dev)
{
struct clk *r = clk_get(dev, id);
struct clk_lookup *l;

if (!r)
return -ENODEV;

l = clkdev_alloc(r, alias, alias_dev_name);
clk_put(r);
if (!l)
return -ENODEV;
clkdev_add(l);
return 0;
}
13 changes: 13 additions & 0 deletions trunk/include/linux/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,17 @@ struct clk *clk_get_parent(struct clk *clk);
*/
struct clk *clk_get_sys(const char *dev_id, const char *con_id);

/**
* clk_add_alias - add a new clock alias
* @alias: name for clock alias
* @alias_dev_name: device name
* @id: platform specific clock name
* @dev: device
*
* Allows using generic clock names for drivers by adding a new alias.
* Assumes clkdev, see clkdev.h for more info.
*/
int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
struct device *dev);

#endif

0 comments on commit 3dc18b6

Please sign in to comment.