Exemple #1
0
unsigned target_pause_for_battery_charge(void)
{
	if (target_check_power_on_reason() == PWR_ON_EVENT_FTM)
		return PWR_ON_EVENT_FTM;
	if (target_check_power_on_reason() == PWR_ON_EVENT_USB_CHG && is_poweroff_charging_enabled())
		return PWR_ON_EVENT_USB_CHG;
	return 0;
}
Exemple #2
0
unsigned target_pause_for_battery_charge(void)
{
	if (target_check_power_on_reason() == PWR_ON_EVENT_WALL_CHG)
		return 1;

	return 0;
}
Exemple #3
0
static void target_shutdown_for_rtc_alarm(void)
{
	if (target_check_power_on_reason() == PWR_ON_EVENT_RTC_ALARM) {
		dprintf(CRITICAL,
			"Power on due to RTC alarm. Going to shutdown!!\n");
		pm8058_rtc0_alarm_irq_disable();
		shutdown_device();
	}
}
Exemple #4
0
unsigned target_pause_for_battery_charge(void)
{
    //check power on reason only for fluid devices
    if( hw_platform_type != LINUX_MACHTYPE_7x30_FLUID)
        return 0;

    if (target_check_power_on_reason() == PWR_ON_EVENT_USB_CHG)
        return 1;
   return 0;
}
Exemple #5
0
void target_init(void)
{
	unsigned base_addr;
	unsigned char slot;
	unsigned platform_id = board_platform_id();

	dprintf(INFO, "target_init()\n");

	pu_reason = target_check_power_on_reason();
	reboot_mode = check_reboot_mode();

	/* Initialize PMIC driver */
	pmic.read = (pm8921_read_func) & pa1_ssbi2_read_bytes;
	pmic.write = (pm8921_write_func) & pa1_ssbi2_write_bytes;

	pm8921_init(&pmic);

	target_shutdown_for_battinfo();
	target_shutdown_for_pwrkey();

	/* Keypad init */
	keys_init();

	if((platform_id == MSM8960)   ||
	   (platform_id == MSM8960AB) ||
	   (platform_id == APQ8060AB) ||
	   (platform_id == MSM8260AB) ||
	   (platform_id == MSM8660AB))
	{
		msm8960_keypad_init();
	}
	else if((platform_id == MSM8230)   ||
			(platform_id == MSM8630)   ||
			(platform_id == MSM8930)   ||
			(platform_id == MSM8230AA) ||
			(platform_id == MSM8630AA) ||
			(platform_id == MSM8930AA))
	{
		msm8930_keypad_init();
	}
	else if((platform_id == APQ8064) ||
		    (platform_id == MPQ8064) ||
		    (platform_id == APQ8064AB))
	{
		apq8064_keypad_init();
	}

	/* Display splash screen if enabled */
#if DISPLAY_SPLASH_SCREEN
	if (board_target_id() == LINUX_MACHTYPE_8960_CDP || (board_target_id() == LINUX_MACHTYPE_8960_MITWOA))
		panel_backlight_on_mitwoa(0);
	display_init();
	dprintf(INFO, "Diplay initialized\n");
	mdelay(34);
	if (board_target_id() == LINUX_MACHTYPE_8064_MITWO || (board_target_id() == LINUX_MACHTYPE_8064_MTP))
		panel_backlight_on_mitwo(1);
	else
		panel_backlight_on_mitwoa(1);
#endif

	if ((platform_id == MSM8960) || (platform_id == MSM8960AB) ||
		(platform_id == APQ8060AB) || (platform_id == MSM8260AB) ||
		(platform_id == MSM8660AB) || (platform_id == MSM8660A) ||
		(platform_id == MSM8260A) || (platform_id == APQ8060A))
		/* Enable Hardware CE */
		platform_ce_type = CRYPTO_ENGINE_TYPE_HW;

	/* Trying Slot 1 first */
	slot = 1;
	base_addr = mmc_sdc_base[slot - 1];
	if (mmc_boot_main(slot, base_addr)) {
		/* Trying Slot 3 next */
		slot = 3;
		base_addr = mmc_sdc_base[slot - 1];
		if (mmc_boot_main(slot, base_addr)) {
			dprintf(CRITICAL, "mmc init failed!");
			ASSERT(0);
		}
	}
}