Lines Matching +full:syscon +full:- +full:clk
1 // SPDX-License-Identifier: GPL-2.0+
8 #include <clk-uclass.h>
10 #include <syscon.h>
22 static int utmi_clk_enable(struct clk *clk) in utmi_clk_enable() argument
24 struct pmc_platdata *plat = dev_get_platdata(clk->dev); in utmi_clk_enable()
25 struct at91_pmc *pmc = plat->reg_base; in utmi_clk_enable()
26 struct clk clk_dev; in utmi_clk_enable()
33 if (readl(&pmc->sr) & AT91_PMC_LOCKU) in utmi_clk_enable()
41 err = clk_get_by_index(clk->dev, 0, &clk_dev); in utmi_clk_enable()
43 return -EINVAL; in utmi_clk_enable()
65 return -EINVAL; in utmi_clk_enable()
68 if (plat->regmap_sfr) { in utmi_clk_enable()
69 err = regmap_read(plat->regmap_sfr, AT91_SFR_UTMICKTRIM, &tmp); in utmi_clk_enable()
71 return -EINVAL; in utmi_clk_enable()
75 err = regmap_write(plat->regmap_sfr, AT91_SFR_UTMICKTRIM, tmp); in utmi_clk_enable()
77 return -EINVAL; in utmi_clk_enable()
80 return -EINVAL; in utmi_clk_enable()
83 tmp = readl(&pmc->uckr); in utmi_clk_enable()
87 writel(tmp, &pmc->uckr); in utmi_clk_enable()
89 while ((--timeout) && !(readl(&pmc->sr) & AT91_PMC_LOCKU)) in utmi_clk_enable()
93 return -ETIMEDOUT; in utmi_clk_enable()
99 static ulong utmi_clk_get_rate(struct clk *clk) in utmi_clk_get_rate() argument
101 /* UTMI clk rate is fixed. */ in utmi_clk_get_rate()
113 struct udevice *syscon; in utmi_clk_ofdata_to_platdata() local
116 "regmap-sfr", &syscon); in utmi_clk_ofdata_to_platdata()
118 if (syscon) in utmi_clk_ofdata_to_platdata()
119 plat->regmap_sfr = syscon_get_regmap(syscon); in utmi_clk_ofdata_to_platdata()
130 { .compatible = "atmel,at91sam9x5-clk-utmi" },
135 .name = "at91sam9x5-utmi-clk",