• Sherry Sun's avatar
    tty: serial: fsl_lpuart: enable wakeup source for lpuart · 4f5cb8c5
    Sherry Sun authored
    LPUART supports both synchronous wakeup and asynchronous wakeup(wakeup
    the system when the UART clocks are shut-off), the synchronous wakeup is
    configured by UARTCTRL_RIE interrupt, and the asynchronous wakeup is
    configured by UARTBAUD_RXEDGIE interrupt.
    
    Add lpuart_uport_is_active() to determine if the uart port needs to get
    into the suspend states, also add lpuart_suspend_noirq() and
    lpuart_resume_noirq() to enable and disable the wakeup irq bits if the
    uart port needs to be set as wakeup source.
    
    When use lpuart with DMA mode, it still needs to switch to the cpu mode
    in .suspend() that enable cpu interrupts RIE and RXEDGIE as wakeup
    source, after system resume back, needs to setup DMA again, .resume()
    will share the HW setup code with .startup(), so abstract the same code
    to the api like lpuart32_hw_setup().
    Signed-off-by: default avatarSherry Sun <sherry.sun@nxp.com>
    Link: https://lore.kernel.org/r/20221110113859.8485-2-sherry.sun@nxp.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    4f5cb8c5
fsl_lpuart.c 76.8 KB