Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372461
b: refs/heads/master
c: 5e2e019
h: refs/heads/master
i:
  372459: 2db9013
v: v3
  • Loading branch information
Heiko Stuebner authored and Kukjin Kim committed Mar 28, 2013
1 parent 7741295 commit 57a7701
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6e92bf5a01afb1f897aa15a34517da07d7c0c320
refs/heads/master: 5e2e0195ec89d8e266a2530ffec335c483c64899
33 changes: 33 additions & 0 deletions trunk/drivers/clk/samsung/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,39 @@ void samsung_clk_add_lookup(struct clk *clk, unsigned int id)
clk_table[id] = clk;
}

/* register a list of aliases */
void __init samsung_clk_register_alias(struct samsung_clock_alias *list,
unsigned int nr_clk)
{
struct clk *clk;
unsigned int idx, ret;

if (!clk_table) {
pr_err("%s: clock table missing\n", __func__);
return;
}

for (idx = 0; idx < nr_clk; idx++, list++) {
if (!list->id) {
pr_err("%s: clock id missing for index %d\n", __func__,
idx);
continue;
}

clk = clk_table[list->id];
if (!clk) {
pr_err("%s: failed to find clock %d\n", __func__,
list->id);
continue;
}

ret = clk_register_clkdev(clk, list->alias, list->dev_name);
if (ret)
pr_err("%s: failed to register lookup %s\n",
__func__, list->alias);
}
}

/* register a list of fixed clocks */
void __init samsung_clk_register_fixed_rate(
struct samsung_fixed_rate_clock *list, unsigned int nr_clk)
Expand Down
21 changes: 21 additions & 0 deletions trunk/drivers/clk/samsung/clk.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@

#include <mach/map.h>

/**
* struct samsung_clock_alias: information about mux clock
* @id: platform specific id of the clock.
* @dev_name: name of the device to which this clock belongs.
* @alias: optional clock alias name to be assigned to this clock.
*/
struct samsung_clock_alias {
unsigned int id;
const char *dev_name;
const char *alias;
};

#define ALIAS(_id, dname, a) \
{ \
.id = _id, \
.dev_name = dname, \
.alias = a, \
}

/**
* struct samsung_fixed_rate_clock: information about fixed-rate clock
* @id: platform specific id of the clock.
Expand Down Expand Up @@ -251,6 +270,8 @@ extern void __init samsung_clk_of_register_fixed_ext(

extern void samsung_clk_add_lookup(struct clk *clk, unsigned int id);

extern void samsung_clk_register_alias(struct samsung_clock_alias *list,
unsigned int nr_clk);
extern void __init samsung_clk_register_fixed_rate(
struct samsung_fixed_rate_clock *clk_list, unsigned int nr_clk);
extern void __init samsung_clk_register_fixed_factor(
Expand Down

0 comments on commit 57a7701

Please sign in to comment.