return volt;
}
+
static struct adc_platform_data rk30_adc_pdata = {
.ref_volt = 3300, //3300mV
.base_chn = 3,
.get_base_volt = &rk30_get_base_volt,
};
+
static struct resource rk30_adc_resource[] = {
{
.start = IRQ_SARADC,
{
client->result = result;
}
+
static void adc_callback(struct adc_host *adc)
{
struct adc_request *req = NULL, *n = NULL;
kfree(req);
}
}
+
void adc_finished(struct adc_host *adc, int result)
{
unsigned long flags;
adc_callback(adc);
}
+
void adc_core_irq_handle(struct adc_host *adc)
{
int result = 0;
}
EXPORT_SYMBOL(adc_async_read);
-int get_def_ref_volt(void)
+
+int adc_get_def_ref_volt(void)
{
return g_adc->pdata->ref_volt;
}
-EXPORT_SYMBOL(get_def_ref_volt);
-int get_curr_ref_volt(void)
+EXPORT_SYMBOL(adc_get_def_ref_volt);
+
+int adc_get_curr_ref_volt(void)
{
int v = 0, volt = 0;
return volt * 1024 / v;
}
-EXPORT_SYMBOL(get_curr_ref_volt);
+EXPORT_SYMBOL(adc_get_curr_ref_volt);
static int __init adc_core_init(void)
{
MODULE_DESCRIPTION("Driver for ADC");\r
MODULE_AUTHOR("kfx, kfx@rock-chips.com");\r
MODULE_LICENSE("GPL");\r
+\r
static int __init adc_test_init(void)\r
{\r
printk("def_ref_volt: %dmV, curr_ref_volt: %dmV\n", \r
- get_def_ref_volt(), get_curr_ref_volt());\r
+ adc_get_def_ref_volt(), adc_get_curr_ref_volt());\r
#ifdef ADC_TEST \r
rk30_adc_test();\r
#endif\r
/*\r
* function: return current reference voltage, unit: mV\r
*/\r
-int get_curr_ref_volt(void);\r
+int adc_get_curr_ref_volt(void);\r
/*\r
* function: return default reference voltage, unit: mV\r
*/\r
-int get_def_ref_volt(void);\r
+int adc_get_def_ref_volt(void);\r
#else\r
static inline struct adc_client *adc_register(int chn,\r
void (*callback)(struct adc_client *, void *, int),\r
static inline void adc_unregister(struct adc_client *client) {}\r
static inline int adc_sync_read(struct adc_client *client) { return -1; }\r
static inline int adc_async_read(struct adc_client *client) { return -1; }\r
-static inline int get_curr_ref_volt(void) { return -1; }\r
-static inline int get_def_ref_volt(void) { return -1; }\r
+static inline int adc_get_curr_ref_volt(void) { return -1; }\r
+static inline int adc_get_def_ref_volt(void) { return -1; }\r
#endif\r
\r
#endif\r