#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clockchips.h>
#include <linux/mfd/ingenic-tcu.h>
#include <linux/mfd/syscon.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/syscore_ops.h>
#include <dt-bindings/clock/ingenic,tcu.h>
#define TCU_CLK_COUNT …
#undef pr_fmt
#define pr_fmt(fmt) …
enum tcu_clk_parent { … };
struct ingenic_soc_info { … };
struct ingenic_tcu_clk_info { … };
struct ingenic_tcu_clk { … };
struct ingenic_tcu { … };
static struct ingenic_tcu *ingenic_tcu;
static inline struct ingenic_tcu_clk *to_tcu_clk(struct clk_hw *hw)
{ … }
static int ingenic_tcu_enable(struct clk_hw *hw)
{ … }
static void ingenic_tcu_disable(struct clk_hw *hw)
{ … }
static int ingenic_tcu_is_enabled(struct clk_hw *hw)
{ … }
static bool ingenic_tcu_enable_regs(struct clk_hw *hw)
{ … }
static void ingenic_tcu_disable_regs(struct clk_hw *hw)
{ … }
static u8 ingenic_tcu_get_parent(struct clk_hw *hw)
{ … }
static int ingenic_tcu_set_parent(struct clk_hw *hw, u8 idx)
{ … }
static unsigned long ingenic_tcu_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{ … }
static u8 ingenic_tcu_get_prescale(unsigned long rate, unsigned long req_rate)
{ … }
static int ingenic_tcu_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{ … }
static int ingenic_tcu_set_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long parent_rate)
{ … }
static const struct clk_ops ingenic_tcu_clk_ops = …;
static const char * const ingenic_tcu_timer_parents[] = …;
#define DEF_TIMER …
static const struct ingenic_tcu_clk_info ingenic_tcu_clk_info[] = …;
static const struct ingenic_tcu_clk_info ingenic_tcu_watchdog_clk_info = …;
static const struct ingenic_tcu_clk_info ingenic_tcu_ost_clk_info = …;
#undef DEF_TIMER
static int __init ingenic_tcu_register_clock(struct ingenic_tcu *tcu,
unsigned int idx, enum tcu_clk_parent parent,
const struct ingenic_tcu_clk_info *info,
struct clk_hw_onecell_data *clocks)
{ … }
static const struct ingenic_soc_info jz4740_soc_info = …;
static const struct ingenic_soc_info jz4725b_soc_info = …;
static const struct ingenic_soc_info jz4770_soc_info = …;
static const struct ingenic_soc_info x1000_soc_info = …;
static const struct of_device_id __maybe_unused ingenic_tcu_of_match[] __initconst = …;
static int __init ingenic_tcu_probe(struct device_node *np)
{ … }
static int __maybe_unused tcu_pm_suspend(void)
{ … }
static void __maybe_unused tcu_pm_resume(void)
{ … }
static struct syscore_ops __maybe_unused tcu_pm_ops = …;
static void __init ingenic_tcu_init(struct device_node *np)
{ … }
CLK_OF_DECLARE_DRIVER(jz4740_cgu, "ingenic,jz4740-tcu", ingenic_tcu_init);
CLK_OF_DECLARE_DRIVER(jz4725b_cgu, "ingenic,jz4725b-tcu", ingenic_tcu_init);
CLK_OF_DECLARE_DRIVER(jz4760_cgu, "ingenic,jz4760-tcu", ingenic_tcu_init);
CLK_OF_DECLARE_DRIVER(jz4770_cgu, "ingenic,jz4770-tcu", ingenic_tcu_init);
CLK_OF_DECLARE_DRIVER(x1000_cgu, "ingenic,x1000-tcu", ingenic_tcu_init);