Lines Matching +full:clkout +full:- +full:clock
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Clkout driver for Rockchip RK808
7 * Author:Chris Zhong <zyw@rock-chips.com>
10 #include <linux/clk-provider.h>
34 return regmap_update_bits(rk808_clkout->regmap, RK808_CLK32OUT_REG, in rk808_clkout2_enable()
55 int ret = regmap_read(rk808_clkout->regmap, RK808_CLK32OUT_REG, &val); in rk808_clkout2_is_prepared()
78 unsigned int idx = clkspec->args[0]; in of_clk_rk808_get()
82 return ERR_PTR(-EINVAL); in of_clk_rk808_get()
85 return idx ? &rk808_clkout->clkout2_hw : &rk808_clkout->clkout1_hw; in of_clk_rk808_get()
94 return regmap_update_bits(rk808_clkout->regmap, RK817_SYS_CFG(1), in rk817_clkout2_enable()
116 int ret = regmap_read(rk808_clkout->regmap, RK817_SYS_CFG(1), &val); in rk817_clkout2_is_prepared()
150 struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent); in rk808_clkout_probe()
151 struct device *dev = &pdev->dev; in rk808_clkout_probe()
156 dev->of_node = pdev->dev.parent->of_node; in rk808_clkout_probe()
161 return -ENOMEM; in rk808_clkout_probe()
163 rk808_clkout->regmap = dev_get_regmap(pdev->dev.parent, NULL); in rk808_clkout_probe()
164 if (!rk808_clkout->regmap) in rk808_clkout_probe()
165 return -ENODEV; in rk808_clkout_probe()
169 init.name = "rk808-clkout1"; in rk808_clkout_probe()
171 rk808_clkout->clkout1_hw.init = &init; in rk808_clkout_probe()
174 of_property_read_string_index(dev->of_node, "clock-output-names", in rk808_clkout_probe()
177 ret = devm_clk_hw_register(dev, &rk808_clkout->clkout1_hw); in rk808_clkout_probe()
181 init.name = "rk808-clkout2"; in rk808_clkout_probe()
182 init.ops = rkpmic_get_ops(rk808->variant); in rk808_clkout_probe()
183 rk808_clkout->clkout2_hw.init = &init; in rk808_clkout_probe()
186 of_property_read_string_index(dev->of_node, "clock-output-names", in rk808_clkout_probe()
189 ret = devm_clk_hw_register(dev, &rk808_clkout->clkout2_hw); in rk808_clkout_probe()
193 return devm_of_clk_add_hw_provider(&pdev->dev, of_clk_rk808_get, in rk808_clkout_probe()
200 .name = "rk808-clkout",
206 MODULE_DESCRIPTION("Clkout driver for the rk808 series PMICs");
207 MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>");
209 MODULE_ALIAS("platform:rk808-clkout");