linux/drivers/clocksource/timer-msc313e.c

// SPDX-License-Identifier: GPL-2.0
/*
 * MStar timer driver
 *
 * Copyright (C) 2021 Daniel Palmer
 * Copyright (C) 2021 Romain Perier
 *
 */

#include <linux/clk.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/irqreturn.h>
#include <linux/sched_clock.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>

#ifdef CONFIG_ARM
#include <linux/delay.h>
#endif

#include "timer-of.h"

#define TIMER_NAME

#define MSC313E_REG_CTRL
#define MSC313E_REG_CTRL_TIMER_EN
#define MSC313E_REG_CTRL_TIMER_TRIG
#define MSC313E_REG_CTRL_TIMER_INT_EN
#define MSC313E_REG_TIMER_MAX_LOW
#define MSC313E_REG_TIMER_MAX_HIGH
#define MSC313E_REG_COUNTER_LOW
#define MSC313E_REG_COUNTER_HIGH
#define MSC313E_REG_TIMER_DIVIDE

#define MSC313E_CLK_DIVIDER
#define TIMER_SYNC_TICKS

#ifdef CONFIG_ARM
struct msc313e_delay {
	void __iomem *base;
	struct delay_timer delay;
};
static struct msc313e_delay msc313e_delay;
#endif

static void __iomem *msc313e_clksrc;

static void msc313e_timer_stop(void __iomem *base)
{}

static void msc313e_timer_start(void __iomem *base, bool periodic)
{}

static void msc313e_timer_setup(void __iomem *base, unsigned long delay)
{}

static unsigned long msc313e_timer_current_value(void __iomem *base)
{}

static int msc313e_timer_clkevt_shutdown(struct clock_event_device *evt)
{}

static int msc313e_timer_clkevt_set_oneshot(struct clock_event_device *evt)
{}

static int msc313e_timer_clkevt_set_periodic(struct clock_event_device *evt)
{}

static int msc313e_timer_clkevt_next_event(unsigned long evt, struct clock_event_device *clkevt)
{}

static irqreturn_t msc313e_timer_clkevt_irq(int irq, void *dev_id)
{}

static u64 msc313e_timer_clksrc_read(struct clocksource *cs)
{}

#ifdef CONFIG_ARM
static unsigned long msc313e_read_delay_timer_read(void)
{
	return msc313e_timer_current_value(msc313e_delay.base);
}
#endif

static u64 msc313e_timer_sched_clock_read(void)
{}

static struct clock_event_device msc313e_clkevt =;

static int __init msc313e_clkevt_init(struct device_node *np)
{}

static int __init msc313e_clksrc_init(struct device_node *np)
{}

static int __init msc313e_timer_init(struct device_node *np)
{}

TIMER_OF_DECLARE(msc313, "mstar,msc313e-timer", msc313e_timer_init);
TIMER_OF_DECLARE(ssd20xd, "sstar,ssd20xd-timer", msc313e_timer_init);