Loading drivers/scsi/ufs/ufs-qcom.c +23 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #include <linux/acpi.h> #include <linux/time.h> #include <linux/of.h> #include <linux/bitfield.h> #include <linux/platform_device.h> #include <linux/phy/phy.h> #include <linux/gpio/consumer.h> Loading Loading @@ -1486,8 +1487,19 @@ static int ufs_qcom_quirk_host_pa_saveconfigtime(struct ufs_hba *hba) static int ufs_qcom_apply_dev_quirks(struct ufs_hba *hba) { unsigned long flags; int err = 0; spin_lock_irqsave(hba->host->host_lock, flags); /* Set the rpm auto suspend delay to 3s */ hba->host->hostt->rpm_autosuspend_delay = UFS_QCOM_AUTO_SUSPEND_DELAY; /* Set the default auto-hiberate idle timer value to 1ms */ hba->ahit = FIELD_PREP(UFSHCI_AHIBERN8_TIMER_MASK, 1) | FIELD_PREP(UFSHCI_AHIBERN8_SCALE_MASK, 3); /* Set the clock gating delay to performance mode */ hba->clk_gating.delay_ms = UFS_QCOM_CLK_GATING_DELAY_MS_PERF; spin_unlock_irqrestore(hba->host->host_lock, flags); if (hba->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME) err = ufs_qcom_quirk_host_pa_saveconfigtime(hba); Loading Loading @@ -2352,6 +2364,12 @@ static int ufs_qcom_clk_scale_up_pre_change(struct ufs_hba *hba) static int ufs_qcom_clk_scale_up_post_change(struct ufs_hba *hba) { unsigned long flags; spin_lock_irqsave(hba->host->host_lock, flags); hba->clk_gating.delay_ms = UFS_QCOM_CLK_GATING_DELAY_MS_PERF; spin_unlock_irqrestore(hba->host->host_lock, flags); return 0; } Loading Loading @@ -2388,6 +2406,11 @@ static int ufs_qcom_clk_scale_down_post_change(struct ufs_hba *hba) struct ufs_clk_info *clki; struct list_head *head = &hba->clk_list_head; u32 curr_freq = 0; unsigned long flags; spin_lock_irqsave(hba->host->host_lock, flags); hba->clk_gating.delay_ms = UFS_QCOM_CLK_GATING_DELAY_MS_PWR_SAVE; spin_unlock_irqrestore(hba->host->host_lock, flags); if (!ufs_qcom_cap_qunipro(host)) return 0; Loading drivers/scsi/ufs/ufs-qcom.h +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ #define UFS_QCOM_LIMIT_DESIRED_MODE FAST #define UFS_QCOM_LIMIT_PHY_SUBMODE UFS_QCOM_PHY_SUBMODE_G4 /* default value of auto suspend is 3 seconds */ #define UFS_QCOM_AUTO_SUSPEND_DELAY 3000 #define UFS_QCOM_CLK_GATING_DELAY_MS_PWR_SAVE 10 #define UFS_QCOM_CLK_GATING_DELAY_MS_PERF 50 /* QCOM UFS host controller vendor specific registers */ enum { REG_UFS_SYS1CLK_1US = 0xC0, Loading Loading
drivers/scsi/ufs/ufs-qcom.c +23 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ #include <linux/acpi.h> #include <linux/time.h> #include <linux/of.h> #include <linux/bitfield.h> #include <linux/platform_device.h> #include <linux/phy/phy.h> #include <linux/gpio/consumer.h> Loading Loading @@ -1486,8 +1487,19 @@ static int ufs_qcom_quirk_host_pa_saveconfigtime(struct ufs_hba *hba) static int ufs_qcom_apply_dev_quirks(struct ufs_hba *hba) { unsigned long flags; int err = 0; spin_lock_irqsave(hba->host->host_lock, flags); /* Set the rpm auto suspend delay to 3s */ hba->host->hostt->rpm_autosuspend_delay = UFS_QCOM_AUTO_SUSPEND_DELAY; /* Set the default auto-hiberate idle timer value to 1ms */ hba->ahit = FIELD_PREP(UFSHCI_AHIBERN8_TIMER_MASK, 1) | FIELD_PREP(UFSHCI_AHIBERN8_SCALE_MASK, 3); /* Set the clock gating delay to performance mode */ hba->clk_gating.delay_ms = UFS_QCOM_CLK_GATING_DELAY_MS_PERF; spin_unlock_irqrestore(hba->host->host_lock, flags); if (hba->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME) err = ufs_qcom_quirk_host_pa_saveconfigtime(hba); Loading Loading @@ -2352,6 +2364,12 @@ static int ufs_qcom_clk_scale_up_pre_change(struct ufs_hba *hba) static int ufs_qcom_clk_scale_up_post_change(struct ufs_hba *hba) { unsigned long flags; spin_lock_irqsave(hba->host->host_lock, flags); hba->clk_gating.delay_ms = UFS_QCOM_CLK_GATING_DELAY_MS_PERF; spin_unlock_irqrestore(hba->host->host_lock, flags); return 0; } Loading Loading @@ -2388,6 +2406,11 @@ static int ufs_qcom_clk_scale_down_post_change(struct ufs_hba *hba) struct ufs_clk_info *clki; struct list_head *head = &hba->clk_list_head; u32 curr_freq = 0; unsigned long flags; spin_lock_irqsave(hba->host->host_lock, flags); hba->clk_gating.delay_ms = UFS_QCOM_CLK_GATING_DELAY_MS_PWR_SAVE; spin_unlock_irqrestore(hba->host->host_lock, flags); if (!ufs_qcom_cap_qunipro(host)) return 0; Loading
drivers/scsi/ufs/ufs-qcom.h +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ #define UFS_QCOM_LIMIT_DESIRED_MODE FAST #define UFS_QCOM_LIMIT_PHY_SUBMODE UFS_QCOM_PHY_SUBMODE_G4 /* default value of auto suspend is 3 seconds */ #define UFS_QCOM_AUTO_SUSPEND_DELAY 3000 #define UFS_QCOM_CLK_GATING_DELAY_MS_PWR_SAVE 10 #define UFS_QCOM_CLK_GATING_DELAY_MS_PERF 50 /* QCOM UFS host controller vendor specific registers */ enum { REG_UFS_SYS1CLK_1US = 0xC0, Loading