Lines Matching +full:exynos5410 +full:- +full:clock
1 // SPDX-License-Identifier: GPL-2.0-only
6 * Clock driver for Exynos clock output
11 #include <linux/clk-provider.h>
53 .compatible = "samsung,exynos3250-pmu",
56 .compatible = "samsung,exynos4210-pmu",
59 .compatible = "samsung,exynos4212-pmu",
62 .compatible = "samsung,exynos4412-pmu",
65 .compatible = "samsung,exynos5250-pmu",
68 .compatible = "samsung,exynos5410-pmu",
71 .compatible = "samsung,exynos5420-pmu",
74 .compatible = "samsung,exynos5433-pmu",
89 if (!dev->parent) { in exynos_clkout_match_parent_dev()
91 return -EINVAL; in exynos_clkout_match_parent_dev()
94 match = of_match_device(exynos_clkout_ids, dev->parent); in exynos_clkout_match_parent_dev()
97 return -EINVAL; in exynos_clkout_match_parent_dev()
99 variant = match->data; in exynos_clkout_match_parent_dev()
101 *mux_mask = variant->mux_mask; in exynos_clkout_match_parent_dev()
114 clkout = devm_kzalloc(&pdev->dev, in exynos_clkout_probe()
118 return -ENOMEM; in exynos_clkout_probe()
120 ret = exynos_clkout_match_parent_dev(&pdev->dev, &mux_mask); in exynos_clkout_probe()
124 clkout->np = pdev->dev.of_node; in exynos_clkout_probe()
125 if (!clkout->np) { in exynos_clkout_probe()
127 * pdev->dev.parent was checked by exynos_clkout_match_parent_dev() in exynos_clkout_probe()
130 clkout->np = pdev->dev.parent->of_node; in exynos_clkout_probe()
135 spin_lock_init(&clkout->slock); in exynos_clkout_probe()
142 parents[i] = of_clk_get_by_name(clkout->np, name); in exynos_clkout_probe()
153 return -EINVAL; in exynos_clkout_probe()
155 clkout->reg = of_iomap(clkout->np, 0); in exynos_clkout_probe()
156 if (!clkout->reg) { in exynos_clkout_probe()
157 ret = -ENODEV; in exynos_clkout_probe()
161 clkout->gate.reg = clkout->reg + EXYNOS_PMU_DEBUG_REG; in exynos_clkout_probe()
162 clkout->gate.bit_idx = EXYNOS_CLKOUT_DISABLE_SHIFT; in exynos_clkout_probe()
163 clkout->gate.flags = CLK_GATE_SET_TO_DISABLE; in exynos_clkout_probe()
164 clkout->gate.lock = &clkout->slock; in exynos_clkout_probe()
166 clkout->mux.reg = clkout->reg + EXYNOS_PMU_DEBUG_REG; in exynos_clkout_probe()
167 clkout->mux.mask = mux_mask; in exynos_clkout_probe()
168 clkout->mux.shift = EXYNOS_CLKOUT_MUX_SHIFT; in exynos_clkout_probe()
169 clkout->mux.lock = &clkout->slock; in exynos_clkout_probe()
171 clkout->data.hws[0] = clk_hw_register_composite(NULL, "clkout", in exynos_clkout_probe()
172 parent_names, parent_count, &clkout->mux.hw, in exynos_clkout_probe()
173 &clk_mux_ops, NULL, NULL, &clkout->gate.hw, in exynos_clkout_probe()
176 if (IS_ERR(clkout->data.hws[0])) { in exynos_clkout_probe()
177 ret = PTR_ERR(clkout->data.hws[0]); in exynos_clkout_probe()
181 clkout->data.num = EXYNOS_CLKOUT_NR_CLKS; in exynos_clkout_probe()
182 ret = of_clk_add_hw_provider(clkout->np, of_clk_hw_onecell_get, &clkout->data); in exynos_clkout_probe()
189 clk_hw_unregister(clkout->data.hws[0]); in exynos_clkout_probe()
191 iounmap(clkout->reg); in exynos_clkout_probe()
197 dev_err(&pdev->dev, "failed to register clkout clock\n"); in exynos_clkout_probe()
206 of_clk_del_provider(clkout->np); in exynos_clkout_remove()
207 clk_hw_unregister(clkout->data.hws[0]); in exynos_clkout_remove()
208 iounmap(clkout->reg); in exynos_clkout_remove()
215 clkout->pmu_debug_save = readl(clkout->reg + EXYNOS_PMU_DEBUG_REG); in exynos_clkout_suspend()
224 writel(clkout->pmu_debug_save, clkout->reg + EXYNOS_PMU_DEBUG_REG); in exynos_clkout_resume()
234 .name = "exynos-clkout",
245 MODULE_DESCRIPTION("Samsung Exynos clock output driver");