Lines Matching defs:port
87 /* SLIMbus Rx port on channel 0. */
89 /* SLIMbus Tx port on channel 0. */
91 /* SLIMbus Rx port on channel 1. */
93 /* SLIMbus Tx port on channel 1. */
95 /* SLIMbus Rx port on channel 2. */
97 /* SLIMbus Tx port on channel 2. */
99 /* SLIMbus Rx port on channel 3. */
101 /* SLIMbus Tx port on channel 3. */
103 /* SLIMbus Rx port on channel 4. */
105 /* SLIMbus Tx port on channel 4. */
107 /* SLIMbus Rx port on channel 5. */
109 /* SLIMbus Tx port on channel 5. */
111 /* SLIMbus Rx port on channel 6. */
113 /* SLIMbus Tx port on channel 6. */
124 /* Start of the range of port IDs for TDM devices. */
127 /* End of the range of port IDs for TDM devices. */
131 /* Size of the range of port IDs for TDM ports. */
306 /* AFE WSA Codec DMA Rx port 0 */
308 /* AFE WSA Codec DMA Tx port 0 */
310 /* AFE WSA Codec DMA Rx port 1 */
312 /* AFE WSA Codec DMA Tx port 1 */
314 /* AFE WSA Codec DMA Tx port 2 */
316 /* AFE VA Codec DMA Tx port 0 */
318 /* AFE VA Codec DMA Tx port 1 */
320 /* AFE VA Codec DMA Tx port 2 */
322 /* AFE Rx Codec DMA Rx port 0 */
324 /* AFE Tx Codec DMA Tx port 0 */
326 /* AFE Rx Codec DMA Rx port 1 */
328 /* AFE Tx Codec DMA Tx port 1 */
330 /* AFE Rx Codec DMA Rx port 2 */
332 /* AFE Tx Codec DMA Tx port 2 */
334 /* AFE Rx Codec DMA Rx port 3 */
336 /* AFE Tx Codec DMA Tx port 3 */
338 /* AFE Rx Codec DMA Rx port 4 */
340 /* AFE Tx Codec DMA Tx port 4 */
342 /* AFE Rx Codec DMA Rx port 5 */
344 /* AFE Tx Codec DMA Tx port 5 */
346 /* AFE Rx Codec DMA Rx port 6 */
348 /* AFE Rx Codec DMA Rx port 7 */
445 * master port is to be connected.
450 /* Sampling rate of the port.
574 * on A Family SoCs DSP port IDs are same as virtual Port IDs.
833 struct q6afe_port *port;
837 port = container_of(ref, struct q6afe_port, refcount);
838 afe = port->afe;
840 list_del(&port->node);
842 kfree(port->scfg);
843 kfree(port);
869 struct q6afe_port *port;
886 port = q6afe_find_port(afe, hdr->token);
887 if (port) {
888 port->result = *res;
889 wake_up(&port->wait);
890 kref_put(&port->refcount, q6afe_port_free);
915 * q6afe_get_port_id() - Get port id from a given port index
917 * @index: port index
931 struct q6afe_port *port, uint32_t rsp_opcode)
933 wait_queue_head_t *wait = &port->wait;
938 if (port) {
939 wait = &port->wait;
940 result = &port->result;
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);
1020 static int q6afe_port_set_param(struct q6afe_port *port, void *data,
1023 return q6afe_set_param(port->afe, port, data, param_id, module_id,
1024 psize, port->token);
1027 static int q6afe_port_set_param_v2(struct q6afe_port *port, void *data,
1032 struct q6afe *afe = port->afe;
1034 u16 port_id = port->id;
1055 pkt->hdr.token = port->token;
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",
1076 static int q6afe_port_set_lpass_clock(struct q6afe_port *port,
1079 return q6afe_port_set_param_v2(port, cfg,
1085 static int q6afe_set_lpass_clock_v2(struct q6afe_port *port,
1088 return q6afe_port_set_param(port, cfg, AFE_PARAM_ID_CLOCK_SET,
1092 static int q6afe_set_digital_codec_core_clock(struct q6afe_port *port,
1095 return q6afe_port_set_param_v2(port, cfg,
1120 int q6afe_port_set_sysclk(struct q6afe_port *port, int clk_id,
1134 ret = q6afe_set_digital_codec_core_clock(port, &dcfg);
1142 ret = q6afe_port_set_lpass_clock(port, &ccfg);
1151 ret = q6afe_port_set_lpass_clock(port, &ccfg);
1163 ret = q6afe_set_lpass_clock_v2(port, &cset);
1175 * q6afe_port_stop() - Stop a afe port
1177 * @port: Instance of port to stop
1181 int q6afe_port_stop(struct q6afe_port *port)
1184 struct q6afe *afe = port->afe;
1186 int port_id = port->id;
1191 port_id = port->id;
1192 index = port->token;
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);
1227 * q6afe_slim_port_prepare() - Prepare slim afe port.
1229 * @port: Instance of afe port
1230 * @cfg: SLIM configuration for the afe port
1233 void q6afe_slim_port_prepare(struct q6afe_port *port,
1236 union afe_port_config *pcfg = &port->port_cfg;
1252 * q6afe_tdm_port_prepare() - Prepare tdm afe port.
1254 * @port: Instance of afe port
1255 * @cfg: TDM configuration for the afe port
1258 void q6afe_tdm_port_prepare(struct q6afe_port *port,
1261 union afe_port_config *pcfg = &port->port_cfg;
1274 port->scfg = kzalloc(sizeof(*port->scfg), GFP_KERNEL);
1275 if (!port->scfg)
1278 port->scfg->minor_version = AFE_API_VERSION_SLOT_MAPPING_CONFIG;
1279 port->scfg->num_channels = cfg->num_channels;
1280 port->scfg->bitwidth = cfg->bit_width;
1281 port->scfg->data_align_type = cfg->data_align_type;
1282 memcpy(port->scfg->ch_mapping, cfg->ch_mapping,
1288 * q6afe_hdmi_port_prepare() - Prepare hdmi afe port.
1290 * @port: Instance of afe port
1291 * @cfg: HDMI configuration for the afe port
1294 void q6afe_hdmi_port_prepare(struct q6afe_port *port,
1297 union afe_port_config *pcfg = &port->port_cfg;
1309 * q6afe_i2s_port_prepare() - Prepare i2s afe port.
1311 * @port: Instance of afe port
1312 * @cfg: I2S configuration for the afe port
1315 int q6afe_i2s_port_prepare(struct q6afe_port *port, struct q6afe_i2s_cfg *cfg)
1317 union afe_port_config *pcfg = &port->port_cfg;
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
1458 void q6afe_cdc_dma_port_prepare(struct q6afe_port *port,
1461 union afe_port_config *pcfg = &port->port_cfg;
1474 * q6afe_port_start() - Start a afe port
1476 * @port: Instance of port to start
1480 int q6afe_port_start(struct q6afe_port *port)
1483 struct q6afe *afe = port->afe;
1484 int port_id = port->id;
1485 int ret, param_id = port->cfg_type;
1490 ret = q6afe_port_set_param_v2(port, &port->port_cfg, param_id,
1492 sizeof(port->port_cfg));
1494 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1499 if (port->scfg) {
1500 ret = q6afe_port_set_param_v2(port, port->scfg,
1502 AFE_MODULE_TDM, sizeof(*port->scfg));
1504 dev_err(afe->dev, "AFE enable for port 0x%x failed %d\n",
1524 pkt->hdr.token = port->token;
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",
1540 * q6afe_port_get_from_id() - Get port instance from a port id
1543 * @id: port id
1545 * Return: Will be an error pointer on error or a valid afe port
1552 struct q6afe_port *port;
1557 dev_err(dev, "AFE port token[%d] invalid!\n", id);
1561 /* if port is multiple times bind/unbind before callback finishes */
1562 port = q6afe_find_port(afe, id);
1563 if (port) {
1565 return port;
1609 dev_err(dev, "Invalid port id 0x%x\n", port_id);
1613 port = kzalloc(sizeof(*port), GFP_KERNEL);
1614 if (!port)
1617 init_waitqueue_head(&port->wait);
1619 port->token = id;
1620 port->id = port_id;
1621 port->afe = afe;
1622 port->cfg_type = cfg_type;
1623 kref_init(&port->refcount);
1626 list_add_tail(&port->node, &afe->port_list);
1629 return port;
1635 * q6afe_port_put() - Release port reference
1637 * @port: Instance of port to put
1639 void q6afe_port_put(struct q6afe_port *port)
1641 kref_put(&port->refcount, q6afe_port_free);