clk: actions: Cache regmap info in private clock descriptor

In order to support the reset controller, regmap info needs to
be cached in the private clock descriptor, owl_clk_desc. Hence,
save that and also make the clock descriptor struct non const.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
Manivannan Sadhasivam 2018-08-10 15:21:05 +05:30 committed by Stephen Boyd
parent 5b394b2ddf
commit 3a23eb725b
4 changed files with 8 additions and 6 deletions

View File

@ -39,7 +39,7 @@ static void owl_clk_set_regmap(const struct owl_clk_desc *desc,
}
int owl_clk_regmap_init(struct platform_device *pdev,
const struct owl_clk_desc *desc)
struct owl_clk_desc *desc)
{
void __iomem *base;
struct regmap *regmap;
@ -57,6 +57,7 @@ int owl_clk_regmap_init(struct platform_device *pdev,
}
owl_clk_set_regmap(desc, regmap);
desc->regmap = regmap;
return 0;
}

View File

@ -26,6 +26,7 @@ struct owl_clk_desc {
struct owl_clk_common **clks;
unsigned long num_clks;
struct clk_hw_onecell_data *hw_clks;
struct regmap *regmap;
};
static inline struct owl_clk_common *
@ -35,7 +36,7 @@ static inline struct owl_clk_common *
}
int owl_clk_regmap_init(struct platform_device *pdev,
const struct owl_clk_desc *desc);
struct owl_clk_desc *desc);
int owl_clk_probe(struct device *dev, struct clk_hw_onecell_data *hw_clks);
#endif /* _OWL_COMMON_H_ */

View File

@ -569,7 +569,7 @@ static struct clk_hw_onecell_data s700_hw_clks = {
.num = CLK_NR_CLKS,
};
static const struct owl_clk_desc s700_clk_desc = {
static struct owl_clk_desc s700_clk_desc = {
.clks = s700_clks,
.num_clks = ARRAY_SIZE(s700_clks),
@ -578,7 +578,7 @@ static const struct owl_clk_desc s700_clk_desc = {
static int s700_clk_probe(struct platform_device *pdev)
{
const struct owl_clk_desc *desc;
struct owl_clk_desc *desc;
desc = &s700_clk_desc;
owl_clk_regmap_init(pdev, desc);

View File

@ -684,7 +684,7 @@ static struct clk_hw_onecell_data s900_hw_clks = {
.num = CLK_NR_CLKS,
};
static const struct owl_clk_desc s900_clk_desc = {
static struct owl_clk_desc s900_clk_desc = {
.clks = s900_clks,
.num_clks = ARRAY_SIZE(s900_clks),
@ -693,7 +693,7 @@ static const struct owl_clk_desc s900_clk_desc = {
static int s900_clk_probe(struct platform_device *pdev)
{
const struct owl_clk_desc *desc;
struct owl_clk_desc *desc;
desc = &s900_clk_desc;
owl_clk_regmap_init(pdev, desc);