Lines Matching +full:am654 +full:- +full:ehrpwm +full:- +full:tbclk
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com/
6 #include <linux/clk-provider.h>
37 return regmap_write_bits(priv->regmap, priv->reg, priv->idx, in ti_syscon_gate_clk_enable()
38 priv->idx); in ti_syscon_gate_clk_enable()
45 regmap_write_bits(priv->regmap, priv->reg, priv->idx, 0); in ti_syscon_gate_clk_disable()
53 regmap_read(priv->regmap, priv->reg, &val); in ti_syscon_gate_clk_is_enabled()
55 return !!(val & priv->idx); in ti_syscon_gate_clk_is_enabled()
76 return ERR_PTR(-ENOMEM); in ti_syscon_gate_clk_register()
80 name = kasprintf(GFP_KERNEL, "%s:%s", data->name, parent_name); in ti_syscon_gate_clk_register()
86 init.name = data->name; in ti_syscon_gate_clk_register()
92 priv->regmap = regmap; in ti_syscon_gate_clk_register()
93 priv->reg = data->offset; in ti_syscon_gate_clk_register()
94 priv->idx = BIT(data->bit_idx); in ti_syscon_gate_clk_register()
95 priv->hw.init = &init; in ti_syscon_gate_clk_register()
97 ret = devm_clk_hw_register(dev, &priv->hw); in ti_syscon_gate_clk_register()
105 return &priv->hw; in ti_syscon_gate_clk_register()
112 struct device *dev = &pdev->dev; in ti_syscon_gate_clk_probe()
119 return -EINVAL; in ti_syscon_gate_clk_probe()
121 regmap = device_node_to_regmap(dev->of_node); in ti_syscon_gate_clk_probe()
127 for (p = data; p->name; p++) in ti_syscon_gate_clk_probe()
130 num_parents = of_clk_get_parent_count(dev->of_node); in ti_syscon_gate_clk_probe()
131 if (of_device_is_compatible(dev->of_node, "ti,am62-audio-refclk") && in ti_syscon_gate_clk_probe()
133 return dev_err_probe(dev, -EINVAL, in ti_syscon_gate_clk_probe()
140 return -ENOMEM; in ti_syscon_gate_clk_probe()
142 hw_data->num = num_clks; in ti_syscon_gate_clk_probe()
144 parent_name = of_clk_get_parent_name(dev->of_node, 0); in ti_syscon_gate_clk_probe()
146 hw_data->hws[i] = ti_syscon_gate_clk_register(dev, regmap, in ti_syscon_gate_clk_probe()
149 if (IS_ERR(hw_data->hws[i])) in ti_syscon_gate_clk_probe()
156 hw_data->hws[0]); in ti_syscon_gate_clk_probe()
204 .compatible = "ti,am654-ehrpwm-tbclk",
208 .compatible = "ti,am64-epwm-tbclk",
212 .compatible = "ti,am62-epwm-tbclk",
216 .compatible = "ti,am62-audio-refclk",
226 .name = "ti-syscon-gate-clk",
233 MODULE_DESCRIPTION("Syscon backed gate-clock driver");