コード例 #1
0
bool sec_bat_check_jig_status(void)
{
#if defined(CONFIG_SEC_H_PROJECT) || defined(CONFIG_SEC_F_PROJECT) || \
	defined(CONFIG_SEC_KS01_PROJECT) || defined(CONFIG_MACH_MONDRIAN) || \
	defined(CONFIG_SEC_K_PROJECT) || defined(CONFIG_SEC_FRESCO_PROJECT) || \
	defined(CONFIG_SEC_KACTIVE_PROJECT)
#if defined(CONFIG_EXTCON)
	return get_jig_state();
#else
	extern bool is_jig_attached;	// from sec-switch
	return is_jig_attached;
#endif
#else
	if (!sec_fuelgauge) {
		pr_err("%s: sec_fuelgauge is empty\n", __func__);
		return false;
	}

	if (sec_fuelgauge->pdata->jig_irq >= 0) {
		if (gpio_get_value_cansleep(sec_fuelgauge->pdata->jig_irq))
			return true;
		else
			return false;
	} else {
		pr_err("%s: jig_irq is invalid\n", __func__);
		return false;
	}
#endif
}
コード例 #2
0
bool sec_bat_check_jig_status(void)
{
#if defined(CONFIG_SEC_LENTIS_PROJECT) || defined(CONFIG_SEC_TRLTE_PROJECT) || defined(CONFIG_SEC_TBLTE_PROJECT) || \
	defined(CONFIG_SEC_KCCAT6_PROJECT)
#if defined(CONFIG_EXTCON)
	return get_jig_state();
#else
	return false;
#endif
#else
#if 0
	if (!sec_fuelgauge) {
		pr_err("%s: sec_fuelgauge is empty\n", __func__);
		return false;
	}

	if (sec_fuelgauge->pdata->jig_irq >= 0) {
		if (gpio_get_value_cansleep(sec_fuelgauge->pdata->jig_irq))
			return true;
		else
			return false;
	} else {
		pr_err("%s: jig_irq is invalid\n", __func__);
		return false;
	}
#endif
	return false;
#endif
}
bool sec_bat_check_jig_status(void)
{
#if defined(CONFIG_SM5502_MUIC)
	return check_sm5502_jig_state();
#elif defined(CONFIG_SM5504_MUIC)
	return check_sm5504_jig_state();
#elif defined(CONFIG_SM5703_MUIC)
	return check_sm5703_muic_jig_state();
#elif defined(CONFIG_EXTCON_MAX77849)
	return get_jig_state();
#else
	return false;
#endif
}