Commit fe546c54 authored by Sibi Sankar's avatar Sibi Sankar Committed by Andy Gross

soc: qcom: rpmpd: Add support to set rpmpd state to max

rpmpd max state varies across SoCs and SoC families, add support
in the driver to make it SoC/SoC family specific
Reviewed-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
Reviewed-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarSibi Sankar <sibis@codeaurora.org>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarAndy Gross <agross@kernel.org>
parent 8b334442
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#define KEY_ENABLE 0x6e657773 /* swen */ #define KEY_ENABLE 0x6e657773 /* swen */
#define KEY_FLOOR_CORNER 0x636676 /* vfc */ #define KEY_FLOOR_CORNER 0x636676 /* vfc */
#define MAX_RPMPD_STATE 6 #define MAX_8996_RPMPD_STATE 6
#define DEFINE_RPMPD_CORNER_SMPA(_platform, _name, _active, r_id) \ #define DEFINE_RPMPD_CORNER_SMPA(_platform, _name, _active, r_id) \
static struct rpmpd _platform##_##_active; \ static struct rpmpd _platform##_##_active; \
...@@ -83,12 +83,14 @@ struct rpmpd { ...@@ -83,12 +83,14 @@ struct rpmpd {
const int res_type; const int res_type;
const int res_id; const int res_id;
struct qcom_smd_rpm *rpm; struct qcom_smd_rpm *rpm;
unsigned int max_state;
__le32 key; __le32 key;
}; };
struct rpmpd_desc { struct rpmpd_desc {
struct rpmpd **rpmpds; struct rpmpd **rpmpds;
size_t num_pds; size_t num_pds;
unsigned int max_state;
}; };
static DEFINE_MUTEX(rpmpd_lock); static DEFINE_MUTEX(rpmpd_lock);
...@@ -114,6 +116,7 @@ static struct rpmpd *msm8996_rpmpds[] = { ...@@ -114,6 +116,7 @@ static struct rpmpd *msm8996_rpmpds[] = {
static const struct rpmpd_desc msm8996_desc = { static const struct rpmpd_desc msm8996_desc = {
.rpmpds = msm8996_rpmpds, .rpmpds = msm8996_rpmpds,
.num_pds = ARRAY_SIZE(msm8996_rpmpds), .num_pds = ARRAY_SIZE(msm8996_rpmpds),
.max_state = MAX_8996_RPMPD_STATE,
}; };
static const struct of_device_id rpmpd_match_table[] = { static const struct of_device_id rpmpd_match_table[] = {
...@@ -225,8 +228,8 @@ static int rpmpd_set_performance(struct generic_pm_domain *domain, ...@@ -225,8 +228,8 @@ static int rpmpd_set_performance(struct generic_pm_domain *domain,
int ret = 0; int ret = 0;
struct rpmpd *pd = domain_to_rpmpd(domain); struct rpmpd *pd = domain_to_rpmpd(domain);
if (state > MAX_RPMPD_STATE) if (state > pd->max_state)
state = MAX_RPMPD_STATE; state = pd->max_state;
mutex_lock(&rpmpd_lock); mutex_lock(&rpmpd_lock);
...@@ -287,6 +290,7 @@ static int rpmpd_probe(struct platform_device *pdev) ...@@ -287,6 +290,7 @@ static int rpmpd_probe(struct platform_device *pdev)
} }
rpmpds[i]->rpm = rpm; rpmpds[i]->rpm = rpm;
rpmpds[i]->max_state = desc->max_state;
rpmpds[i]->pd.power_off = rpmpd_power_off; rpmpds[i]->pd.power_off = rpmpd_power_off;
rpmpds[i]->pd.power_on = rpmpd_power_on; rpmpds[i]->pd.power_on = rpmpd_power_on;
rpmpds[i]->pd.set_performance_state = rpmpd_set_performance; rpmpds[i]->pd.set_performance_state = rpmpd_set_performance;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment