uid_cputime: Check for the range while removing range of UIDs.
[firefly-linux-kernel-4.4.55.git] / drivers / adc / adc_priv.h
1 /* include/linux/adc.h\r
2  *\r
3  * This program is free software; you can redistribute it and/or modify\r
4  * it under the terms of the GNU General Public License version 2 as\r
5  * published by the Free Software Foundation.\r
6  *\r
7 */\r
8 \r
9 #ifndef __ASM_ADC_PRIV_H\r
10 #define __ASM_ADC_PRIV_H\r
11 \r
12 #include <linux/kernel.h>\r
13 #include <linux/module.h>\r
14 #include <linux/init.h>\r
15 #include <linux/device.h>\r
16 #include <linux/delay.h>\r
17 #include <linux/slab.h>\r
18 #include <linux/time.h>\r
19 #include <linux/err.h>\r
20 #include <linux/io.h>\r
21 #include <linux/mutex.h>\r
22 #include <linux/clk.h>\r
23 #include <linux/workqueue.h>\r
24 #include <linux/interrupt.h>\r
25 #include <mach/board.h>\r
26 #ifdef CONFIG_ADC_RK28\r
27 #include "plat/rk28_adc.h"\r
28 #endif\r
29 #ifdef CONFIG_ADC_RK29\r
30 #include "plat/rk29_adc.h"\r
31 #endif\r
32 #ifdef CONFIG_ADC_RK30\r
33 #include "plat/rk30_adc.h"\r
34 #endif\r
35 \r
36 #define ADC_READ_TMO    100 // ms\r
37 \r
38 #define adc_writel                 writel_relaxed\r
39 #define adc_readl                  readl_relaxed\r
40 \r
41 #if 0\r
42 #define adc_dbg(dev, format, arg...)            \\r
43         dev_printk(KERN_INFO , dev , format , ## arg)\r
44 #else\r
45 #define adc_dbg(dev, format, arg...)\r
46 #endif\r
47 \r
48 enum read_type{\r
49         ADC_SYNC_READ = 0,\r
50         ADC_ASYNC_READ,\r
51 };\r
52 \r
53 struct adc_request {\r
54         struct list_head entry;\r
55         struct adc_client *client;\r
56 };\r
57 struct adc_ops {\r
58         void (*start)(struct adc_host *);\r
59         void (*stop)(struct adc_host *);\r
60         int (*read)(struct adc_host *);\r
61         void (*dump)(struct adc_host *);\r
62 };\r
63 struct adc_host {\r
64         struct list_head entry;\r
65         struct list_head req_head;\r
66         struct list_head callback_head;\r
67         unsigned int is_suspended;\r
68         enum host_chn_mask mask;\r
69         struct device *dev;\r
70         unsigned int chn;\r
71         spinlock_t lock;\r
72         struct mutex m_lock;\r
73         unsigned int client_count;\r
74         const struct adc_ops *ops;\r
75         struct adc_client *base_client;\r
76         struct adc_platform_data *pdata;\r
77         unsigned long priv[0];\r
78 };\r
79 \r
80 static inline void *adc_priv(struct adc_host *adc)\r
81 {\r
82         return adc->priv;\r
83 }\r
84 extern struct adc_host *g_adc;\r
85 struct adc_host *adc_alloc_host(struct device *dev, int extra, enum host_chn_mask mask);\r
86 void adc_free_host(struct adc_host *adc);\r
87 void adc_core_irq_handle(struct adc_host *adc);\r
88 #endif\r
89 \r