#include <linux/bitops.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clkdev.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/math64.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/time.h>
#include "cgu.h"
#define MHZ …
static inline const struct ingenic_cgu_clk_info *
to_clk_info(struct ingenic_clk *clk)
{ … }
static inline bool
ingenic_cgu_gate_get(struct ingenic_cgu *cgu,
const struct ingenic_cgu_gate_info *info)
{ … }
static inline void
ingenic_cgu_gate_set(struct ingenic_cgu *cgu,
const struct ingenic_cgu_gate_info *info, bool val)
{ … }
static unsigned long
ingenic_pll_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
{ … }
static void
ingenic_pll_calc_m_n_od(const struct ingenic_cgu_pll_info *pll_info,
unsigned long rate, unsigned long parent_rate,
unsigned int *pm, unsigned int *pn, unsigned int *pod)
{ … }
static unsigned long
ingenic_pll_calc(const struct ingenic_cgu_clk_info *clk_info,
unsigned long rate, unsigned long parent_rate,
unsigned int *pm, unsigned int *pn, unsigned int *pod)
{ … }
static long
ingenic_pll_round_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long *prate)
{ … }
static inline int ingenic_pll_check_stable(struct ingenic_cgu *cgu,
const struct ingenic_cgu_pll_info *pll_info)
{ … }
static int
ingenic_pll_set_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long parent_rate)
{ … }
static int ingenic_pll_enable(struct clk_hw *hw)
{ … }
static void ingenic_pll_disable(struct clk_hw *hw)
{ … }
static int ingenic_pll_is_enabled(struct clk_hw *hw)
{ … }
static const struct clk_ops ingenic_pll_ops = …;
static u8 ingenic_clk_get_parent(struct clk_hw *hw)
{ … }
static int ingenic_clk_set_parent(struct clk_hw *hw, u8 idx)
{ … }
static unsigned long
ingenic_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
{ … }
static unsigned int
ingenic_clk_calc_hw_div(const struct ingenic_cgu_clk_info *clk_info,
unsigned int div)
{ … }
static unsigned
ingenic_clk_calc_div(struct clk_hw *hw,
const struct ingenic_cgu_clk_info *clk_info,
unsigned long parent_rate, unsigned long req_rate)
{ … }
static int ingenic_clk_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{ … }
static inline int ingenic_clk_check_stable(struct ingenic_cgu *cgu,
const struct ingenic_cgu_clk_info *clk_info)
{ … }
static int
ingenic_clk_set_rate(struct clk_hw *hw, unsigned long req_rate,
unsigned long parent_rate)
{ … }
static int ingenic_clk_enable(struct clk_hw *hw)
{ … }
static void ingenic_clk_disable(struct clk_hw *hw)
{ … }
static int ingenic_clk_is_enabled(struct clk_hw *hw)
{ … }
static const struct clk_ops ingenic_clk_ops = …;
static int ingenic_register_clock(struct ingenic_cgu *cgu, unsigned idx)
{ … }
struct ingenic_cgu *
ingenic_cgu_new(const struct ingenic_cgu_clk_info *clock_info,
unsigned num_clocks, struct device_node *np)
{ … }
int ingenic_cgu_register_clocks(struct ingenic_cgu *cgu)
{ … }