Lines Matching +full:rk808 +full:- +full:clkout2

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>
14 #include <linux/mfd/rk808.h>
18 struct rk808 *rk808; member
34 struct rk808 *rk808 = rk808_clkout->rk808; in rk808_clkout2_enable() local
36 return regmap_update_bits(rk808->regmap, RK808_CLK32OUT_REG, in rk808_clkout2_enable()
55 struct rk808 *rk808 = rk808_clkout->rk808; in rk808_clkout2_is_prepared() local
58 int ret = regmap_read(rk808->regmap, RK808_CLK32OUT_REG, &val); in rk808_clkout2_is_prepared()
81 unsigned int idx = clkspec->args[0]; in of_clk_rk808_get()
85 return ERR_PTR(-EINVAL); in of_clk_rk808_get()
88 return idx ? &rk808_clkout->clkout2_hw : &rk808_clkout->clkout1_hw; in of_clk_rk808_get()
96 struct rk808 *rk808 = rk808_clkout->rk808; in rk817_clkout2_enable() local
98 return regmap_update_bits(rk808->regmap, RK817_SYS_CFG(1), in rk817_clkout2_enable()
118 struct rk808 *rk808 = rk808_clkout->rk808; in rk817_clkout2_is_prepared() local
121 int ret = regmap_read(rk808->regmap, RK817_SYS_CFG(1), &val); in rk817_clkout2_is_prepared()
155 struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent); in rk808_clkout_probe() local
156 struct i2c_client *client = rk808->i2c; in rk808_clkout_probe()
157 struct device_node *node = client->dev.of_node; in rk808_clkout_probe()
162 rk808_clkout = devm_kzalloc(&client->dev, in rk808_clkout_probe()
165 return -ENOMEM; in rk808_clkout_probe()
167 rk808_clkout->rk808 = rk808; in rk808_clkout_probe()
171 init.name = "rk808-clkout1"; in rk808_clkout_probe()
173 rk808_clkout->clkout1_hw.init = &init; in rk808_clkout_probe()
176 of_property_read_string_index(node, "clock-output-names", in rk808_clkout_probe()
179 ret = devm_clk_hw_register(&client->dev, &rk808_clkout->clkout1_hw); in rk808_clkout_probe()
183 init.name = "rk808-clkout2"; in rk808_clkout_probe()
184 init.ops = rkpmic_get_ops(rk808->variant); in rk808_clkout_probe()
185 rk808_clkout->clkout2_hw.init = &init; in rk808_clkout_probe()
188 of_property_read_string_index(node, "clock-output-names", in rk808_clkout_probe()
191 ret = devm_clk_hw_register(&client->dev, &rk808_clkout->clkout2_hw); in rk808_clkout_probe()
195 return devm_of_clk_add_hw_provider(&pdev->dev, of_clk_rk808_get, in rk808_clkout_probe()
202 .name = "rk808-clkout",
208 MODULE_DESCRIPTION("Clkout driver for the rk808 series PMICs");
209 MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>");
211 MODULE_ALIAS("platform:rk808-clkout");