revert v86 reported chg_ok of commit cb6f8a8f312c9ee1420a1b1afeb4b550b958f1ac and...
authorwuhao <wuhao@wuhao@rock-chips.com>
Mon, 12 Nov 2012 08:06:34 +0000 (16:06 +0800)
committerwuhao <wuhao@wuhao@rock-chips.com>
Mon, 12 Nov 2012 08:09:46 +0000 (16:09 +0800)
arch/arm/mach-rk2928/board-rk2926-sdk.c
drivers/mfd/tps65910.c

index 6056fcd5fc1f718fae67b6b5c08c39d255ed1792..67549b7905520546bb902bf2a5a15ad25f440fe5 100755 (executable)
@@ -58,6 +58,9 @@
 #include "board-rk2928-sdk-camera.c" 
 #include "board-rk2928-sdk-key.c"
 
+#include <linux/irq.h>
+#include <linux/interrupt.h>
+
 #ifdef  CONFIG_THREE_FB_BUFFER
 #define RK30_FB0_MEM_SIZE 12*SZ_1M
 #else
@@ -76,13 +79,6 @@ extern  int act8931_charge_ok  ;
 #define V86_VERSION_1_1
 #endif
 
-#if defined(V86_VERSION_1_1)
-#if defined(CONFIG_MFD_TPS65910)
-extern int tps65910_charge_ok ;
-#endif
-#endif
-
-
 static struct spi_board_info board_spi_devices[] = {
 };
 
