linux/drivers/clocksource/samsung_pwm_timer.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 *
 * samsung - Common hr-timer support (s3c and s5p)
 */

#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/clockchips.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/sched_clock.h>

#include <clocksource/samsung_pwm.h>

/*
 * Clocksource driver
 */

#define REG_TCFG0
#define REG_TCFG1
#define REG_TCON
#define REG_TINT_CSTAT

#define REG_TCNTB(chan)
#define REG_TCMPB(chan)

#define TCFG0_PRESCALER_MASK
#define TCFG0_PRESCALER1_SHIFT

#define TCFG1_SHIFT(x)
#define TCFG1_MUX_MASK

/*
 * Each channel occupies 4 bits in TCON register, but there is a gap of 4
 * bits (one channel) after channel 0, so channels have different numbering
 * when accessing TCON register.
 *
 * In addition, the location of autoreload bit for channel 4 (TCON channel 5)
 * in its set of bits is 2 as opposed to 3 for other channels.
 */
#define TCON_START(chan)
#define TCON_MANUALUPDATE(chan)
#define TCON_INVERT(chan)
#define _TCON_AUTORELOAD(chan)
#define _TCON_AUTORELOAD4(chan)
#define TCON_AUTORELOAD(chan)

DEFINE_SPINLOCK();
EXPORT_SYMBOL();

struct samsung_pwm_clocksource {};

static struct samsung_pwm_clocksource pwm;

static void samsung_timer_set_prescale(unsigned int channel, u16 prescale)
{}

static void samsung_timer_set_divisor(unsigned int channel, u8 divisor)
{}

static void samsung_time_stop(unsigned int channel)
{}

static void samsung_time_setup(unsigned int channel, unsigned long tcnt)
{}

static void samsung_time_start(unsigned int channel, bool periodic)
{}

static int samsung_set_next_event(unsigned long cycles,
				  struct clock_event_device *evt)
{}

static int samsung_shutdown(struct clock_event_device *evt)
{}

static int samsung_set_periodic(struct clock_event_device *evt)
{}

static void samsung_clockevent_resume(struct clock_event_device *cev)
{}

static struct clock_event_device time_event_device =;

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

static void __init samsung_clockevent_init(void)
{}

static void samsung_clocksource_suspend(struct clocksource *cs)
{}

static void samsung_clocksource_resume(struct clocksource *cs)
{}

static u64 notrace samsung_clocksource_read(struct clocksource *c)
{}

static struct clocksource samsung_clocksource =;

/*
 * Override the global weak sched_clock symbol with this
 * local implementation which uses the clocksource to get some
 * better resolution when scheduling the kernel. We accept that
 * this wraps around for now, since it is just a relative time
 * stamp. (Inspired by U300 implementation.)
 */
static u64 notrace samsung_read_sched_clock(void)
{}

static int __init samsung_clocksource_init(void)
{}

static void __init samsung_timer_resources(void)
{}

/*
 * PWM master driver
 */
static int __init _samsung_pwm_clocksource_init(void)
{}

void __init samsung_pwm_clocksource_init(void __iomem *base,
					 unsigned int *irqs,
					 const struct samsung_pwm_variant *variant)
{}

#ifdef CONFIG_TIMER_OF
static int __init samsung_pwm_alloc(struct device_node *np,
				    const struct samsung_pwm_variant *variant)
{}

static const struct samsung_pwm_variant s3c24xx_variant =;

static int __init s3c2410_pwm_clocksource_init(struct device_node *np)
{}
TIMER_OF_DECLARE(s3c2410_pwm, "samsung,s3c2410-pwm", s3c2410_pwm_clocksource_init);

static const struct samsung_pwm_variant s3c64xx_variant =;

static int __init s3c64xx_pwm_clocksource_init(struct device_node *np)
{}
TIMER_OF_DECLARE(s3c6400_pwm, "samsung,s3c6400-pwm", s3c64xx_pwm_clocksource_init);

static const struct samsung_pwm_variant s5p64x0_variant =;

static int __init s5p64x0_pwm_clocksource_init(struct device_node *np)
{}
TIMER_OF_DECLARE(s5p6440_pwm, "samsung,s5p6440-pwm", s5p64x0_pwm_clocksource_init);

static const struct samsung_pwm_variant s5p_variant =;

static int __init s5p_pwm_clocksource_init(struct device_node *np)
{}
TIMER_OF_DECLARE(s5pc100_pwm, "samsung,s5pc100-pwm", s5p_pwm_clocksource_init);
#endif