drm/msm/dsi: Get rid of msm_dsi_config::num_dsi
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Sat, 18 Mar 2023 13:42:48 +0000 (14:42 +0100)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Thu, 6 Apr 2023 17:29:44 +0000 (20:29 +0300)
In preparation for supporting multiple sets of possible base registers,
remove the num_dsi variable. We're comparing the io_start array contents
with the reg value from the DTS, so it will either match one of the
expected values or don't match against a zero (which we get from partial
array initialization).

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/527658/
Link: https://lore.kernel.org/r/20230307-topic-dsi_qcm-v6-2-70e13b1214fa@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/dsi/dsi_cfg.c
drivers/gpu/drm/msm/dsi/dsi_cfg.h
drivers/gpu/drm/msm/dsi/dsi_host.c

index 6d21f0b..4515f52 100644 (file)
@@ -22,7 +22,6 @@ static const struct msm_dsi_config apq8064_dsi_cfg = {
        .bus_clk_names = dsi_v2_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names),
        .io_start = { 0x4700000, 0x5800000 },
-       .num_dsi = 2,
 };
 
 static const char * const dsi_6g_bus_clk_names[] = {
@@ -42,7 +41,6 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = {
        .bus_clk_names = dsi_6g_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
        .io_start = { 0xfd922800, 0xfd922b00 },
-       .num_dsi = 2,
 };
 
 static const char * const dsi_8916_bus_clk_names[] = {
@@ -61,7 +59,6 @@ static const struct msm_dsi_config msm8916_dsi_cfg = {
        .bus_clk_names = dsi_8916_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names),
        .io_start = { 0x1a98000 },
-       .num_dsi = 1,
 };
 
 static const char * const dsi_8976_bus_clk_names[] = {
@@ -80,7 +77,6 @@ static const struct msm_dsi_config msm8976_dsi_cfg = {
        .bus_clk_names = dsi_8976_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names),
        .io_start = { 0x1a94000, 0x1a96000 },
-       .num_dsi = 2,
 };
 
 static const struct regulator_bulk_data msm8994_dsi_regulators[] = {
@@ -99,7 +95,6 @@ static const struct msm_dsi_config msm8994_dsi_cfg = {
        .bus_clk_names = dsi_6g_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
        .io_start = { 0xfd998000, 0xfd9a0000 },
-       .num_dsi = 2,
 };
 
 static const char * const dsi_8996_bus_clk_names[] = {
@@ -119,7 +114,6 @@ static const struct msm_dsi_config msm8996_dsi_cfg = {
        .bus_clk_names = dsi_8996_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names),
        .io_start = { 0x994000, 0x996000 },
-       .num_dsi = 2,
 };
 
 static const char * const dsi_msm8998_bus_clk_names[] = {
@@ -138,7 +132,6 @@ static const struct msm_dsi_config msm8998_dsi_cfg = {
        .bus_clk_names = dsi_msm8998_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names),
        .io_start = { 0xc994000, 0xc996000 },
-       .num_dsi = 2,
 };
 
 static const char * const dsi_sdm660_bus_clk_names[] = {
@@ -156,7 +149,6 @@ static const struct msm_dsi_config sdm660_dsi_cfg = {
        .bus_clk_names = dsi_sdm660_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names),
        .io_start = { 0xc994000, 0xc996000 },
-       .num_dsi = 2,
 };
 
 static const char * const dsi_sdm845_bus_clk_names[] = {
@@ -178,7 +170,6 @@ static const struct msm_dsi_config sdm845_dsi_cfg = {
        .bus_clk_names = dsi_sdm845_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names),
        .io_start = { 0xae94000, 0xae96000 },
-       .num_dsi = 2,
 };
 
 static const struct regulator_bulk_data sm8550_dsi_regulators[] = {
@@ -192,7 +183,6 @@ static const struct msm_dsi_config sm8550_dsi_cfg = {
        .bus_clk_names = dsi_sdm845_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names),
        .io_start = { 0xae94000, 0xae96000 },
-       .num_dsi = 2,
 };
 
 static const struct regulator_bulk_data sc7180_dsi_regulators[] = {
@@ -206,7 +196,6 @@ static const struct msm_dsi_config sc7180_dsi_cfg = {
        .bus_clk_names = dsi_sc7180_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names),
        .io_start = { 0xae94000 },
-       .num_dsi = 1,
 };
 
 static const char * const dsi_sc7280_bus_clk_names[] = {
@@ -224,7 +213,6 @@ static const struct msm_dsi_config sc7280_dsi_cfg = {
        .bus_clk_names = dsi_sc7280_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names),
        .io_start = { 0xae94000, 0xae96000 },
-       .num_dsi = 2,
 };
 
 static const char * const dsi_qcm2290_bus_clk_names[] = {
@@ -242,7 +230,6 @@ static const struct msm_dsi_config qcm2290_dsi_cfg = {
        .bus_clk_names = dsi_qcm2290_bus_clk_names,
        .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names),
        .io_start = { 0x5e94000 },
-       .num_dsi = 1,
 };
 
 static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
index 44be4a8..6b6b16c 100644 (file)
@@ -39,7 +39,6 @@ struct msm_dsi_config {
        const char * const *bus_clk_names;
        const int num_bus_clks;
        const resource_size_t io_start[DSI_MAX];
-       const int num_dsi;
 };
 
 struct msm_dsi_host_cfg_ops {
index 18fa30e..9021f0d 100644 (file)
@@ -1868,7 +1868,7 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host)
        if (!res)
                return -EINVAL;
 
-       for (i = 0; i < cfg->num_dsi; i++) {
+       for (i = 0; i < DSI_MAX; i++) {
                if (cfg->io_start[i] == res->start)
                        return i;
        }