1 /* include/linux/adc.h
\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
9 #ifndef __ASM_ADC_PRIV_H
\r
10 #define __ASM_ADC_PRIV_H
\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
29 #ifdef CONFIG_ADC_RK29
\r
30 #include "plat/rk29_adc.h"
\r
32 #ifdef CONFIG_ADC_RK30
\r
33 #include "plat/rk30_adc.h"
\r
36 #define ADC_READ_TMO 100 // ms
\r
38 #define adc_writel writel_relaxed
\r
39 #define adc_readl readl_relaxed
\r
42 #define adc_dbg(dev, format, arg...) \
\r
43 dev_printk(KERN_INFO , dev , format , ## arg)
\r
45 #define adc_dbg(dev, format, arg...)
\r
53 struct adc_request {
\r
54 struct list_head entry;
\r
55 struct adc_client *client;
\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
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
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
80 static inline void *adc_priv(struct adc_host *adc)
\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