rk29_phone:add config for wm831x charge IRQ
authorroot <root@lw.(none)>
Wed, 13 Jul 2011 13:05:08 +0000 (21:05 +0800)
committerroot <root@lw.(none)>
Wed, 13 Jul 2011 13:05:08 +0000 (21:05 +0800)
arch/arm/configs/rk29_a22_defconfig
drivers/power/Kconfig
drivers/power/wm831x_power.c

index 29881ce1e882c9ab409ef370ff47b1c9e70cbcd1..89156bb831a1b7a61ab15c1bc51e7daf7e7afe71 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.32.27
-# Sat Jul  2 02:51:53 2011
+# Wed Jul 13 20:55:31 2011
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -20,6 +20,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
 CONFIG_ARCH_HAS_CPUFREQ=y
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
 CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
 CONFIG_VECTORS_BASE=0xffff0000
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -228,8 +229,6 @@ CONFIG_DDR_TYPE_LPDDR=y
 # CONFIG_DDR_TYPE_DDR3_2133M is not set
 # CONFIG_DDR_TYPE_DDR3_2133N is not set
 # CONFIG_DDR_TYPE_DDR3_DEFAULT is not set
-CONFIG_RK29_MEM_SIZE_512M=y
-# CONFIG_RK29_MEM_SIZE_1G is not set
 CONFIG_RK29_MEM_SIZE_M=512
 CONFIG_DDR_SDRAM_FREQ=192
 
@@ -237,6 +236,7 @@ CONFIG_DDR_SDRAM_FREQ=192
 # RK29 VPU (Video Processing Unit) support
 #
 CONFIG_RK29_VPU=y
+CONFIG_RK29_VPU_SERVICE=y
 # CONFIG_RK29_VPU_DEBUG is not set
 # CONFIG_RK29_JTAG is not set
 CONFIG_RK29_LAST_LOG=y
@@ -310,7 +310,8 @@ CONFIG_AEABI=y
 # CONFIG_OABI_COMPAT is not set
 # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
 # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-# CONFIG_HIGHMEM is not set
+CONFIG_HIGHMEM=y
+# CONFIG_HIGHPTE is not set
 CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_FLATMEM_MANUAL=y
 # CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -320,7 +321,8 @@ CONFIG_FLAT_NODE_MEM_MAP=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 # CONFIG_PHYS_ADDR_T_64BIT is not set
-CONFIG_ZONE_DMA_FLAG=0
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_HAVE_MLOCK=y
 CONFIG_HAVE_MLOCKED_PAGE_BIT=y
@@ -870,6 +872,7 @@ CONFIG_TOUCHSCREEN_ILI2102_IIC=y
 # CONFIG_TOUCHSCREEN_GT801_IIC is not set
 # CONFIG_TOUCHSCREEN_GT818_IIC is not set
 # CONFIG_D70_L3188A is not set
+# CONFIG_TOUCHSCREEN_GOODIX_NEWTON is not set
 # CONFIG_TOUCHSCREEN_FT5406 is not set
 CONFIG_INPUT_MISC=y
 # CONFIG_INPUT_LPSENSOR_ISL29028 is not set
@@ -1064,6 +1067,7 @@ CONFIG_POWER_SUPPLY=y
 CONFIG_WM831X_BACKUP=y
 CONFIG_WM831X_POWER=y
 CONFIG_WM831X_CHARGER_DISPLAY=y
+CONFIG_WM831X_WITH_BATTERY=y
 # CONFIG_BATTERY_DS2760 is not set
 # CONFIG_BATTERY_DS2782 is not set
 # CONFIG_BATTERY_BQ27x00 is not set
@@ -1442,7 +1446,6 @@ CONFIG_SDMMC1_RK29=y
 # CONFIG_MMC_SDHCI is not set
 # CONFIG_MMC_AT91 is not set
 # CONFIG_MMC_ATMELMCI is not set
-# CONFIG_MMC_SPI is not set
 # CONFIG_MEMSTICK is not set
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
@@ -1788,6 +1791,7 @@ CONFIG_TIMER_STATS=y
 # CONFIG_DEBUG_SPINLOCK_SLEEP is not set
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_HIGHMEM is not set
 CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
index cd5385205b40e9e33c593b40dd4cc3febfa19146..fdf06cfe66c426c16831de8b2f59e47903a4c3ae 100755 (executable)
@@ -44,11 +44,18 @@ config WM831X_POWER
 
 config WM831X_CHARGER_DISPLAY
        tristate "WM831X Charger display support"
-       depends on MFD_WM831X
+       depends on WM831X_POWER
        help
          Say Y here to enable support for the power management unit
          provided by Wolfson Microelectronics WM831x Charger Display.  
 
+config WM831X_WITH_BATTERY
+       tristate "WM831X battery exist"
+       depends on WM831X_POWER
+       default n
+       help
+         WM831X battery exist.
+
 config WM8350_POWER
         tristate "WM8350 PMU support"
         depends on MFD_WM8350
