Lines Matching +full:bd71815 +full:- +full:32 +full:k +full:- +full:out

1 // SPDX-License-Identifier: GPL-2.0
10 #include <linux/mfd/rohm-generic.h>
11 #include <linux/clk-provider.h>
16 /* BD71815 */
39 return regmap_update_bits(c->regmap, c->reg, c->mask, status); in bd71837_clk_set()
49 dev_dbg(&c->pdev->dev, "Failed to disable 32K clk (%d)\n", rv); in bd71837_clk_disable()
65 rval = regmap_read(c->regmap, c->reg, &enabled); in bd71837_clk_is_enabled()
70 return enabled & c->mask; in bd71837_clk_is_enabled()
82 int rval = -ENOMEM; in bd71837_clk_probe()
84 struct device *parent = pdev->dev.parent; in bd71837_clk_probe()
86 .name = "bd718xx-32k-out", in bd71837_clk_probe()
89 enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; in bd71837_clk_probe()
91 c = devm_kzalloc(&pdev->dev, sizeof(*c), GFP_KERNEL); in bd71837_clk_probe()
93 return -ENOMEM; in bd71837_clk_probe()
95 c->regmap = dev_get_regmap(pdev->dev.parent, NULL); in bd71837_clk_probe()
96 if (!c->regmap) in bd71837_clk_probe()
97 return -ENODEV; in bd71837_clk_probe()
100 parent_clk = of_clk_get_parent_name(parent->of_node, 0); in bd71837_clk_probe()
104 dev_err(&pdev->dev, "No parent clk found\n"); in bd71837_clk_probe()
105 return -EINVAL; in bd71837_clk_probe()
110 c->reg = BD718XX_REG_OUT32K; in bd71837_clk_probe()
111 c->mask = CLK_OUT_EN_MASK; in bd71837_clk_probe()
114 c->reg = BD71828_REG_OUT32K; in bd71837_clk_probe()
115 c->mask = CLK_OUT_EN_MASK; in bd71837_clk_probe()
118 c->reg = BD71815_REG_OUT32K; in bd71837_clk_probe()
119 c->mask = CLK_OUT_EN_MASK; in bd71837_clk_probe()
122 dev_err(&pdev->dev, "Unknown clk chip\n"); in bd71837_clk_probe()
123 return -EINVAL; in bd71837_clk_probe()
125 c->pdev = pdev; in bd71837_clk_probe()
126 c->hw.init = &init; in bd71837_clk_probe()
128 of_property_read_string_index(parent->of_node, in bd71837_clk_probe()
129 "clock-output-names", 0, &init.name); in bd71837_clk_probe()
131 rval = devm_clk_hw_register(&pdev->dev, &c->hw); in bd71837_clk_probe()
133 dev_err(&pdev->dev, "failed to register 32K clk"); in bd71837_clk_probe()
136 rval = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, in bd71837_clk_probe()
137 &c->hw); in bd71837_clk_probe()
139 dev_err(&pdev->dev, "adding clk provider failed\n"); in bd71837_clk_probe()
145 { "bd71837-clk", ROHM_CHIP_TYPE_BD71837 },
146 { "bd71847-clk", ROHM_CHIP_TYPE_BD71847 },
147 { "bd71828-clk", ROHM_CHIP_TYPE_BD71828 },
148 { "bd71815-clk", ROHM_CHIP_TYPE_BD71815 },
155 .name = "bd718xx-clk",
166 MODULE_ALIAS("platform:bd718xx-clk");