mpic_timer.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * arch/powerpc/include/asm/mpic_timer.h
  4. *
  5. * Header file for Mpic Global Timer
  6. *
  7. * Copyright 2013 Freescale Semiconductor, Inc.
  8. *
  9. * Author: Wang Dongsheng <[email protected]>
  10. * Li Yang <[email protected]>
  11. */
  12. #ifndef __MPIC_TIMER__
  13. #define __MPIC_TIMER__
  14. #include <linux/interrupt.h>
  15. #include <linux/time.h>
  16. struct mpic_timer {
  17. void *dev;
  18. struct cascade_priv *cascade_handle;
  19. unsigned int num;
  20. unsigned int irq;
  21. };
  22. #ifdef CONFIG_MPIC_TIMER
  23. struct mpic_timer *mpic_request_timer(irq_handler_t fn, void *dev,
  24. time64_t time);
  25. void mpic_start_timer(struct mpic_timer *handle);
  26. void mpic_stop_timer(struct mpic_timer *handle);
  27. void mpic_get_remain_time(struct mpic_timer *handle, time64_t *time);
  28. void mpic_free_timer(struct mpic_timer *handle);
  29. #else
  30. struct mpic_timer *mpic_request_timer(irq_handler_t fn, void *dev,
  31. time64_t time) { return NULL; }
  32. void mpic_start_timer(struct mpic_timer *handle) { }
  33. void mpic_stop_timer(struct mpic_timer *handle) { }
  34. void mpic_get_remain_time(struct mpic_timer *handle, time64_t *time) { }
  35. void mpic_free_timer(struct mpic_timer *handle) { }
  36. #endif
  37. #endif