it8xxx2: re-factor idle routine

Don't leave idle state if soc isn't waked-up by an interrupt.
(We change to check interrupt controller register)

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
This commit is contained in:
Dino Li 2022-03-24 13:36:41 +08:00 committed by Maureen Helm
commit 5b9db5a251
4 changed files with 32 additions and 27 deletions

View file

@ -179,6 +179,11 @@ uint8_t ite_intc_get_irq_num(void)
return intc_irq;
}
bool ite_intc_no_irq(void)
{
return (IVECT == IVECT_OFFSET_WITH_IRQ);
}
uint8_t get_irq(void *arg)
{
ARG_UNUSED(arg);
@ -197,8 +202,6 @@ uint8_t get_irq(void *arg)
intc_irq -= IVECT_OFFSET_WITH_IRQ;
/* clear interrupt status */
ite_intc_isr_clear(intc_irq);
/* Clear flag on each interrupt. */
wait_interrupt_fired = 0;
/* return interrupt number */
return intc_irq;
}

View file

@ -9,7 +9,4 @@
#include <dt-bindings/interrupt-controller/ite-intc.h>
#include <soc.h>
/* use data type int here not bool to get better instruction number. */
volatile int wait_interrupt_fired;
#endif /* ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_ITE_IT8XXX2_H_ */