示例#1
0
void ap_usb_power_on(int set_vaue)
{
    byte reg_value=0;
    byte reg_address=0x0D;

    if(set_vaue) {
        Get_MAX8998_PM_ADDR(reg_address, &reg_value, 1); // read 0x0D register
        reg_value = reg_value | (0x1 << 7);
        Set_MAX8998_PM_ADDR(reg_address,&reg_value,1);
        printk("[ap_usb_power_on]AP USB Power ON, askon: %d, mtp : %d\n",askonstatus,mtp_mode_on);
        if(mtp_mode_on == 1) {
            samsung_kies_mtp_mode_flag = 1;
            printk("************ [ap_usb_power_on] samsung_kies_mtp_mode_flag:%d, mtp:%d\n", samsung_kies_mtp_mode_flag, mtp_mode_on);
        }
        else {
            samsung_kies_mtp_mode_flag = 0;
            printk("!!!!!!!!!!! [ap_usb_power_on]AP samsung_kies_mtp_mode_flag%d, mtp:%d\n",samsung_kies_mtp_mode_flag, mtp_mode_on);
        }
    }
    else {
        Get_MAX8998_PM_ADDR(reg_address, &reg_value, 1); // read 0x0D register
        reg_value = reg_value & ~(0x1 << 7);
        Set_MAX8998_PM_ADDR(reg_address,&reg_value,1);
        printk("[ap_usb_power_on]AP USB Power OFF, askon: %d, mtp : %d\n",askonstatus,mtp_mode_on);
    }
}
示例#2
0
void FSA9480_Enable_SPK(u8 enable)
{
    struct i2c_client *client = fsa9480_i2c_client;
    u8 data = 0;
    byte reg_value=0;
    byte reg_address=0x0D;

    if(enable)
    {
        DEBUG_FSA9480("FSA9480_Enable_SPK --- enable\n");
        msleep(10);
        Get_MAX8998_PM_ADDR(reg_address, &reg_value, 1); // read 0x0D register
        check_reg = reg_value;
        reg_value = ((0x2<<5)|reg_value);
        check_reg = reg_value;
        Set_MAX8998_PM_ADDR(reg_address,&reg_value,1);
        check_reg = reg_value;

        msleep(10);
        fsa9480_write(client, REGISTER_MANUALSW1, 0x90);	// D+/- switching by V_Audio_L/R in HW03
        msleep(10);
        fsa9480_write(client, REGISTER_CONTROL, 0x1A);	//manual switching

    }
}
示例#3
0
void FSA9480_Enable_CP_USB(u8 enable)
{
	struct i2c_client *client = fsa9480_i2c_client;
	byte reg_value=0;
	byte reg_address=0x0D;

	if(enable)
	{
		printk("[FSA9480_Enable_CP_USB] Enable CP USB\n");
		mdelay(10);
		Get_MAX8998_PM_ADDR(reg_address, &reg_value, 1); // read 0x0D register
		check_reg = reg_value;
		reg_value = ((0x2<<5)|reg_value);
		check_reg = reg_value;
		Set_MAX8998_PM_ADDR(reg_address,&reg_value,1);
		check_reg = reg_value;
			
		mdelay(10);
#if defined(CONFIG_GALAXY_I897)
                fsa9480_write(client, REGISTER_MANUALSW1, 0x90);  // D+/- switching by Audio_L/R
#else
		fsa9480_write(client, REGISTER_MANUALSW1, 0x48);  // D+/- switching by Audio_L/R in HW04
#endif

		mdelay(10);
		fsa9480_write(client, REGISTER_CONTROL, 0x1A);	

	}
	else
	{
		printk("[FSA9480_Enable_AP_USB] Enable AP USB\n");
		Get_MAX8998_PM_ADDR(reg_address, &reg_value, 1); // read 0x0D register
	
		if(askonstatus||mtp_mode_on)
		ap_usb_power_on(0);
		else
		ap_usb_power_on(1);
		mdelay(10);
		fsa9480_write(client, REGISTER_CONTROL, 0x1E);
	}
}
示例#4
0
void FSA9480_Enable_CP_USB(u8 enable)
{
	byte reg_value=0;
	byte reg_address=0x0D;

	if(enable)
	{
		printk("[FSA9480_Enable_CP_USB] Enable CP USB\n");
		mdelay(10);
		Get_MAX8998_PM_ADDR(reg_address, &reg_value, 1); // read 0x0D register
		check_reg = reg_value;
		reg_value = ((0x2<<5)|reg_value);
		check_reg = reg_value;
		Set_MAX8998_PM_ADDR(reg_address,&reg_value,1);
		check_reg = reg_value;
			
		mdelay(10);
		fsa9480_write( REGISTER_MANUALSW1, 0x90);	

		mdelay(10);
		fsa9480_write( REGISTER_CONTROL, 0x1A);	

	}
	else
	{
		printk("[FSA9480_Enable_AP_USB] Enable AP USB\n");
		Get_MAX8998_PM_ADDR(reg_address, &reg_value, 1); // read 0x0D register

		if(askonstatus||mtp_mode_on)
			ap_usb_power_on(0);
		else
			ap_usb_power_on(1);
		mdelay(10);
		fsa9480_write( REGISTER_CONTROL, 0x1E);	
	}

}