Lines Matching full:wo

21 		.name = "wo-emi",
24 .name = "wo-ilm",
27 .name = "wo-data",
31 .name = "wo-boot",
64 mtk_wed_mcu_get_response(struct mtk_wed_wo *wo, unsigned long expires) in mtk_wed_mcu_get_response() argument
69 wait_event_timeout(wo->mcu.wait, !skb_queue_empty(&wo->mcu.res_q), in mtk_wed_mcu_get_response()
71 return skb_dequeue(&wo->mcu.res_q); in mtk_wed_mcu_get_response()
74 void mtk_wed_mcu_rx_event(struct mtk_wed_wo *wo, struct sk_buff *skb) in mtk_wed_mcu_rx_event() argument
76 skb_queue_tail(&wo->mcu.res_q, skb); in mtk_wed_mcu_rx_event()
77 wake_up(&wo->mcu.wait); in mtk_wed_mcu_rx_event()
98 void mtk_wed_mcu_rx_unsolicited_event(struct mtk_wed_wo *wo, in mtk_wed_mcu_rx_unsolicited_event() argument
107 dev_notice(wo->hw->dev, "%s\n", skb->data); in mtk_wed_mcu_rx_unsolicited_event()
115 dev_notice(wo->hw->dev, in mtk_wed_mcu_rx_unsolicited_event()
124 mtk_wed_update_rx_stats(wo->hw->wed_dev, skb); in mtk_wed_mcu_rx_unsolicited_event()
134 mtk_wed_mcu_skb_send_msg(struct mtk_wed_wo *wo, struct sk_buff *skb, in mtk_wed_mcu_skb_send_msg() argument
140 wo->mcu.timeout = 20 * HZ; in mtk_wed_mcu_skb_send_msg()
147 u16 seq = ++wo->mcu.seq; in mtk_wed_mcu_skb_send_msg()
150 seq = ++wo->mcu.seq; in mtk_wed_mcu_skb_send_msg()
159 return mtk_wed_wo_queue_tx_skb(wo, &wo->q_tx, skb); in mtk_wed_mcu_skb_send_msg()
163 mtk_wed_mcu_parse_response(struct mtk_wed_wo *wo, struct sk_buff *skb, in mtk_wed_mcu_parse_response() argument
169 dev_err(wo->hw->dev, "Message %08x (seq %d) timeout\n", in mtk_wed_mcu_parse_response()
181 mtk_wed_update_rx_stats(wo->hw->wed_dev, skb); in mtk_wed_mcu_parse_response()
190 int mtk_wed_mcu_send_msg(struct mtk_wed_wo *wo, int id, int cmd, in mtk_wed_mcu_send_msg() argument
202 mutex_lock(&wo->mcu.mutex); in mtk_wed_mcu_send_msg()
204 ret = mtk_wed_mcu_skb_send_msg(wo, skb, id, cmd, &seq, wait_resp); in mtk_wed_mcu_send_msg()
208 expires = jiffies + wo->mcu.timeout; in mtk_wed_mcu_send_msg()
210 skb = mtk_wed_mcu_get_response(wo, expires); in mtk_wed_mcu_send_msg()
211 ret = mtk_wed_mcu_parse_response(wo, skb, cmd, seq); in mtk_wed_mcu_send_msg()
216 mutex_unlock(&wo->mcu.mutex); in mtk_wed_mcu_send_msg()
224 struct mtk_wed_wo *wo = dev->hw->wed_wo; in mtk_wed_mcu_msg_update() local
229 if (WARN_ON(!wo)) in mtk_wed_mcu_msg_update()
232 return mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO, id, data, len, in mtk_wed_mcu_msg_update()
261 mtk_wed_mcu_run_firmware(struct mtk_wed_wo *wo, const struct firmware *fw) in mtk_wed_mcu_run_firmware() argument
312 mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo) in mtk_wed_mcu_load_firmware() argument
322 int index = of_property_match_string(wo->hw->node, in mtk_wed_mcu_load_firmware()
328 ret = mtk_wed_get_memory_region(wo->hw, index, &mem_region[i]); in mtk_wed_mcu_load_firmware()
334 wed_w32(wo->hw->wed_dev, MTK_WED_SCR0 + 4 * MTK_WED_DUMMY_CR_FWDL, in mtk_wed_mcu_load_firmware()
335 wo->hw->index + 1); in mtk_wed_mcu_load_firmware()
338 switch (wo->hw->version) { in mtk_wed_mcu_load_firmware()
340 if (of_device_is_compatible(wo->hw->node, in mtk_wed_mcu_load_firmware()
344 fw_name = wo->hw->index ? MT7986_FIRMWARE_WO1 in mtk_wed_mcu_load_firmware()
348 fw_name = wo->hw->index ? MT7988_FIRMWARE_WO1 in mtk_wed_mcu_load_firmware()
355 ret = request_firmware(&fw, fw_name, wo->hw->dev); in mtk_wed_mcu_load_firmware()
361 dev_info(wo->hw->dev, in mtk_wed_mcu_load_firmware()
362 "MTK WED WO Firmware Version: %.10s, Build Time: %.15s\n", in mtk_wed_mcu_load_firmware()
364 dev_info(wo->hw->dev, "MTK WED WO Chip ID %02x Region %d\n", in mtk_wed_mcu_load_firmware()
367 ret = mtk_wed_mcu_run_firmware(wo, fw); in mtk_wed_mcu_load_firmware()
372 if (!mtk_wed_is_v3_or_greater(wo->hw) && wo->hw->index) in mtk_wed_mcu_load_firmware()
377 /* wo firmware reset */ in mtk_wed_mcu_load_firmware()
390 mtk_wed_mcu_read_fw_dl(struct mtk_wed_wo *wo) in mtk_wed_mcu_read_fw_dl() argument
392 return wed_r32(wo->hw->wed_dev, in mtk_wed_mcu_read_fw_dl()
396 int mtk_wed_mcu_init(struct mtk_wed_wo *wo) in mtk_wed_mcu_init() argument
401 skb_queue_head_init(&wo->mcu.res_q); in mtk_wed_mcu_init()
402 init_waitqueue_head(&wo->mcu.wait); in mtk_wed_mcu_init()
403 mutex_init(&wo->mcu.mutex); in mtk_wed_mcu_init()
405 ret = mtk_wed_mcu_load_firmware(wo); in mtk_wed_mcu_init()
409 return readx_poll_timeout(mtk_wed_mcu_read_fw_dl, wo, val, !val, in mtk_wed_mcu_init()