diff options
| -rw-r--r-- | arch/arm/mach-pxa/clock.c | 25 | ||||
| -rw-r--r-- | arch/arm/mach-pxa/clock.h | 5 |
2 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c index c01eea88f787..ca8e20538157 100644 --- a/arch/arm/mach-pxa/clock.c +++ b/arch/arm/mach-pxa/clock.c | |||
| @@ -125,3 +125,28 @@ void clks_register(struct clk *clks, size_t num) | |||
| 125 | list_add(&clks[i].node, &clocks); | 125 | list_add(&clks[i].node, &clocks); |
| 126 | mutex_unlock(&clocks_mutex); | 126 | mutex_unlock(&clocks_mutex); |
| 127 | } | 127 | } |
| 128 | |||
| 129 | int clk_add_alias(char *alias, struct device *alias_dev, char *id, | ||
| 130 | struct device *dev) | ||
| 131 | { | ||
| 132 | struct clk *r = clk_lookup(dev, id); | ||
| 133 | struct clk *new; | ||
| 134 | |||
| 135 | if (!r) | ||
| 136 | return -ENODEV; | ||
| 137 | |||
| 138 | new = kzalloc(sizeof(struct clk), GFP_KERNEL); | ||
| 139 | |||
| 140 | if (!new) | ||
| 141 | return -ENOMEM; | ||
| 142 | |||
| 143 | new->name = alias; | ||
| 144 | new->dev = alias_dev; | ||
| 145 | new->other = r; | ||
| 146 | |||
| 147 | mutex_lock(&clocks_mutex); | ||
| 148 | list_add(&new->node, &clocks); | ||
| 149 | mutex_unlock(&clocks_mutex); | ||
| 150 | |||
| 151 | return 0; | ||
| 152 | } | ||
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h index 1ec8f9178aaf..73be795fe3bf 100644 --- a/arch/arm/mach-pxa/clock.h +++ b/arch/arm/mach-pxa/clock.h | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | #include <linux/list.h> | ||
| 2 | |||
| 1 | struct clk; | 3 | struct clk; |
| 2 | 4 | ||
| 3 | struct clkops { | 5 | struct clkops { |
| @@ -86,3 +88,6 @@ extern void clk_pxa3xx_cken_disable(struct clk *); | |||
| 86 | #endif | 88 | #endif |
| 87 | 89 | ||
| 88 | void clks_register(struct clk *clks, size_t num); | 90 | void clks_register(struct clk *clks, size_t num); |
| 91 | int clk_add_alias(char *alias, struct device *alias_dev, char *id, | ||
| 92 | struct device *dev); | ||
| 93 | |||
