This source file includes following definitions.
- to_omap_device
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
21 #define __ARCH_ARM_PLAT_OMAP_INCLUDE_MACH_OMAP_DEVICE_H
22
23 #include <linux/kernel.h>
24 #include <linux/platform_device.h>
25
26 #include "omap_hwmod.h"
27
28 extern struct dev_pm_domain omap_device_pm_domain;
29 extern struct dev_pm_domain omap_device_fail_pm_domain;
30
31
32 #define OMAP_DEVICE_STATE_UNKNOWN 0
33 #define OMAP_DEVICE_STATE_ENABLED 1
34 #define OMAP_DEVICE_STATE_IDLE 2
35 #define OMAP_DEVICE_STATE_SHUTDOWN 3
36
37
38 #define OMAP_DEVICE_SUSPENDED BIT(0)
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 struct omap_device {
56 struct platform_device *pdev;
57 struct omap_hwmod **hwmods;
58 unsigned long _driver_status;
59 u8 hwmods_cnt;
60 u8 _state;
61 u8 flags;
62 };
63
64
65
66 int omap_device_enable(struct platform_device *pdev);
67 int omap_device_idle(struct platform_device *pdev);
68
69
70
71 struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
72 struct omap_hwmod *oh, void *pdata,
73 int pdata_len);
74
75 struct omap_device *omap_device_alloc(struct platform_device *pdev,
76 struct omap_hwmod **ohs, int oh_cnt);
77 void omap_device_delete(struct omap_device *od);
78 int omap_device_register(struct platform_device *pdev);
79
80 struct device *omap_device_get_by_hwmod_name(const char *oh_name);
81
82
83 int omap_device_get_context_loss_count(struct platform_device *pdev);
84
85
86
87 int omap_device_assert_hardreset(struct platform_device *pdev,
88 const char *name);
89 int omap_device_deassert_hardreset(struct platform_device *pdev,
90 const char *name);
91
92
93 static inline struct omap_device *to_omap_device(struct platform_device *pdev)
94 {
95 return pdev ? pdev->archdata.od : NULL;
96 }
97 #endif