dmtimer-omap.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * DMTIMER platform data for TI OMAP platforms
  3. *
  4. * Copyright (C) 2012 Texas Instruments
  5. * Author: Jon Hunter <jon-hunter@ti.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License version 2 as published by
  9. * the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__
  20. #define __PLATFORM_DATA_DMTIMER_OMAP_H__
  21. struct omap_dm_timer_ops {
  22. struct omap_dm_timer *(*request_by_node)(struct device_node *np);
  23. struct omap_dm_timer *(*request_specific)(int timer_id);
  24. struct omap_dm_timer *(*request)(void);
  25. int (*free)(struct omap_dm_timer *timer);
  26. void (*enable)(struct omap_dm_timer *timer);
  27. void (*disable)(struct omap_dm_timer *timer);
  28. int (*get_irq)(struct omap_dm_timer *timer);
  29. int (*set_int_enable)(struct omap_dm_timer *timer,
  30. unsigned int value);
  31. int (*set_int_disable)(struct omap_dm_timer *timer, u32 mask);
  32. struct clk *(*get_fclk)(struct omap_dm_timer *timer);
  33. int (*start)(struct omap_dm_timer *timer);
  34. int (*stop)(struct omap_dm_timer *timer);
  35. int (*set_source)(struct omap_dm_timer *timer, int source);
  36. int (*set_load)(struct omap_dm_timer *timer, int autoreload,
  37. unsigned int value);
  38. int (*set_match)(struct omap_dm_timer *timer, int enable,
  39. unsigned int match);
  40. int (*set_pwm)(struct omap_dm_timer *timer, int def_on,
  41. int toggle, int trigger);
  42. int (*set_prescaler)(struct omap_dm_timer *timer, int prescaler);
  43. unsigned int (*read_counter)(struct omap_dm_timer *timer);
  44. int (*write_counter)(struct omap_dm_timer *timer,
  45. unsigned int value);
  46. unsigned int (*read_status)(struct omap_dm_timer *timer);
  47. int (*write_status)(struct omap_dm_timer *timer,
  48. unsigned int value);
  49. };
  50. struct dmtimer_platform_data {
  51. /* set_timer_src - Only used for OMAP1 devices */
  52. int (*set_timer_src)(struct platform_device *pdev, int source);
  53. u32 timer_capability;
  54. u32 timer_errata;
  55. int (*get_context_loss_count)(struct device *);
  56. const struct omap_dm_timer_ops *timer_ops;
  57. };
  58. #endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */