Lines Matching full:afe

26 /* AFE CMDs */
308 /* AFE WSA Codec DMA Rx port 0 */
310 /* AFE WSA Codec DMA Tx port 0 */
312 /* AFE WSA Codec DMA Rx port 1 */
314 /* AFE WSA Codec DMA Tx port 1 */
316 /* AFE WSA Codec DMA Tx port 2 */
318 /* AFE VA Codec DMA Tx port 0 */
320 /* AFE VA Codec DMA Tx port 1 */
322 /* AFE VA Codec DMA Tx port 2 */
324 /* AFE Rx Codec DMA Rx port 0 */
326 /* AFE Tx Codec DMA Tx port 0 */
328 /* AFE Rx Codec DMA Rx port 1 */
330 /* AFE Tx Codec DMA Tx port 1 */
332 /* AFE Rx Codec DMA Rx port 2 */
334 /* AFE Tx Codec DMA Tx port 2 */
336 /* AFE Rx Codec DMA Rx port 3 */
338 /* AFE Tx Codec DMA Tx port 3 */
340 /* AFE Rx Codec DMA Rx port 4 */
342 /* AFE Tx Codec DMA Tx port 4 */
344 /* AFE Rx Codec DMA Rx port 5 */
346 /* AFE Tx Codec DMA Tx port 5 */
348 /* AFE Rx Codec DMA Rx port 6 */
350 /* AFE Rx Codec DMA Rx port 7 */
549 struct q6afe *afe; member
574 * Mapping between Virtual Port IDs to DSP AFE Port ID
840 struct q6afe *afe; in q6afe_port_free() local
844 afe = port->afe; in q6afe_port_free()
845 spin_lock_irqsave(&afe->port_list_lock, flags); in q6afe_port_free()
847 spin_unlock_irqrestore(&afe->port_list_lock, flags); in q6afe_port_free()
852 static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token) in q6afe_find_port() argument
858 spin_lock_irqsave(&afe->port_list_lock, flags); in q6afe_find_port()
859 list_for_each_entry(p, &afe->port_list, node) in q6afe_find_port()
866 spin_unlock_irqrestore(&afe->port_list_lock, flags); in q6afe_find_port()
872 struct q6afe *afe = dev_get_drvdata(&adev->dev); in q6afe_callback() local
884 dev_err(afe->dev, "cmd = 0x%x returned error = 0x%x\n", in q6afe_callback()
892 port = q6afe_find_port(afe, hdr->token); in q6afe_callback()
898 afe->result = *res; in q6afe_callback()
899 wake_up(&afe->wait); in q6afe_callback()
903 dev_err(afe->dev, "Unknown cmd 0x%x\n", res->opcode); in q6afe_callback()
909 afe->result.opcode = hdr->opcode; in q6afe_callback()
910 afe->result.status = res->status; in q6afe_callback()
911 wake_up(&afe->wait); in q6afe_callback()
936 static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt, in afe_apr_send_pkt() argument
943 mutex_lock(&afe->lock); in afe_apr_send_pkt()
948 result = &afe->result; in afe_apr_send_pkt()
949 wait = &afe->wait; in afe_apr_send_pkt()
955 ret = apr_send_pkt(afe->apr, pkt); in afe_apr_send_pkt()
957 dev_err(afe->dev, "packet not transmitted (%d)\n", ret); in afe_apr_send_pkt()
967 dev_err(afe->dev, "DSP returned error[%x]\n", in afe_apr_send_pkt()
975 mutex_unlock(&afe->lock); in afe_apr_send_pkt()
980 static int q6afe_set_param(struct q6afe *afe, struct q6afe_port *port, in q6afe_set_param() argument
1018 ret = afe_apr_send_pkt(afe, pkt, port, AFE_SVC_CMD_SET_PARAM); in q6afe_set_param()
1020 dev_err(afe->dev, "AFE set params failed %d\n", ret); in q6afe_set_param()
1029 return q6afe_set_param(port->afe, port, data, param_id, module_id, in q6afe_port_set_param()
1038 struct q6afe *afe = port->afe; in q6afe_port_set_param_v2() local
1073 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_SET_PARAM_V2); in q6afe_port_set_param_v2()
1075 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n", in q6afe_port_set_param_v2()
1110 struct q6afe *afe = dev_get_drvdata(dev->parent); in q6afe_set_lpass_clock() local
1120 return q6afe_set_param(afe, NULL, &cset, AFE_PARAM_ID_CLOCK_SET, in q6afe_set_lpass_clock()
1181 * q6afe_port_stop() - Stop a afe port
1190 struct q6afe *afe = port->afe; in q6afe_port_stop() local
1199 dev_err(afe->dev, "AFE port index[%d] invalid!\n", index); in q6afe_port_stop()
1222 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_DEVICE_STOP); in q6afe_port_stop()
1224 dev_err(afe->dev, "AFE close failed %d\n", ret); in q6afe_port_stop()
1232 * q6afe_slim_port_prepare() - Prepare slim afe port.
1234 * @port: Instance of afe port
1235 * @cfg: SLIM configuration for the afe port
1257 * q6afe_tdm_port_prepare() - Prepare tdm afe port.
1259 * @port: Instance of afe port
1260 * @cfg: TDM configuration for the afe port
1293 * q6afe_hdmi_port_prepare() - Prepare hdmi afe port.
1295 * @port: Instance of afe port
1296 * @cfg: HDMI configuration for the afe port
1314 * q6afe_i2s_port_prepare() - Prepare i2s afe port.
1316 * @port: Instance of afe port
1317 * @cfg: I2S configuration for the afe port
1323 struct device *dev = port->afe->dev; in q6afe_i2s_port_prepare()
1457 * q6afe_cdc_dma_port_prepare() - Prepare dma afe port.
1459 * @port: Instance of afe port
1460 * @cfg: DMA configuration for the afe port
1479 * q6afe_port_start() - Start a afe port
1488 struct q6afe *afe = port->afe; in q6afe_port_start() local
1499 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n", in q6afe_port_start()
1509 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n", in q6afe_port_start()
1534 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_DEVICE_START); in q6afe_port_start()
1536 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n", in q6afe_port_start()
1547 * @dev: Pointer to afe child device.
1550 * Return: Will be an error pointer on error or a valid afe port
1556 struct q6afe *afe = dev_get_drvdata(dev->parent); in q6afe_port_get_from_id() local
1562 dev_err(dev, "AFE port token[%d] invalid!\n", id); in q6afe_port_get_from_id()
1567 port = q6afe_find_port(afe, id); in q6afe_port_get_from_id()
1569 dev_err(dev, "AFE Port already open\n"); in q6afe_port_get_from_id()
1628 port->afe = afe; in q6afe_port_get_from_id()
1632 spin_lock_irqsave(&afe->port_list_lock, flags); in q6afe_port_get_from_id()
1633 list_add_tail(&port->node, &afe->port_list); in q6afe_port_get_from_id()
1634 spin_unlock_irqrestore(&afe->port_list_lock, flags); in q6afe_port_get_from_id()
1655 struct q6afe *afe = dev_get_drvdata(dev->parent); in q6afe_unvote_lpass_core_hw() local
1681 ret = apr_send_pkt(afe->apr, pkt); in q6afe_unvote_lpass_core_hw()
1683 dev_err(afe->dev, "AFE failed to unvote (%d)\n", hw_block_id); in q6afe_unvote_lpass_core_hw()
1693 struct q6afe *afe = dev_get_drvdata(dev->parent); in q6afe_vote_lpass_core_hw() local
1720 ret = afe_apr_send_pkt(afe, pkt, NULL, in q6afe_vote_lpass_core_hw()
1723 dev_err(afe->dev, "AFE failed to vote (%d)\n", hw_block_id); in q6afe_vote_lpass_core_hw()
1733 struct q6afe *afe; in q6afe_probe() local
1736 afe = devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL); in q6afe_probe()
1737 if (!afe) in q6afe_probe()
1740 q6core_get_svc_api_info(adev->svc_id, &afe->ainfo); in q6afe_probe()
1741 afe->apr = adev; in q6afe_probe()
1742 mutex_init(&afe->lock); in q6afe_probe()
1743 init_waitqueue_head(&afe->wait); in q6afe_probe()
1744 afe->dev = dev; in q6afe_probe()
1745 INIT_LIST_HEAD(&afe->port_list); in q6afe_probe()
1746 spin_lock_init(&afe->port_list_lock); in q6afe_probe()
1748 dev_set_drvdata(dev, afe); in q6afe_probe()