msm_serial_hs: Use new clock framework apis
Clock framework provides clk_prepare/clk_unprepare (callable from
non-atomic context only) and clk_enable/clk_disable (callable from
atomic/non-atomic context) APIs. Start using these new APIs.
To use these new Clock APIs below changes are done in driver.
1. wakeup irq is converted into wakeup threaded irq.
2. New mutex lock (clk_mutex) is introduced to guard the clock
off/on request and making sure that there is no race condition
exist between these two asynchronous calls.
3. current UART Tx/Rx activities and clock status is checked in
msm_hs_isr() function by calling msm_hs_check_clock_off_locked()
function. Based on the return value of it, clock off timer is
started. Now same functionality is achieved by clock_off_work and
it is used instead of explicit function call.
With these changes, HSUART_DM driver imposes below restrictions on
usage of exported Clock On/Off APIs.
1. Client driver shouldn't call msm_hs_request_clk_on() API from
atomic context. It must be called from non-atomic context.
2. Client driver can call msm_hs_requeset_clk_off() API from
both atomic / non-atomic context.
Change-Id: I75512f488bb53f4f9a08879a1d473706861f5cd4
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
1 file changed