mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 17:41:22 +00:00
clk: shmobile: clk-mstp: change to using clock-indices
With the addition of clock-indices, we need to change the renesas clock implementation to use these instead of the local definition of "renesas,clock-indices". Since this will break booting with older device trees, we add a simple auto-detection of which properties are present. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
This commit is contained in:
parent
874f224cc5
commit
8e33f91a0b
@ -43,7 +43,7 @@ Example
|
||||
clock-output-names =
|
||||
"tpu0", "mmcif1", "sdhi3", "sdhi2",
|
||||
"sdhi1", "sdhi0", "mmcif0";
|
||||
renesas,clock-indices = <
|
||||
clock-indices = <
|
||||
R8A7790_CLK_TPU0 R8A7790_CLK_MMCIF1 R8A7790_CLK_SDHI3
|
||||
R8A7790_CLK_SDHI2 R8A7790_CLK_SDHI1 R8A7790_CLK_SDHI0
|
||||
R8A7790_CLK_MMCIF0
|
||||
|
@ -156,6 +156,7 @@ cpg_mstp_clock_register(const char *name, const char *parent_name,
|
||||
static void __init cpg_mstp_clocks_init(struct device_node *np)
|
||||
{
|
||||
struct mstp_clock_group *group;
|
||||
const char *idxname;
|
||||
struct clk **clks;
|
||||
unsigned int i;
|
||||
|
||||
@ -184,6 +185,11 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
|
||||
for (i = 0; i < MSTP_MAX_CLOCKS; ++i)
|
||||
clks[i] = ERR_PTR(-ENOENT);
|
||||
|
||||
if (of_find_property(np, "clock-indices", &i))
|
||||
idxname = "clock-indices";
|
||||
else
|
||||
idxname = "renesas,clock-indices";
|
||||
|
||||
for (i = 0; i < MSTP_MAX_CLOCKS; ++i) {
|
||||
const char *parent_name;
|
||||
const char *name;
|
||||
@ -197,8 +203,7 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
|
||||
continue;
|
||||
|
||||
parent_name = of_clk_get_parent_name(np, i);
|
||||
ret = of_property_read_u32_index(np, "renesas,clock-indices", i,
|
||||
&clkidx);
|
||||
ret = of_property_read_u32_index(np, idxname, i, &clkidx);
|
||||
if (parent_name == NULL || ret < 0)
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user