Loading drivers/scsi/ufs/ufshcd.c +9 −34 Original line number Original line Diff line number Diff line Loading @@ -408,6 +408,7 @@ static struct ufs_dev_fix ufs_fixups[] = { UFS_DEVICE_NO_FASTAUTO), UFS_DEVICE_NO_FASTAUTO), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE), UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_DEVICE_NO_VCCQ), UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL, UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL, UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM), UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM), UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL, UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL, Loading Loading @@ -476,7 +477,6 @@ static int ufshcd_config_vreg(struct device *dev, struct ufs_vreg *vreg, bool on); struct ufs_vreg *vreg, bool on); static int ufshcd_enable_vreg(struct device *dev, struct ufs_vreg *vreg); static int ufshcd_enable_vreg(struct device *dev, struct ufs_vreg *vreg); static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg); static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg); static bool ufshcd_is_g4_supported(struct ufs_hba *hba); #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) static struct devfreq_simple_ondemand_data ufshcd_ondemand_data = { static struct devfreq_simple_ondemand_data ufshcd_ondemand_data = { Loading Loading @@ -8192,7 +8192,7 @@ static int ufshcd_set_low_vcc_level(struct ufs_hba *hba, struct ufs_vreg *vreg = hba->vreg_info.vcc; struct ufs_vreg *vreg = hba->vreg_info.vcc; /* Check if device supports the low voltage VCC feature */ /* Check if device supports the low voltage VCC feature */ if (dev_desc->wspecversion < 0x300 && !ufshcd_is_g4_supported(hba)) if (dev_desc->wspecversion < 0x300) return 0; return 0; /* /* Loading Loading @@ -8727,34 +8727,6 @@ static int ufs_read_device_desc_data(struct ufs_hba *hba) return 0; return 0; } } /** * ufshcd_is_g4_supported - check if device supports HS-G4 * @hba: per-adapter instance * * Returns True if device supports HS-G4, False otherwise. */ static bool ufshcd_is_g4_supported(struct ufs_hba *hba) { int ret; u32 tx_hsgear = 0; /* check device capability */ ret = ufshcd_dme_peer_get(hba, UIC_ARG_MIB_SEL(TX_HSGEAR_CAPABILITY, UIC_ARG_MPHY_TX_GEN_SEL_INDEX(0)), &tx_hsgear); if (ret) { dev_err(hba->dev, "%s: Failed getting peer TX_HSGEAR_CAPABILITY. err = %d\n", __func__, ret); return false; } if (tx_hsgear == UFS_HS_G4) return true; else return false; } /** /** * ufshcd_probe_hba - probe hba to detect device and initialize * ufshcd_probe_hba - probe hba to detect device and initialize * @hba: per-adapter instance * @hba: per-adapter instance Loading Loading @@ -8813,10 +8785,13 @@ static int ufshcd_probe_hba(struct ufs_hba *hba) ufshcd_tune_unipro_params(hba); ufshcd_tune_unipro_params(hba); ufshcd_apply_pm_quirks(hba); ufshcd_apply_pm_quirks(hba); if (card.wspecversion < 0x300) { ret = ufshcd_set_vccq_rail_unused(hba, ret = ufshcd_set_vccq_rail_unused(hba, (hba->dev_info.quirks & UFS_DEVICE_NO_VCCQ) ? true : false); (hba->dev_info.quirks & UFS_DEVICE_NO_VCCQ) ? true : false); if (ret) if (ret) goto out; goto out; } /* UFS device is also active now */ /* UFS device is also active now */ ufshcd_set_ufs_dev_active(hba); ufshcd_set_ufs_dev_active(hba); Loading Loading
drivers/scsi/ufs/ufshcd.c +9 −34 Original line number Original line Diff line number Diff line Loading @@ -408,6 +408,7 @@ static struct ufs_dev_fix ufs_fixups[] = { UFS_DEVICE_NO_FASTAUTO), UFS_DEVICE_NO_FASTAUTO), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE), UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE), UFS_FIX(UFS_VENDOR_SAMSUNG, UFS_ANY_MODEL, UFS_DEVICE_NO_VCCQ), UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL, UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL, UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM), UFS_DEVICE_QUIRK_DELAY_BEFORE_LPM), UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL, UFS_FIX(UFS_VENDOR_TOSHIBA, UFS_ANY_MODEL, Loading Loading @@ -476,7 +477,6 @@ static int ufshcd_config_vreg(struct device *dev, struct ufs_vreg *vreg, bool on); struct ufs_vreg *vreg, bool on); static int ufshcd_enable_vreg(struct device *dev, struct ufs_vreg *vreg); static int ufshcd_enable_vreg(struct device *dev, struct ufs_vreg *vreg); static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg); static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg); static bool ufshcd_is_g4_supported(struct ufs_hba *hba); #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) static struct devfreq_simple_ondemand_data ufshcd_ondemand_data = { static struct devfreq_simple_ondemand_data ufshcd_ondemand_data = { Loading Loading @@ -8192,7 +8192,7 @@ static int ufshcd_set_low_vcc_level(struct ufs_hba *hba, struct ufs_vreg *vreg = hba->vreg_info.vcc; struct ufs_vreg *vreg = hba->vreg_info.vcc; /* Check if device supports the low voltage VCC feature */ /* Check if device supports the low voltage VCC feature */ if (dev_desc->wspecversion < 0x300 && !ufshcd_is_g4_supported(hba)) if (dev_desc->wspecversion < 0x300) return 0; return 0; /* /* Loading Loading @@ -8727,34 +8727,6 @@ static int ufs_read_device_desc_data(struct ufs_hba *hba) return 0; return 0; } } /** * ufshcd_is_g4_supported - check if device supports HS-G4 * @hba: per-adapter instance * * Returns True if device supports HS-G4, False otherwise. */ static bool ufshcd_is_g4_supported(struct ufs_hba *hba) { int ret; u32 tx_hsgear = 0; /* check device capability */ ret = ufshcd_dme_peer_get(hba, UIC_ARG_MIB_SEL(TX_HSGEAR_CAPABILITY, UIC_ARG_MPHY_TX_GEN_SEL_INDEX(0)), &tx_hsgear); if (ret) { dev_err(hba->dev, "%s: Failed getting peer TX_HSGEAR_CAPABILITY. err = %d\n", __func__, ret); return false; } if (tx_hsgear == UFS_HS_G4) return true; else return false; } /** /** * ufshcd_probe_hba - probe hba to detect device and initialize * ufshcd_probe_hba - probe hba to detect device and initialize * @hba: per-adapter instance * @hba: per-adapter instance Loading Loading @@ -8813,10 +8785,13 @@ static int ufshcd_probe_hba(struct ufs_hba *hba) ufshcd_tune_unipro_params(hba); ufshcd_tune_unipro_params(hba); ufshcd_apply_pm_quirks(hba); ufshcd_apply_pm_quirks(hba); if (card.wspecversion < 0x300) { ret = ufshcd_set_vccq_rail_unused(hba, ret = ufshcd_set_vccq_rail_unused(hba, (hba->dev_info.quirks & UFS_DEVICE_NO_VCCQ) ? true : false); (hba->dev_info.quirks & UFS_DEVICE_NO_VCCQ) ? true : false); if (ret) if (ret) goto out; goto out; } /* UFS device is also active now */ /* UFS device is also active now */ ufshcd_set_ufs_dev_active(hba); ufshcd_set_ufs_dev_active(hba); Loading