aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivek Gautam <vivek.gautam@codeaurora.org>2018-09-04 06:17:18 -0400
committerKishon Vijay Abraham I <kishon@ti.com>2018-09-26 03:39:37 -0400
commit1e1e465c6d23aa7d1858eb2894408f15770af16c (patch)
tree70e3b9e151c1322a452208f3968a39372b319dd3
parent2ba3c43f09c50eb1c0472decdfba71010d8694dc (diff)
scsi/ufs: qcom: Remove ufs_qcom_phy_*() calls from host
The host makes direct calls into phy using ufs_qcom_phy_*() APIs. These APIs are only defined for 20nm qcom-ufs-qmp phy which is not being used by any architecture as yet. Future architectures too are not going to use 20nm ufs phy. So remove these ufs_qcom_phy_*() calls from host to let further change declare the 20nm phy as broken. Also remove couple of stale enum defines for ufs phy. Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-rw-r--r--drivers/phy/qualcomm/phy-qcom-ufs-i.h2
-rw-r--r--drivers/scsi/ufs/ufs-qcom.c28
-rw-r--r--drivers/scsi/ufs/ufs-qcom.h5
-rw-r--r--include/linux/phy/phy-qcom-ufs.h24
4 files changed, 2 insertions, 57 deletions
diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-i.h b/drivers/phy/qualcomm/phy-qcom-ufs-i.h
index 822c83b8efcd..681644e43248 100644
--- a/drivers/phy/qualcomm/phy-qcom-ufs-i.h
+++ b/drivers/phy/qualcomm/phy-qcom-ufs-i.h
@@ -17,9 +17,9 @@
17 17
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/phy/phy.h>
20#include <linux/regulator/consumer.h> 21#include <linux/regulator/consumer.h>
21#include <linux/slab.h> 22#include <linux/slab.h>
22#include <linux/phy/phy-qcom-ufs.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 75ee5906b966..3dc4501c6945 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -16,7 +16,6 @@
16#include <linux/of.h> 16#include <linux/of.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/phy/phy.h> 18#include <linux/phy/phy.h>
19#include <linux/phy/phy-qcom-ufs.h>
20 19
21#include "ufshcd.h" 20#include "ufshcd.h"
22#include "ufshcd-pltfrm.h" 21#include "ufshcd-pltfrm.h"
@@ -189,22 +188,9 @@ out:
189 188
190static int ufs_qcom_link_startup_post_change(struct ufs_hba *hba) 189static int ufs_qcom_link_startup_post_change(struct ufs_hba *hba)
191{ 190{
192 struct ufs_qcom_host *host = ufshcd_get_variant(hba);
193 struct phy *phy = host->generic_phy;
194 u32 tx_lanes; 191 u32 tx_lanes;
195 int err = 0;
196
197 err = ufs_qcom_get_connected_tx_lanes(hba, &tx_lanes);
198 if (err)
199 goto out;
200 192
201 err = ufs_qcom_phy_set_tx_lane_enable(phy, tx_lanes); 193 return ufs_qcom_get_connected_tx_lanes(hba, &tx_lanes);
202 if (err)
203 dev_err(hba->dev, "%s: ufs_qcom_phy_set_tx_lane_enable failed\n",
204 __func__);
205
206out:
207 return err;
208} 194}
209 195
210static int ufs_qcom_check_hibern8(struct ufs_hba *hba) 196static int ufs_qcom_check_hibern8(struct ufs_hba *hba)
@@ -932,10 +918,8 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
932{ 918{
933 u32 val; 919 u32 val;
934 struct ufs_qcom_host *host = ufshcd_get_variant(hba); 920 struct ufs_qcom_host *host = ufshcd_get_variant(hba);
935 struct phy *phy = host->generic_phy;
936 struct ufs_qcom_dev_params ufs_qcom_cap; 921 struct ufs_qcom_dev_params ufs_qcom_cap;
937 int ret = 0; 922 int ret = 0;
938 int res = 0;
939 923
940 if (!dev_req_params) { 924 if (!dev_req_params) {
941 pr_err("%s: incoming dev_req_params is NULL\n", __func__); 925 pr_err("%s: incoming dev_req_params is NULL\n", __func__);
@@ -1002,12 +986,6 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
1002 } 986 }
1003 987
1004 val = ~(MAX_U32 << dev_req_params->lane_tx); 988 val = ~(MAX_U32 << dev_req_params->lane_tx);
1005 res = ufs_qcom_phy_set_tx_lane_enable(phy, val);
1006 if (res) {
1007 dev_err(hba->dev, "%s: ufs_qcom_phy_set_tx_lane_enable() failed res = %d\n",
1008 __func__, res);
1009 ret = res;
1010 }
1011 989
1012 /* cache the power mode parameters to use internally */ 990 /* cache the power mode parameters to use internally */
1013 memcpy(&host->dev_req_params, 991 memcpy(&host->dev_req_params,
@@ -1264,10 +1242,6 @@ static int ufs_qcom_init(struct ufs_hba *hba)
1264 } 1242 }
1265 } 1243 }
1266 1244
1267 /* update phy revision information before calling phy_init() */
1268 ufs_qcom_phy_save_controller_version(host->generic_phy,
1269 host->hw_ver.major, host->hw_ver.minor, host->hw_ver.step);
1270
1271 err = ufs_qcom_init_lane_clks(host); 1245 err = ufs_qcom_init_lane_clks(host);
1272 if (err) 1246 if (err)
1273 goto out_variant_clear; 1247 goto out_variant_clear;
diff --git a/drivers/scsi/ufs/ufs-qcom.h b/drivers/scsi/ufs/ufs-qcom.h
index 295f4bef6a0e..c114826316eb 100644
--- a/drivers/scsi/ufs/ufs-qcom.h
+++ b/drivers/scsi/ufs/ufs-qcom.h
@@ -129,11 +129,6 @@ enum {
129 MASK_CLK_NS_REG = 0xFFFC00, 129 MASK_CLK_NS_REG = 0xFFFC00,
130}; 130};
131 131
132enum ufs_qcom_phy_init_type {
133 UFS_PHY_INIT_FULL,
134 UFS_PHY_INIT_CFG_RESTORE,
135};
136
137/* QCOM UFS debug print bit mask */ 132/* QCOM UFS debug print bit mask */
138#define UFS_QCOM_DBG_PRINT_REGS_EN BIT(0) 133#define UFS_QCOM_DBG_PRINT_REGS_EN BIT(0)
139#define UFS_QCOM_DBG_PRINT_ICE_REGS_EN BIT(1) 134#define UFS_QCOM_DBG_PRINT_ICE_REGS_EN BIT(1)
diff --git a/include/linux/phy/phy-qcom-ufs.h b/include/linux/phy/phy-qcom-ufs.h
deleted file mode 100644
index 9dd85071bcce..000000000000
--- a/include/linux/phy/phy-qcom-ufs.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Copyright (c) 2013-2015, Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef PHY_QCOM_UFS_H_
16#define PHY_QCOM_UFS_H_
17
18#include "phy.h"
19
20int ufs_qcom_phy_set_tx_lane_enable(struct phy *phy, u32 tx_lanes);
21void ufs_qcom_phy_save_controller_version(struct phy *phy,
22 u8 major, u16 minor, u16 step);
23
24#endif /* PHY_QCOM_UFS_H_ */