Lines Matching +full:bd71828 +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>
18 /* BD71828 */
24 * BD71837, BD71847, BD70528 and BD71828 all use bit [0] to clk output control
39 return regmap_update_bits(c->mfd->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->mfd->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()
87 .name = "bd718xx-32k-out", in bd71837_clk_probe()
90 enum rohm_chip_type chip = platform_get_device_id(pdev)->driver_data; in bd71837_clk_probe()
92 c = devm_kzalloc(&pdev->dev, sizeof(*c), GFP_KERNEL); in bd71837_clk_probe()
94 return -ENOMEM; in bd71837_clk_probe()
97 parent_clk = of_clk_get_parent_name(parent->of_node, 0); in bd71837_clk_probe()
101 dev_err(&pdev->dev, "No parent clk found\n"); in bd71837_clk_probe()
102 return -EINVAL; in bd71837_clk_probe()
107 c->reg = BD718XX_REG_OUT32K; in bd71837_clk_probe()
108 c->mask = CLK_OUT_EN_MASK; in bd71837_clk_probe()
111 c->reg = BD71828_REG_OUT32K; in bd71837_clk_probe()
112 c->mask = CLK_OUT_EN_MASK; in bd71837_clk_probe()
115 c->reg = BD70528_REG_OUT32K; in bd71837_clk_probe()
116 c->mask = CLK_OUT_EN_MASK; in bd71837_clk_probe()
119 dev_err(&pdev->dev, "Unknown clk chip\n"); in bd71837_clk_probe()
120 return -EINVAL; in bd71837_clk_probe()
122 c->mfd = mfd; in bd71837_clk_probe()
123 c->pdev = pdev; in bd71837_clk_probe()
124 c->hw.init = &init; in bd71837_clk_probe()
126 of_property_read_string_index(parent->of_node, in bd71837_clk_probe()
127 "clock-output-names", 0, &init.name); in bd71837_clk_probe()
129 rval = devm_clk_hw_register(&pdev->dev, &c->hw); in bd71837_clk_probe()
131 dev_err(&pdev->dev, "failed to register 32K clk"); in bd71837_clk_probe()
134 rval = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, in bd71837_clk_probe()
135 &c->hw); in bd71837_clk_probe()
137 dev_err(&pdev->dev, "adding clk provider failed\n"); in bd71837_clk_probe()
143 { "bd71837-clk", ROHM_CHIP_TYPE_BD71837 },
144 { "bd71847-clk", ROHM_CHIP_TYPE_BD71847 },
145 { "bd70528-clk", ROHM_CHIP_TYPE_BD70528 },
146 { "bd71828-clk", ROHM_CHIP_TYPE_BD71828 },
153 .name = "bd718xx-clk",
164 MODULE_ALIAS("platform:bd718xx-clk");