Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * DMTIMER platform data for TI OMAP platforms
4 *
5 * Copyright (C) 2012 Texas Instruments
6 * Author: Jon Hunter <jon-hunter@ti.com>
7 */
8
9#ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__
10#define __PLATFORM_DATA_DMTIMER_OMAP_H__
11
12struct 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, unsigned int value);
34 int (*set_match)(struct omap_dm_timer *timer, int enable,
35 unsigned int match);
36 int (*set_pwm)(struct omap_dm_timer *timer, int def_on,
37 int toggle, int trigger, int autoreload);
38 int (*get_pwm_status)(struct omap_dm_timer *timer);
39 int (*set_cap)(struct omap_dm_timer *timer,
40 int autoreload, bool config_period);
41 int (*get_cap_status)(struct omap_dm_timer *timer);
42 int (*set_prescaler)(struct omap_dm_timer *timer, int prescaler);
43
44 unsigned int (*read_counter)(struct omap_dm_timer *timer);
45 unsigned int (*read_cap)(struct omap_dm_timer *timer, bool is_period);
46 int (*write_counter)(struct omap_dm_timer *timer,
47 unsigned int value);
48 unsigned int (*read_status)(struct omap_dm_timer *timer);
49 int (*write_status)(struct omap_dm_timer *timer,
50 unsigned int value);
51};
52
53struct dmtimer_platform_data {
54 /* set_timer_src - Only used for OMAP1 devices */
55 int (*set_timer_src)(struct platform_device *pdev, int source);
56 u32 timer_capability;
57 u32 timer_errata;
58 int (*get_context_loss_count)(struct device *);
59 const struct omap_dm_timer_ops *timer_ops;
60};
61
62#endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */