|
@@ -1,5 +1,5 @@
|
|
|
/*
|
|
|
- * Copyright (c) 2013-2015, Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2013-2016, Linux Foundation. All rights reserved.
|
|
|
*
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
@@ -132,21 +132,24 @@ static int ufs_qcom_enable_lane_clks(struct ufs_qcom_host *host)
|
|
|
if (err)
|
|
|
goto disable_rx_l0;
|
|
|
|
|
|
- err = ufs_qcom_host_clk_enable(dev, "rx_lane1_sync_clk",
|
|
|
- host->rx_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;
|
|
|
+ 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_rx_l1:
|
|
|
- clk_disable_unprepare(host->rx_l1_sync_clk);
|
|
|
+ if (host->hba->lanes_per_direction > 1)
|
|
|
+ clk_disable_unprepare(host->rx_l1_sync_clk);
|
|
|
disable_tx_l0:
|
|
|
clk_disable_unprepare(host->tx_l0_sync_clk);
|
|
|
disable_rx_l0:
|
|
@@ -170,14 +173,16 @@ static int ufs_qcom_init_lane_clks(struct ufs_qcom_host *host)
|
|
|
if (err)
|
|
|
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_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;
|
|
|
}
|