mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
BACKPORT: scsi: ufs: Introduce fixup_dev_quirks vops
Some UFS deivces may have required device quirks or have non-standard features which are enabled only on specified UFS hosts or for special customers. To not "pollute" common device quirk list, i.e. ufs_fixups table, for those devices mentioned above, introduce "fixup_dev_quirks" vops to allow vendors to fix or modify device quirks accordingly. Link: https://lore.kernel.org/r/20200508080115.24233-3-stanley.chu@mediatek.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Bug: 151050916 (cherry picked from commit c28c00ba4f060949c2f461f08a4aa10024a40672) [ Resolved minor conflict in drivers/scsi/ufs/ufshcd.h ] Change-Id: I0317f26b92c6b14569f4081937b662195e62b905 Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
e854924b25
commit
dcda3bd59f
2 changed files with 18 additions and 2 deletions
|
|
@ -7021,7 +7021,7 @@ wb_disabled:
|
|||
hba->caps &= ~UFSHCD_CAP_WB_EN;
|
||||
}
|
||||
|
||||
static void ufs_fixup_device_setup(struct ufs_hba *hba)
|
||||
static void ufshcd_fixup_dev_quirks(struct ufs_hba *hba)
|
||||
{
|
||||
struct ufs_dev_fix *f;
|
||||
struct ufs_dev_info *dev_info = &hba->dev_info;
|
||||
|
|
@ -7036,6 +7036,15 @@ static void ufs_fixup_device_setup(struct ufs_hba *hba)
|
|||
}
|
||||
}
|
||||
|
||||
static void ufs_fixup_device_setup(struct ufs_hba *hba)
|
||||
{
|
||||
/* fix by general quirk table */
|
||||
ufshcd_fixup_dev_quirks(hba);
|
||||
|
||||
/* allow vendors to fix quirks */
|
||||
ufshcd_vops_fixup_dev_quirks(hba);
|
||||
}
|
||||
|
||||
static int ufs_get_device_desc(struct ufs_hba *hba)
|
||||
{
|
||||
int err;
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
#include <linux/android_kabi.h>
|
||||
|
||||
#include "ufs.h"
|
||||
#include "ufs_quirks.h"
|
||||
#include "ufshci.h"
|
||||
|
||||
#define UFSHCD "ufshcd"
|
||||
|
|
@ -350,6 +351,7 @@ struct ufs_hba_variant_ops {
|
|||
void (*hibern8_notify)(struct ufs_hba *, enum uic_cmd_dme,
|
||||
enum ufs_notify_change_status);
|
||||
int (*apply_dev_quirks)(struct ufs_hba *hba);
|
||||
void (*fixup_dev_quirks)(struct ufs_hba *hba);
|
||||
int (*suspend)(struct ufs_hba *, enum ufs_pm_op);
|
||||
int (*resume)(struct ufs_hba *, enum ufs_pm_op);
|
||||
void (*dbg_register_dump)(struct ufs_hba *hba);
|
||||
|
|
@ -1053,7 +1055,6 @@ int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
|
|||
|
||||
void ufshcd_auto_hibern8_enable(struct ufs_hba *hba);
|
||||
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
|
||||
|
||||
#define SD_ASCII_STD true
|
||||
#define SD_RAW false
|
||||
int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
|
||||
|
|
@ -1188,6 +1189,12 @@ static inline int ufshcd_vops_apply_dev_quirks(struct ufs_hba *hba)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline void ufshcd_vops_fixup_dev_quirks(struct ufs_hba *hba)
|
||||
{
|
||||
if (hba->vops && hba->vops->fixup_dev_quirks)
|
||||
hba->vops->fixup_dev_quirks(hba);
|
||||
}
|
||||
|
||||
static inline int ufshcd_vops_suspend(struct ufs_hba *hba, enum ufs_pm_op op)
|
||||
{
|
||||
if (hba->vops && hba->vops->suspend)
|
||||
|
|
|
|||
Loading…
Reference in a new issue