Lines Matching +full:lpc1850 +full:- +full:creg +full:- +full:clk

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Clk driver for NXP LPC18xx/43xx Configuration Registers (CREG)
8 #include <linux/clk-provider.h>
47 struct clk_creg_data *creg = to_clk_creg(hw); in clk_creg_32k_prepare() local
50 ret = regmap_update_bits(creg->reg, LPC18XX_CREG_CREG0, in clk_creg_32k_prepare()
65 struct clk_creg_data *creg = to_clk_creg(hw); in clk_creg_32k_unprepare() local
67 regmap_update_bits(creg->reg, LPC18XX_CREG_CREG0, in clk_creg_32k_unprepare()
74 struct clk_creg_data *creg = to_clk_creg(hw); in clk_creg_32k_is_prepared() local
77 regmap_read(creg->reg, LPC18XX_CREG_CREG0, &reg); in clk_creg_32k_is_prepared()
91 struct clk_creg_data *creg = to_clk_creg(hw); in clk_creg_enable() local
93 return regmap_update_bits(creg->reg, LPC18XX_CREG_CREG0, in clk_creg_enable()
94 creg->en_mask, creg->en_mask); in clk_creg_enable()
99 struct clk_creg_data *creg = to_clk_creg(hw); in clk_creg_disable() local
101 regmap_update_bits(creg->reg, LPC18XX_CREG_CREG0, in clk_creg_disable()
102 creg->en_mask, 0); in clk_creg_disable()
107 struct clk_creg_data *creg = to_clk_creg(hw); in clk_creg_is_enabled() local
110 regmap_read(creg->reg, LPC18XX_CREG_CREG0, &reg); in clk_creg_is_enabled()
112 return !!(reg & creg->en_mask); in clk_creg_is_enabled()
136 static struct clk *clk_register_creg_clk(struct device *dev, in clk_register_creg_clk()
143 init.ops = creg_clk->ops; in clk_register_creg_clk()
144 init.name = creg_clk->name; in clk_register_creg_clk()
149 creg_clk->reg = syscon; in clk_register_creg_clk()
150 creg_clk->hw.init = &init; in clk_register_creg_clk()
153 return devm_clk_register(dev, &creg_clk->hw); in clk_register_creg_clk()
155 return clk_register(NULL, &creg_clk->hw); in clk_register_creg_clk()
158 static struct clk *clk_creg_early[CREG_CLK_MAX];
169 syscon = syscon_node_to_regmap(np->parent); in lpc18xx_creg_clk_init()
180 clk_creg_early[CREG_CLK_1KHZ] = ERR_PTR(-EPROBE_DEFER); in lpc18xx_creg_clk_init()
184 CLK_OF_DECLARE_DRIVER(lpc18xx_creg_clk, "nxp,lpc1850-creg-clk",
187 static struct clk *clk_creg[CREG_CLK_MAX];
195 struct device_node *np = pdev->dev.of_node; in lpc18xx_creg_clk_probe()
198 syscon = syscon_node_to_regmap(np->parent); in lpc18xx_creg_clk_probe()
200 dev_err(&pdev->dev, "syscon lookup failed\n"); in lpc18xx_creg_clk_probe()
214 { .compatible = "nxp,lpc1850-creg-clk" },
221 .name = "lpc18xx-creg-clk",