Commit 3c606134 authored by Konrad Dybcio's avatar Konrad Dybcio Committed by Dmitry Baryshkov

drm/msm/dsi: Get rid of msm_dsi_config::num_dsi

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: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: default avatarMarijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: default avatarKonrad 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.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent 36b0d6c1
...@@ -22,7 +22,6 @@ static const struct msm_dsi_config apq8064_dsi_cfg = { ...@@ -22,7 +22,6 @@ static const struct msm_dsi_config apq8064_dsi_cfg = {
.bus_clk_names = dsi_v2_bus_clk_names, .bus_clk_names = dsi_v2_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_v2_bus_clk_names),
.io_start = { 0x4700000, 0x5800000 }, .io_start = { 0x4700000, 0x5800000 },
.num_dsi = 2,
}; };
static const char * const dsi_6g_bus_clk_names[] = { static const char * const dsi_6g_bus_clk_names[] = {
...@@ -42,7 +41,6 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = { ...@@ -42,7 +41,6 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = {
.bus_clk_names = dsi_6g_bus_clk_names, .bus_clk_names = dsi_6g_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
.io_start = { 0xfd922800, 0xfd922b00 }, .io_start = { 0xfd922800, 0xfd922b00 },
.num_dsi = 2,
}; };
static const char * const dsi_8916_bus_clk_names[] = { static const char * const dsi_8916_bus_clk_names[] = {
...@@ -61,7 +59,6 @@ static const struct msm_dsi_config msm8916_dsi_cfg = { ...@@ -61,7 +59,6 @@ static const struct msm_dsi_config msm8916_dsi_cfg = {
.bus_clk_names = dsi_8916_bus_clk_names, .bus_clk_names = dsi_8916_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_8916_bus_clk_names),
.io_start = { 0x1a98000 }, .io_start = { 0x1a98000 },
.num_dsi = 1,
}; };
static const char * const dsi_8976_bus_clk_names[] = { static const char * const dsi_8976_bus_clk_names[] = {
...@@ -80,7 +77,6 @@ static const struct msm_dsi_config msm8976_dsi_cfg = { ...@@ -80,7 +77,6 @@ static const struct msm_dsi_config msm8976_dsi_cfg = {
.bus_clk_names = dsi_8976_bus_clk_names, .bus_clk_names = dsi_8976_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_8976_bus_clk_names),
.io_start = { 0x1a94000, 0x1a96000 }, .io_start = { 0x1a94000, 0x1a96000 },
.num_dsi = 2,
}; };
static const struct regulator_bulk_data msm8994_dsi_regulators[] = { static const struct regulator_bulk_data msm8994_dsi_regulators[] = {
...@@ -99,7 +95,6 @@ static const struct msm_dsi_config msm8994_dsi_cfg = { ...@@ -99,7 +95,6 @@ static const struct msm_dsi_config msm8994_dsi_cfg = {
.bus_clk_names = dsi_6g_bus_clk_names, .bus_clk_names = dsi_6g_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
.io_start = { 0xfd998000, 0xfd9a0000 }, .io_start = { 0xfd998000, 0xfd9a0000 },
.num_dsi = 2,
}; };
static const char * const dsi_8996_bus_clk_names[] = { static const char * const dsi_8996_bus_clk_names[] = {
...@@ -119,7 +114,6 @@ static const struct msm_dsi_config msm8996_dsi_cfg = { ...@@ -119,7 +114,6 @@ static const struct msm_dsi_config msm8996_dsi_cfg = {
.bus_clk_names = dsi_8996_bus_clk_names, .bus_clk_names = dsi_8996_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_8996_bus_clk_names),
.io_start = { 0x994000, 0x996000 }, .io_start = { 0x994000, 0x996000 },
.num_dsi = 2,
}; };
static const char * const dsi_msm8998_bus_clk_names[] = { static const char * const dsi_msm8998_bus_clk_names[] = {
...@@ -138,7 +132,6 @@ static const struct msm_dsi_config msm8998_dsi_cfg = { ...@@ -138,7 +132,6 @@ static const struct msm_dsi_config msm8998_dsi_cfg = {
.bus_clk_names = dsi_msm8998_bus_clk_names, .bus_clk_names = dsi_msm8998_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_msm8998_bus_clk_names),
.io_start = { 0xc994000, 0xc996000 }, .io_start = { 0xc994000, 0xc996000 },
.num_dsi = 2,
}; };
static const char * const dsi_sdm660_bus_clk_names[] = { static const char * const dsi_sdm660_bus_clk_names[] = {
...@@ -156,7 +149,6 @@ static const struct msm_dsi_config sdm660_dsi_cfg = { ...@@ -156,7 +149,6 @@ static const struct msm_dsi_config sdm660_dsi_cfg = {
.bus_clk_names = dsi_sdm660_bus_clk_names, .bus_clk_names = dsi_sdm660_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_sdm660_bus_clk_names),
.io_start = { 0xc994000, 0xc996000 }, .io_start = { 0xc994000, 0xc996000 },
.num_dsi = 2,
}; };
static const char * const dsi_sdm845_bus_clk_names[] = { static const char * const dsi_sdm845_bus_clk_names[] = {
...@@ -178,7 +170,6 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { ...@@ -178,7 +170,6 @@ static const struct msm_dsi_config sdm845_dsi_cfg = {
.bus_clk_names = dsi_sdm845_bus_clk_names, .bus_clk_names = dsi_sdm845_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names),
.io_start = { 0xae94000, 0xae96000 }, .io_start = { 0xae94000, 0xae96000 },
.num_dsi = 2,
}; };
static const struct regulator_bulk_data sm8550_dsi_regulators[] = { static const struct regulator_bulk_data sm8550_dsi_regulators[] = {
...@@ -192,7 +183,6 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { ...@@ -192,7 +183,6 @@ static const struct msm_dsi_config sm8550_dsi_cfg = {
.bus_clk_names = dsi_sdm845_bus_clk_names, .bus_clk_names = dsi_sdm845_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_sdm845_bus_clk_names),
.io_start = { 0xae94000, 0xae96000 }, .io_start = { 0xae94000, 0xae96000 },
.num_dsi = 2,
}; };
static const struct regulator_bulk_data sc7180_dsi_regulators[] = { static const struct regulator_bulk_data sc7180_dsi_regulators[] = {
...@@ -206,7 +196,6 @@ static const struct msm_dsi_config sc7180_dsi_cfg = { ...@@ -206,7 +196,6 @@ static const struct msm_dsi_config sc7180_dsi_cfg = {
.bus_clk_names = dsi_sc7180_bus_clk_names, .bus_clk_names = dsi_sc7180_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_sc7180_bus_clk_names),
.io_start = { 0xae94000 }, .io_start = { 0xae94000 },
.num_dsi = 1,
}; };
static const char * const dsi_sc7280_bus_clk_names[] = { static const char * const dsi_sc7280_bus_clk_names[] = {
...@@ -224,7 +213,6 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { ...@@ -224,7 +213,6 @@ static const struct msm_dsi_config sc7280_dsi_cfg = {
.bus_clk_names = dsi_sc7280_bus_clk_names, .bus_clk_names = dsi_sc7280_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_sc7280_bus_clk_names),
.io_start = { 0xae94000, 0xae96000 }, .io_start = { 0xae94000, 0xae96000 },
.num_dsi = 2,
}; };
static const char * const dsi_qcm2290_bus_clk_names[] = { static const char * const dsi_qcm2290_bus_clk_names[] = {
...@@ -242,7 +230,6 @@ static const struct msm_dsi_config qcm2290_dsi_cfg = { ...@@ -242,7 +230,6 @@ static const struct msm_dsi_config qcm2290_dsi_cfg = {
.bus_clk_names = dsi_qcm2290_bus_clk_names, .bus_clk_names = dsi_qcm2290_bus_clk_names,
.num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names), .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names),
.io_start = { 0x5e94000 }, .io_start = { 0x5e94000 },
.num_dsi = 1,
}; };
static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = { static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
......
...@@ -39,7 +39,6 @@ struct msm_dsi_config { ...@@ -39,7 +39,6 @@ struct msm_dsi_config {
const char * const *bus_clk_names; const char * const *bus_clk_names;
const int num_bus_clks; const int num_bus_clks;
const resource_size_t io_start[DSI_MAX]; const resource_size_t io_start[DSI_MAX];
const int num_dsi;
}; };
struct msm_dsi_host_cfg_ops { struct msm_dsi_host_cfg_ops {
......
...@@ -1868,7 +1868,7 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host) ...@@ -1868,7 +1868,7 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host)
if (!res) if (!res)
return -EINVAL; return -EINVAL;
for (i = 0; i < cfg->num_dsi; i++) { for (i = 0; i < DSI_MAX; i++) {
if (cfg->io_start[i] == res->start) if (cfg->io_start[i] == res->start)
return i; return i;
} }
......
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