summaryrefslogtreecommitdiff
path: root/drivers/pmdomain/qcom
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-03-13 11:33:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-03-13 11:33:10 -0700
commita070a08d006d142e2ae0bf73843dc90c2b42b02f (patch)
treef01565da3cfc9c1c72a085b4d3274b3ec23bc757 /drivers/pmdomain/qcom
parent15223fdbdf4f75102c5507f764bda0fdcdf726ae (diff)
parentccabbb6768fc72d6cb0223324925c93658d91e63 (diff)
Merge tag 'pmdomain-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm
Pull pmdomain updates from Ulf Hansson: "Core: - Log a message when unused PM domains gets disabled - Scale down parent/child performance states in the reverse order Providers: - qcom: rpmpd: Add power domains support for MSM8974, MSM8974PRO, PMA8084 and PM8841 - renesas: rcar-gen4-sysc: Reduce atomic delays - renesas: rcar-sysc: Adjust the waiting time to cover the worst case - renesas: r8a779h0-sysc: Add support for the r8a779h0 PM domains - imx: imx8mp-blk-ctrl: Add the fdcc clock to the hdmimix domains - imx: imx8mp-blk-ctrl: Error out if domains are missing in DT Improve support for multiple PM domains: - Add two helper functions to attach/detach multiple PM domains - Convert a couple of drivers to use the new helper functions" * tag 'pmdomain-v6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: (22 commits) pmdomain: renesas: rcar-gen4-sysc: Reduce atomic delays pmdomain: renesas: Adjust the waiting time to cover the worst case pmdomain: qcom: rpmpd: Add MSM8974PRO+PMA8084 power domains pmdomain: qcom: rpmpd: Add MSM8974+PM8841 power domains pmdomain: core: constify of_phandle_args in add device and subdomain pmdomain: core: constify of_phandle_args in xlate media: venus: Convert to dev_pm_domain_attach|detach_list() for vcodec remoteproc: qcom_q6v5_adsp: Convert to dev_pm_domain_attach|detach_list() remoteproc: imx_rproc: Convert to dev_pm_domain_attach|detach_list() remoteproc: imx_dsp_rproc: Convert to dev_pm_domain_attach|detach_list() PM: domains: Add helper functions to attach/detach multiple PM domains pmdomain: imx8mp-blk-ctrl: imx8mp_blk: Add fdcc clock to hdmimix domain pmdomain: mediatek: Use devm_platform_ioremap_resource() in init_scp() pmdomain: renesas: r8a779h0-sysc: Add r8a779h0 support pmdomain: imx8mp-blk-ctrl: Error out if domains are missing in DT pmdomain: ti: Add a null pointer check to the omap_prm_domain_init pmdomain: renesas: rcar-gen4-sysc: Remove unneeded includes pmdomain: core: Print a message when unused power domains are disabled pmdomain: qcom: rpmpd: Keep one RPM handle for all RPMPDs pmdomain: core: Scale down parent/child performance states in reverse order ...
Diffstat (limited to 'drivers/pmdomain/qcom')
-rw-r--r--drivers/pmdomain/qcom/rpmpd.c96
1 files changed, 89 insertions, 7 deletions
diff --git a/drivers/pmdomain/qcom/rpmpd.c b/drivers/pmdomain/qcom/rpmpd.c
index 7796d65f96e8..5e6280b4cf70 100644
--- a/drivers/pmdomain/qcom/rpmpd.c
+++ b/drivers/pmdomain/qcom/rpmpd.c
@@ -16,6 +16,8 @@
#define domain_to_rpmpd(domain) container_of(domain, struct rpmpd, pd)
+static struct qcom_smd_rpm *rpmpd_smd_rpm;
+
/* Resource types:
* RPMPD_X is X encoded as a little-endian, lower-case, ASCII string */
#define RPMPD_SMPA 0x61706d73
@@ -54,7 +56,6 @@ struct rpmpd {
bool enabled;
const int res_type;
const int res_id;
- struct qcom_smd_rpm *rpm;
unsigned int max_state;
__le32 key;
bool state_synced;
@@ -226,7 +227,46 @@ static struct rpmpd cx_s3a_vfl = {
.key = KEY_FLOOR_LEVEL,
};
+static struct rpmpd cx_s2b_corner_ao;
+static struct rpmpd cx_s2b_corner = {
+ .pd = { .name = "cx", },
+ .peer = &cx_s2b_corner_ao,
+ .res_type = RPMPD_SMPB,
+ .res_id = 2,
+ .key = KEY_CORNER,
+};
+
+static struct rpmpd cx_s2b_corner_ao = {
+ .pd = { .name = "cx_ao", },
+ .peer = &cx_s2b_corner,
+ .active_only = true,
+ .res_type = RPMPD_SMPB,
+ .res_id = 2,
+ .key = KEY_CORNER,
+};
+
+static struct rpmpd cx_s2b_vfc = {
+ .pd = { .name = "cx_vfc", },
+ .res_type = RPMPD_SMPB,
+ .res_id = 2,
+ .key = KEY_FLOOR_CORNER,
+};
+
/* G(F)X */
+static struct rpmpd gfx_s7a_corner = {
+ .pd = { .name = "gfx", },
+ .res_type = RPMPD_SMPA,
+ .res_id = 7,
+ .key = KEY_CORNER,
+};
+
+static struct rpmpd gfx_s7a_vfc = {
+ .pd = { .name = "gfx_vfc", },
+ .res_type = RPMPD_SMPA,
+ .res_id = 7,
+ .key = KEY_FLOOR_CORNER,
+};
+
static struct rpmpd gfx_s2b_corner = {
.pd = { .name = "gfx", },
.res_type = RPMPD_SMPB,
@@ -241,6 +281,20 @@ static struct rpmpd gfx_s2b_vfc = {
.key = KEY_FLOOR_CORNER,
};
+static struct rpmpd gfx_s4b_corner = {
+ .pd = { .name = "gfx", },
+ .res_type = RPMPD_SMPB,
+ .res_id = 4,
+ .key = KEY_CORNER,
+};
+
+static struct rpmpd gfx_s4b_vfc = {
+ .pd = { .name = "gfx_vfc", },
+ .res_type = RPMPD_SMPB,
+ .res_id = 4,
+ .key = KEY_FLOOR_CORNER,
+};
+
static struct rpmpd mx_rwmx0_lvl;
static struct rpmpd gx_rwgx0_lvl_ao;
static struct rpmpd gx_rwgx0_lvl = {
@@ -663,6 +717,34 @@ static const struct rpmpd_desc msm8953_desc = {
.max_state = RPM_SMD_LEVEL_TURBO,
};
+static struct rpmpd *msm8974_rpmpds[] = {
+ [MSM8974_VDDCX] = &cx_s2b_corner,
+ [MSM8974_VDDCX_AO] = &cx_s2b_corner_ao,
+ [MSM8974_VDDCX_VFC] = &cx_s2b_vfc,
+ [MSM8974_VDDGFX] = &gfx_s4b_corner,
+ [MSM8974_VDDGFX_VFC] = &gfx_s4b_vfc,
+};
+
+static const struct rpmpd_desc msm8974_desc = {
+ .rpmpds = msm8974_rpmpds,
+ .num_pds = ARRAY_SIZE(msm8974_rpmpds),
+ .max_state = MAX_CORNER_RPMPD_STATE,
+};
+
+static struct rpmpd *msm8974pro_pma8084_rpmpds[] = {
+ [MSM8974_VDDCX] = &cx_s2a_corner,
+ [MSM8974_VDDCX_AO] = &cx_s2a_corner_ao,
+ [MSM8974_VDDCX_VFC] = &cx_s2a_vfc,
+ [MSM8974_VDDGFX] = &gfx_s7a_corner,
+ [MSM8974_VDDGFX_VFC] = &gfx_s7a_vfc,
+};
+
+static const struct rpmpd_desc msm8974pro_pma8084_desc = {
+ .rpmpds = msm8974pro_pma8084_rpmpds,
+ .num_pds = ARRAY_SIZE(msm8974pro_pma8084_rpmpds),
+ .max_state = MAX_CORNER_RPMPD_STATE,
+};
+
static struct rpmpd *msm8976_rpmpds[] = {
[MSM8976_VDDCX] = &cx_s2a_lvl,
[MSM8976_VDDCX_AO] = &cx_s2a_lvl_ao,
@@ -856,6 +938,8 @@ static const struct of_device_id rpmpd_match_table[] = {
{ .compatible = "qcom,msm8917-rpmpd", .data = &msm8917_desc },
{ .compatible = "qcom,msm8939-rpmpd", .data = &msm8939_desc },
{ .compatible = "qcom,msm8953-rpmpd", .data = &msm8953_desc },
+ { .compatible = "qcom,msm8974-rpmpd", .data = &msm8974_desc },
+ { .compatible = "qcom,msm8974pro-pma8084-rpmpd", .data = &msm8974pro_pma8084_desc },
{ .compatible = "qcom,msm8976-rpmpd", .data = &msm8976_desc },
{ .compatible = "qcom,msm8994-rpmpd", .data = &msm8994_desc },
{ .compatible = "qcom,msm8996-rpmpd", .data = &msm8996_desc },
@@ -879,7 +963,7 @@ static int rpmpd_send_enable(struct rpmpd *pd, bool enable)
.value = cpu_to_le32(enable),
};
- return qcom_rpm_smd_write(pd->rpm, QCOM_SMD_RPM_ACTIVE_STATE,
+ return qcom_rpm_smd_write(rpmpd_smd_rpm, QCOM_SMD_RPM_ACTIVE_STATE,
pd->res_type, pd->res_id, &req, sizeof(req));
}
@@ -891,7 +975,7 @@ static int rpmpd_send_corner(struct rpmpd *pd, int state, unsigned int corner)
.value = cpu_to_le32(corner),
};
- return qcom_rpm_smd_write(pd->rpm, state, pd->res_type, pd->res_id,
+ return qcom_rpm_smd_write(rpmpd_smd_rpm, state, pd->res_type, pd->res_id,
&req, sizeof(req));
};
@@ -1004,12 +1088,11 @@ static int rpmpd_probe(struct platform_device *pdev)
int i;
size_t num;
struct genpd_onecell_data *data;
- struct qcom_smd_rpm *rpm;
struct rpmpd **rpmpds;
const struct rpmpd_desc *desc;
- rpm = dev_get_drvdata(pdev->dev.parent);
- if (!rpm) {
+ rpmpd_smd_rpm = dev_get_drvdata(pdev->dev.parent);
+ if (!rpmpd_smd_rpm) {
dev_err(&pdev->dev, "Unable to retrieve handle to RPM\n");
return -ENODEV;
}
@@ -1039,7 +1122,6 @@ static int rpmpd_probe(struct platform_device *pdev)
continue;
}
- rpmpds[i]->rpm = rpm;
rpmpds[i]->max_state = desc->max_state;
rpmpds[i]->pd.power_off = rpmpd_power_off;
rpmpds[i]->pd.power_on = rpmpd_power_on;