linux/drivers/clocksource/renesas-ostm.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Renesas Timer Support - OSTM
 *
 * Copyright (C) 2017 Renesas Electronics America, Inc.
 * Copyright (C) 2017 Chris Brandt
 */

#include <linux/clk.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/sched_clock.h>
#include <linux/slab.h>

#include "timer-of.h"

/*
 * The OSTM contains independent channels.
 * The first OSTM channel probed will be set up as a free running
 * clocksource. Additionally we will use this clocksource for the system
 * schedule timer sched_clock().
 *
 * The second (or more) channel probed will be set up as an interrupt
 * driven clock event.
 */

static void __iomem *system_clock;	/* For sched_clock() */

/* OSTM REGISTERS */
#define OSTM_CMP
#define OSTM_CNT
#define OSTM_TE
#define OSTM_TS
#define OSTM_TT
#define OSTM_CTL

#define TE
#define TS
#define TT
#define CTL_PERIODIC
#define CTL_ONESHOT
#define CTL_FREERUN

static void ostm_timer_stop(struct timer_of *to)
{}

static int __init ostm_init_clksrc(struct timer_of *to)
{}

static u64 notrace ostm_read_sched_clock(void)
{}

static void __init ostm_init_sched_clock(struct timer_of *to)
{}

static int ostm_clock_event_next(unsigned long delta,
				 struct clock_event_device *ced)
{}

static int ostm_shutdown(struct clock_event_device *ced)
{}
static int ostm_set_periodic(struct clock_event_device *ced)
{}

static int ostm_set_oneshot(struct clock_event_device *ced)
{}

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

static int __init ostm_init_clkevt(struct timer_of *to)
{}

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

TIMER_OF_DECLARE(ostm, "renesas,ostm", ostm_init);

#if defined(CONFIG_ARCH_RZG2L) || defined(CONFIG_ARCH_R9A09G057)
static int __init ostm_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;

	return ostm_init(dev->of_node);
}

static const struct of_device_id ostm_of_table[] = {
	{ .compatible = "renesas,ostm", },
	{ /* sentinel */ }
};

static struct platform_driver ostm_device_driver = {
	.driver = {
		.name = "renesas_ostm",
		.of_match_table = of_match_ptr(ostm_of_table),
		.suppress_bind_attrs = true,
	},
};
builtin_platform_driver_probe(ostm_device_driver, ostm_probe);
#endif