예제 #1
0
void battery_param_init(struct battery_type *battery)
{
	/* set battery id to unknown to get battery id and related characters*/
	battery->id_index = BATTERY_ID_UNKNOWN;

	/* default to 25C unless we can get valid battery temp from adc*/
	battery->temp_01c = 250;
	battery->last_temp_01c = battery->temp_01c;
	battery->temp_check_index = 0;
	battery->last_temp_adc = 0;

	battery->voltage_mV = 3800;

	/* this is used when accumulate current by software; initial it as 0mAs*/
	battery->software_charge_counter_mAms = 0;

	/* set POR at first by software; gauge ic will has correct value*/
	battery->is_power_on_reset = TRUE;

	if (support_ds2746_gauge_ic) {
		__ds2746_init_config(battery);
	}

	if (battery->thermal_id == THERMAL_1000) {
		TEMP_MAP = TEMP_MAP_1000K;
		printk(DRIVER_ZONE "Use 1000 Kohm thermal resistance");
	} else if (battery->thermal_id == THERMAL_600) {
		TEMP_MAP = TEMP_MAP_600K;
		printk(DRIVER_ZONE "Use 600 Kohm thermal resistance");
	} else	{
		printk(DRIVER_ZONE "Use default(300 Kohm) thermal resistance");
	}

	/*printk(DRIVER_ZONE "battery param inited with board name <%s>\n", HTC_BATT_BOARD_NAME);*/
}
예제 #2
0
void battery_param_init(struct battery_type *battery)
{
	
	battery->temp_01c = 250;
	battery->last_temp_01c = battery->temp_01c;
	battery->temp_check_index = 0;
	battery->last_temp_adc = 0;

	battery->voltage_mV = 3800;

	
	battery->software_charge_counter_mAms = 0;

	
	battery->is_power_on_reset = TRUE;

	if (support_ds2746_gauge_ic) {
		__ds2746_init_config(battery);
	}

	switch (battery->thermal_id) {

	case THERMAL_1000_100_4360:
		TEMP_MAP = TEMP_MAP_1000K_100_4360;
		printk(DRIVER_ZONE "Use 1000(100/4360) Kohm thermal resistance");
		break;
	case THERMAL_300_47_3440:
		TEMP_MAP = TEMP_MAP_300K_47_3440;
		printk(DRIVER_ZONE "Use 300(47/3440) Kohm thermal resistance");
		break;
	case THERMAL_470_100_4360:
		TEMP_MAP = TEMP_MAP_470K_100_4360;
		printk(DRIVER_ZONE "Use 470(100/4360) Kohm thermal resistance\n");
		break;
	default:
		printk(DRIVER_ZONE "Use 300(100/4360) Kohm thermal resistance");
		break;
	}

	
}
예제 #3
0
void battery_param_init(struct battery_type *battery)
{
	/* default to 25C unless we can get valid battery temp from adc*/
	battery->temp_01c = 250;
	battery->last_temp_01c = battery->temp_01c;
	battery->temp_check_index = 0;
	battery->last_temp_adc = 0;

	battery->voltage_mV = 3800;

	/* this is used when accumulate current by software; initial it as 0mAs*/
	battery->software_charge_counter_mAms = 0;

	/* set POR at first by software; gauge ic will has correct value*/
	battery->is_prediction = TRUE;

	if (support_ds2746_gauge_ic) {
		__ds2746_init_config(battery);
	}

#if 0
	switch (battery->thermal_id) {

	case THERMAL_1000_100_4360:
		TEMP_MAP = TEMP_MAP_1000K_100_4360;
		printk(DRIVER_ZONE "Use 1000(100/4360) Kohm thermal resistance");
		break;
	case THERMAL_300_47_3440:
		TEMP_MAP = TEMP_MAP_300K_47_3440;
		printk(DRIVER_ZONE "Use 300(47/3440) Kohm thermal resistance");
		break;
	default:
		printk(DRIVER_ZONE "Use 300(100/4360) Kohm thermal resistance");
		break;
	}
#endif

	/*printk(DRIVER_ZONE "battery param inited with board name <%s>\n", HTC_BATT_BOARD_NAME);*/
}