mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
ANDROID: scsi: ufs: add ->fill_prdt() variant op
Add a ->fill_prdt() variant op so that UFS platform drivers can initialize variant-specific PRDT fields. This is needed for FMP support. Bug: 166139333 Bug: 162257402 Change-Id: Icd07b5e475555ef3eaa0ae9e18a1ae9a4b981679 Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
committed by
Alistair Delva
parent
a2ca8408de
commit
617dda8838
@@ -2211,7 +2211,7 @@ static int ufshcd_map_sg(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
|
||||
lrbp->utr_descriptor_ptr->prd_table_length = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ufshcd_vops_fill_prdt(hba, lrbp, sg_segments);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -282,6 +282,8 @@ struct ufs_pwr_mode_info {
|
||||
* @phy_initialization: used to initialize phys
|
||||
* @device_reset: called to issue a reset pulse on the UFS device
|
||||
* @program_key: program or evict an inline encryption key
|
||||
* @fill_prdt: called after initializing the standard PRDT fields so that any
|
||||
* variant-specific PRDT fields can be initialized too
|
||||
*/
|
||||
struct ufs_hba_variant_ops {
|
||||
const char *name;
|
||||
@@ -317,6 +319,8 @@ struct ufs_hba_variant_ops {
|
||||
void *data);
|
||||
int (*program_key)(struct ufs_hba *hba,
|
||||
const union ufs_crypto_cfg_entry *cfg, int slot);
|
||||
int (*fill_prdt)(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
|
||||
unsigned int segments);
|
||||
};
|
||||
|
||||
/* clock gating state */
|
||||
@@ -1173,6 +1177,16 @@ static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
|
||||
hba->vops->config_scaling_param(hba, profile, data);
|
||||
}
|
||||
|
||||
static inline int ufshcd_vops_fill_prdt(struct ufs_hba *hba,
|
||||
struct ufshcd_lrb *lrbp,
|
||||
unsigned int segments)
|
||||
{
|
||||
if (hba->vops && hba->vops->fill_prdt)
|
||||
return hba->vops->fill_prdt(hba, lrbp, segments);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern struct ufs_pm_lvl_states ufs_pm_lvl_states[];
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user