adc: get_def_ref_volt/get_curr_ref_volt --> adc_get_def_ref_volt/adc_get_curr_volt
authorkfx <kfx@rock-chips.com>
Fri, 16 Nov 2012 03:32:25 +0000 (11:32 +0800)
committerkfx <kfx@rock-chips.com>
Fri, 16 Nov 2012 03:32:25 +0000 (11:32 +0800)
arch/arm/mach-rk2928/devices.c
drivers/adc/core.c
drivers/adc/plat/rk30_adc.c
include/linux/adc.h

index 7858914bd95467dda12a3fa05269b13800af7432..fabd582cc4fadb5a099be660304f3e9de582d697 100755 (executable)
@@ -45,11 +45,13 @@ static int rk30_get_base_volt(void)
 
         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,
index 35ba255d8bd39317e6f1420855d1040b1d11e88e..c13c15d3879ee9dadb751d74e838d0803916c2b4 100755 (executable)
@@ -118,6 +118,7 @@ adc_sync_read_callback(struct adc_client *client, void *param, int result)
 {
         client->result = result;
 }
+
 static void adc_callback(struct adc_host *adc)
 {
         struct adc_request *req = NULL, *n = NULL;
@@ -136,6 +137,7 @@ static void adc_callback(struct adc_host *adc)
                 kfree(req);
         }
 }
+
 void adc_finished(struct adc_host *adc, int result)
 {
        unsigned long flags;
@@ -157,6 +159,7 @@ void adc_finished(struct adc_host *adc, int result)
 
         adc_callback(adc);
 }
+
 void adc_core_irq_handle(struct adc_host *adc)
 {
         int result = 0;
@@ -240,12 +243,14 @@ int adc_async_read(struct adc_client *client)
 }
 
 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;
 
@@ -264,7 +269,7 @@ int get_curr_ref_volt(void)
 
         return volt * 1024 / v;
 }
-EXPORT_SYMBOL(get_curr_ref_volt);
+EXPORT_SYMBOL(adc_get_curr_ref_volt);
 
 static int __init adc_core_init(void)
 {
index 48d9ca6155cce0f8c83328b5079b8240e243fd56..afe6923931a456a0e1567a0fd2c70b851c754373 100755 (executable)
@@ -311,10 +311,11 @@ module_exit(rk30_adc_exit);
 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
index 3cda18c687f4f8b64186b0b926135a21cc74e3fc..178545e7e2ff265bc050eca9f2b5547f52658457 100755 (executable)
@@ -58,11 +58,11 @@ int adc_async_read(struct adc_client *client);
 /*\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
@@ -73,8 +73,8 @@ static inline struct adc_client *adc_register(int chn,
 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