Lines Matching defs:afe

547 	struct q6afe *afe;
834 struct q6afe *afe;
838 afe = port->afe;
839 spin_lock_irqsave(&afe->port_list_lock, flags);
841 spin_unlock_irqrestore(&afe->port_list_lock, flags);
846 static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token)
852 spin_lock_irqsave(&afe->port_list_lock, flags);
853 list_for_each_entry(p, &afe->port_list, node)
860 spin_unlock_irqrestore(&afe->port_list_lock, flags);
866 struct q6afe *afe = dev_get_drvdata(&adev->dev);
878 dev_err(afe->dev, "cmd = 0x%x returned error = 0x%x\n",
886 port = q6afe_find_port(afe, hdr->token);
892 afe->result = *res;
893 wake_up(&afe->wait);
897 dev_err(afe->dev, "Unknown cmd 0x%x\n", res->opcode);
903 afe->result.opcode = hdr->opcode;
904 afe->result.status = res->status;
905 wake_up(&afe->wait);
930 static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
937 mutex_lock(&afe->lock);
942 result = &afe->result;
943 wait = &afe->wait;
949 ret = apr_send_pkt(afe->apr, pkt);
951 dev_err(afe->dev, "packet not transmitted (%d)\n", ret);
961 dev_err(afe->dev, "DSP returned error[%x]\n",
969 mutex_unlock(&afe->lock);
974 static int q6afe_set_param(struct q6afe *afe, struct q6afe_port *port,
1012 ret = afe_apr_send_pkt(afe, pkt, port, AFE_SVC_CMD_SET_PARAM);
1014 dev_err(afe->dev, "AFE set params failed %d\n", ret);
1023 return q6afe_set_param(port->afe, port, data, param_id, module_id,
1032 struct q6afe *afe = port->afe;
1067 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_SET_PARAM_V2);
1069 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1104 struct q6afe *afe = dev_get_drvdata(dev->parent);
1114 return q6afe_set_param(afe, NULL, &cset, AFE_PARAM_ID_CLOCK_SET,
1175 * q6afe_port_stop() - Stop a afe port
1184 struct q6afe *afe = port->afe;
1194 dev_err(afe->dev, "AFE port index[%d] invalid!\n", index);
1217 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_DEVICE_STOP);
1219 dev_err(afe->dev, "AFE close failed %d\n", ret);
1227 * q6afe_slim_port_prepare() - Prepare slim afe port.
1229 * @port: Instance of afe port
1230 * @cfg: SLIM configuration for the afe port
1252 * q6afe_tdm_port_prepare() - Prepare tdm afe port.
1254 * @port: Instance of afe port
1255 * @cfg: TDM configuration for the afe port
1288 * q6afe_hdmi_port_prepare() - Prepare hdmi afe port.
1290 * @port: Instance of afe port
1291 * @cfg: HDMI configuration for the afe port
1309 * q6afe_i2s_port_prepare() - Prepare i2s afe port.
1311 * @port: Instance of afe port
1312 * @cfg: I2S configuration for the afe port
1318 struct device *dev = port->afe->dev;
1452 * q6afe_dam_port_prepare() - Prepare dma afe port.
1454 * @port: Instance of afe port
1455 * @cfg: DMA configuration for the afe port
1474 * q6afe_port_start() - Start a afe port
1483 struct q6afe *afe = port->afe;
1494 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1504 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1529 ret = afe_apr_send_pkt(afe, pkt, port, AFE_PORT_CMD_DEVICE_START);
1531 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1542 * @dev: Pointer to afe child device.
1545 * Return: Will be an error pointer on error or a valid afe port
1551 struct q6afe *afe = dev_get_drvdata(dev->parent);
1562 port = q6afe_find_port(afe, id);
1621 port->afe = afe;
1625 spin_lock_irqsave(&afe->port_list_lock, flags);
1626 list_add_tail(&port->node, &afe->port_list);
1627 spin_unlock_irqrestore(&afe->port_list_lock, flags);
1648 struct q6afe *afe = dev_get_drvdata(dev->parent);
1674 ret = apr_send_pkt(afe->apr, pkt);
1676 dev_err(afe->dev, "AFE failed to unvote (%d)\n", hw_block_id);
1686 struct q6afe *afe = dev_get_drvdata(dev->parent);
1713 ret = afe_apr_send_pkt(afe, pkt, NULL,
1716 dev_err(afe->dev, "AFE failed to vote (%d)\n", hw_block_id);
1726 struct q6afe *afe;
1729 afe = devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL);
1730 if (!afe)
1733 q6core_get_svc_api_info(adev->svc_id, &afe->ainfo);
1734 afe->apr = adev;
1735 mutex_init(&afe->lock);
1736 init_waitqueue_head(&afe->wait);
1737 afe->dev = dev;
1738 INIT_LIST_HEAD(&afe->port_list);
1739 spin_lock_init(&afe->port_list_lock);
1741 dev_set_drvdata(dev, afe);