ucsi_ccg: Check DEV_INT bit only when starting CCG4
Subsystems (2)
PATCH 1/1 ucsi_ccg: Check DEV_INT bit only when starting CCG4
From: Sing-Han Chen <[email protected]>
after driver sending the UCSI_START cmd, CCGx would clear Bit 0:Device Interrupt in the INTR_REG if CCGX reset successfully.
however, there might be a chance that other bits in INTR_REG are not cleared due to internal data queued in PPM and cause the driver thinks CCGx reset failed.
the commit checks bit 0 in INTR_REG and ignore other bits. ucsi driver would reset PPM later.
--- drivers/usb/typec/ucsi/ucsi_ccg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/ucsi/ucsi_ccg.c +1 -1
@@ -325,7 +325,7 @@ static int ucsi_ccg_init(struct ucsi_ccg *uc)if (status <0 )return status; -if (!data) +if (!(data &DEV_INT ))return 0 ; status =ccg_write (uc,CCGX_RAB_INTR_REG , &data,sizeof (data));
Signature · 1 line
2.25.1
Hi,
Quoted 10 lines · Wayne Chang
From: Sing-Han Chen <[email protected]>
after driver sending the
UCSI_STARTcmd, CCGx would clear Bit 0:Device Interrupt in theINTR_REGif CCGX reset successfully.however, there might be a chance that other bits in
INTR_REGare not cleared due to internal data queued in PPM and cause the driver thinks CCGx reset failed.
Quoted 5 lines
the commit checks bit 0 in
INTR_REGand ignore other bits. ucsi driver would reset PPM later.Signed-off-by Sing-Han Chen <[email protected]>Signed-off-by WayneChang <[email protected]>
^^^^^^^^^^
You probable should have a space there. In any case, FWIW:
Quoted 19 lines
--- drivers/usb/typec/ucsi/ucsi_ccg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)rivers/usb/typec/ucsi/ucsi_ccg.c renamed from drivers/usb/typec/ucsi/ucsi_ccg.c +1
-1@@ -325,7 +325,7 @@ static int ucsi_ccg_init(struct ucsi_ccg *uc)if (status <0 )return status; -if (!data) +if (!(data &DEV_INT ))return 0 ; status =ccg_write (uc,CCGX_RAB_INTR_REG , &data,sizeof (data));Signature · 1 line
2.25.1
thanks,
Signature · 1 line
heikki
Hi Heikki,
Thanks for the review.
Quoted 18 lines · Heikki Krogerus
Hi,
Quoted 13 lines · Wayne Chang
From: Sing-Han Chen <[email protected]>
after driver sending the
UCSI_STARTcmd, CCGx would clear Bit 0:Device Interrupt in theINTR_REGif CCGX reset successfully.however, there might be a chance that other bits in
INTR_REGare not cleared due to internal data queued in PPM and cause the driver thinks CCGx reset failed.the commit checks bit 0 in
INTR_REGand ignore other bits. ucsi driver would reset PPM later.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Sing-Han Chen <[email protected]>Signed-off-by WayneChang <[email protected]>^^^^^^^^^^You probable should have a space there. In any case, FWIW:
Acked-by Heikki Krogerus <[email protected]>
Yes, I'll update the commit message and send it out.
Quoted 16 lines
Quoted 16 lines
--- drivers/usb/typec/ucsi/ucsi_ccg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)rivers/usb/typec/ucsi/ucsi_ccg.c renamed from drivers/usb/typec/ucsi/ucsi_ccg.c +1
-1@@ -325,7 +325,7 @@ static int ucsi_ccg_init(struct ucsi_ccg *uc)if (status <0 )return status; -if (!data) +if (!(data &DEV_INT ))return 0 ;
Quoted 9 lines
Quoted 3 lines
rivers/usb/typec/ucsi/ucsi_ccg.c renamed from drivers/usb/typec/ucsi/ucsi_ccg.c +0
-1status =ccg_write (uc,CCGX_RAB_INTR_REG , &data,sizeof (data)); --2.25.1
thanks,
--
heikki
thanks,
Wayne.