static void isl9519q_charge(struct work_struct *isl9519_work)
{
	u16 temp;
	int ret;
	struct isl9519q_struct *isl_chg;
	int isl_charger_current;
	int mv_reading;

	isl_chg = container_of(isl9519_work, struct isl9519q_struct,
			charge_work.work);

	dev_dbg(&isl_chg->client->dev, "%s\n", __func__);

	if (isl_chg->charging) {
		isl_charger_current = isl_read_adc(CHANNEL_ADC_BATT_AMON,
								&mv_reading);
		dev_dbg(&isl_chg->client->dev, "%s mv_reading=%d\n",
				__func__, mv_reading);
		dev_dbg(&isl_chg->client->dev, "%s isl_charger_current=%d\n",
				__func__, isl_charger_current);
		if (isl_charger_current >= 0
			&& isl_charger_current <= isl_chg->term_current) {
			msm_charger_notify_event(
					&isl_chg->adapter_hw_chg,
					CHG_DONE_EVENT);
		}
		isl9519q_write_reg(isl_chg->client, CHG_CURRENT_REG,
				isl_chg->chgcurrent);
		ret = isl9519q_read_reg(isl_chg->client, CONTROL_REG, &temp);
		if (!ret) {
			if (!(temp & TRCKL_CHG_STATUS_BIT))
				msm_charger_notify_event(
						&isl_chg->adapter_hw_chg,
						CHG_BATT_BEGIN_FAST_CHARGING);
		} else {
			dev_err(&isl_chg->client->dev,
				"%s couldnt read cntrl reg\n", __func__);
		}
		schedule_delayed_work(&isl_chg->charge_work,
						ISL9519_CHG_PERIOD);
	}
}
static void isl_adapter_check_ichg(struct isl9519q_struct *isl_chg)
{
	int ichg; /* isl charger current */
	int mv_reading = 0;

	ichg = isl_read_adc(CHANNEL_ADC_BATT_AMON, &mv_reading);

	dev_dbg(&isl_chg->client->dev, "%s mv_reading=%d\n",
		__func__, mv_reading);
	dev_dbg(&isl_chg->client->dev, "%s isl_charger_current=%d\n",
		__func__, ichg);

	if (ichg >= 0 && ichg <= isl_chg->term_current)
		msm_charger_notify_event(&isl_chg->adapter_hw_chg,
					 CHG_DONE_EVENT);

	isl_chg->trickle = is_trickle_charging(isl_chg);
	if (isl_chg->trickle)
		msm_charger_notify_event(&isl_chg->adapter_hw_chg,
					 CHG_BATT_BEGIN_FAST_CHARGING);
}