Skip to content

Commit bdf5c0b

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Rename ufshcd_auto_hibern8_enable() and make it static
Rename ufshcd_auto_hibern8_enable() into ufshcd_configure_auto_hibern8() since this function can enable or disable auto-hibernation. Since ufshcd_auto_hibern8_enable() is only used inside the UFSHCI driver core, declare it static. Additionally, move the definition of this function to just before its first caller. Suggested-by: Bao D. Nguyen <quic_nguyenb@quicinc.com> Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com> Reviewed-by: Can Guo <quic_cang@quicinc.com> Cc: Avri Altman <avri.altman@wdc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20231214192416.3638077-2-bvanassche@acm.org Reviewed-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 26cdd69 commit bdf5c0b

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4413,6 +4413,14 @@ int ufshcd_uic_hibern8_exit(struct ufs_hba *hba)
44134413
}
44144414
EXPORT_SYMBOL_GPL(ufshcd_uic_hibern8_exit);
44154415

4416+
static void ufshcd_configure_auto_hibern8(struct ufs_hba *hba)
4417+
{
4418+
if (!ufshcd_is_auto_hibern8_supported(hba))
4419+
return;
4420+
4421+
ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER);
4422+
}
4423+
44164424
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
44174425
{
44184426
unsigned long flags;
@@ -4432,21 +4440,13 @@ void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
44324440
!pm_runtime_suspended(&hba->ufs_device_wlun->sdev_gendev)) {
44334441
ufshcd_rpm_get_sync(hba);
44344442
ufshcd_hold(hba);
4435-
ufshcd_auto_hibern8_enable(hba);
4443+
ufshcd_configure_auto_hibern8(hba);
44364444
ufshcd_release(hba);
44374445
ufshcd_rpm_put_sync(hba);
44384446
}
44394447
}
44404448
EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update);
44414449

4442-
void ufshcd_auto_hibern8_enable(struct ufs_hba *hba)
4443-
{
4444-
if (!ufshcd_is_auto_hibern8_supported(hba))
4445-
return;
4446-
4447-
ufshcd_writel(hba, hba->ahit, REG_AUTO_HIBERNATE_IDLE_TIMER);
4448-
}
4449-
44504450
/**
44514451
* ufshcd_init_pwr_info - setting the POR (power on reset)
44524452
* values in hba power info
@@ -8953,8 +8953,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool init_dev_params)
89538953

89548954
if (hba->ee_usr_mask)
89558955
ufshcd_write_ee_control(hba);
8956-
/* Enable Auto-Hibernate if configured */
8957-
ufshcd_auto_hibern8_enable(hba);
8956+
ufshcd_configure_auto_hibern8(hba);
89588957

89598958
out:
89608959
spin_lock_irqsave(hba->host->host_lock, flags);
@@ -9956,8 +9955,7 @@ static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
99569955
cancel_delayed_work(&hba->rpm_dev_flush_recheck_work);
99579956
}
99589957

9959-
/* Enable Auto-Hibernate if configured */
9960-
ufshcd_auto_hibern8_enable(hba);
9958+
ufshcd_configure_auto_hibern8(hba);
99619959

99629960
goto out;
99639961

include/ufs/ufshcd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,6 @@ static inline int ufshcd_disable_host_tx_lcc(struct ufs_hba *hba)
13711371
return ufshcd_dme_set(hba, UIC_ARG_MIB(PA_LOCAL_TX_LCC_ENABLE), 0);
13721372
}
13731373

1374-
void ufshcd_auto_hibern8_enable(struct ufs_hba *hba);
13751374
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
13761375
void ufshcd_fixup_dev_quirks(struct ufs_hba *hba,
13771376
const struct ufs_dev_quirk *fixups);

0 commit comments

Comments
 (0)