Lines Matching defs:afe
549 struct q6afe *afe;
840 struct q6afe *afe;
844 afe = port->afe;
845 spin_lock_irqsave(&afe->port_list_lock, flags);
847 spin_unlock_irqrestore(&afe->port_list_lock, flags);
852 static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token)
858 spin_lock_irqsave(&afe->port_list_lock, flags);
859 list_for_each_entry(p, &afe->port_list, node)
866 spin_unlock_irqrestore(&afe->port_list_lock, flags);
872 struct q6afe *afe = dev_get_drvdata(&adev->dev);
884 dev_err(afe->dev, "cmd = 0x%x returned error = 0x%x\n",
892 port = q6afe_find_port(afe, hdr->token);
898 afe->result = *res;
899 wake_up(&afe->wait);
903 dev_err(afe->dev, "Unknown cmd 0x%x\n", res->opcode);
909 afe->result.opcode = hdr->opcode;
910 afe->result.status = res->status;
911 wake_up(&afe->wait);
936 static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
943 mutex_lock(&afe->lock);
948 result = &afe->result;
949 wait = &afe->wait;
955 ret = apr_send_pkt(afe->apr, pkt);
957 dev_err(afe->dev, "packet not transmitted (%d)\n", ret);
967 dev_err(afe->dev, "DSP returned error[%x]\n",
975 mutex_unlock(&afe->lock);
980 static int q6afe_set_param(struct q6afe *afe, struct q6afe_port *port,
1018 ret = afe_apr_send_pkt(afe, pkt, port, AFE_SVC_CMD_SET_PARAM);
1020 dev_err(afe->dev, "AFE set params failed %d\n", ret);
1029 return q6afe_set_param(port->afe, port, data, param_id, module_id,
1038 struct q6afe *afe = port->afe;
1073 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_SET_PARAM_V2);
1075 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1110 struct q6afe *afe = dev_get_drvdata(dev->parent);
1120 return q6afe_set_param(afe, NULL, &cset, AFE_PARAM_ID_CLOCK_SET,
1181 * q6afe_port_stop() - Stop a afe port
1190 struct q6afe *afe = port->afe;
1199 dev_err(afe->dev, "AFE port index[%d] invalid!\n", index);
1222 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_DEVICE_STOP);
1224 dev_err(afe->dev, "AFE close failed %d\n", ret);
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;
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;
1499 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1509 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1534 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_DEVICE_START);
1536 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
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);
1567 port = q6afe_find_port(afe, id);
1628 port->afe = afe;
1632 spin_lock_irqsave(&afe->port_list_lock, flags);
1633 list_add_tail(&port->node, &afe->port_list);
1634 spin_unlock_irqrestore(&afe->port_list_lock, flags);
1655 struct q6afe *afe = dev_get_drvdata(dev->parent);
1681 ret = apr_send_pkt(afe->apr, pkt);
1683 dev_err(afe->dev, "AFE failed to unvote (%d)\n", hw_block_id);
1693 struct q6afe *afe = dev_get_drvdata(dev->parent);
1720 ret = afe_apr_send_pkt(afe, pkt, NULL,
1723 dev_err(afe->dev, "AFE failed to vote (%d)\n", hw_block_id);
1733 struct q6afe *afe;
1736 afe = devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL);
1737 if (!afe)
1740 q6core_get_svc_api_info(adev->svc_id, &afe->ainfo);
1741 afe->apr = adev;
1742 mutex_init(&afe->lock);
1743 init_waitqueue_head(&afe->wait);
1744 afe->dev = dev;
1745 INIT_LIST_HEAD(&afe->port_list);
1746 spin_lock_init(&afe->port_list_lock);
1748 dev_set_drvdata(dev, afe);