summaryrefslogtreecommitdiffstats
path: root/drivers/clk/zynqmp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/zynqmp')
-rw-r--r--drivers/clk/zynqmp/clk-divider-zynqmp.c30
-rw-r--r--drivers/clk/zynqmp/clk-gate-zynqmp.c30
-rw-r--r--drivers/clk/zynqmp/clk-mux-zynqmp.c30
-rw-r--r--drivers/clk/zynqmp/clk-pll-zynqmp.c48
-rw-r--r--drivers/clk/zynqmp/clkc.c2
5 files changed, 70 insertions, 70 deletions
diff --git a/drivers/clk/zynqmp/clk-divider-zynqmp.c b/drivers/clk/zynqmp/clk-divider-zynqmp.c
index 2fe65b566a..b96cab615b 100644
--- a/drivers/clk/zynqmp/clk-divider-zynqmp.c
+++ b/drivers/clk/zynqmp/clk-divider-zynqmp.c
@@ -16,14 +16,14 @@
#include "clk-zynqmp.h"
struct zynqmp_clk_divider {
- struct clk clk;
+ struct clk_hw hw;
unsigned int clk_id;
enum topology_type type;
const char *parent;
const struct zynqmp_eemi_ops *ops;
};
-#define to_zynqmp_clk_divider(clk) \
- container_of(clk, struct zynqmp_clk_divider, clk)
+#define to_zynqmp_clk_divider(_hw) \
+ container_of(_hw, struct zynqmp_clk_divider, hw)
static int zynqmp_clk_divider_bestdiv(unsigned long rate,
unsigned long *best_parent_rate)
@@ -31,10 +31,10 @@ static int zynqmp_clk_divider_bestdiv(unsigned long rate,
return DIV_ROUND_CLOSEST(*best_parent_rate, rate);
}
-static unsigned long zynqmp_clk_divider_recalc_rate(struct clk *clk,
+static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
- struct zynqmp_clk_divider *div = to_zynqmp_clk_divider(clk);
+ struct zynqmp_clk_divider *div = to_zynqmp_clk_divider(hw);
u32 value;
div->ops->clock_getdivider(div->clk_id, &value);
@@ -46,7 +46,7 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk *clk,
return DIV_ROUND_UP(parent_rate, value);
}
-static long zynqmp_clk_divider_round_rate(struct clk *clk, unsigned long rate,
+static long zynqmp_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate)
{
int bestdiv;
@@ -56,10 +56,10 @@ static long zynqmp_clk_divider_round_rate(struct clk *clk, unsigned long rate,
return *parent_rate / bestdiv;
}
-static int zynqmp_clk_divider_set_rate(struct clk *clk, unsigned long rate,
+static int zynqmp_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
- struct zynqmp_clk_divider *div = to_zynqmp_clk_divider(clk);
+ struct zynqmp_clk_divider *div = to_zynqmp_clk_divider(hw);
u32 bestdiv;
bestdiv = zynqmp_clk_divider_bestdiv(rate, &parent_rate);
@@ -95,17 +95,17 @@ struct clk *zynqmp_clk_register_divider(const char *name,
div->ops = zynqmp_pm_get_eemi_ops();
div->parent = strdup(parents[0]);
- div->clk.name = strdup(name);
- div->clk.ops = &zynqmp_clk_divider_ops;
- div->clk.flags = nodes->flag;
- div->clk.parent_names = &div->parent;
- div->clk.num_parents = 1;
+ div->hw.clk.name = strdup(name);
+ div->hw.clk.ops = &zynqmp_clk_divider_ops;
+ div->hw.clk.flags = nodes->flag;
+ div->hw.clk.parent_names = &div->parent;
+ div->hw.clk.num_parents = 1;
- ret = clk_register(&div->clk);
+ ret = bclk_register(&div->hw.clk);
if (ret) {
kfree(div);
return ERR_PTR(ret);
}
- return &div->clk;
+ return &div->hw.clk;
}
diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c
index 6f03357768..a3b9ee21e5 100644
--- a/drivers/clk/zynqmp/clk-gate-zynqmp.c
+++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c
@@ -16,31 +16,31 @@
#include "clk-zynqmp.h"
struct zynqmp_clk_gate {
- struct clk clk;
+ struct clk_hw hw;
unsigned int clk_id;
const char *parent;
const struct zynqmp_eemi_ops *ops;
};
-#define to_zynqmp_clk_gate(_hw) container_of(_hw, struct zynqmp_clk_gate, clk)
+#define to_zynqmp_clk_gate(_hw) container_of(_hw, struct zynqmp_clk_gate, hw)
-static int zynqmp_clk_gate_enable(struct clk *clk)
+static int zynqmp_clk_gate_enable(struct clk_hw *hw)
{
- struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(clk);
+ struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw);
return gate->ops->clock_enable(gate->clk_id);
}
-static void zynqmp_clk_gate_disable(struct clk *clk)
+static void zynqmp_clk_gate_disable(struct clk_hw *hw)
{
- struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(clk);
+ struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw);
gate->ops->clock_disable(gate->clk_id);
}
-static int zynqmp_clk_gate_is_enabled(struct clk *clk)
+static int zynqmp_clk_gate_is_enabled(struct clk_hw *hw)
{
- struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(clk);
+ struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw);
u32 state;
int ret;
const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
@@ -77,17 +77,17 @@ struct clk *zynqmp_clk_register_gate(const char *name,
gate->ops = zynqmp_pm_get_eemi_ops();
gate->parent = strdup(parents[0]);
- gate->clk.name = strdup(name);
- gate->clk.ops = &zynqmp_clk_gate_ops;
- gate->clk.flags = nodes->flag | CLK_SET_RATE_PARENT;
- gate->clk.parent_names = &gate->parent;
- gate->clk.num_parents = 1;
+ gate->hw.clk.name = strdup(name);
+ gate->hw.clk.ops = &zynqmp_clk_gate_ops;
+ gate->hw.clk.flags = nodes->flag | CLK_SET_RATE_PARENT;
+ gate->hw.clk.parent_names = &gate->parent;
+ gate->hw.clk.num_parents = 1;
- ret = clk_register(&gate->clk);
+ ret = bclk_register(&gate->hw.clk);
if (ret) {
kfree(gate);
return ERR_PTR(ret);
}
- return &gate->clk;
+ return &gate->hw.clk;
}
diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c
index 4c15223980..e7264375f5 100644
--- a/drivers/clk/zynqmp/clk-mux-zynqmp.c
+++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c
@@ -18,17 +18,17 @@
#define ZYNQMP_CLK_MUX_READ_ONLY BIT(3)
struct zynqmp_clk_mux {
- struct clk clk;
+ struct clk_hw hw;
u32 clk_id;
const struct zynqmp_eemi_ops *ops;
};
-#define to_zynqmp_clk_mux(clk) \
- container_of(clk, struct zynqmp_clk_mux, clk)
+#define to_zynqmp_clk_mux(_hw) \
+ container_of(_hw, struct zynqmp_clk_mux, hw)
-static int zynqmp_clk_mux_get_parent(struct clk *clk)
+static int zynqmp_clk_mux_get_parent(struct clk_hw *hw)
{
- struct zynqmp_clk_mux *mux = to_zynqmp_clk_mux(clk);
+ struct zynqmp_clk_mux *mux = to_zynqmp_clk_mux(hw);
u32 value;
mux->ops->clock_getparent(mux->clk_id, &value);
@@ -36,9 +36,9 @@ static int zynqmp_clk_mux_get_parent(struct clk *clk)
return value;
}
-static int zynqmp_clk_mux_set_parent(struct clk *clk, u8 index)
+static int zynqmp_clk_mux_set_parent(struct clk_hw *hw, u8 index)
{
- struct zynqmp_clk_mux *mux = to_zynqmp_clk_mux(clk);
+ struct zynqmp_clk_mux *mux = to_zynqmp_clk_mux(hw);
return mux->ops->clock_setparent(mux->clk_id, index);
}
@@ -82,21 +82,21 @@ struct clk *zynqmp_clk_register_mux(const char *name,
mux->clk_id = clk_id;
mux->ops = zynqmp_pm_get_eemi_ops();
- mux->clk.name = strdup(name);
+ mux->hw.clk.name = strdup(name);
if (nodes->type_flag & ZYNQMP_CLK_MUX_READ_ONLY)
- mux->clk.ops = &zynqmp_clk_mux_ro_ops;
+ mux->hw.clk.ops = &zynqmp_clk_mux_ro_ops;
else
- mux->clk.ops = &zynqmp_clk_mux_ops;
- mux->clk.flags = nodes->flag | CLK_SET_RATE_PARENT;
- mux->clk.parent_names = parent_names;
- mux->clk.num_parents = num_parents;
+ mux->hw.clk.ops = &zynqmp_clk_mux_ops;
+ mux->hw.clk.flags = nodes->flag | CLK_SET_RATE_PARENT;
+ mux->hw.clk.parent_names = parent_names;
+ mux->hw.clk.num_parents = num_parents;
- ret = clk_register(&mux->clk);
+ ret = bclk_register(&mux->hw.clk);
if (ret) {
kfree(parent_names);
kfree(mux);
return ERR_PTR(ret);
}
- return &mux->clk;
+ return &mux->hw.clk;
}
diff --git a/drivers/clk/zynqmp/clk-pll-zynqmp.c b/drivers/clk/zynqmp/clk-pll-zynqmp.c
index e4b759b73c..2e24d9d01c 100644
--- a/drivers/clk/zynqmp/clk-pll-zynqmp.c
+++ b/drivers/clk/zynqmp/clk-pll-zynqmp.c
@@ -16,14 +16,14 @@
#include "clk-zynqmp.h"
struct zynqmp_pll {
- struct clk clk;
+ struct clk_hw hw;
unsigned int clk_id;
const char *parent;
const struct zynqmp_eemi_ops *ops;
};
-#define to_zynqmp_pll(clk) \
- container_of(clk, struct zynqmp_pll, clk)
+#define to_zynqmp_pll(_hw) \
+ container_of(_hw, struct zynqmp_pll, hw)
#define PLL_FBDIV_MIN 25
#define PLL_FBDIV_MAX 125
@@ -53,10 +53,10 @@ static inline void zynqmp_pll_set_mode(struct zynqmp_pll *pll, enum pll_mode mod
pll->ops->ioctl(0, IOCTL_SET_PLL_FRAC_MODE, pll->clk_id, mode, NULL);
}
-static long zynqmp_pll_round_rate(struct clk *clk, unsigned long rate,
+static long zynqmp_pll_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{
- struct zynqmp_pll *pll = to_zynqmp_pll(clk);
+ struct zynqmp_pll *pll = to_zynqmp_pll(hw);
u32 fbdiv;
long rate_div;
@@ -84,10 +84,10 @@ static long zynqmp_pll_round_rate(struct clk *clk, unsigned long rate,
return rate;
}
-static unsigned long zynqmp_pll_recalc_rate(struct clk *clk,
+static unsigned long zynqmp_pll_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
- struct zynqmp_pll *pll = to_zynqmp_pll(clk);
+ struct zynqmp_pll *pll = to_zynqmp_pll(hw);
u32 clk_id = pll->clk_id;
u32 fbdiv, data;
unsigned long rate, frac;
@@ -109,10 +109,10 @@ static unsigned long zynqmp_pll_recalc_rate(struct clk *clk,
return rate;
}
-static int zynqmp_pll_set_rate(struct clk *clk, unsigned long rate,
+static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
- struct zynqmp_pll *pll = to_zynqmp_pll(clk);
+ struct zynqmp_pll *pll = to_zynqmp_pll(hw);
u32 clk_id = pll->clk_id;
u32 fbdiv;
long rate_div, frac, m, f;
@@ -138,9 +138,9 @@ static int zynqmp_pll_set_rate(struct clk *clk, unsigned long rate,
}
}
-static int zynqmp_pll_is_enabled(struct clk *clk)
+static int zynqmp_pll_is_enabled(struct clk_hw *hw)
{
- struct zynqmp_pll *pll = to_zynqmp_pll(clk);
+ struct zynqmp_pll *pll = to_zynqmp_pll(hw);
u32 is_enabled;
int ret;
@@ -151,21 +151,21 @@ static int zynqmp_pll_is_enabled(struct clk *clk)
return !!(is_enabled);
}
-static int zynqmp_pll_enable(struct clk *clk)
+static int zynqmp_pll_enable(struct clk_hw *hw)
{
- struct zynqmp_pll *pll = to_zynqmp_pll(clk);
+ struct zynqmp_pll *pll = to_zynqmp_pll(hw);
- if (zynqmp_pll_is_enabled(clk))
+ if (zynqmp_pll_is_enabled(hw))
return 0;
return pll->ops->clock_enable(pll->clk_id);
}
-static void zynqmp_pll_disable(struct clk *clk)
+static void zynqmp_pll_disable(struct clk_hw *hw)
{
- struct zynqmp_pll *pll = to_zynqmp_pll(clk);
+ struct zynqmp_pll *pll = to_zynqmp_pll(hw);
- if (!zynqmp_pll_is_enabled(clk))
+ if (!zynqmp_pll_is_enabled(hw))
return;
pll->ops->clock_disable(pll->clk_id);
@@ -197,17 +197,17 @@ struct clk *zynqmp_clk_register_pll(const char *name,
pll->ops = zynqmp_pm_get_eemi_ops();
pll->parent = strdup(parents[0]);
- pll->clk.name = strdup(name);
- pll->clk.ops = &zynqmp_pll_ops;
- pll->clk.flags = nodes->flag | CLK_SET_RATE_PARENT;
- pll->clk.parent_names = &pll->parent;
- pll->clk.num_parents = 1;
+ pll->hw.clk.name = strdup(name);
+ pll->hw.clk.ops = &zynqmp_pll_ops;
+ pll->hw.clk.flags = nodes->flag | CLK_SET_RATE_PARENT;
+ pll->hw.clk.parent_names = &pll->parent;
+ pll->hw.clk.num_parents = 1;
- ret = clk_register(&pll->clk);
+ ret = bclk_register(&pll->hw.clk);
if (ret) {
kfree(pll);
return ERR_PTR(ret);
}
- return &pll->clk;
+ return &pll->hw.clk;
}
diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
index 366a12e70a..86d85b6daa 100644
--- a/drivers/clk/zynqmp/clkc.c
+++ b/drivers/clk/zynqmp/clkc.c
@@ -453,7 +453,7 @@ static int zynqmp_register_clocks(struct device_d *dev,
const char *parent_names[MAX_PARENT];
char *name;
struct device_node *node = dev->device_node;
- unsigned int num_parents;
+ int num_parents;
for (i = 0; i < num_clocks; i++) {
if (zynqmp_get_clock_type(i) != CLK_TYPE_OUTPUT)