#include <linux/bitfield.h>
#include <linux/clk-provider.h>
#include <linux/device.h>
#include <linux/sys_soc.h>
#include "renesas-cpg-mssr.h"
#include "rcar-gen3-cpg.h"
#define CPG_PLL0CR 0x00d8
#define CPG_PLL2CR 0x002c
#define CPG_PLL4CR 0x01f4
#define CPG_RCKCR_CKSEL BIT(15)
static spinlock_t cpg_lock;
static void cpg_reg_modify(void __iomem *reg, u32 clear, u32 set)
spin_lock_irqsave(&cpg_lock, flags);
spin_unlock_irqrestore(&cpg_lock, flags);
struct cpg_simple_notifier {
struct notifier_block nb;
static int cpg_simple_notifier_call(struct notifier_block *nb,
unsigned long action, void *data)
struct cpg_simple_notifier *csn =
container_of(nb, struct cpg_simple_notifier, nb);
csn->saved = readl(csn->reg);