Ejemplo n.º 1
0
void battery_capacity_update(struct battery_type *battery, int capacity_01p)
{

	/* ACR 500~500+FULL mapping to capacity 0~FULL*/
	battery->charge_counter_mAh = capacity_01p * battery->charge_full_real_mAh / 1000;
	battery->charge_counter_adc = (battery->charge_counter_mAh + charge_counter_zero_base_mAh) * acr_adc_to_mv_resl / acr_adc_to_mv_coef;
	battery->RARC_01p = capacity_01p;
	if (support_ds2746_gauge_ic) {
		__ds2746_acr_update(battery, capacity_01p);
	}

	printk(DRIVER_ZONE "new RARC=%d C=%dmAh adc=%d.\n",
		battery->RARC_01p,
		battery->charge_counter_mAh,
		battery->charge_counter_adc);
	battery->is_power_on_reset = FALSE;
}
Ejemplo n.º 2
0
void battery_capacity_update(struct battery_type *battery, int capacity_01p)
{

	
	battery->charge_counter_mAh = capacity_01p * battery->charge_full_real_mAh / 1000;
	battery->charge_counter_adc = (battery->charge_counter_mAh + charge_counter_zero_base_mAh) * acr_adc_to_mv_resl / acr_adc_to_mv_coef;
	battery->RARC_01p = capacity_01p;
	if (support_ds2746_gauge_ic) {
		__ds2746_acr_update(battery, capacity_01p);
	}
#if HTC_PARAM_DS2746_DEBUG_ENABLE
	printk(DRIVER_ZONE "new RARC=%d C=%dmAh adc=%d.\n",
		battery->RARC_01p,
		battery->charge_counter_mAh,
		battery->charge_counter_adc);
#endif
	battery->is_power_on_reset = FALSE;
}
Ejemplo n.º 3
0
void battery_capacity_update(struct battery_type *battery, int capacity_01p)
{
	struct battery_parameter* batt_param = container_of(
		battery, struct poweralg_type, battery)->pdata->batt_param;

	/* ACR 500~500+FULL mapping to capacity 0~FULL*/
	battery->charge_counter_mAh = capacity_01p * battery->charge_full_real_mAh / 1000;
	battery->charge_counter_adc =
		(battery->charge_counter_mAh + batt_param->charge_counter_zero_base_mAh) *
		batt_param->acr_adc_to_mv_resl / batt_param->acr_adc_to_mv_coef;
	battery->RARC_01p = capacity_01p;
	if (support_ds2746_gauge_ic) {
		__ds2746_acr_update(battery, capacity_01p);
	}
#if HTC_PARAM_DS2746_DEBUG_ENABLE
	printk(DRIVER_ZONE "new RARC=%d C=%dmAh adc=%d.\n",
		battery->RARC_01p,
		battery->charge_counter_mAh,
		battery->charge_counter_adc);
#endif
	battery->is_prediction = FALSE;
}