index 145911ab9b6635833c83d32bcb5e719fc0e1eb3b..4b19d339da980d9c16a298968225f45b327cc6ae 100755 (executable)
@@ -39,7 +39,7 @@
 static int batt_step_table[batt_num] = {
        3380,3405,3440,3475,3505,3525,
        3540,3557,3570,3580,3610,
-       3630,3643,3655,3665,3673,
+       3630,3640,3652,3662,3672,
        3680,3687,3693,3699,3705,
        3710,3714,3718,3722,3726,
        3730,3734,3738,3742,3746,
@@ -659,6 +659,7 @@ static enum power_supply_property wm831x_bat_props[] = {
        POWER_SUPPLY_PROP_CHARGE_TYPE,
 };
 
+#ifdef CONFIG_WM831X_WITH_BATTERY
 static const char *wm831x_bat_irqs[] = {
        "BATT HOT",
        "BATT COLD",
@@ -685,6 +686,7 @@ static irqreturn_t wm831x_bat_irq(int irq, void *data)
 
        return IRQ_HANDLED;
 }
+#endif
 
 /*********************************************************************
  *             Initialisation
@@ -728,8 +730,8 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
 {
        int i, ret, status;
        static int count = 0;
-       static int disp_plus = 10;
-       static int disp_minus = 10;
+       static int disp_plus = 100;
+       static int disp_minus = 100;
        static int disp_curr = 0;
 
        *level = wm831x_power->batt_info.level;
@@ -787,7 +789,7 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
                        *level = 100;
 
                // ³õʼ״̬
-               if ((disp_plus == 10) && (disp_minus == 10))
+               if ((disp_plus == 100) && (disp_minus == 100))
                {
                        *level = *level;
                        disp_plus = 0;
@@ -796,14 +798,14 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
                }
                else
                {
-                       if (*level <= (wm831x_power->batt_info.level-5))        
+                       if (*level <= (wm831x_power->batt_info.level-3))        
                        {
                                disp_plus = 0;
                                disp_curr = 0;
                                
-                               if (++disp_minus > 3)
+                               if (++disp_minus > 4)
                                {
-                                       *level = wm831x_power->batt_info.level - 5;
+                                       *level = wm831x_power->batt_info.level - 3;
                                        disp_minus = 0;
                                }
                                else
@@ -816,7 +818,7 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
                                disp_plus = 0;
                                disp_minus = 0;
 
-                               if (++disp_curr > 3)
+                               if (++disp_curr > 4)
                                {
                                        *level = *level;
                                        disp_curr = 0;
@@ -826,14 +828,14 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
                                        *level = wm831x_power->batt_info.level;
                                }
                        }
-                       else if (*level >= (wm831x_power->batt_info.level+5))
+                       else if (*level >= (wm831x_power->batt_info.level+3))
                        {
                                disp_minus = 0;
                                disp_curr = 0;
                                
-                               if (++disp_plus > 4)
+                               if (++disp_plus > 10)
                                {
-                                       *level = wm831x_power->batt_info.level + 5;
+                                       *level = wm831x_power->batt_info.level + 3;
                                        disp_plus = 0;
                                }
                                else
@@ -977,6 +979,7 @@ static __devinit int wm831x_power_probe(struct platform_device *pdev)
                goto err_syslo;
        }
 
+#ifdef CONFIG_WM831X_WITH_BATTERY
        for (i = 0; i < ARRAY_SIZE(wm831x_bat_irqs); i++) {
                irq = platform_get_irq_byname(pdev, wm831x_bat_irqs[i]);
                ret = request_threaded_irq(irq, NULL, wm831x_bat_irq,
@@ -991,6 +994,7 @@ static __devinit int wm831x_power_probe(struct platform_device *pdev)
                        goto err_bat_irq;
                }
        }
+#endif
 
        power->interval = TIMER_MS_COUNTS;
        power->batt_info.level = 100;
@@ -1008,7 +1012,8 @@ static __devinit int wm831x_power_probe(struct platform_device *pdev)
        printk("%s:wm831x_power initialized\n",__FUNCTION__);
        power_test_sysfs_init();
        return ret;
-
+       
+#ifdef CONFIG_WM831X_WITH_BATTERY
 err_bat_irq:
        for (; i >= 0; i--) {
                irq = platform_get_irq_byname(pdev, wm831x_bat_irqs[i]);
@@ -1016,6 +1021,7 @@ err_bat_irq:
        }
        irq = platform_get_irq_byname(pdev, "PWR SRC");
        free_irq(irq, power);
+#endif
 
 err_syslo:
        irq = platform_get_irq_byname(pdev, "SYSLO");
@@ -1035,12 +1041,12 @@ static __devexit int wm831x_power_remove(struct platform_device *pdev)
 {
        struct wm831x_power *wm831x_power = platform_get_drvdata(pdev);
        int irq, i;
-
+#ifdef CONFIG_WM831X_WITH_BATTERY
        for (i = 0; i < ARRAY_SIZE(wm831x_bat_irqs); i++) {
                irq = platform_get_irq_byname(pdev, wm831x_bat_irqs[i]);
                free_irq(irq, wm831x_power);
        }
-
+#endif
        irq = platform_get_irq_byname(pdev, "PWR SRC");
        free_irq(irq, wm831x_power);