Lines Matching +full:sun8i +full:- +full:a23 +full:- +full:apb0 +full:- +full:clk
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2014 Chen-Yu Tsai
4 * Author: Chen-Yu Tsai <wens@csie.org>
6 * Allwinner A23 APB0 clock driver
8 * Based on clk-sun6i-apb0.c
9 * Allwinner A31 APB0 clock driver
12 * Author: Boris BREZILLON <boris.brezillon@free-electrons.com>
15 #include <linux/clk-provider.h>
22 static struct clk *sun8i_a23_apb0_register(struct device_node *node, in sun8i_a23_apb0_register()
25 const char *clk_name = node->name; in sun8i_a23_apb0_register()
27 struct clk *clk; in sun8i_a23_apb0_register() local
32 return ERR_PTR(-EINVAL); in sun8i_a23_apb0_register()
34 of_property_read_string(node, "clock-output-names", &clk_name); in sun8i_a23_apb0_register()
36 /* The A23 APB0 clock is a standard 2 bit wide divider clock */ in sun8i_a23_apb0_register()
37 clk = clk_register_divider(NULL, clk_name, clk_parent, 0, reg, in sun8i_a23_apb0_register()
39 if (IS_ERR(clk)) in sun8i_a23_apb0_register()
40 return clk; in sun8i_a23_apb0_register()
42 ret = of_clk_add_provider(node, of_clk_src_simple_get, clk); in sun8i_a23_apb0_register()
46 return clk; in sun8i_a23_apb0_register()
49 clk_unregister_divider(clk); in sun8i_a23_apb0_register()
58 struct clk *clk; in sun8i_a23_apb0_setup() local
63 * This happens with clk nodes instantiated through mfd, in sun8i_a23_apb0_setup()
67 if (PTR_ERR(reg) != -EINVAL) in sun8i_a23_apb0_setup()
68 pr_err("Could not get registers for a23-apb0-clk\n"); in sun8i_a23_apb0_setup()
73 clk = sun8i_a23_apb0_register(node, reg); in sun8i_a23_apb0_setup()
74 if (IS_ERR(clk)) in sun8i_a23_apb0_setup()
84 CLK_OF_DECLARE_DRIVER(sun8i_a23_apb0, "allwinner,sun8i-a23-apb0-clk",
89 struct device_node *np = pdev->dev.of_node; in sun8i_a23_apb0_clk_probe()
92 struct clk *clk; in sun8i_a23_apb0_clk_probe() local
95 reg = devm_ioremap_resource(&pdev->dev, r); in sun8i_a23_apb0_clk_probe()
99 clk = sun8i_a23_apb0_register(np, reg); in sun8i_a23_apb0_clk_probe()
100 return PTR_ERR_OR_ZERO(clk); in sun8i_a23_apb0_clk_probe()
104 { .compatible = "allwinner,sun8i-a23-apb0-clk" },
110 .name = "sun8i-a23-apb0-clk",