|
@@ -667,7 +667,7 @@ static struct swr_port_info *swrm_get_port(struct swr_master *master,
|
|
|
|
|
|
for (i = 0; i < SWR_MSTR_PORT_LEN; i++) {
|
|
|
port = &master->port[i];
|
|
|
- if (port->port_id == port_id) {
|
|
|
+ if (port->slave_port_id == port_id) {
|
|
|
dev_dbg(&master->dev, "%s: port_id: %d, index: %d\n",
|
|
|
__func__, port_id, i);
|
|
|
return port;
|
|
@@ -688,7 +688,7 @@ static struct swr_port_info *swrm_get_avail_port(struct swr_master *master)
|
|
|
continue;
|
|
|
|
|
|
dev_dbg(&master->dev, "%s: port_id: %d, index: %d\n",
|
|
|
- __func__, port->port_id, i);
|
|
|
+ __func__, port->slave_port_id, i);
|
|
|
return port;
|
|
|
}
|
|
|
|
|
@@ -703,7 +703,7 @@ static struct swr_port_info *swrm_get_enabled_port(struct swr_master *master,
|
|
|
|
|
|
for (i = 0; i < SWR_MSTR_PORT_LEN; i++) {
|
|
|
port = &master->port[i];
|
|
|
- if ((port->port_id == port_id) && (port->port_en == true))
|
|
|
+ if ((port->slave_port_id == port_id) && (port->port_en == true))
|
|
|
break;
|
|
|
}
|
|
|
if (i == SWR_MSTR_PORT_LEN)
|
|
@@ -781,7 +781,7 @@ static void swrm_cleanup_disabled_data_ports(struct swr_master *master,
|
|
|
swrm->write(swrm->handle,
|
|
|
SWRM_DP_PORT_CTRL_BANK((mport->id+1), bank),
|
|
|
value);
|
|
|
- swrm_cmd_fifo_wr_cmd(swrm, 0x00, port->dev_id, 0x00,
|
|
|
+ swrm_cmd_fifo_wr_cmd(swrm, 0x00, port->dev_num, 0x00,
|
|
|
SWRS_DP_CHANNEL_ENABLE_BANK(port_type, bank));
|
|
|
|
|
|
dev_dbg(swrm->dev, "%s: mport :%d, reg: 0x%x, val: 0x%x\n",
|
|
@@ -806,7 +806,7 @@ inc_loop:
|
|
|
__func__, port_disable_cnt, master->num_port);
|
|
|
}
|
|
|
|
|
|
-static void swrm_slvdev_datapath_control(struct swr_master *master,
|
|
|
+static int swrm_slvdev_datapath_control(struct swr_master *master,
|
|
|
bool enable)
|
|
|
{
|
|
|
u8 bank;
|
|
@@ -819,7 +819,7 @@ static void swrm_slvdev_datapath_control(struct swr_master *master,
|
|
|
|
|
|
if (!swrm) {
|
|
|
pr_err("%s: swrm is null\n", __func__);
|
|
|
- return;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
bank = get_inactive_bank_num(swrm);
|
|
@@ -848,7 +848,7 @@ static void swrm_slvdev_datapath_control(struct swr_master *master,
|
|
|
* BROADCAST and disabled in GROUP_NONE
|
|
|
*/
|
|
|
if (master->num_port == 0)
|
|
|
- return;
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
value = swrm->read(swrm->handle, SWRM_MCP_FRAME_CTRL_BANK_ADDR(bank));
|
|
@@ -875,6 +875,7 @@ static void swrm_slvdev_datapath_control(struct swr_master *master,
|
|
|
pm_runtime_mark_last_busy(&swrm->pdev->dev);
|
|
|
pm_runtime_put_autosuspend(&swrm->pdev->dev);
|
|
|
}
|
|
|
+ return 0;
|
|
|
}
|
|
|
|
|
|
static void swrm_apply_port_config(struct swr_master *master)
|
|
@@ -932,9 +933,9 @@ static void swrm_copy_data_port_config(struct swr_master *master, u8 bank)
|
|
|
if (!port)
|
|
|
continue;
|
|
|
port_type = mstr_port_type[mport->id];
|
|
|
- if (!port->dev_id || (port->dev_id > master->num_dev)) {
|
|
|
+ if (!port->dev_num || (port->dev_num > master->num_dev)) {
|
|
|
dev_dbg(swrm->dev, "%s: invalid device id = %d\n",
|
|
|
- __func__, port->dev_id);
|
|
|
+ __func__, port->dev_num);
|
|
|
continue;
|
|
|
}
|
|
|
value = ((port->ch_en)
|
|
@@ -953,23 +954,23 @@ static void swrm_copy_data_port_config(struct swr_master *master, u8 bank)
|
|
|
(SWRM_DP_PORT_CTRL_BANK((mport->id+1), bank)), value);
|
|
|
|
|
|
reg[len] = SWRM_CMD_FIFO_WR_CMD;
|
|
|
- val[len++] = SWR_REG_VAL_PACK(port->ch_en, port->dev_id, 0x00,
|
|
|
+ val[len++] = SWR_REG_VAL_PACK(port->ch_en, port->dev_num, 0x00,
|
|
|
SWRS_DP_CHANNEL_ENABLE_BANK(port_type, bank));
|
|
|
|
|
|
reg[len] = SWRM_CMD_FIFO_WR_CMD;
|
|
|
val[len++] = SWR_REG_VAL_PACK(port->sinterval,
|
|
|
- port->dev_id, 0x00,
|
|
|
+ port->dev_num, 0x00,
|
|
|
SWRS_DP_SAMPLE_CONTROL_1_BANK(port_type, bank));
|
|
|
|
|
|
reg[len] = SWRM_CMD_FIFO_WR_CMD;
|
|
|
val[len++] = SWR_REG_VAL_PACK(port->offset1,
|
|
|
- port->dev_id, 0x00,
|
|
|
+ port->dev_num, 0x00,
|
|
|
SWRS_DP_OFFSET_CONTROL_1_BANK(port_type, bank));
|
|
|
|
|
|
if (port_type != 0) {
|
|
|
reg[len] = SWRM_CMD_FIFO_WR_CMD;
|
|
|
val[len++] = SWR_REG_VAL_PACK(port->offset2,
|
|
|
- port->dev_id, 0x00,
|
|
|
+ port->dev_num, 0x00,
|
|
|
SWRS_DP_OFFSET_CONTROL_2_BANK(port_type,
|
|
|
bank));
|
|
|
}
|
|
@@ -1028,15 +1029,15 @@ static int swrm_connect_port(struct swr_master *master,
|
|
|
goto port_fail;
|
|
|
}
|
|
|
list_add(&mport->list, &swrm->mport_list);
|
|
|
- port->dev_id = portinfo->dev_id;
|
|
|
- port->port_id = portinfo->port_id[i];
|
|
|
+ port->dev_num = portinfo->dev_num;
|
|
|
+ port->slave_port_id = portinfo->port_id[i];
|
|
|
port->num_ch = portinfo->num_ch[i];
|
|
|
port->ch_rate = portinfo->ch_rate[i];
|
|
|
port->ch_en = portinfo->ch_en[i];
|
|
|
port->port_en = true;
|
|
|
dev_dbg(&master->dev,
|
|
|
"%s: mstr port %d, slv port %d ch_rate %d num_ch %d\n",
|
|
|
- __func__, mport->id, port->port_id, port->ch_rate,
|
|
|
+ __func__, mport->id, port->slave_port_id, port->ch_rate,
|
|
|
port->num_ch);
|
|
|
}
|
|
|
master->num_port += portinfo->num_port;
|
|
@@ -1120,7 +1121,7 @@ static int swrm_disconnect_port(struct swr_master *master,
|
|
|
continue;
|
|
|
}
|
|
|
port_type = mstr_port_type[mport_id];
|
|
|
- port->dev_id = portinfo->dev_id;
|
|
|
+ port->dev_num = portinfo->dev_num;
|
|
|
port->port_en = false;
|
|
|
port->ch_en = 0;
|
|
|
value = port->ch_en << SWRM_DP_PORT_CTRL_EN_CHAN_SHFT;
|
|
@@ -1132,7 +1133,7 @@ static int swrm_disconnect_port(struct swr_master *master,
|
|
|
swrm->write(swrm->handle,
|
|
|
SWRM_DP_PORT_CTRL_BANK((mport_id+1), bank),
|
|
|
value);
|
|
|
- swrm_cmd_fifo_wr_cmd(swrm, 0x00, port->dev_id, 0x00,
|
|
|
+ swrm_cmd_fifo_wr_cmd(swrm, 0x00, port->dev_num, 0x00,
|
|
|
SWRS_DP_CHANNEL_ENABLE_BANK(port_type, bank));
|
|
|
}
|
|
|
|