summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufs-qcom.c
diff options
context:
space:
mode:
authorYaniv Gardi <ygardi@codeaurora.org>2015-03-31 14:37:14 (GMT)
committerJames Bottomley <JBottomley@Odin.com>2015-04-10 15:53:56 (GMT)
commitcad2e03d8607793fd71a830b4b41fc8e9e9995ea (patch)
tree4ffd08cf1f701eb08fab9c4c01d9d8a84386dae4 /drivers/scsi/ufs/ufs-qcom.c
parentbfdbe8ba21291c024afcec95b7bd515b5bf69689 (diff)
downloadlinux-cad2e03d8607793fd71a830b4b41fc8e9e9995ea.tar.xz
ufs: add support to allow non standard behaviours (quirks)
Some implementation of UFS host controller HW might have some non-standard behaviours (quirks) when compared to behaviour specified by UFSHCI specification. This patch add support to allow specifying all such quirks to standard UFS host controller driver so standard driver takes them into account. In this change a UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS is introduced, where a minimum delay of 1ms is required before DME commands for stability purposes. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-qcom.c')
-rw-r--r--drivers/scsi/ufs/ufs-qcom.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index d7cb843..6652a81 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -694,13 +694,24 @@ out:
*/
static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
{
+ struct ufs_qcom_host *host = hba->priv;
+ if (host->hw_ver.major == 0x1)
+ hba->quirks |= UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS;
- /*
- * TBD
- * here we should be advertising controller quirks according to
- * controller version.
- */
+ if (host->hw_ver.major >= 0x2) {
+ if (!ufs_qcom_cap_qunipro(host))
+ /* Legacy UniPro mode still need following quirks */
+ hba->quirks |= UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS;
+ }
+}
+
+static void ufs_qcom_set_caps(struct ufs_hba *hba)
+{
+ struct ufs_qcom_host *host = hba->priv;
+
+ if (host->hw_ver.major >= 0x2)
+ host->caps = UFS_QCOM_CAP_QUNIPRO;
}
static int ufs_qcom_get_bus_vote(struct ufs_qcom_host *host,
@@ -938,6 +949,7 @@ static int ufs_qcom_init(struct ufs_hba *hba)
if (err)
goto out_disable_phy;
+ ufs_qcom_set_caps(hba);
ufs_qcom_advertise_quirks(hba);
hba->caps |= UFSHCD_CAP_CLK_GATING | UFSHCD_CAP_CLK_SCALING;