void s5pv210_sdhci2_translate_vdd(struct platform_device *pdev, unsigned int vdd)
{	
	int ldo, flag;

	if (pdev->id != 2) /* T-FLSH */
		return;

#if defined (CONFIG_TARGET_LOCALE_EUR) || defined(CONFIG_TARGET_LOCALE_HKTW) || defined (CONFIG_TARGET_LOCALE_HKTW_FET) || defined(CONFIG_TARGET_LOCALE_VZW) || defined(CONFIG_TARGET_LOCALE_USAGSM)
	ldo = (HWREV >= 12) ? MAX8998_LDO7 : MAX8998_LDO6;
#elif CONFIG_TARGET_LOCALE_KOR
	if (HWREV >= 10 && HWREV != 17)
		ldo = MAX8998_LDO7;
	else
		return;	
#endif /* CONFIG_TARGET_LOCALE */	
	flag = 1 << pdev->id;	

	if (vdd == 0) {
		if (vreg_sts & flag) {
			printk(KERN_DEBUG "%s.%d: ldo down\n", pdev->name, pdev->id);		
			max8998_ldo_disable_direct(ldo);			
			vreg_sts &= ~flag;
		}
	}
	else {
		if (!(vreg_sts & flag)) {			
			printk(KERN_DEBUG "%s.%d: ldo on\n", pdev->name, pdev->id);		
			max8998_ldo_enable_direct(ldo);
			vreg_sts |= flag;
		}
	}
}
void s5pv210_sdhci0_translate_vdd(struct platform_device *pdev, 
								 unsigned int vdd)
{
	unsigned int flag = 0;	
	unsigned int ldo = 0, gpio_en = 0, gpio_en2 = 0;

	if (pdev->id != 0)	/* MoviNAND */
		return;	

#if defined(CONFIG_TARGET_LOCALE_EUR) || defined (CONFIG_TARGET_LOCALE_HKTW) || defined (CONFIG_TARGET_LOCALE_HKTW_FET) || defined (CONFIG_TARGET_LOCALE_USAGSM)
	if (HWREV >= 13) {
		gpio_en = GPIO_MASSMEMORY_EN;
	}
	if (HWREV >= 9) {
		gpio_en = GPIO_MASSMEMORY_EN;
		gpio_en2 = (HWREV >= 12) ? GPIO_MASSMEMORY_EN2_REV06 : GPIO_MASSMEMORY_EN2;
	}
	else {		
		ldo = MAX8998_LDO5;
	}
#elif defined(CONFIG_TARGET_LOCALE_KOR)
	if (HWREV >= 10 && HWREV != 17) {
		gpio_en2 = GPIO_MASSMEMORY_EN2;
	}
	else {
		if (HWREV >= 8 && HWREV != 17)
			gpio_en = GPIO_MASSMEMORY_EN;
		ldo = MAX8998_LDO5;
	}
#endif /* CONFIG_TARGET_LOCALE */
	
	flag = 1 << pdev->id;

	if (vdd == 0) {
		if (vreg_sts & flag) {
			if (gpio_en)			
				gpio_set_value(gpio_en, GPIO_LEVEL_LOW);
			if (gpio_en2)
				gpio_set_value(gpio_en2, GPIO_LEVEL_LOW);
			if (ldo)
				max8998_ldo_disable_direct(ldo);		
			
			printk(KERN_DEBUG "%s.%d: ldo down\n", pdev->name, pdev->id);		
			vreg_sts &= ~flag;
		}
	}
	else {
		if (!(vreg_sts & flag))	{
			if (gpio_en)			
				gpio_set_value(gpio_en, GPIO_LEVEL_HIGH);
			if (gpio_en2)
				gpio_set_value(gpio_en2, GPIO_LEVEL_HIGH);
			if (ldo)	
				max8998_ldo_enable_direct(ldo);
			
			printk(KERN_DEBUG "%s.%d: ldo on\n", pdev->name, pdev->id);		
			vreg_sts |= flag;
		}
	}
}
示例#3
0
/*
** Called to disable amp (disable output force)
*/
IMMVIBESPIAPI VibeStatus ImmVibeSPI_ForceOut_AmpDisable(VibeUInt8 nActuatorIndex)
{
#if 0
#error Please review the code between the #if and #endif

    if (g_bAmpEnabled)
    {
        DbgOut((KERN_DEBUG "ImmVibeSPI_ForceOut_AmpDisable.\n"));

        g_bAmpEnabled = false;

#if 0
        mhn_gpio_set_level(GPIO_EN, GPIO_LEVEL_LOW);
        mz_ops.bstat &= ~HN_BATTERY_MOTOR;
#endif
    }
#endif
    if (g_bAmpEnabled)
    {
        g_bAmpEnabled = false;
#if defined (CONFIG_TARGET_LOCALE_EUR) || defined (CONFIG_TARGET_LOCALE_HKTW) || defined (CONFIG_TARGET_LOCALE_HKTW_FET) || defined (CONFIG_TARGET_LOCALE_VZW) || defined (CONFIG_TARGET_LOCALE_USAGSM)
        if(HWREV >= 0xf)
#elif defined (CONFIG_TARGET_LOCALE_KOR)
        if(HWREV >= 0xe)
#else
        if(HWREV >= 0xff)
#endif
        {
            pwm_config(Immvib_pwm, 0, g_PWM_duty_max/2);
            pwm_disable(Immvib_pwm);
            gpio_set_value(VIB_EN, GPIO_LEVEL_LOW);
        }
        max8998_ldo_disable_direct(MAX8998_LDO16);
    }

    return VIBE_S_SUCCESS;
}
示例#4
0
/*
 * s5p_pmic_gating()
 *
 * To do turn on/off LDOs of pmic for power gating
 *
*/
int s5p_pmic_gating(unsigned int power_domain, unsigned int on_off)
{
    switch( power_domain )
    {
    case S5PC110_POWER_DOMAIN_MFC: //MFC off
        if (on_off) {
            // power on
        } else {
            // power off
        }
        break;

    case S5PC110_POWER_DOMAIN_G3D: //G3D off
        if (on_off) {
            // power on
        } else {
            // power off
        }
        break;

    case S5PC110_POWER_DOMAIN_LCD: //LCD: ldo7, 17
        if (on_off) {
            // power on
            max8998_ldo_enable_direct(MAX8998_LDO7);
            max8998_ldo_enable_direct(MAX8998_LDO17);
        } else {
            // power off
            max8998_ldo_disable_direct(MAX8998_LDO7);
            max8998_ldo_disable_direct(MAX8998_LDO17);
        }
        break;

    case S5PC110_POWER_DOMAIN_TV: //TV off
        if (on_off) {
            // power on
            //max8998_ldo_enable_direct(MAX8998_LDO8);
        } else {
            // power off
            //max8998_ldo_disable_direct(MAX8998_LDO8);
        }
        break;

    case S5PC110_POWER_DOMAIN_CAM: //CAM: ldo 11,12,13,14,15, 16
        if (on_off) {
            // power on
            /*max8998_ldo_enable_direct(MAX8998_LDO11);
            max8998_ldo_enable_direct(MAX8998_LDO12);
            max8998_ldo_enable_direct(MAX8998_LDO13);
            max8998_ldo_enable_direct(MAX8998_LDO14);
            max8998_ldo_enable_direct(MAX8998_LDO15);
            max8998_ldo_enable_direct(MAX8998_LDO16);*/
        } else {
            // power off
            /*max8998_ldo_disable_direct(MAX8998_LDO7);
            max8998_ldo_disable_direct(MAX8998_LDO12);
            max8998_ldo_disable_direct(MAX8998_LDO13);
            max8998_ldo_disable_direct(MAX8998_LDO14);
            max8998_ldo_disable_direct(MAX8998_LDO15);
            max8998_ldo_disable_direct(MAX8998_LDO16);*/
        }
        break;

    case S5PC110_POWER_DOMAIN_AUDIO: //AUDIO off
#if 0 // for audio pwr gating is not supported on chip
        if (on_off) {
            // power on
        } else {
            // power off
        }
#endif
        break;

    default :
        printk( "[SYSCON][Err] S5PC110_PMIC_Gating - power_domain: %d durning %s\n", power_domain, on_off ? "Turn on" : "Turn off" );
        break;
    }

    return 1;
}