Exemplo n.º 1
0
/* Treat OverVoltage/UnderVoltage as source missing */
static int is_dc_chg_plugged_in(struct pm8921_chg_chip *chip)
{
	int pres, ov, uv;

	pres = pm_chg_get_rt_status(chip, DCIN_VALID_IRQ);
	ov = pm_chg_get_rt_status(chip, DCIN_OV_IRQ);
	uv = pm_chg_get_rt_status(chip, DCIN_UV_IRQ);

	return pres && !ov && !uv;
}
static int is_chg_plugged_in(void)
{
    return pm_chg_get_rt_status(pm8058_chg.pmic_chg_irq[CHGVAL_IRQ]);
}