#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clk/renesas.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/pm_clock.h>
#include <linux/pm_domain.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#define MSTP_MAX_CLOCKS …
struct mstp_clock_group { … };
struct mstp_clock { … };
#define to_mstp_clock(_hw) …
static inline u32 cpg_mstp_read(struct mstp_clock_group *group,
u32 __iomem *reg)
{ … }
static inline void cpg_mstp_write(struct mstp_clock_group *group, u32 val,
u32 __iomem *reg)
{ … }
static int cpg_mstp_clock_endisable(struct clk_hw *hw, bool enable)
{ … }
static int cpg_mstp_clock_enable(struct clk_hw *hw)
{ … }
static void cpg_mstp_clock_disable(struct clk_hw *hw)
{ … }
static int cpg_mstp_clock_is_enabled(struct clk_hw *hw)
{ … }
static const struct clk_ops cpg_mstp_clock_ops = …;
static struct clk * __init cpg_mstp_clock_register(const char *name,
const char *parent_name, unsigned int index,
struct mstp_clock_group *group)
{ … }
static void __init cpg_mstp_clocks_init(struct device_node *np)
{ … }
CLK_OF_DECLARE(cpg_mstp_clks, "renesas,cpg-mstp-clocks", cpg_mstp_clocks_init);
int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
{ … }
void cpg_mstp_detach_dev(struct generic_pm_domain *unused, struct device *dev)
{ … }
void __init cpg_mstp_add_clk_domain(struct device_node *np)
{ … }