devon:charger bring up

cannot detect charger after usb or otg unpluged
clear z350 irq when vbus rising or falling

Change-Id: Id7d2da0af3606d901c17457184338c72f975948b
Signed-off-by: longc102 <longc102@motorola.com>
Reviewed-on: https://gerrit.mot.com/2221963
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Submit-Approved: Jira Key
Tested-by: Jira Key
Reviewed-by: Qiong Xie <xieq2@motorola.com>
(cherry picked from commit 0c0ea637941fd2da601a80f338047db89220e683)
Reviewed-on: https://gerrit.mot.com/2223149
Reviewed-by: Wang Wang <wangwang1@lenovo.com>
This commit is contained in:
longc102 2022-03-21 22:56:25 +08:00 • committed by Qiong Xie
commit 0493700446

View file

@ -532,6 +532,17 @@ int moto_tcmd_wt6670f_get_firmware_version(void)
}
EXPORT_SYMBOL_GPL(moto_tcmd_wt6670f_get_firmware_version);
static void clear_irq_signal(void)
{
int ret = 0;
u16 data = 0;
if(QC3P_Z350 == g_qc3p_id){
ret = wt6670f_read_word(_wt, 0x11, &data);
pr_err("%s: data:%x, ret:%d\n", __func__, data, ret);
}
}
static irqreturn_t wt6670f_intr_handler(int irq, void *data)
{
m_chg_type = 0xff;
@ -597,6 +608,7 @@ static int wt6670_iio_write_raw(struct iio_dev *indio_dev,
pr_info("wt6670 set volt count:%d\n",val1);
break;
case PSY_IIO_START_BC12_DETECTION:
clear_irq_signal();
wt6670f_reset_chg_type();
wt6670f_start_detection();
pr_info("wt6670 start bc1.2 detection\n");