Explorar el Código

Merge "soc: Fix PDR WSA auto-enumeration issue"

qctecmdr hace 2 años
padre
commit
9553953215
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. 3 2
      soc/swr-mstr-ctrl.c
  2. 1 0
      soc/swr-mstr-ctrl.h

+ 3 - 2
soc/swr-mstr-ctrl.c

@@ -1400,7 +1400,7 @@ static void swrm_get_device_frame_shape(struct swr_mstr_ctrl *swrm,
 
 	if (swrm->master_id == MASTER_ID_TX) {
 		uc = swrm_get_uc(swrm->bus_clk);
-		port_id_offset = (port_req->dev_num - 1) *
+		port_id_offset = swrm->dev_mapping[port_req->dev_num] *
 					SWR_MAX_DEV_PORT_NUM +
 					port_req->slave_port_id;
 		if (port_id_offset >= SWR_MAX_MSTR_PORT_NUM)
@@ -1429,7 +1429,7 @@ static void swrm_get_device_frame_shape(struct swr_mstr_ctrl *swrm,
 	}
 	if (swrm->master_id == MASTER_ID_WSA) {
 		uc = swrm_get_uc(swrm->bus_clk);
-		port_id_offset = (port_req->dev_num - 1) *
+		port_id_offset = swrm->dev_mapping[port_req->dev_num] *
 					SWR_MAX_DEV_PORT_NUM +
 					port_req->slave_port_id;
 		if (port_id_offset >= SWR_MAX_MSTR_PORT_NUM ||
@@ -2464,6 +2464,7 @@ static int swrm_get_logical_dev_num(struct swr_master *mstr, u64 dev_id,
 					if ((id & SWR_DEV_ID_MASK) == dev_id) {
 						*dev_num = i;
 						ret = 0;
+						swrm->dev_mapping[*dev_num] = dev_id;
 						dev_info(swrm->dev,
 							"%s: devnum %d assigned for dev %llx\n",
 							__func__, i,

+ 1 - 0
soc/swr-mstr-ctrl.h

@@ -197,6 +197,7 @@ struct swr_mstr_ctrl {
 	u32 is_always_on;
 	bool clk_stop_wakeup;
 	struct swr_port_params pp[SWR_UC_MAX][SWR_MAX_MSTR_PORT_NUM];/*max_devNum * max_ports 11 * 14 */
+	u64 dev_mapping[SWR_MAX_DEV_NUM + 1]; /* Dev Num is 1-indexed */
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *debugfs_swrm_dent;
 	struct dentry *debugfs_peek;