Skip to content

Commit

Permalink
scsi: ufs-qcom: Override devfreq parameters
Browse files Browse the repository at this point in the history
Override devfreq parameters for power-performance trade-off.

Link: https://lore.kernel.org/r/b6875729b6072134985c9113a820cf60a2af22e7.1585160616.git.asutoshd@codeaurora.org
Acked-by: Avri Altman <[email protected]>
Signed-off-by: Asutosh Das <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
Asutosh Das authored and martinkpetersen committed Mar 27, 2020
1 parent 2c75f9a commit 80b2100
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions drivers/scsi/ufs/ufs-qcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <linux/phy/phy.h>
#include <linux/gpio/consumer.h>
#include <linux/reset-controller.h>
#include <linux/devfreq.h>

#include "ufshcd.h"
#include "ufshcd-pltfrm.h"
Expand Down Expand Up @@ -1689,6 +1690,29 @@ static void ufs_qcom_device_reset(struct ufs_hba *hba)
usleep_range(10, 15);
}

#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
static void ufs_qcom_config_scaling_param(struct ufs_hba *hba,
struct devfreq_dev_profile *p,
void *data)
{
static struct devfreq_simple_ondemand_data *d;

if (!data)
return;

d = (struct devfreq_simple_ondemand_data *)data;
p->polling_ms = 60;
d->upthreshold = 70;
d->downdifferential = 5;
}
#else
static void ufs_qcom_config_scaling_param(struct ufs_hba *hba,
struct devfreq_dev_profile *p,
void *data)
{
}
#endif

/**
* struct ufs_hba_qcom_vops - UFS QCOM specific variant operations
*
Expand All @@ -1710,6 +1734,7 @@ static const struct ufs_hba_variant_ops ufs_hba_qcom_vops = {
.resume = ufs_qcom_resume,
.dbg_register_dump = ufs_qcom_dump_dbg_regs,
.device_reset = ufs_qcom_device_reset,
.config_scaling_param = ufs_qcom_config_scaling_param,
};

/**
Expand Down

0 comments on commit 80b2100

Please sign in to comment.