Lines Matching refs:ipc_protocol
12 int ipc_protocol_tq_msg_send(struct iosm_protocol *ipc_protocol, in ipc_protocol_tq_msg_send() argument
17 int index = ipc_protocol_msg_prep(ipc_protocol->imem, msg_type, in ipc_protocol_tq_msg_send()
24 ipc_protocol->rsp_ring[index] = response; in ipc_protocol_tq_msg_send()
25 ipc_protocol_msg_hp_update(ipc_protocol->imem); in ipc_protocol_tq_msg_send()
36 struct iosm_protocol *ipc_protocol = ipc_imem->ipc_protocol; in ipc_protocol_tq_msg_send_cb() local
38 return ipc_protocol_tq_msg_send(ipc_protocol, send_args->msg_type, in ipc_protocol_tq_msg_send_cb()
49 struct iosm_protocol *ipc_protocol = ipc_imem->ipc_protocol; in ipc_protocol_tq_msg_remove() local
51 ipc_protocol->rsp_ring[arg] = NULL; in ipc_protocol_tq_msg_remove()
55 int ipc_protocol_msg_send(struct iosm_protocol *ipc_protocol, in ipc_protocol_msg_send() argument
64 exec_timeout = (ipc_protocol_get_ap_exec_stage(ipc_protocol) == in ipc_protocol_msg_send()
83 index = ipc_task_queue_send_task(ipc_protocol->imem, in ipc_protocol_msg_send()
88 dev_err(ipc_protocol->dev, "msg %d failed", prep); in ipc_protocol_msg_send()
100 ipc_task_queue_send_task(ipc_protocol->imem, in ipc_protocol_msg_send()
103 dev_err(ipc_protocol->dev, "msg timeout"); in ipc_protocol_msg_send()
104 ipc_uevent_send(ipc_protocol->pcie->dev, UEVENT_MDM_TIMEOUT); in ipc_protocol_msg_send()
109 dev_err(ipc_protocol->dev, in ipc_protocol_msg_send()
119 static int ipc_protocol_msg_send_host_sleep(struct iosm_protocol *ipc_protocol, in ipc_protocol_msg_send_host_sleep() argument
127 return ipc_protocol_msg_send(ipc_protocol, IPC_MSG_PREP_SLEEP, in ipc_protocol_msg_send_host_sleep()
131 void ipc_protocol_doorbell_trigger(struct iosm_protocol *ipc_protocol, in ipc_protocol_doorbell_trigger() argument
134 ipc_pm_signal_hpda_doorbell(&ipc_protocol->pm, identifier, true); in ipc_protocol_doorbell_trigger()
137 bool ipc_protocol_pm_dev_sleep_handle(struct iosm_protocol *ipc_protocol) in ipc_protocol_pm_dev_sleep_handle() argument
139 u32 ipc_status = ipc_protocol_get_ipc_status(ipc_protocol); in ipc_protocol_pm_dev_sleep_handle()
143 dev_err(ipc_protocol->dev, in ipc_protocol_pm_dev_sleep_handle()
154 requested = ipc_protocol_pm_dev_get_sleep_notification(ipc_protocol); in ipc_protocol_pm_dev_sleep_handle()
156 return ipc_pm_dev_slp_notification(&ipc_protocol->pm, requested); in ipc_protocol_pm_dev_sleep_handle()
162 struct iosm_pm *ipc_pm = &ipc_imem->ipc_protocol->pm; in ipc_protocol_tq_wakeup_dev_slp()
172 void ipc_protocol_s2idle_sleep(struct iosm_protocol *ipc_protocol, bool sleep) in ipc_protocol_s2idle_sleep() argument
174 ipc_pm_set_s2idle_sleep(&ipc_protocol->pm, sleep); in ipc_protocol_s2idle_sleep()
177 bool ipc_protocol_suspend(struct iosm_protocol *ipc_protocol) in ipc_protocol_suspend() argument
179 if (!ipc_pm_prepare_host_sleep(&ipc_protocol->pm)) in ipc_protocol_suspend()
182 ipc_task_queue_send_task(ipc_protocol->imem, in ipc_protocol_suspend()
186 if (!ipc_pm_wait_for_device_active(&ipc_protocol->pm)) { in ipc_protocol_suspend()
187 ipc_uevent_send(ipc_protocol->pcie->dev, UEVENT_MDM_TIMEOUT); in ipc_protocol_suspend()
192 dev_dbg(ipc_protocol->dev, "send TARGET_HOST, ENTER_SLEEP"); in ipc_protocol_suspend()
193 if (ipc_protocol_msg_send_host_sleep(ipc_protocol, in ipc_protocol_suspend()
196 ipc_protocol->pm.host_pm_state = IPC_MEM_HOST_PM_ACTIVE; in ipc_protocol_suspend()
200 ipc_protocol->pm.host_pm_state = IPC_MEM_HOST_PM_SLEEP; in ipc_protocol_suspend()
206 bool ipc_protocol_resume(struct iosm_protocol *ipc_protocol) in ipc_protocol_resume() argument
208 if (!ipc_pm_prepare_host_active(&ipc_protocol->pm)) in ipc_protocol_resume()
211 dev_dbg(ipc_protocol->dev, "send TARGET_HOST, EXIT_SLEEP"); in ipc_protocol_resume()
212 if (ipc_protocol_msg_send_host_sleep(ipc_protocol, in ipc_protocol_resume()
214 ipc_protocol->pm.host_pm_state = IPC_MEM_HOST_PM_SLEEP; in ipc_protocol_resume()
218 ipc_protocol->pm.host_pm_state = IPC_MEM_HOST_PM_ACTIVE; in ipc_protocol_resume()
225 struct iosm_protocol *ipc_protocol = in ipc_protocol_init() local
226 kzalloc(sizeof(*ipc_protocol), GFP_KERNEL); in ipc_protocol_init()
230 if (!ipc_protocol) in ipc_protocol_init()
233 ipc_protocol->dev = ipc_imem->dev; in ipc_protocol_init()
234 ipc_protocol->pcie = ipc_imem->pcie; in ipc_protocol_init()
235 ipc_protocol->imem = ipc_imem; in ipc_protocol_init()
236 ipc_protocol->p_ap_shm = NULL; in ipc_protocol_init()
237 ipc_protocol->phy_ap_shm = 0; in ipc_protocol_init()
239 ipc_protocol->old_msg_tail = 0; in ipc_protocol_init()
241 ipc_protocol->p_ap_shm = in ipc_protocol_init()
242 dma_alloc_coherent(&ipc_protocol->pcie->pci->dev, in ipc_protocol_init()
243 sizeof(*ipc_protocol->p_ap_shm), in ipc_protocol_init()
244 &ipc_protocol->phy_ap_shm, GFP_KERNEL); in ipc_protocol_init()
246 if (!ipc_protocol->p_ap_shm) { in ipc_protocol_init()
247 dev_err(ipc_protocol->dev, "pci shm alloc error"); in ipc_protocol_init()
248 kfree(ipc_protocol); in ipc_protocol_init()
253 addr = ipc_protocol->phy_ap_shm; in ipc_protocol_init()
254 p_ci = &ipc_protocol->p_ap_shm->ci; in ipc_protocol_init()
271 ipc_pm_init(ipc_protocol); in ipc_protocol_init()
273 return ipc_protocol; in ipc_protocol_init()