Merge remote-tracking branch 'remotes/aosp/android-3.0' into develop-3.0
[firefly-linux-kernel-4.4.55.git] / drivers / cmmb / cmmb_class.h
1 #ifndef _CMMB_CLASS_H_\r
2 #define _CMMB_CLASS_H_\r
3 \r
4 \r
5 #include <linux/types.h>\r
6 #include <linux/poll.h>\r
7 #include <linux/fs.h>\r
8 #include <linux/list.h>\r
9 #include <linux/smp_lock.h>\r
10 \r
11 #define CMMB_MAJOR 200\r
12 \r
13 \r
14 #define CMMB_DEVICE_TUNER   0\r
15 #define CMMB_DEVICE_DEMO    1\r
16 #define CMMB_DEVICE_DEMUX   2\r
17 #define CMMB_DEVICE_CA      3\r
18 #define CMMB_DEVICE_MEMO    4\r
19 \r
20 extern struct class * cmmb_class;\r
21 \r
22 struct cmmb_adapter {\r
23         int num;\r
24         struct list_head list_head;\r
25         struct list_head device_list;\r
26         const char *name;\r
27         void* priv;\r
28         struct device *device;\r
29 };\r
30 \r
31 \r
32 extern struct cmmb_adapter CMMB_adapter;\r
33 struct cmmb_device {\r
34         struct list_head list_head;\r
35         struct file_operations *fops;\r
36         struct cmmb_adapter *adapter;\r
37         int type;\r
38         u32 id;\r
39 \r
40         wait_queue_head_t         wait_queue;\r
41 \r
42         int (*kernel_ioctl)(struct inode *inode, struct file *file,\r
43                             unsigned int cmd, void *arg);\r
44 \r
45         void *priv;\r
46 };\r
47 \r
48 \r
49 int cmmb_register_device(struct cmmb_adapter *adap, struct cmmb_device **pcmmbdev,\r
50                          struct file_operations *fops, void *priv, int type,char* name);\r
51 void cmmb_unregister_device(struct cmmb_device *cmmbdev);\r
52 \r
53 #define cmmb_attach(FUNCTION, ARGS...) ({ \\r
54         FUNCTION(ARGS); \\r
55 \r
56 \r
57 #endif/* #ifndef _CMMB_CLASS_H_ */