summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufs-qcom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ufs/ufs-qcom.c')
-rw-r--r--drivers/scsi/ufs/ufs-qcom.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 55ee0c4b9018..07955d70a76f 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -115,33 +115,34 @@ static int ufs_qcom_enable_lane_clks(struct ufs_qcom_host *host)
if (host->is_lane_clks_enabled)
return 0;
- err = ufs_qcom_host_clk_enable(dev,
- "rx_lane0_sync_clk", host->rx_l0_sync_clk);
+ err = ufs_qcom_host_clk_enable(dev, "rx_lane0_sync_clk",
+ host->rx_l0_sync_clk);
if (err)
goto out;
- err = ufs_qcom_host_clk_enable(dev,
- "rx_lane1_sync_clk", host->rx_l1_sync_clk);
+ err = ufs_qcom_host_clk_enable(dev, "tx_lane0_sync_clk",
+ host->tx_l0_sync_clk);
if (err)
goto disable_rx_l0;
- err = ufs_qcom_host_clk_enable(dev,
- "tx_lane0_sync_clk", host->tx_l0_sync_clk);
- if (err)
- goto disable_rx_l1;
-
- err = ufs_qcom_host_clk_enable(dev,
- "tx_lane1_sync_clk", host->tx_l1_sync_clk);
- if (err)
- goto disable_tx_l0;
+ if (host->hba->lanes_per_direction > 1) {
+ err = ufs_qcom_host_clk_enable(dev, "rx_lane1_sync_clk",
+ host->rx_l1_sync_clk);
+ if (err)
+ goto disable_tx_l0;
+ err = ufs_qcom_host_clk_enable(dev, "tx_lane1_sync_clk",
+ host->tx_l1_sync_clk);
+ if (err)
+ goto disable_rx_l1;
+ }
host->is_lane_clks_enabled = true;
goto out;
-disable_tx_l0:
- clk_disable_unprepare(host->tx_l0_sync_clk);
disable_rx_l1:
clk_disable_unprepare(host->rx_l1_sync_clk);
+disable_tx_l0:
+ clk_disable_unprepare(host->tx_l0_sync_clk);
disable_rx_l0:
clk_disable_unprepare(host->rx_l0_sync_clk);
out:
@@ -159,17 +160,20 @@ static int ufs_qcom_init_lane_clks(struct ufs_qcom_host *host)
goto out;
err = ufs_qcom_host_clk_get(dev,
- "rx_lane1_sync_clk", &host->rx_l1_sync_clk);
- if (err)
- goto out;
-
- err = ufs_qcom_host_clk_get(dev,
"tx_lane0_sync_clk", &host->tx_l0_sync_clk);
if (err)
goto out;
- err = ufs_qcom_host_clk_get(dev,
- "tx_lane1_sync_clk", &host->tx_l1_sync_clk);
+ /* In case of single lane per direction, don't read lane1 clocks */
+ if (host->hba->lanes_per_direction > 1) {
+ err = ufs_qcom_host_clk_get(dev, "rx_lane1_sync_clk",
+ &host->rx_l1_sync_clk);
+ if (err)
+ goto out;
+
+ err = ufs_qcom_host_clk_get(dev, "tx_lane1_sync_clk",
+ &host->tx_l1_sync_clk);
+ }
out:
return err;
}