samsung-time.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* linux/arch/arm/plat-samsung/include/plat/samsung-time.h
  2. *
  3. * Copyright 2011 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * Header file for samsung s3c and s5p time support
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __ASM_PLAT_SAMSUNG_TIME_H
  13. #define __ASM_PLAT_SAMSUNG_TIME_H __FILE__
  14. /* SAMSUNG HR-Timer Clock mode */
  15. enum samsung_timer_mode {
  16. SAMSUNG_PWM0,
  17. SAMSUNG_PWM1,
  18. SAMSUNG_PWM2,
  19. SAMSUNG_PWM3,
  20. SAMSUNG_PWM4,
  21. };
  22. struct samsung_timer_source {
  23. unsigned int event_id;
  24. unsigned int source_id;
  25. };
  26. /* Be able to sleep for atleast 4 seconds (usually more) */
  27. #define SAMSUNG_TIMER_MIN_RANGE 4
  28. #if defined(CONFIG_ARCH_S3C24XX) || defined(CONFIG_ARCH_S5PC100)
  29. #define TCNT_MAX 0xffff
  30. #define TSCALER_DIV 25
  31. #define TDIV 50
  32. #define TSIZE 16
  33. #else
  34. #define TCNT_MAX 0xffffffff
  35. #define TSCALER_DIV 2
  36. #define TDIV 2
  37. #define TSIZE 32
  38. #endif
  39. #define NON_PERIODIC 0
  40. #define PERIODIC 1
  41. extern void __init samsung_set_timer_source(enum samsung_timer_mode event,
  42. enum samsung_timer_mode source);
  43. extern void __init samsung_timer_init(void);
  44. #endif /* __ASM_PLAT_SAMSUNG_TIME_H */