Prechádzať zdrojové kódy

Merge "soc: soundwire: Update check link status for master init" into audio-drivers.lnx.4.0

Linux Build Service Account 5 rokov pred
rodič
commit
e96eb4e5b2
1 zmenil súbory, kde vykonal 8 pridanie a 2 odobranie
  1. 8 2
      soc/swr-mstr-ctrl.c

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

@@ -2199,6 +2199,12 @@ static int swrm_master_init(struct swr_mstr_ctrl *swrm)
 
 	swr_master_bulk_write(swrm, reg, value, len);
 
+	if (!swrm_check_link_status(swrm, 0x1)) {
+		dev_err(swrm->dev,
+			"%s: swr link failed to connect\n",
+			__func__);
+		return -EINVAL;
+	}
 	/*
 	 * For SWR master version 1.5.1, continue
 	 * execute on command ignore.
@@ -2842,6 +2848,8 @@ static int swrm_runtime_suspend(struct device *dev)
 			mutex_lock(&swrm->reslock);
 			usleep_range(100, 105);
 		}
+		if (!swrm_check_link_status(swrm, 0x0))
+			goto exit;
 		ret = swrm_clk_request(swrm, false);
 		if (ret) {
 			dev_err(dev, "%s: swrmn clk failed\n", __func__);
@@ -2857,8 +2865,6 @@ static int swrm_runtime_suspend(struct device *dev)
 					SWR_WAKE_IRQ_REGISTER, (void *)swrm);
 				swrm->ipc_wakeup_triggered = false;
 			}
-			if (!swrm_check_link_status(swrm, 0x0))
-				goto exit;
 		}
 
 	}