#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/math.h>
#include <linux/module.h>
#include <linux/rational.h>
#include <linux/slab.h>
#include <linux/clk-provider.h>
#include "clk-fractional-divider.h"
static inline u32 clk_fd_readl(struct clk_fractional_divider *fd)
{ … }
static inline void clk_fd_writel(struct clk_fractional_divider *fd, u32 val)
{ … }
static void clk_fd_get_div(struct clk_hw *hw, struct u32_fract *fract)
{ … }
static unsigned long clk_fd_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
{ … }
void clk_fractional_divider_general_approximation(struct clk_hw *hw,
unsigned long rate,
unsigned long *parent_rate,
unsigned long *m, unsigned long *n)
{ … }
EXPORT_SYMBOL_GPL(…);
static long clk_fd_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate)
{ … }
static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{ … }
#ifdef CONFIG_DEBUG_FS
static int clk_fd_numerator_get(void *hw, u64 *val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static int clk_fd_denominator_get(void *hw, u64 *val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static void clk_fd_debug_init(struct clk_hw *hw, struct dentry *dentry)
{ … }
#endif
const struct clk_ops clk_fractional_divider_ops = …;
EXPORT_SYMBOL_GPL(…);
struct clk_hw *clk_hw_register_fractional_divider(struct device *dev,
const char *name, const char *parent_name, unsigned long flags,
void __iomem *reg, u8 mshift, u8 mwidth, u8 nshift, u8 nwidth,
u8 clk_divider_flags, spinlock_t *lock)
{ … }
EXPORT_SYMBOL_GPL(…);
struct clk *clk_register_fractional_divider(struct device *dev,
const char *name, const char *parent_name, unsigned long flags,
void __iomem *reg, u8 mshift, u8 mwidth, u8 nshift, u8 nwidth,
u8 clk_divider_flags, spinlock_t *lock)
{ … }
EXPORT_SYMBOL_GPL(…);
void clk_hw_unregister_fractional_divider(struct clk_hw *hw)
{ … }