Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 4f78a56

Browse files
Mani-Sadhasivammartinkpetersen
authored andcommitted
scsi: ufs: qcom: Allow passing platform specific OF data
In order to allow platform specific flags and configurations, introduce the platform specific OF data and move the existing quirk UFSHCD_QUIRK_BROKEN_LSDBS_CAP for SM8550 and SM8650 SoCs. Reviewed-by: Avri Altman <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Tested-by: Amit Pundir <[email protected]> # on SM8550-HDK Reviewed-by: Bart Van Assche <[email protected]> Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent bb98507 commit 4f78a56

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

drivers/ufs/host/ufs-qcom.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ static u32 ufs_qcom_get_ufs_hci_version(struct ufs_hba *hba)
871871
*/
872872
static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
873873
{
874+
const struct ufs_qcom_drvdata *drvdata = of_device_get_match_data(hba->dev);
874875
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
875876

876877
if (host->hw_ver.major == 0x2)
@@ -879,9 +880,8 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
879880
if (host->hw_ver.major > 0x3)
880881
hba->quirks |= UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH;
881882

882-
if (of_device_is_compatible(hba->dev->of_node, "qcom,sm8550-ufshc") ||
883-
of_device_is_compatible(hba->dev->of_node, "qcom,sm8650-ufshc"))
884-
hba->quirks |= UFSHCD_QUIRK_BROKEN_LSDBS_CAP;
883+
if (drvdata && drvdata->quirks)
884+
hba->quirks |= drvdata->quirks;
885885
}
886886

887887
static void ufs_qcom_set_phy_gear(struct ufs_qcom_host *host)
@@ -1865,9 +1865,14 @@ static void ufs_qcom_remove(struct platform_device *pdev)
18651865
platform_device_msi_free_irqs_all(hba->dev);
18661866
}
18671867

1868+
static const struct ufs_qcom_drvdata ufs_qcom_sm8550_drvdata = {
1869+
.quirks = UFSHCD_QUIRK_BROKEN_LSDBS_CAP,
1870+
};
1871+
18681872
static const struct of_device_id ufs_qcom_of_match[] __maybe_unused = {
18691873
{ .compatible = "qcom,ufshc" },
1870-
{ .compatible = "qcom,sm8550-ufshc" },
1874+
{ .compatible = "qcom,sm8550-ufshc", .data = &ufs_qcom_sm8550_drvdata },
1875+
{ .compatible = "qcom,sm8650-ufshc", .data = &ufs_qcom_sm8550_drvdata },
18711876
{},
18721877
};
18731878
MODULE_DEVICE_TABLE(of, ufs_qcom_of_match);

drivers/ufs/host/ufs-qcom.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ struct ufs_qcom_host {
217217
bool esi_enabled;
218218
};
219219

220+
struct ufs_qcom_drvdata {
221+
enum ufshcd_quirks quirks;
222+
};
223+
220224
static inline u32
221225
ufs_qcom_get_debug_reg_offset(struct ufs_qcom_host *host, u32 reg)
222226
{

0 commit comments

Comments
 (0)