#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/iopoll.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_clock.h>
#include <linux/pm_domain.h>
#include <linux/reset-controller.h>
#include <dt-bindings/clock/renesas-cpg-mssr.h>
#include "rzv2h-cpg.h"
#ifdef DEBUG
#define WARN_DEBUG …
#else
#define WARN_DEBUG(x) …
#endif
#define GET_CLK_ON_OFFSET(x) …
#define GET_CLK_MON_OFFSET(x) …
#define GET_RST_OFFSET(x) …
#define GET_RST_MON_OFFSET(x) …
#define KDIV(val) …
#define MDIV(val) …
#define PDIV(val) …
#define SDIV(val) …
#define DDIV_DIVCTL_WEN(shift) …
#define GET_MOD_CLK_ID(base, index, bit) …
#define CPG_CLKSTATUS0 …
struct rzv2h_cpg_priv { … };
#define rcdev_to_priv(x) …
struct pll_clk { … };
#define to_pll(_hw) …
struct mod_clock { … };
#define to_mod_clock(_hw) …
struct ddiv_clk { … };
#define to_ddiv_clock(_div) …
static unsigned long rzv2h_cpg_pll_clk_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{ … }
static const struct clk_ops rzv2h_cpg_pll_ops = …;
static struct clk * __init
rzv2h_cpg_pll_clk_register(const struct cpg_core_clk *core,
struct rzv2h_cpg_priv *priv,
const struct clk_ops *ops)
{ … }
static unsigned long rzv2h_ddiv_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{ … }
static long rzv2h_ddiv_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{ … }
static int rzv2h_ddiv_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{ … }
static inline int rzv2h_cpg_wait_ddiv_clk_update_done(void __iomem *base, u8 mon)
{ … }
static int rzv2h_ddiv_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{ … }
static const struct clk_ops rzv2h_ddiv_clk_divider_ops = …;
static struct clk * __init
rzv2h_cpg_ddiv_clk_register(const struct cpg_core_clk *core,
struct rzv2h_cpg_priv *priv)
{ … }
static struct clk
*rzv2h_cpg_clk_src_twocell_get(struct of_phandle_args *clkspec,
void *data)
{ … }
static void __init
rzv2h_cpg_register_core_clk(const struct cpg_core_clk *core,
struct rzv2h_cpg_priv *priv)
{ … }
static int rzv2h_mod_clock_endisable(struct clk_hw *hw, bool enable)
{ … }
static int rzv2h_mod_clock_enable(struct clk_hw *hw)
{ … }
static void rzv2h_mod_clock_disable(struct clk_hw *hw)
{ … }
static int rzv2h_mod_clock_is_enabled(struct clk_hw *hw)
{ … }
static const struct clk_ops rzv2h_mod_clock_ops = …;
static void __init
rzv2h_cpg_register_mod_clk(const struct rzv2h_mod_clk *mod,
struct rzv2h_cpg_priv *priv)
{ … }
static int rzv2h_cpg_assert(struct reset_controller_dev *rcdev,
unsigned long id)
{ … }
static int rzv2h_cpg_deassert(struct reset_controller_dev *rcdev,
unsigned long id)
{ … }
static int rzv2h_cpg_reset(struct reset_controller_dev *rcdev,
unsigned long id)
{ … }
static int rzv2h_cpg_status(struct reset_controller_dev *rcdev,
unsigned long id)
{ … }
static const struct reset_control_ops rzv2h_cpg_reset_ops = …;
static int rzv2h_cpg_reset_xlate(struct reset_controller_dev *rcdev,
const struct of_phandle_args *reset_spec)
{ … }
static int rzv2h_cpg_reset_controller_register(struct rzv2h_cpg_priv *priv)
{ … }
struct rzv2h_cpg_pd { … };
static int rzv2h_cpg_attach_dev(struct generic_pm_domain *domain, struct device *dev)
{ … }
static void rzv2h_cpg_detach_dev(struct generic_pm_domain *unused, struct device *dev)
{ … }
static void rzv2h_cpg_genpd_remove_simple(void *data)
{ … }
static int __init rzv2h_cpg_add_pm_domains(struct rzv2h_cpg_priv *priv)
{ … }
static void rzv2h_cpg_del_clk_provider(void *data)
{ … }
static int __init rzv2h_cpg_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id rzv2h_cpg_match[] = …;
static struct platform_driver rzv2h_cpg_driver = …;
static int __init rzv2h_cpg_init(void)
{ … }
subsys_initcall(rzv2h_cpg_init);
MODULE_DESCRIPTION(…) …;