#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/sys_soc.h>
#include "rcar-cpg-lib.h"
DEFINE_SPINLOCK(…);
void cpg_reg_modify(void __iomem *reg, u32 clear, u32 set)
{
unsigned long flags;
u32 val;
spin_lock_irqsave(&cpg_lock, flags);
val = readl(reg);
val &= ~clear;
val |= set;
writel(val, reg);
spin_unlock_irqrestore(&cpg_lock, flags);
};
static int cpg_simple_notifier_call(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
void cpg_simple_notifier_register(struct raw_notifier_head *notifiers,
struct cpg_simple_notifier *csn)
{ … }
#define SDnSRCFC_SHIFT …
#define STPnHCK …
static const struct clk_div_table cpg_sdh_div_table[] = …;
struct clk * __init cpg_sdh_clk_register(const char *name,
void __iomem *sdnckcr, const char *parent_name,
struct raw_notifier_head *notifiers)
{ … }
static const struct clk_div_table cpg_sd_div_table[] = …;
struct clk * __init cpg_sd_clk_register(const char *name,
void __iomem *sdnckcr, const char *parent_name)
{ … }
struct rpc_clock { … };
static const struct clk_div_table cpg_rpc_div_table[] = …;
struct clk * __init cpg_rpc_clk_register(const char *name,
void __iomem *rpcckcr, const char *parent_name,
struct raw_notifier_head *notifiers)
{ … }
struct rpcd2_clock { … };
struct clk * __init cpg_rpcd2_clk_register(const char *name,
void __iomem *rpcckcr,
const char *parent_name)
{ … }