Thomas Gleixner | caab277 | 2019-06-03 07:44:50 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Jon Hunter | 40fc3bb | 2012-09-28 11:34:49 -0500 | [diff] [blame] | 2 | /* |
| 3 | * DMTIMER platform data for TI OMAP platforms |
| 4 | * |
| 5 | * Copyright (C) 2012 Texas Instruments |
| 6 | * Author: Jon Hunter <jon-hunter@ti.com> |
Jon Hunter | 40fc3bb | 2012-09-28 11:34:49 -0500 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__ |
| 10 | #define __PLATFORM_DATA_DMTIMER_OMAP_H__ |
| 11 | |
Keerthy | a7f249e | 2018-02-15 11:31:47 +0530 | [diff] [blame] | 12 | struct omap_dm_timer_ops { |
| 13 | struct omap_dm_timer *(*request_by_node)(struct device_node *np); |
| 14 | struct omap_dm_timer *(*request_specific)(int timer_id); |
| 15 | struct omap_dm_timer *(*request)(void); |
| 16 | |
| 17 | int (*free)(struct omap_dm_timer *timer); |
| 18 | |
| 19 | void (*enable)(struct omap_dm_timer *timer); |
| 20 | void (*disable)(struct omap_dm_timer *timer); |
| 21 | |
| 22 | int (*get_irq)(struct omap_dm_timer *timer); |
| 23 | int (*set_int_enable)(struct omap_dm_timer *timer, |
| 24 | unsigned int value); |
| 25 | int (*set_int_disable)(struct omap_dm_timer *timer, u32 mask); |
| 26 | |
| 27 | struct clk *(*get_fclk)(struct omap_dm_timer *timer); |
| 28 | |
| 29 | int (*start)(struct omap_dm_timer *timer); |
| 30 | int (*stop)(struct omap_dm_timer *timer); |
| 31 | int (*set_source)(struct omap_dm_timer *timer, int source); |
| 32 | |
| 33 | int (*set_load)(struct omap_dm_timer *timer, int autoreload, |
| 34 | unsigned int value); |
| 35 | int (*set_match)(struct omap_dm_timer *timer, int enable, |
| 36 | unsigned int match); |
| 37 | int (*set_pwm)(struct omap_dm_timer *timer, int def_on, |
| 38 | int toggle, int trigger); |
| 39 | int (*set_prescaler)(struct omap_dm_timer *timer, int prescaler); |
| 40 | |
| 41 | unsigned int (*read_counter)(struct omap_dm_timer *timer); |
| 42 | int (*write_counter)(struct omap_dm_timer *timer, |
| 43 | unsigned int value); |
| 44 | unsigned int (*read_status)(struct omap_dm_timer *timer); |
| 45 | int (*write_status)(struct omap_dm_timer *timer, |
| 46 | unsigned int value); |
| 47 | }; |
| 48 | |
Jon Hunter | 40fc3bb | 2012-09-28 11:34:49 -0500 | [diff] [blame] | 49 | struct dmtimer_platform_data { |
| 50 | /* set_timer_src - Only used for OMAP1 devices */ |
| 51 | int (*set_timer_src)(struct platform_device *pdev, int source); |
| 52 | u32 timer_capability; |
| 53 | u32 timer_errata; |
| 54 | int (*get_context_loss_count)(struct device *); |
Keerthy | a7f249e | 2018-02-15 11:31:47 +0530 | [diff] [blame] | 55 | const struct omap_dm_timer_ops *timer_ops; |
Jon Hunter | 40fc3bb | 2012-09-28 11:34:49 -0500 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | #endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */ |