bq27541 board

This commit is contained in:
clb
2011-07-29 17:07:45 +08:00
parent 4f06e65cd8
commit 0ade95b873
2 changed files with 33 additions and 0 deletions

View File

@@ -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

View File

@@ -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;
}
break;
/*
case NEWTON_AC_DETEC:
{
int ac_status = rk29_newton_get_ac_status();
if(copy_to_user(argp, &ac_status, 4)) return -EFAULT;
}
break;
*/
case NEWTON_GPS_CTRL:
{
int value = 0;
@@ -202,11 +205,14 @@ static int rk29_newton_probe(struct platform_device *pdev)
printk("gpio_request NEWTON_GPIO_GPS_PWR error\n");
return -EIO;
}
/*
if(gpio_request(NEWTON_GPIO_AC_DETEC,NULL) != 0){
gpio_free(NEWTON_GPIO_AC_DETEC);
printk("gpio_request NEWTON_GPIO_AC_DETEC error\n");
return -EIO;
}
*/
rk29_newton_set_gps_power(GPIO_LOW);
DBG("%s:rk29 newton initialized\n",__FUNCTION__);
return ret;