soc: qcom: rpmpd: Add SM6375 support
authorKonrad Dybcio <konrad.dybcio@somainline.org>
Sat, 16 Jul 2022 19:32:01 +0000 (21:32 +0200)
committerBjorn Andersson <andersson@kernel.org>
Wed, 14 Sep 2022 03:25:35 +0000 (22:25 -0500)
Add support for RPMPDs on SM6375.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20220716193201.455728-2-konrad.dybcio@somainline.org
drivers/soc/qcom/rpmpd.c

index 5803038c744e58b24b641ad4c47fa7ffca7de392..337b1ad1cd3bfecd4119dd417a4676655f9ee7bf 100644 (file)
@@ -29,6 +29,7 @@
 #define RPMPD_RWLM 0x6d6c7772
 #define RPMPD_RWSC 0x63737772
 #define RPMPD_RWSM 0x6d737772
+#define RPMPD_RWGX 0x78677772
 
 /* Operation Keys */
 #define KEY_CORNER             0x6e726f63 /* corn */
@@ -433,6 +434,26 @@ static const struct rpmpd_desc sm6125_desc = {
        .max_state = RPM_SMD_LEVEL_BINNING,
 };
 
+DEFINE_RPMPD_PAIR(sm6375, vddgx, vddgx_ao, RWGX, LEVEL, 0);
+static struct rpmpd *sm6375_rpmpds[] = {
+       [SM6375_VDDCX] = &sm6125_vddcx,
+       [SM6375_VDDCX_AO] = &sm6125_vddcx_ao,
+       [SM6375_VDDCX_VFL] = &sm6125_vddcx_vfl,
+       [SM6375_VDDMX] = &sm6125_vddmx,
+       [SM6375_VDDMX_AO] = &sm6125_vddmx_ao,
+       [SM6375_VDDMX_VFL] = &sm6125_vddmx_vfl,
+       [SM6375_VDDGX] = &sm6375_vddgx,
+       [SM6375_VDDGX_AO] = &sm6375_vddgx_ao,
+       [SM6375_VDD_LPI_CX] = &sm6115_vdd_lpi_cx,
+       [SM6375_VDD_LPI_MX] = &sm6115_vdd_lpi_mx,
+};
+
+static const struct rpmpd_desc sm6375_desc = {
+       .rpmpds = sm6375_rpmpds,
+       .num_pds = ARRAY_SIZE(sm6375_rpmpds),
+       .max_state = RPM_SMD_LEVEL_TURBO_NO_CPR,
+};
+
 static struct rpmpd *qcm2290_rpmpds[] = {
        [QCM2290_VDDCX] = &sm6115_vddcx,
        [QCM2290_VDDCX_AO] = &sm6115_vddcx_ao,
@@ -466,6 +487,7 @@ static const struct of_device_id rpmpd_match_table[] = {
        { .compatible = "qcom,sdm660-rpmpd", .data = &sdm660_desc },
        { .compatible = "qcom,sm6115-rpmpd", .data = &sm6115_desc },
        { .compatible = "qcom,sm6125-rpmpd", .data = &sm6125_desc },
+       { .compatible = "qcom,sm6375-rpmpd", .data = &sm6375_desc },
        { }
 };
 MODULE_DEVICE_TABLE(of, rpmpd_match_table);