[PATCH v1 3/3] scsi: ufs-mediatek: add apply_dev_quirks variant operation

Stanley Chu stanley.chu at mediatek.com
Sat Jan 4 20:55:18 PST 2020


Add vendor-specific variant callback "apply_dev_quirks"
in MediaTek UFS driver.

Cc: Alim Akhtar <alim.akhtar at samsung.com>
Cc: Asutosh Das <asutoshd at codeaurora.org>
Cc: Avri Altman <avri.altman at wdc.com>
Cc: Bart Van Assche <bvanassche at acm.org>
Cc: Bean Huo <beanhuo at micron.com>
Cc: Can Guo <cang at codeaurora.org>
Cc: Matthias Brugger <matthias.bgg at gmail.com>
Signed-off-by: Stanley Chu <stanley.chu at mediatek.com>
---
 drivers/scsi/ufs/ufs-mediatek.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
index 41f80eeada46..8d999c0e60fe 100644
--- a/drivers/scsi/ufs/ufs-mediatek.c
+++ b/drivers/scsi/ufs/ufs-mediatek.c
@@ -16,6 +16,7 @@
 
 #include "ufshcd.h"
 #include "ufshcd-pltfrm.h"
+#include "ufs_quirks.h"
 #include "unipro.h"
 #include "ufs-mediatek.h"
 
@@ -405,6 +406,15 @@ static int ufs_mtk_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	return 0;
 }
 
+static int ufs_mtk_apply_dev_quirks(struct ufs_hba *hba,
+				    struct ufs_dev_desc *card)
+{
+	if (card->wmanufacturerid == UFS_VENDOR_SAMSUNG)
+		ufshcd_dme_set(hba, UIC_ARG_MIB(PA_TACTIVATE), 6);
+
+	return 0;
+}
+
 /**
  * struct ufs_hba_mtk_vops - UFS MTK specific variant operations
  *
@@ -417,6 +427,7 @@ static struct ufs_hba_variant_ops ufs_hba_mtk_vops = {
 	.setup_clocks        = ufs_mtk_setup_clocks,
 	.link_startup_notify = ufs_mtk_link_startup_notify,
 	.pwr_change_notify   = ufs_mtk_pwr_change_notify,
+	.apply_dev_quirks    = ufs_mtk_apply_dev_quirks,
 	.suspend             = ufs_mtk_suspend,
 	.resume              = ufs_mtk_resume,
 	.device_reset        = ufs_mtk_device_reset,
-- 
2.18.0


More information about the linux-arm-kernel mailing list