linux/drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2020 Yangtao Li <[email protected]>
 */

#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/platform_device.h>

#include "ccu_common.h"
#include "ccu_reset.h"

#include "ccu_div.h"
#include "ccu_gate.h"
#include "ccu_mp.h"
#include "ccu_nm.h"

#include "ccu-sun50i-a100-r.h"

static const char * const cpus_r_apb2_parents[] =;
static const struct ccu_mux_var_prediv cpus_r_apb2_predivs[] =;

static struct ccu_div r_cpus_clk =;

static CLK_FIXED_FACTOR_HW(r_ahb_clk, "r-ahb", &r_cpus_clk.common.hw, 1, 1, 0);

static struct ccu_div r_apb1_clk =;

static struct ccu_div r_apb2_clk =;

static const struct clk_parent_data clk_parent_r_apb1[] =;

static const struct clk_parent_data clk_parent_r_apb2[] =;

static SUNXI_CCU_GATE_DATA(r_apb1_timer_clk, "r-apb1-timer", clk_parent_r_apb1,
			   0x11c, BIT(0), 0);

static SUNXI_CCU_GATE_DATA(r_apb1_twd_clk, "r-apb1-twd", clk_parent_r_apb1,
			   0x12c, BIT(0), 0);

static const char * const r_apb1_pwm_clk_parents[] =;
static SUNXI_CCU_MUX(r_apb1_pwm_clk, "r-apb1-pwm", r_apb1_pwm_clk_parents,
		     0x130, 24, 2, 0);

static SUNXI_CCU_GATE_DATA(r_apb1_bus_pwm_clk, "r-apb1-bus-pwm",
			   clk_parent_r_apb1, 0x13c, BIT(0), 0);

static SUNXI_CCU_GATE_DATA(r_apb1_ppu_clk, "r-apb1-ppu", clk_parent_r_apb1,
			   0x17c, BIT(0), 0);

static SUNXI_CCU_GATE_DATA(r_apb2_uart_clk, "r-apb2-uart", clk_parent_r_apb2,
			   0x18c, BIT(0), 0);

static SUNXI_CCU_GATE_DATA(r_apb2_i2c0_clk, "r-apb2-i2c0", clk_parent_r_apb2,
			   0x19c, BIT(0), 0);

static SUNXI_CCU_GATE_DATA(r_apb2_i2c1_clk, "r-apb2-i2c1", clk_parent_r_apb2,
			   0x19c, BIT(1), 0);

static const char * const r_apb1_ir_rx_parents[] =;
static SUNXI_CCU_MP_WITH_MUX_GATE(r_apb1_ir_rx_clk, "r-apb1-ir-rx",
				  r_apb1_ir_rx_parents, 0x1c0,
				  0, 5,		/* M */
				  8, 2,		/* P */
				  24, 1,	/* mux */
				  BIT(31),	/* gate */
				  0);

static SUNXI_CCU_GATE_DATA(r_apb1_bus_ir_rx_clk, "r-apb1-bus-ir-rx",
			   clk_parent_r_apb1, 0x1cc, BIT(0), 0);

static SUNXI_CCU_GATE(r_ahb_bus_rtc_clk, "r-ahb-rtc", "r-ahb",
		      0x20c, BIT(0), 0);

static struct ccu_common *sun50i_a100_r_ccu_clks[] =;

static struct clk_hw_onecell_data sun50i_a100_r_hw_clks =;

static struct ccu_reset_map sun50i_a100_r_ccu_resets[] =;

static const struct sunxi_ccu_desc sun50i_a100_r_ccu_desc =;

static int sun50i_a100_r_ccu_probe(struct platform_device *pdev)
{}

static const struct of_device_id sun50i_a100_r_ccu_ids[] =;
MODULE_DEVICE_TABLE(of, sun50i_a100_r_ccu_ids);

static struct platform_driver sun50i_a100_r_ccu_driver =;
module_platform_driver();

MODULE_IMPORT_NS();
MODULE_DESCRIPTION();
MODULE_LICENSE();