timer-davinci.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * TI DaVinci clocksource driver
  4. *
  5. * Copyright (C) 2019 Texas Instruments
  6. * Author: Bartosz Golaszewski <[email protected]>
  7. */
  8. #ifndef __TIMER_DAVINCI_H__
  9. #define __TIMER_DAVINCI_H__
  10. #include <linux/clk.h>
  11. #include <linux/ioport.h>
  12. enum {
  13. DAVINCI_TIMER_CLOCKEVENT_IRQ,
  14. DAVINCI_TIMER_CLOCKSOURCE_IRQ,
  15. DAVINCI_TIMER_NUM_IRQS,
  16. };
  17. /**
  18. * struct davinci_timer_cfg - davinci clocksource driver configuration struct
  19. * @reg: register range resource
  20. * @irq: clockevent and clocksource interrupt resources
  21. * @cmp_off: if set - it specifies the compare register used for clockevent
  22. *
  23. * Note: if the compare register is specified, the driver will use the bottom
  24. * clock half for both clocksource and clockevent and the compare register
  25. * to generate event irqs. The user must supply the correct compare register
  26. * interrupt number.
  27. *
  28. * This is only used by da830 the DSP of which uses the top half. The timer
  29. * driver still configures the top half to run in free-run mode.
  30. */
  31. struct davinci_timer_cfg {
  32. struct resource reg;
  33. struct resource irq[DAVINCI_TIMER_NUM_IRQS];
  34. unsigned int cmp_off;
  35. };
  36. int __init davinci_timer_register(struct clk *clk,
  37. const struct davinci_timer_cfg *data);
  38. #endif /* __TIMER_DAVINCI_H__ */