clk-mstp.c (cdd5b5a9761fd66d17586e4f4ba6588c70e640ea) | clk-mstp.c (4ae2c995c4339959ef04eb9afbbda1966299e5d6) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * R-Car MSTP clocks 4 * 5 * Copyright (C) 2013 Ideas On Board SPRL 6 * Copyright (C) 2015 Glider bvba 7 * 8 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 9 */ 10 11#include <linux/clk.h> 12#include <linux/clk-provider.h> | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * R-Car MSTP clocks 4 * 5 * Copyright (C) 2013 Ideas On Board SPRL 6 * Copyright (C) 2015 Glider bvba 7 * 8 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 9 */ 10 11#include <linux/clk.h> 12#include <linux/clk-provider.h> |
13#include <linux/clkdev.h> | |
14#include <linux/clk/renesas.h> 15#include <linux/device.h> 16#include <linux/io.h> 17#include <linux/iopoll.h> 18#include <linux/of.h> 19#include <linux/of_address.h> 20#include <linux/pm_clock.h> 21#include <linux/pm_domain.h> | 13#include <linux/clk/renesas.h> 14#include <linux/device.h> 15#include <linux/io.h> 16#include <linux/iopoll.h> 17#include <linux/of.h> 18#include <linux/of_address.h> 19#include <linux/pm_clock.h> 20#include <linux/pm_domain.h> |
21#include <linux/slab.h> |
|
22#include <linux/spinlock.h> 23 24/* 25 * MSTP clocks. We can't use standard gate clocks as we need to poll on the 26 * status register when enabling the clock. 27 */ 28 29#define MSTP_MAX_CLOCKS 32 --- 202 unchanged lines hidden (view full) --- 232 if (clkidx >= MSTP_MAX_CLOCKS) { 233 pr_err("%s: invalid clock %pOFn %s index %u\n", 234 __func__, np, name, clkidx); 235 continue; 236 } 237 238 clks[clkidx] = cpg_mstp_clock_register(name, parent_name, 239 clkidx, group); | 22#include <linux/spinlock.h> 23 24/* 25 * MSTP clocks. We can't use standard gate clocks as we need to poll on the 26 * status register when enabling the clock. 27 */ 28 29#define MSTP_MAX_CLOCKS 32 --- 202 unchanged lines hidden (view full) --- 232 if (clkidx >= MSTP_MAX_CLOCKS) { 233 pr_err("%s: invalid clock %pOFn %s index %u\n", 234 __func__, np, name, clkidx); 235 continue; 236 } 237 238 clks[clkidx] = cpg_mstp_clock_register(name, parent_name, 239 clkidx, group); |
240 if (!IS_ERR(clks[clkidx])) { | 240 if (!IS_ERR(clks[clkidx])) |
241 group->data.clk_num = max(group->data.clk_num, 242 clkidx + 1); | 241 group->data.clk_num = max(group->data.clk_num, 242 clkidx + 1); |
243 /* 244 * Register a clkdev to let board code retrieve the 245 * clock by name and register aliases for non-DT 246 * devices. 247 * 248 * FIXME: Remove this when all devices that require a 249 * clock will be instantiated from DT. 250 */ 251 clk_register_clkdev(clks[clkidx], name, NULL); 252 } else { | 243 else |
253 pr_err("%s: failed to register %pOFn %s clock (%ld)\n", 254 __func__, np, name, PTR_ERR(clks[clkidx])); | 244 pr_err("%s: failed to register %pOFn %s clock (%ld)\n", 245 __func__, np, name, PTR_ERR(clks[clkidx])); |
255 } | |
256 } 257 258 of_clk_add_provider(np, of_clk_src_onecell_get, &group->data); 259} 260CLK_OF_DECLARE(cpg_mstp_clks, "renesas,cpg-mstp-clocks", cpg_mstp_clocks_init); 261 262int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev) 263{ --- 75 unchanged lines hidden --- | 246 } 247 248 of_clk_add_provider(np, of_clk_src_onecell_get, &group->data); 249} 250CLK_OF_DECLARE(cpg_mstp_clks, "renesas,cpg-mstp-clocks", cpg_mstp_clocks_init); 251 252int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev) 253{ --- 75 unchanged lines hidden --- |