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>
35 return regmap_write_bits(priv->regmap, priv->reg, priv->idx, in ti_syscon_gate_clk_enable()
36 priv->idx); in ti_syscon_gate_clk_enable()
43 regmap_write_bits(priv->regmap, priv->reg, priv->idx, 0); in ti_syscon_gate_clk_disable()
51 regmap_read(priv->regmap, priv->reg, &val); in ti_syscon_gate_clk_is_enabled()
53 return !!(val & priv->idx); in ti_syscon_gate_clk_is_enabled()
72 return ERR_PTR(-ENOMEM); in ti_syscon_gate_clk_register()
74 init.name = data->name; in ti_syscon_gate_clk_register()
80 priv->regmap = regmap; in ti_syscon_gate_clk_register()
81 priv->reg = data->offset; in ti_syscon_gate_clk_register()
82 priv->idx = BIT(data->bit_idx); in ti_syscon_gate_clk_register()
83 priv->hw.init = &init; in ti_syscon_gate_clk_register()
85 ret = devm_clk_hw_register(dev, &priv->hw); in ti_syscon_gate_clk_register()
89 return &priv->hw; in ti_syscon_gate_clk_register()
96 struct device *dev = &pdev->dev; in ti_syscon_gate_clk_probe()
102 return -EINVAL; in ti_syscon_gate_clk_probe()
104 regmap = syscon_node_to_regmap(dev->of_node); in ti_syscon_gate_clk_probe()
106 if (PTR_ERR(regmap) == -EPROBE_DEFER) in ti_syscon_gate_clk_probe()
107 return -EPROBE_DEFER; in ti_syscon_gate_clk_probe()
113 for (p = data; p->name; p++) in ti_syscon_gate_clk_probe()
119 return -ENOMEM; in ti_syscon_gate_clk_probe()
121 hw_data->num = num_clks; in ti_syscon_gate_clk_probe()
124 hw_data->hws[i] = ti_syscon_gate_clk_register(dev, regmap, in ti_syscon_gate_clk_probe()
126 if (IS_ERR(hw_data->hws[i])) in ti_syscon_gate_clk_probe()
174 .compatible = "ti,am654-ehrpwm-tbclk",
178 .compatible = "ti,am64-epwm-tbclk",
182 .compatible = "ti,am62-epwm-tbclk",
192 .name = "ti-syscon-gate-clk",
199 MODULE_DESCRIPTION("Syscon backed gate-clock driver");