2 * DMTIMER platform data for TI OMAP platforms
4 * Copyright (C) 2012 Texas Instruments
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.
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
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/>.
20 #ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__
21 #define __PLATFORM_DATA_DMTIMER_OMAP_H__
23 struct omap_dm_timer_ops {
24 struct omap_dm_timer *(*request_by_node)(struct device_node *np);
25 struct omap_dm_timer *(*request_specific)(int timer_id);
26 struct omap_dm_timer *(*request)(void);
28 int (*free)(struct omap_dm_timer *timer);
30 void (*enable)(struct omap_dm_timer *timer);
31 void (*disable)(struct omap_dm_timer *timer);
33 int (*get_irq)(struct omap_dm_timer *timer);
34 int (*set_int_enable)(struct omap_dm_timer *timer,
36 int (*set_int_disable)(struct omap_dm_timer *timer, u32 mask);
38 struct clk *(*get_fclk)(struct omap_dm_timer *timer);
40 int (*start)(struct omap_dm_timer *timer);
41 int (*stop)(struct omap_dm_timer *timer);
42 int (*set_source)(struct omap_dm_timer *timer, int source);
44 int (*set_load)(struct omap_dm_timer *timer, int autoreload,
46 int (*set_match)(struct omap_dm_timer *timer, int enable,
48 int (*set_pwm)(struct omap_dm_timer *timer, int def_on,
49 int toggle, int trigger);
50 int (*set_prescaler)(struct omap_dm_timer *timer, int prescaler);
52 unsigned int (*read_counter)(struct omap_dm_timer *timer);
53 int (*write_counter)(struct omap_dm_timer *timer,
55 unsigned int (*read_status)(struct omap_dm_timer *timer);
56 int (*write_status)(struct omap_dm_timer *timer,
60 struct dmtimer_platform_data {
61 /* set_timer_src - Only used for OMAP1 devices */
62 int (*set_timer_src)(struct platform_device *pdev, int source);
65 int (*get_context_loss_count)(struct device *);
66 const struct omap_dm_timer_ops *timer_ops;
69 #endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */