linux/drivers/clocksource/timer-atmel-pit.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * at91sam926x_time.c - Periodic Interval Timer (PIT) for at91sam926x
 *
 * Copyright (C) 2005-2006 M. Amine SAYA, ATMEL Rousset, France
 * Revision	 2005 M. Nicolas Diremdjian, ATMEL Rousset, France
 * Converted to ClockSource/ClockEvents by David Brownell.
 */

#define pr_fmt(fmt)

#include <linux/clk.h>
#include <linux/clockchips.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/slab.h>

#define AT91_PIT_MR
#define AT91_PIT_PITIEN
#define AT91_PIT_PITEN
#define AT91_PIT_PIV

#define AT91_PIT_SR
#define AT91_PIT_PITS

#define AT91_PIT_PIVR
#define AT91_PIT_PIIR
#define AT91_PIT_PICNT
#define AT91_PIT_CPIV

#define PIT_CPIV(x)
#define PIT_PICNT(x)

struct pit_data {};

static inline struct pit_data *clksrc_to_pit_data(struct clocksource *clksrc)
{}

static inline struct pit_data *clkevt_to_pit_data(struct clock_event_device *clkevt)
{}

static inline unsigned int pit_read(void __iomem *base, unsigned int reg_offset)
{}

static inline void pit_write(void __iomem *base, unsigned int reg_offset, unsigned long value)
{}

/*
 * Clocksource:  just a monotonic counter of MCK/16 cycles.
 * We don't care whether or not PIT irqs are enabled.
 */
static u64 read_pit_clk(struct clocksource *cs)
{}

static int pit_clkevt_shutdown(struct clock_event_device *dev)
{}

/*
 * Clockevent device:  interrupts every 1/HZ (== pit_cycles * MCK/16)
 */
static int pit_clkevt_set_periodic(struct clock_event_device *dev)
{}

static void at91sam926x_pit_suspend(struct clock_event_device *cedev)
{}

static void at91sam926x_pit_reset(struct pit_data *data)
{}

static void at91sam926x_pit_resume(struct clock_event_device *cedev)
{}

/*
 * IRQ handler for the timer.
 */
static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
{}

/*
 * Set up both clocksource and clockevent support.
 */
static int __init at91sam926x_pit_dt_init(struct device_node *node)
{}
TIMER_OF_DECLARE(at91sam926x_pit, "atmel,at91sam9260-pit",
		       at91sam926x_pit_dt_init);