bq27541 board
authorclb <clb@rock-chips.com>
Fri, 29 Jul 2011 09:07:45 +0000 (17:07 +0800)
committerclb <clb@rock-chips.com>
Fri, 29 Jul 2011 09:07:45 +0000 (17:07 +0800)
arch/arm/mach-rk29/board-rk29-newton.c
drivers/misc/newton.c

index 03b2837c2a433df9117c10dc3eae3d416ca9c7b2..beaa239fbb254246865d3fe6b436c687673979bc 100755 (executable)
@@ -838,6 +838,25 @@ struct bq27510_platform_data bq27510_info = {
 };
 #endif
 
+#if defined (CONFIG_BATTERY_BQ27541)
+#define        DC_CHECK_PIN    RK29_PIN4_PA1
+#define        LI_LION_BAT_NUM 1
+static int bq27541_init_dc_check_pin(void){    
+       if(gpio_request(DC_CHECK_PIN,"dc_check") != 0){      
+               gpio_free(DC_CHECK_PIN);      
+               printk("bq27541 init dc check pin request error\n");      
+               return -EIO;    
+       }       
+       gpio_direction_input(DC_CHECK_PIN);     
+       return 0;
+}
+
+struct bq27541_platform_data bq27541_info = {  
+       .init_dc_check_pin = bq27541_init_dc_check_pin, 
+       .dc_check_pin =  DC_CHECK_PIN,          
+       .bat_num = LI_LION_BAT_NUM,
+};
+#endif
 
 /*****************************************************************************************
  * i2c devices
@@ -1143,6 +1162,14 @@ static struct i2c_board_info __initdata board_i2c2_devices[] = {
 
 #ifdef CONFIG_I2C3_RK29
 static struct i2c_board_info __initdata board_i2c3_devices[] = {
+       #if defined (CONFIG_BATTERY_BQ27541)
+       {
+               .type                   = "bq27541",
+               .addr           = 0x55,
+               .flags                  = 0,
+               .platform_data  = &bq27541_info,
+       },
+#endif
 };
 #endif
 
index a04288d7173c88cab43817c08930cf855e62b5c6..dcc7b7256de7a1f59762d09e98994065d1851fa0 100755 (executable)
@@ -131,12 +131,15 @@ int rk29_newton_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
             if(copy_to_user(argp, &sn.UID_Data, sizeof(sn.UID_Data)))  return -EFAULT;\r
        }\r
                break;\r
+/*             \r
        case NEWTON_AC_DETEC:\r
                {\r
                        int ac_status = rk29_newton_get_ac_status();\r
                        if(copy_to_user(argp, &ac_status, 4))  return -EFAULT;\r
                }\r
                break;\r
+*/\r
+\r
        case NEWTON_GPS_CTRL:\r
                {\r
                        int value = 0;\r
@@ -202,11 +205,14 @@ static int rk29_newton_probe(struct platform_device *pdev)
          printk("gpio_request NEWTON_GPIO_GPS_PWR error\n");\r
          return -EIO;\r
        }\r
+       \r
+/*\r
        if(gpio_request(NEWTON_GPIO_AC_DETEC,NULL) != 0){\r
          gpio_free(NEWTON_GPIO_AC_DETEC);\r
          printk("gpio_request NEWTON_GPIO_AC_DETEC error\n");\r
          return -EIO;\r
        }\r
+*/\r
        rk29_newton_set_gps_power(GPIO_LOW);\r
        DBG("%s:rk29 newton initialized\n",__FUNCTION__);\r
        return ret;\r