Lines Matching +full:fine +full:- +full:tune

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2011-2017, The Linux Foundation
10 * slim_ctrl_clk_pause() - Called by slimbus controller to enter/exit
17 * Slimbus specification needs this sequence to turn-off clocks for the bus.
20 * To exit clock-pause, controller typically wakes up active framer device.
23 * For entering clock-pause, -EBUSY is returned if a message txn in pending.
29 struct slim_sched *sched = &ctrl->sched; in slim_ctrl_clk_pause()
36 return -EINVAL; in slim_ctrl_clk_pause()
38 mutex_lock(&sched->m_reconf); in slim_ctrl_clk_pause()
40 if (sched->clk_state == SLIM_CLK_ACTIVE) { in slim_ctrl_clk_pause()
41 mutex_unlock(&sched->m_reconf); in slim_ctrl_clk_pause()
46 * Fine-tune calculation based on clock gear, in slim_ctrl_clk_pause()
47 * message-bandwidth after bandwidth management in slim_ctrl_clk_pause()
49 ret = wait_for_completion_timeout(&sched->pause_comp, in slim_ctrl_clk_pause()
52 mutex_unlock(&sched->m_reconf); in slim_ctrl_clk_pause()
54 return -ETIMEDOUT; in slim_ctrl_clk_pause()
63 if (sched->clk_state == SLIM_CLK_PAUSED && ctrl->wakeup) in slim_ctrl_clk_pause()
64 ret = ctrl->wakeup(ctrl); in slim_ctrl_clk_pause()
66 sched->clk_state = SLIM_CLK_ACTIVE; in slim_ctrl_clk_pause()
67 mutex_unlock(&sched->m_reconf); in slim_ctrl_clk_pause()
73 if (ctrl->sched.clk_state == SLIM_CLK_PAUSED) { in slim_ctrl_clk_pause()
74 mutex_unlock(&sched->m_reconf); in slim_ctrl_clk_pause()
78 spin_lock_irqsave(&ctrl->txn_lock, flags); in slim_ctrl_clk_pause()
81 if (idr_find(&ctrl->tid_idr, i)) { in slim_ctrl_clk_pause()
82 spin_unlock_irqrestore(&ctrl->txn_lock, flags); in slim_ctrl_clk_pause()
83 mutex_unlock(&sched->m_reconf); in slim_ctrl_clk_pause()
84 return -EBUSY; in slim_ctrl_clk_pause()
87 spin_unlock_irqrestore(&ctrl->txn_lock, flags); in slim_ctrl_clk_pause()
89 sched->clk_state = SLIM_CLK_ENTERING_PAUSE; in slim_ctrl_clk_pause()
112 sched->clk_state = SLIM_CLK_ACTIVE; in slim_ctrl_clk_pause()
114 sched->clk_state = SLIM_CLK_PAUSED; in slim_ctrl_clk_pause()
115 complete(&sched->pause_comp); in slim_ctrl_clk_pause()
117 mutex_unlock(&sched->m_reconf); in slim_ctrl_clk_pause()