2019-06-03 08:44:50 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-04-21 01:22:13 +04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Samsung Electronics Co., Ltd.
|
|
|
|
*/
|
|
|
|
#ifndef __CLOCKSOURCE_SAMSUNG_PWM_H
|
|
|
|
#define __CLOCKSOURCE_SAMSUNG_PWM_H
|
|
|
|
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
|
|
|
|
#define SAMSUNG_PWM_NUM 5
|
|
|
|
|
2013-04-06 04:40:36 +04:00
|
|
|
/*
|
|
|
|
* Following declaration must be in an ifdef due to this symbol being static
|
|
|
|
* in pwm-samsung driver if the clocksource driver is not compiled in and the
|
|
|
|
* spinlock is not shared between both drivers.
|
|
|
|
*/
|
|
|
|
#ifdef CONFIG_CLKSRC_SAMSUNG_PWM
|
2013-04-23 19:46:24 +04:00
|
|
|
extern spinlock_t samsung_pwm_lock;
|
2013-04-06 04:40:36 +04:00
|
|
|
#endif
|
2013-04-23 19:46:24 +04:00
|
|
|
|
2013-04-21 01:22:13 +04:00
|
|
|
struct samsung_pwm_variant {
|
|
|
|
u8 bits;
|
|
|
|
u8 div_base;
|
|
|
|
u8 tclk_mask;
|
|
|
|
u8 output_mask;
|
|
|
|
bool has_tint_cstat;
|
|
|
|
};
|
|
|
|
|
2013-04-23 19:46:27 +04:00
|
|
|
void samsung_pwm_clocksource_init(void __iomem *base,
|
2021-05-06 23:27:25 +03:00
|
|
|
unsigned int *irqs,
|
2021-05-06 23:27:26 +03:00
|
|
|
const struct samsung_pwm_variant *variant);
|
2013-04-23 19:46:27 +04:00
|
|
|
|
2013-04-21 01:22:13 +04:00
|
|
|
#endif /* __CLOCKSOURCE_SAMSUNG_PWM_H */
|