scsi: ufs: ufs-exynos: Support custom version of ufs_hba_variant_ops
authorChanho Park <chanho61.park@samsung.com>
Mon, 18 Oct 2021 12:42:08 +0000 (21:42 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 28 Oct 2021 03:10:11 +0000 (23:10 -0400)
By default, ufs_hba_exynos_ops will be used. Add support for a custom
version of ufs_hba_variant_ops because some variants of exynos-ufs will use
only few callbacks.

Link: https://lore.kernel.org/r/20211018124216.153072-8-chanho61.park@samsung.com
Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Kiwoong Kim <kwmad.kim@samsung.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-exynos.c
drivers/scsi/ufs/ufs-exynos.h

index d81a2eb894add366601af1d92b30a4bf0b3e76ae..b9257d72e9c8d5c3c84e9ceba359b9e3972a752a 100644 (file)
@@ -1237,8 +1237,14 @@ static int exynos_ufs_probe(struct platform_device *pdev)
 {
        int err;
        struct device *dev = &pdev->dev;
+       const struct ufs_hba_variant_ops *vops = &ufs_hba_exynos_ops;
+       const struct exynos_ufs_drv_data *drv_data =
+               device_get_match_data(dev);
 
-       err = ufshcd_pltfrm_init(pdev, &ufs_hba_exynos_ops);
+       if (drv_data && drv_data->vops)
+               vops = drv_data->vops;
+
+       err = ufshcd_pltfrm_init(pdev, vops);
        if (err)
                dev_err(dev, "ufshcd_pltfrm_init() failed %d\n", err);
 
index 2e72aabaa6732a975455aa1f9203fdf114008054..74f556d8a00332b00ffdfc4ff0af3b19830f4752 100644 (file)
@@ -142,6 +142,7 @@ struct exynos_ufs_uic_attr {
 };
 
 struct exynos_ufs_drv_data {
+       const struct ufs_hba_variant_ops *vops;
        struct exynos_ufs_uic_attr *uic_attr;
        unsigned int quirks;
        unsigned int opts;