@@ -710,6 +706,13 @@ static struct platform_device device_acodec = {
 #ifdef CONFIG_BATTERY_RK30_ADC_FAC
 #if  defined(V86_VERSION_1_0) || defined(V86_VERSION_1_1)
 #define   DC_DET_PIN  RK2928_PIN1_PA5
+
+#if defined(V86_VERSION_1_1)
+static int tps65910_charge_ok;
+static irqreturn_t tps65910_gpio0_r_irq(int irq, void *irq_data);
+static irqreturn_t tps65910_gpio0_f_irq(int irq, void *irq_data); 
+#endif
+
 int rk30_battery_adc_io_init(void){
        int ret = 0;
                
@@ -726,22 +729,54 @@ int rk30_battery_adc_io_init(void){
                printk("failed to set gpio dc_det input\n");
                return ret ;
        }
-       
+
+      #if defined(V86_VERSION_1_1)
+      //ÉÏÉýÑØ
+       //ret = request_irq(IRQ_BOARD_BASE+TPS65910_IRQ_GPIO_R, tps65910_gpio0_r_irq, IRQF_TRIGGER_RISING, "chg_ok", NULL);
+      ret = request_threaded_irq( IRQ_BOARD_BASE +TPS65910_IRQ_GPIO_R,
+                        NULL, tps65910_gpio0_r_irq, IRQF_TRIGGER_RISING,
+                        "chg_ok", NULL);
+       if (ret) {
+               printk("failed to request_irq IRQ_BOARD_BASE +TPS65910_IRQ_GPIO_R , error = %d \n",ret);
+               return ret ;
+       }
+       #endif
+       
        return 0;
 
 }
+
 #if defined(V86_VERSION_1_1)
-extern int tps65910_charge_ok;
+static irqreturn_t tps65910_gpio0_r_irq(int irq, void *irq_data)//ÉÏÉýÑØÖжϺ¯Êý
+{
+       //printk("-----------------chg_ok_det######### %s\n",__func__);
+       tps65910_charge_ok = 1 ;
+      int ret = request_threaded_irq( IRQ_BOARD_BASE +TPS65910_IRQ_GPIO_F,
+                        NULL, tps65910_gpio0_f_irq, IRQF_TRIGGER_RISING,
+                        "chg_no_ok", NULL);
+
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t tps65910_gpio0_f_irq(int irq, void *irq_data)//ϽµÑØÖжϺ¯Êý
+{
+       //printk("-----------------chg_no_ok######### %s\n",__func__);
+       tps65910_charge_ok = 0 ;
+      int ret = request_threaded_irq( IRQ_BOARD_BASE +TPS65910_IRQ_GPIO_R,
+                        NULL, tps65910_gpio0_r_irq, IRQF_TRIGGER_RISING,
+                        "chg_ok", NULL);
+
+       return IRQ_HANDLED;
+}
+
 #if defined(CONFIG_MFD_TPS65910)
 int rk30_battery_adc_charging_ok( ){
-
-       if( gpio_get_value(DC_DET_PIN) == GPIO_LOW){
-       //printk(">>>>>>>>>> DC_DET_OK\n");
+       //printk(">>>>>>>>>>return tps65910_charge_ok = %d \n",tps65910_charge_ok);
+       if( gpio_get_value(DC_DET_PIN) == GPIO_LOW){         
            if( tps65910_charge_ok ){
-                //printk(">>>>>>>>>>return tps65910_charge_ok = %d \n",tps65910_charge_ok);
+
                 return 1 ;
             }
-            //printk(">>>>>>>>>> tps65910_charge_ok = %d \n",tps65910_charge_ok);
        }
 
        return 0 ;
@@ -761,7 +796,7 @@ static struct rk30_adc_battery_platform_data rk30_adc_battery_platdata = {
          .charging_ok     = rk30_battery_adc_charging_ok ,
         #endif
 
-        .reference_voltage=3200,
+        .reference_voltage=3300,
         .pull_up_res = 200 ,
         .pull_down_res = 200 ,
 
index af4e442dcfb4b0e1cade1f1b12a24eb21fa6cad0..dd67d3110df28813139152d541e03e44e9490a3b 100755 (executable)
 #include <linux/mfd/core.h>
 #include <linux/mfd/tps65910.h>
 
-#if defined(CONFIG_MACH_RK2926_V86)
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-int tps65910_charge_ok = 0 ;
-EXPORT_SYMBOL(tps65910_charge_ok);
-#endif
-
 struct tps65910 *g_tps65910;
 
 static struct mfd_cell tps65910s[] = {
@@ -239,22 +232,6 @@ out:
 }
 EXPORT_SYMBOL_GPL(tps65910_clear_bits);
 
-#if defined(CONFIG_MACH_RK2926_V86)
-static irqreturn_t tps65910_gpio0_r_irq(int irq, void *irq_data)
-{
-       //printk("#########chg_ok_det######### %s\n",__func__);
-       tps65910_charge_ok = 1 ;
-       return IRQ_HANDLED;
-}
-
-static irqreturn_t tps65910_gpio0_f_irq(int irq, void *irq_data)
-{
-       //printk("#########chg_no_ok######### %s\n",__func__);
-       tps65910_charge_ok = 0 ;
-       return IRQ_HANDLED;
-}
-#endif
-
 static int tps65910_i2c_probe(struct i2c_client *i2c,
                            const struct i2c_device_id *id)
 {
@@ -314,28 +291,6 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
        if (ret < 0)
                goto err;
 
-       /************************* chg_ok det ******************/
-       #if defined(CONFIG_MACH_RK2926_V86)
-       if ( tps65910->irq_base) {
-               ret = request_threaded_irq( tps65910->irq_base +
-                       TPS65910_IRQ_GPIO_R,
-                        NULL, tps65910_gpio0_r_irq, IRQF_TRIGGER_RISING,
-                        "chg_ok", tps65910);
-               }
-       if (ret < 0)
-               printk( "chg_ok IRQ request failed: %d\n");
-               
-       if ( tps65910->irq_base) {
-               ret = request_threaded_irq( tps65910->irq_base +
-                       TPS65910_IRQ_GPIO_F,
-                        NULL, tps65910_gpio0_f_irq, IRQF_TRIGGER_FALLING,
-                        "chg_no_ok", tps65910);
-               }
-       if (ret < 0)
-               printk( "chg_ok IRQ request failed: %d\n");
-      #endif
-       /****************************************************/
-
        if (pmic_plat_data && pmic_plat_data->post_init) {
                ret = pmic_plat_data->post_init(tps65910);
                if (ret != 0) {