aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r--drivers/gpu/drm/msm/dsi/dsi.c7
-rw-r--r--drivers/gpu/drm/msm/dsi/dsi_cfg.c161
-rw-r--r--drivers/gpu/drm/msm/dsi/dsi_cfg.h9
-rw-r--r--drivers/gpu/drm/msm/dsi/dsi_host.c14
4 files changed, 70 insertions, 121 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 31fdee2052be..baab79ab6e74 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -4,7 +4,6 @@
*/
#include "dsi.h"
-#include "dsi_cfg.h"
bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi)
{
@@ -173,8 +172,10 @@ static int dsi_dev_remove(struct platform_device *pdev)
}
static const struct of_device_id dt_match[] = {
- { .compatible = "qcom,mdss-dsi-ctrl", .data = NULL /* autodetect cfg */ },
- { .compatible = "qcom,dsi-ctrl-6g-qcm2290", .data = &qcm2290_dsi_cfg_handler },
+ { .compatible = "qcom,mdss-dsi-ctrl" },
+
+ /* Deprecated, don't use */
+ { .compatible = "qcom,dsi-ctrl-6g-qcm2290" },
{}
};
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
index 6d21f0b33411..29ccd755cc2e 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
@@ -21,8 +21,9 @@ static const struct msm_dsi_config apq8064_dsi_cfg = {
.num_regulators = ARRAY_SIZE(apq8064_dsi_regulators),
.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,
+ .io_start = {
+ { 0x4700000, 0x5800000 },
+ },
};
static const char * const dsi_6g_bus_clk_names[] = {
@@ -41,46 +42,40 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = {
.num_regulators = ARRAY_SIZE(msm8974_apq8084_regulators),
.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,
+ .io_start = {
+ { 0xfd922800, 0xfd922b00 },
+ },
};
-static const char * const dsi_8916_bus_clk_names[] = {
+static const char * const dsi_v1_3_1_clk_names[] = {
"mdp_core", "iface", "bus",
};
-static const struct regulator_bulk_data msm8916_dsi_regulators[] = {
+static const struct regulator_bulk_data dsi_v1_3_1_regulators[] = {
{ .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */
{ .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
};
static const struct msm_dsi_config msm8916_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
- .regulator_data = msm8916_dsi_regulators,
- .num_regulators = ARRAY_SIZE(msm8916_dsi_regulators),
- .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[] = {
- "mdp_core", "iface", "bus",
-};
-
-static const struct regulator_bulk_data msm8976_dsi_regulators[] = {
- { .supply = "vdda", .init_load_uA = 100000 }, /* 1.2 V */
- { .supply = "vddio", .init_load_uA = 100000 }, /* 1.8 V */
+ .regulator_data = dsi_v1_3_1_regulators,
+ .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators),
+ .bus_clk_names = dsi_v1_3_1_clk_names,
+ .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names),
+ .io_start = {
+ { 0x1a98000 },
+ },
};
static const struct msm_dsi_config msm8976_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
- .regulator_data = msm8976_dsi_regulators,
- .num_regulators = ARRAY_SIZE(msm8976_dsi_regulators),
- .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,
+ .regulator_data = dsi_v1_3_1_regulators,
+ .num_regulators = ARRAY_SIZE(dsi_v1_3_1_regulators),
+ .bus_clk_names = dsi_v1_3_1_clk_names,
+ .num_bus_clks = ARRAY_SIZE(dsi_v1_3_1_clk_names),
+ .io_start = {
+ { 0x1a94000, 0x1a96000 },
+ },
};
static const struct regulator_bulk_data msm8994_dsi_regulators[] = {
@@ -98,12 +93,9 @@ static const struct msm_dsi_config msm8994_dsi_cfg = {
.num_regulators = ARRAY_SIZE(msm8994_dsi_regulators),
.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[] = {
- "mdp_core", "iface", "bus", "core_mmss",
+ .io_start = {
+ { 0xfd998000, 0xfd9a0000 },
+ },
};
static const struct regulator_bulk_data msm8996_dsi_regulators[] = {
@@ -116,10 +108,11 @@ static const struct msm_dsi_config msm8996_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
.regulator_data = msm8996_dsi_regulators,
.num_regulators = ARRAY_SIZE(msm8996_dsi_regulators),
- .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,
+ .bus_clk_names = dsi_6g_bus_clk_names,
+ .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names),
+ .io_start = {
+ { 0x994000, 0x996000 },
+ },
};
static const char * const dsi_msm8998_bus_clk_names[] = {
@@ -137,8 +130,9 @@ static const struct msm_dsi_config msm8998_dsi_cfg = {
.num_regulators = ARRAY_SIZE(msm8998_dsi_regulators),
.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,
+ .io_start = {
+ { 0xc994000, 0xc996000 },
+ },
};
static const char * const dsi_sdm660_bus_clk_names[] = {
@@ -155,30 +149,29 @@ static const struct msm_dsi_config sdm660_dsi_cfg = {
.num_regulators = ARRAY_SIZE(sdm660_dsi_regulators),
.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,
+ .io_start = {
+ { 0xc994000, 0xc996000 },
+ },
};
-static const char * const dsi_sdm845_bus_clk_names[] = {
+static const char * const dsi_v2_4_clk_names[] = {
"iface", "bus",
};
-static const char * const dsi_sc7180_bus_clk_names[] = {
- "iface", "bus",
-};
-
-static const struct regulator_bulk_data sdm845_dsi_regulators[] = {
+static const struct regulator_bulk_data dsi_v2_4_regulators[] = {
{ .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */
};
static const struct msm_dsi_config sdm845_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
- .regulator_data = sdm845_dsi_regulators,
- .num_regulators = ARRAY_SIZE(sdm845_dsi_regulators),
- .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,
+ .regulator_data = dsi_v2_4_regulators,
+ .num_regulators = ARRAY_SIZE(dsi_v2_4_regulators),
+ .bus_clk_names = dsi_v2_4_clk_names,
+ .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
+ .io_start = {
+ { 0xae94000, 0xae96000 }, /* SDM845 / SDM670 */
+ { 0x5e94000 }, /* QCM2290 / SM6115 / SM6125 / SM6375 */
+ },
};
static const struct regulator_bulk_data sm8550_dsi_regulators[] = {
@@ -189,28 +182,11 @@ static const struct msm_dsi_config sm8550_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
.regulator_data = sm8550_dsi_regulators,
.num_regulators = ARRAY_SIZE(sm8550_dsi_regulators),
- .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[] = {
- { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */
-};
-
-static const struct msm_dsi_config sc7180_dsi_cfg = {
- .io_offset = DSI_6G_REG_SHIFT,
- .regulator_data = sc7180_dsi_regulators,
- .num_regulators = ARRAY_SIZE(sc7180_dsi_regulators),
- .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[] = {
- "iface", "bus",
+ .bus_clk_names = dsi_v2_4_clk_names,
+ .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
+ .io_start = {
+ { 0xae94000, 0xae96000 },
+ },
};
static const struct regulator_bulk_data sc7280_dsi_regulators[] = {
@@ -221,28 +197,11 @@ static const struct msm_dsi_config sc7280_dsi_cfg = {
.io_offset = DSI_6G_REG_SHIFT,
.regulator_data = sc7280_dsi_regulators,
.num_regulators = ARRAY_SIZE(sc7280_dsi_regulators),
- .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[] = {
- "iface", "bus",
-};
-
-static const struct regulator_bulk_data qcm2290_dsi_cfg_regulators[] = {
- { .supply = "vdda", .init_load_uA = 21800 }, /* 1.2 V */
-};
-
-static const struct msm_dsi_config qcm2290_dsi_cfg = {
- .io_offset = DSI_6G_REG_SHIFT,
- .regulator_data = qcm2290_dsi_cfg_regulators,
- .num_regulators = ARRAY_SIZE(qcm2290_dsi_cfg_regulators),
- .bus_clk_names = dsi_qcm2290_bus_clk_names,
- .num_bus_clks = ARRAY_SIZE(dsi_qcm2290_bus_clk_names),
- .io_start = { 0x5e94000 },
- .num_dsi = 1,
+ .bus_clk_names = dsi_v2_4_clk_names,
+ .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names),
+ .io_start = {
+ { 0xae94000, 0xae96000 },
+ },
};
static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
@@ -311,7 +270,7 @@ static const struct msm_dsi_cfg_handler dsi_cfg_handlers[] = {
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_0,
&sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_4_1,
- &sc7180_dsi_cfg, &msm_dsi_6g_v2_host_ops},
+ &sdm845_dsi_cfg, &msm_dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_5_0,
&sc7280_dsi_cfg, &msm_dsi_6g_v2_host_ops},
{MSM_DSI_VER_MAJOR_6G, MSM_DSI_6G_VER_MINOR_V2_6_0,
@@ -335,9 +294,3 @@ const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor)
return cfg_hnd;
}
-
-/* Non autodetect configs */
-const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler = {
- .cfg = &qcm2290_dsi_cfg,
- .ops = &msm_dsi_6g_v2_host_ops,
-};
diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.h b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
index 44be4a88aa83..91bdaf50bb1a 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.h
+++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.h
@@ -32,14 +32,16 @@
#define DSI_6G_REG_SHIFT 4
+/* Maximum number of configurations matched against the same hw revision */
+#define VARIANTS_MAX 2
+
struct msm_dsi_config {
u32 io_offset;
const struct regulator_bulk_data *regulator_data;
int num_regulators;
const char * const *bus_clk_names;
const int num_bus_clks;
- const resource_size_t io_start[DSI_MAX];
- const int num_dsi;
+ const resource_size_t io_start[VARIANTS_MAX][DSI_MAX];
};
struct msm_dsi_host_cfg_ops {
@@ -63,8 +65,5 @@ struct msm_dsi_cfg_handler {
const struct msm_dsi_cfg_handler *msm_dsi_cfg_get(u32 major, u32 minor);
-/* Non autodetect configs */
-extern const struct msm_dsi_cfg_handler qcm2290_dsi_cfg_handler;
-
#endif /* __MSM_DSI_CFG_H__ */
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 18fa30e1e858..961689a255c4 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -214,10 +214,6 @@ static const struct msm_dsi_cfg_handler *dsi_get_config(
int ret;
u32 major = 0, minor = 0;
- cfg_hnd = device_get_match_data(dev);
- if (cfg_hnd)
- return cfg_hnd;
-
ahb_clk = msm_clk_get(msm_host->pdev, "iface");
if (IS_ERR(ahb_clk)) {
pr_err("%s: cannot get interface clock\n", __func__);
@@ -1862,16 +1858,16 @@ static int dsi_host_get_id(struct msm_dsi_host *msm_host)
struct platform_device *pdev = msm_host->pdev;
const struct msm_dsi_config *cfg = msm_host->cfg_hnd->cfg;
struct resource *res;
- int i;
+ int i, j;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dsi_ctrl");
if (!res)
return -EINVAL;
- for (i = 0; i < cfg->num_dsi; i++) {
- if (cfg->io_start[i] == res->start)
- return i;
- }
+ for (i = 0; i < VARIANTS_MAX; i++)
+ for (j = 0; j < DSI_MAX; j++)
+ if (cfg->io_start[i][j] == res->start)
+ return j;
return -EINVAL;
}