samsung_pwm.h 803 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2013 Samsung Electronics Co., Ltd.
  4. */
  5. #ifndef __CLOCKSOURCE_SAMSUNG_PWM_H
  6. #define __CLOCKSOURCE_SAMSUNG_PWM_H
  7. #include <linux/spinlock.h>
  8. #define SAMSUNG_PWM_NUM 5
  9. /*
  10. * Following declaration must be in an ifdef due to this symbol being static
  11. * in pwm-samsung driver if the clocksource driver is not compiled in and the
  12. * spinlock is not shared between both drivers.
  13. */
  14. #ifdef CONFIG_CLKSRC_SAMSUNG_PWM
  15. extern spinlock_t samsung_pwm_lock;
  16. #endif
  17. struct samsung_pwm_variant {
  18. u8 bits;
  19. u8 div_base;
  20. u8 tclk_mask;
  21. u8 output_mask;
  22. bool has_tint_cstat;
  23. };
  24. void samsung_pwm_clocksource_init(void __iomem *base,
  25. unsigned int *irqs,
  26. const struct samsung_pwm_variant *variant);
  27. #endif /* __CLOCKSOURCE_SAMSUNG_PWM_H */