Esempio n. 1
0
void set_charging_current_sub(void)
{
#ifdef CONFIG_LGE_BLOCK_CHARGING_MODE
	if ( 0 == get_block_charging_state() ) {
		printk(KERN_INFO "%s: Block Charging State\n", __func__);
		return ;
	}
#endif

	switch( get_ext_pwr_type() ) {
		case NO_CABLE:
			charging_ic_active_default();
			break;
		case LT_CABLE_56K:
		case LT_CABLE_130K:
		case LT_CABLE_910K:
			charging_ic_set_factory_mode();

			/* mbk_temp HW Request */
			setting_for_factory_mode_hw_req();
			break;
		case TA_CABLE:
		case FORGED_TA_CABLE:
			charging_ic_set_ta_mode();
			break;
		case USB_CABLE:
		case ABNORMAL_USB_100MA:
		case ABNORMAL_USB_400MA:
			charging_ic_set_usb_mode();
			break;
	}
	printk("[charging_msg] %s, External Power Type %d, charging_ic_status %d \n", __FUNCTION__, get_ext_pwr_type(), charging_ic_status);
	return ;
}
Esempio n. 2
0
void set_charging_current(void)
{
	static int old_status = -1;
	int current_status = -1;

	if( !get_madc_probe_done() )
		return ;

	current_status = get_external_power_status();
	if( old_status != current_status ) {

		/* mbk_temp */
		lge_usb_acc_detect();

		switch( get_ext_pwr_type() ) {
			case NO_CABLE:
				break;
			case LT_CABLE:
				// if LT_Cable, u-boot already set charing current. in kernel no need to set 
				//charging_ic_set_factory_mode();

				/* mbk_temp HW Request */
				setting_for_factory_mode_hw_req();
				break;
			case TA_CABLE:
			case FORGED_TA_CABLE:
				charging_ic_set_ta_mode();
				break;
		}
		printk("[charging_msg] %s, External Power Type %d \n", __FUNCTION__, get_ext_pwr_type());

		old_status = current_status;
	}

	charger_state_update_by_other();
	return ;
}