#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/math64.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_clock.h>
#include <linux/pm_domain.h>
#include <linux/slab.h>
#include <linux/soc/renesas/r9a06g032-sysctrl.h>
#include <linux/spinlock.h>
#include <dt-bindings/clock/r9a06g032-sysctrl.h>
#define R9A06G032_SYSCTRL_USB …
#define R9A06G032_SYSCTRL_USB_H2MODE …
#define R9A06G032_SYSCTRL_DMAMUX …
struct regbit { … };
#define RB(_reg, _bit) …
struct r9a06g032_gate { … };
enum gate_type { … };
struct r9a06g032_clkdesc { … };
#define I_GATE(_clk, _rst, _rdy, _midle, _scon, _mirack, _mistat) …
#define D_GATE(_idx, _n, _src, ...) …
#define D_MODULE(_idx, _n, _src, ...) …
#define D_ROOT(_idx, _n, _mul, _div) …
#define D_FFC(_idx, _n, _src, _div) …
#define D_DIV(_idx, _n, _src, _reg, _min, _max, ...) …
#define D_UGATE(_idx, _n, _src, _g, _g1, _r1, _g2, _r2) …
#define R9A06G032_CLKOUT …
#define R9A06G032_CLKOUT_D10 …
#define R9A06G032_CLKOUT_D16 …
#define R9A06G032_CLKOUT_D160 …
#define R9A06G032_CLKOUT_D1OR2 …
#define R9A06G032_CLKOUT_D20 …
#define R9A06G032_CLKOUT_D40 …
#define R9A06G032_CLKOUT_D5 …
#define R9A06G032_CLKOUT_D8 …
#define R9A06G032_DIV_ADC …
#define R9A06G032_DIV_I2C …
#define R9A06G032_DIV_NAND …
#define R9A06G032_DIV_P1_PG …
#define R9A06G032_DIV_P2_PG …
#define R9A06G032_DIV_P3_PG …
#define R9A06G032_DIV_P4_PG …
#define R9A06G032_DIV_P5_PG …
#define R9A06G032_DIV_P6_PG …
#define R9A06G032_DIV_QSPI0 …
#define R9A06G032_DIV_QSPI1 …
#define R9A06G032_DIV_REF_SYNC …
#define R9A06G032_DIV_SDIO0 …
#define R9A06G032_DIV_SDIO1 …
#define R9A06G032_DIV_SWITCH …
#define R9A06G032_DIV_UART …
#define R9A06G032_DIV_MOTOR …
#define R9A06G032_CLK_DDRPHY_PLLCLK_D4 …
#define R9A06G032_CLK_ECAT100_D4 …
#define R9A06G032_CLK_HSR100_D2 …
#define R9A06G032_CLK_REF_SYNC_D4 …
#define R9A06G032_CLK_REF_SYNC_D8 …
#define R9A06G032_CLK_SERCOS100_D2 …
#define R9A06G032_DIV_CA7 …
#define R9A06G032_UART_GROUP_012 …
#define R9A06G032_UART_GROUP_34567 …
#define R9A06G032_CLOCK_COUNT …
static const struct r9a06g032_clkdesc r9a06g032_clocks[] = …;
struct r9a06g032_priv { … };
static struct r9a06g032_priv *sysctrl_priv;
int r9a06g032_sysctrl_set_dmamux(u32 mask, u32 val)
{ … }
EXPORT_SYMBOL_GPL(…);
static void clk_rdesc_set(struct r9a06g032_priv *clocks,
struct regbit rb, unsigned int on)
{ … }
static int clk_rdesc_get(struct r9a06g032_priv *clocks, struct regbit rb)
{ … }
struct r9a06g032_clk_gate { … };
#define to_r9a06g032_gate(_hw) …
static int create_add_module_clock(struct of_phandle_args *clkspec,
struct device *dev)
{ … }
static int r9a06g032_attach_dev(struct generic_pm_domain *pd,
struct device *dev)
{ … }
static void r9a06g032_detach_dev(struct generic_pm_domain *unused, struct device *dev)
{ … }
static int r9a06g032_add_clk_domain(struct device *dev)
{ … }
static void
r9a06g032_clk_gate_set(struct r9a06g032_priv *clocks,
struct r9a06g032_gate *g, int on)
{ … }
static int r9a06g032_clk_gate_enable(struct clk_hw *hw)
{ … }
static void r9a06g032_clk_gate_disable(struct clk_hw *hw)
{ … }
static int r9a06g032_clk_gate_is_enabled(struct clk_hw *hw)
{ … }
static const struct clk_ops r9a06g032_clk_gate_ops = …;
static struct clk *
r9a06g032_register_gate(struct r9a06g032_priv *clocks,
const char *parent_name,
const struct r9a06g032_clkdesc *desc)
{ … }
struct r9a06g032_clk_div { … };
#define to_r9a06g032_div(_hw) …
static unsigned long
r9a06g032_div_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{ … }
static long
r9a06g032_div_clamp_div(struct r9a06g032_clk_div *clk,
unsigned long rate, unsigned long prate)
{ … }
static int
r9a06g032_div_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
{ … }
static int
r9a06g032_div_set_rate(struct clk_hw *hw,
unsigned long rate, unsigned long parent_rate)
{ … }
static const struct clk_ops r9a06g032_clk_div_ops = …;
static struct clk *
r9a06g032_register_div(struct r9a06g032_priv *clocks,
const char *parent_name,
const struct r9a06g032_clkdesc *desc)
{ … }
struct r9a06g032_clk_bitsel { … };
#define to_clk_bitselect(_hw) …
static u8 r9a06g032_clk_mux_get_parent(struct clk_hw *hw)
{ … }
static int r9a06g032_clk_mux_set_parent(struct clk_hw *hw, u8 index)
{ … }
static const struct clk_ops clk_bitselect_ops = …;
static struct clk *
r9a06g032_register_bitsel(struct r9a06g032_priv *clocks,
const char *parent_name,
const struct r9a06g032_clkdesc *desc)
{ … }
struct r9a06g032_clk_dualgate { … };
#define to_clk_dualgate(_hw) …
static int
r9a06g032_clk_dualgate_setenable(struct r9a06g032_clk_dualgate *g, int enable)
{ … }
static int r9a06g032_clk_dualgate_enable(struct clk_hw *hw)
{ … }
static void r9a06g032_clk_dualgate_disable(struct clk_hw *hw)
{ … }
static int r9a06g032_clk_dualgate_is_enabled(struct clk_hw *hw)
{ … }
static const struct clk_ops r9a06g032_clk_dualgate_ops = …;
static struct clk *
r9a06g032_register_dualgate(struct r9a06g032_priv *clocks,
const char *parent_name,
const struct r9a06g032_clkdesc *desc,
struct regbit sel)
{ … }
static void r9a06g032_clocks_del_clk_provider(void *data)
{ … }
static void __init r9a06g032_init_h2mode(struct r9a06g032_priv *clocks)
{ … }
static int __init r9a06g032_clocks_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id r9a06g032_match[] = …;
static struct platform_driver r9a06g032_clock_driver = …;
static int __init r9a06g032_clocks_init(void)
{ … }
subsys_initcall(r9a06g032_clocks_init);