Fix DSI host idx detection on HW revision clash
Subsystems (6)
v6 cover Fix DSI host idx detection on HW revision clash
v5 -> v6:
- Squash both fixes that concerned the deprecated QCM2290 compatible to avoid warnings
v5: https://lore.kernel.org/r/[email protected]
v4 -> v5:
- Drop superfluous items: level in [8/10]
- Remove the header define for the qcm2290 config in [6/10] instead of [7/10]
- Pick up tags
v4: https://lore.kernel.org/r/[email protected]
v3 -> v4:
- Use the shiny new compatible in the 6115 bindings example [9/10]
- Remove the leftover include and header definition [6, 7/10]
- Deduplicate the qcm2290 clks/regs in the common deduplication commit instead of doing it separately
- Pick up tags
- Rebase on next-20230314 (nothing seems to have changed fwiw)
v3: https://lore.kernel.org/r/[email protected]
v2 -> v3:
- Merge with [1], I should have done that earlier..
- Squash 6115 compatible patches into one
- Pick up tags (except Rob's ack in 6115 compatible addition, as it was changed)
- Use b4 (sorry if you got an incomplete set of messages before..)
[1] https://lore.kernel.org/linux-arm-msm/[email protected]/
v2: https://lore.kernel.org/linux-arm-msm/[email protected]/
v1 -> v2:
- squash the 2d-array-ification and fixing up the logic into one patch
- drop num_variants, loop over VARIANTS_MAX*DSI_MAX unconditionally
- drop inadequate Fixes: tags
- pick up rbs
v1: https://lore.kernel.org/linux-arm-msm/[email protected]/
Some DSI host versions are implemented on multiple SoCs which use vastly different register maps. This messes with our current assumptions of being able to map {dsi0, dsi1} to {reg0, reg1}. Solve that by adding a way of specifying multiple sets of base registers and try comparing them against the register specified in DT until we find a match.
This removes the need for the QCM2290-specific compatible which was used in the SM6115 DT (which uses DSIv2.4.1, just like SC7180). The series also takes care of that.
Tested on SM6115P Lenovo Tab P11 and SM8350 PDX215
---
Konrad Dybcio (9):
dt-bindings: display/msm: dsi-controller-main: Fix deprecated QCM2290 compatible drm/msm/dsi: Get rid of msm_dsi_config::num_dsi
drm/msm/dsi: Fix DSI index detection when version clash occurs drm/msm/dsi: dsi_cfg: Deduplicate identical structs
drm/msm/dsi: dsi_cfg: Merge SC7180 config into SDM845
drm/msm/dsi: Switch the QCM2290-specific compatible to index autodetection drm/msm/dsi: Remove custom DSI config handling
dt-bindings: display/msm: dsi-controller-main: Add SM6115
arm64: dts: qcom: sm6115: Use the correct DSI compatible
.../bindings/display/msm/dsi-controller-main.yaml | 9 +- .../bindings/display/msm/qcom,sm6115-mdss.yaml | 10 +- arch/arm64/boot/dts/qcom/sm6115.dtsi | 2 +- drivers/gpu/drm/msm/dsi/dsi.c | 7 +- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 161 ++++++++------------- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 9 +- drivers/gpu/drm/msm/dsi/dsi_host.c | 14 +- 7 files changed, 84 insertions(+), 128 deletions(-)
---
base-commit: 6f08c1de13a9403341c18b66638a05588b2663ce
change-id: 20230307-topic-dsi_qcm-5cd03c230f8f
Best regards,
Signature · 1 line
Konrad Dybcio <[email protected]>
PATCH v6 1/9 dt-bindings: display/msm: dsi-controller-main: Fix deprecated QCM2290 compatible
The point of the previous cleanup was to disallow "qcom,mdss-dsi-ctrl" alone. This however didn't quite work out and the property became undocumented instead of deprecated. Fix that.
Additionally, the "qcom," prefix was missed previously. Fix it.
--- .../devicetree/bindings/display/msm/dsi-controller-main.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +3 -4
@@ -31,10 +31,9 @@ properties: - qcom,sm8450-dsi-ctrl - qcom,sm8550-dsi-ctrl - const: qcom,mdss-dsi-ctrl - - items: - - enum: - - dsi-ctrl-6g-qcm2290 - - const: qcom,mdss-dsi-ctrl + - enum: + - qcom,dsi-ctrl-6g-qcm2290 + - qcom,mdss-dsi-ctrl # This should always come with an SoC-specific compatible deprecated: true reg:
Signature · 1 line
2.39.2
Re: [PATCH v6 1/9] dt-bindings: display/msm: dsi-controller-main: Fix deprecated QCM2290 compatible
Quoted 11 lines · Konrad Dybcio
The point of the previous cleanup was to disallow "qcom,mdss-dsi-ctrl" alone. This however didn't quite work out and the property became undocumented instead of deprecated. Fix that.
Additionally, the "qcom," prefix was missed previously. Fix it.
Fixes 0c0f65c6dd44 ("dt-bindings: msm: dsi-controller-main: Add compatible strings for every current SoC")Acked-by Rob Herring <[email protected]>Reviewed-by Marijn Suijten <[email protected]>Signed-off-by Konrad Dybcio <[email protected]>---
Best regards,
Krzysztof
PATCH v6 2/9 drm/msm/dsi: Get rid of msm_dsi_config::num_dsi
In reply to Konrad DybcioIn 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).
--- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 13 ------------- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 1 - drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_cfg.c +0 -13
@@ -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 = {
drivers/gpu/drm/msm/dsi/dsi_cfg.h +0 -1
@@ -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 {
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -1
@@ -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; }
Signature · 1 line
2.39.2
PATCH v6 3/9 drm/msm/dsi: Fix DSI index detection when version clash occurs
In reply to Konrad DybcioCurrently, we allow for MAX_DSI entries in io_start to facilitate for MAX_DSI number of DSI hosts at different addresses. The configuration is matched against the DSI CTRL hardware revision read back from the component. We need a way to resolve situations where multiple SoCs with different register maps may use the same version of DSI CTRL. In preparation to do so, make msm_dsi_config a 2d array where each entry represents a set of configurations adequate for a given SoC.
This is totally fine to do, as the only differentiating factors between same-version-different-SoCs configurations are the number of DSI hosts (1 or 2, at least as of today) and the set of base registers. The regulator setup is the same, because the DSI hardware is the same, regardless of the SoC it was implemented in.
In addition to that, update the matching logic such that it will loop over VARIANTS_MAX variants, making sure they are all taken into account.
--- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 52 ++++++++++++++++++++++++++++---------- drivers/gpu/drm/msm/dsi/dsi_cfg.h | 5 +++- drivers/gpu/drm/msm/dsi/dsi_host.c | 10 ++++---- 3 files changed, 48 insertions(+), 19 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_cfg.c +39 -13
@@ -21,7 +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 }, + .io_start = { + { 0x4700000, 0x5800000 }, + }, }; static const char * const dsi_6g_bus_clk_names[] = {
@@ -40,7 +42,9 @@ 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 }, + .io_start = { + { 0xfd922800, 0xfd922b00 }, + }, }; static const char * const dsi_8916_bus_clk_names[] = {
@@ -58,7 +62,9 @@ static const struct msm_dsi_config msm8916_dsi_cfg = { .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 }, + .io_start = { + { 0x1a98000 }, + }, }; static const char * const dsi_8976_bus_clk_names[] = {
@@ -76,7 +82,9 @@ static const struct msm_dsi_config msm8976_dsi_cfg = { .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 }, + .io_start = { + { 0x1a94000, 0x1a96000 }, + }, }; static const struct regulator_bulk_data msm8994_dsi_regulators[] = {
@@ -94,7 +102,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 }, + .io_start = { + { 0xfd998000, 0xfd9a0000 }, + }, }; static const char * const dsi_8996_bus_clk_names[] = {
@@ -113,7 +123,9 @@ static const struct msm_dsi_config msm8996_dsi_cfg = { .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 }, + .io_start = { + { 0x994000, 0x996000 }, + }, }; static const char * const dsi_msm8998_bus_clk_names[] = {
@@ -131,7 +143,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 }, + .io_start = { + { 0xc994000, 0xc996000 }, + }, }; static const char * const dsi_sdm660_bus_clk_names[] = {
@@ -148,7 +162,9 @@ 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 }, + .io_start = { + { 0xc994000, 0xc996000 }, + }, }; static const char * const dsi_sdm845_bus_clk_names[] = {
@@ -169,7 +185,9 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { .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 }, + .io_start = { + { 0xae94000, 0xae96000 }, + }, }; static const struct regulator_bulk_data sm8550_dsi_regulators[] = {
@@ -182,7 +200,9 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { .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 }, + .io_start = { + { 0xae94000, 0xae96000 }, + }, }; static const struct regulator_bulk_data sc7180_dsi_regulators[] = {
@@ -195,7 +215,9 @@ static const struct msm_dsi_config sc7180_dsi_cfg = { .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 }, + .io_start = { + { 0xae94000 }, + }, }; static const char * const dsi_sc7280_bus_clk_names[] = {
@@ -212,7 +234,9 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { .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 }, + .io_start = { + { 0xae94000, 0xae96000 }, + }, }; static const char * const dsi_qcm2290_bus_clk_names[] = {
@@ -229,7 +253,9 @@ static const struct msm_dsi_config qcm2290_dsi_cfg = { .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 }, + .io_start = { + { 0x5e94000 }, + }, }; static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = {
drivers/gpu/drm/msm/dsi/dsi_cfg.h +4 -1
@@ -32,13 +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 resource_size_t io_start[VARIANTS_MAX ][DSI_MAX ]; };struct msm_dsi_host_cfg_ops {
drivers/gpu/drm/msm/dsi/dsi_host.c +5 -5
@@ -1862,16 +1862,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 <DSI_MAX ; 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 ; }
Signature · 1 line
2.39.2
PATCH v6 4/9 drm/msm/dsi: dsi_cfg: Deduplicate identical structs
In reply to Konrad DybcioSome structs were defined multiple times for no apparent reason. Deduplicate them.
--- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 93 +++++++++++++-------------------------- 1 file changed, 30 insertions(+), 63 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_cfg.c +30 -63
@@ -47,41 +47,32 @@ static const struct msm_dsi_config msm8974_apq8084_dsi_cfg = { }, }; -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), + .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 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 */ -}; -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), + .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 }, },
@@ -107,10 +98,6 @@ static const struct msm_dsi_config msm8994_dsi_cfg = { }, }; -static const char *const dsi_8996_bus_clk_names[] = { -"mdp_core" ,"iface" ,"bus" ,"core_mmss" , -}; -static const struct regulator_bulk_data msm8996_dsi_regulators[] = { { .supply ="vdda" , .init_load_uA =18160 },/* 1.25 V */ { .supply ="vcca" , .init_load_uA =17000 },/* 0.925 V */
@@ -121,8 +108,8 @@ 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), + .bus_clk_names = dsi_6g_bus_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_6g_bus_clk_names), .io_start = { { 0x994000, 0x996000 }, },
@@ -167,24 +154,20 @@ static const struct msm_dsi_config sdm660_dsi_cfg = { }, }; -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), + .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 }, },
@@ -198,32 +181,24 @@ 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), + .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 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), + .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 }, }, }; -static const char * const dsi_sc7280_bus_clk_names[] = { - "iface", "bus", -}; - static const struct regulator_bulk_data sc7280_dsi_regulators[] = { { .supply = "vdda", .init_load_uA = 8350 }, /* 1.2 V */ };
@@ -232,27 +207,19 @@ 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), + .bus_clk_names = dsi_v2_4_clk_names, + .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { { 0xae94000, 0xae96000 }, }, }; -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), + .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 = { { 0x5e94000 }, },
Signature · 1 line
2.39.2
PATCH v6 5/9 drm/msm/dsi: dsi_cfg: Merge SC7180 config into SDM845
In reply to Konrad DybcioThe configs are identical, other than the number of *maximum* DSI hosts allowed. This isn't an issue, unless somebody deliberately tries to access the inexistent host by adding a dt node for it.
Remove the SC7180 struct and point the hw revision match to the SDM845's one. On a note, this could have been done back when 7180 support was introduced.
--- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_cfg.c +2 -13
@@ -169,7 +169,7 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { .bus_clk_names = dsi_v2_4_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { - { 0xae94000, 0xae96000 }, + { 0xae94000, 0xae96000 }, /* SDM845 / SDM670 / SC7180 */ }, };
@@ -188,17 +188,6 @@ static const struct msm_dsi_config sm8550_dsi_cfg = { }, }; -static const struct msm_dsi_config sc7180_dsi_cfg = { - .io_offset =DSI_6G_REG_SHIFT , - .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 }, - }, -}; -static const struct regulator_bulk_data sc7280_dsi_regulators[] = { { .supply ="vdda" , .init_load_uA =8350 },/* 1.2 V */ };
@@ -291,7 +280,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,
Signature · 1 line
2.39.2
PATCH v6 6/9 drm/msm/dsi: Switch the QCM2290-specific compatible to index autodetection
In reply to Konrad DybcioNow that the logic can handle multiple sets of registers, move the QCM2290 to the common logic and mark it deprecated. This allows us to remove a couple of structs, saving some memory.
--- drivers/gpu/drm/msm/dsi/dsi.c | 5 +++-- drivers/gpu/drm/msm/dsi/dsi_cfg.c | 20 ++------------------ drivers/gpu/drm/msm/dsi/dsi_cfg.h | 3 --- 3 files changed, 5 insertions(+), 23 deletions(-)
drivers/gpu/drm/msm/dsi/dsi.c +3 -2
@@ -4,7 +4,6 @@*/ #include "dsi.h" -#include "dsi_cfg.h" bool msm_dsi_is_cmd_mode (struct msm_dsi *msm_dsi) {
@@ -174,7 +173,9 @@ 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 }, + +/* Deprecated, don't use */ + { .compatible ="qcom,dsi-ctrl-6g-qcm2290" , .data =NULL }, {} };
drivers/gpu/drm/msm/dsi/dsi_cfg.c +2 -18
@@ -169,7 +169,8 @@ static const struct msm_dsi_config sdm845_dsi_cfg = { .bus_clk_names = dsi_v2_4_clk_names, .num_bus_clks = ARRAY_SIZE(dsi_v2_4_clk_names), .io_start = { - { 0xae94000, 0xae96000 }, /* SDM845 / SDM670 / SC7180 */ + { 0xae94000, 0xae96000 }, /* SDM845 / SDM670 */ + { 0x5e94000 }, /* QCM2290 / SM6115 / SM6125 / SM6375 */ }, };
@@ -203,17 +204,6 @@ static const struct msm_dsi_config sc7280_dsi_cfg = { }, }; -static const struct msm_dsi_config qcm2290_dsi_cfg = { - .io_offset =DSI_6G_REG_SHIFT , - .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 = { - {0x5e94000 }, - }, -}; -static const struct msm_dsi_host_cfg_ops msm_dsi_v2_host_ops = { .link_clk_set_rate = dsi_link_clk_set_rate_v2, .link_clk_enable = dsi_link_clk_enable_v2,
@@ -304,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, -};
drivers/gpu/drm/msm/dsi/dsi_cfg.h +0 -3
@@ -65,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__ */
Signature · 1 line
2.39.2
PATCH v6 7/9 drm/msm/dsi: Remove custom DSI config handling
In reply to Konrad DybcioNow that the only user is handled by common code, remove the option to specify custom handlers through match data.
This is effectively a revert of commit:5ae15e76271 ("drm/msm/dsi: Allow to specify dsi config as pdata")
--- drivers/gpu/drm/msm/dsi/dsi.c | 4 ++-- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/gpu/drm/msm/dsi/dsi.c +2 -2
@@ -172,10 +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,mdss-dsi-ctrl" },/* Deprecated, don't use */ - { .compatible ="qcom,dsi-ctrl-6g-qcm2290" , .data =NULL }, + { .compatible ="qcom,dsi-ctrl-6g-qcm2290" }, {} };
drivers/gpu/drm/msm/dsi/dsi_host.c +0 -4
@@ -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__);
Signature · 1 line
2.39.2
PATCH v6 8/9 dt-bindings: display/msm: dsi-controller-main: Add SM6115
In reply to Konrad DybcioAdd a compatible for the DSI on SM6115.
--- .../devicetree/bindings/display/msm/dsi-controller-main.yaml | 2 ++ .../devicetree/bindings/display/msm/qcom,sm6115-mdss.yaml | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml +2 -0
@@ -25,6 +25,7 @@ properties: - qcom,sc7280-dsi-ctrl - qcom,sdm660-dsi-ctrl - qcom,sdm845-dsi-ctrl + - qcom,sm6115-dsi-ctrl - qcom,sm8150-dsi-ctrl - qcom,sm8250-dsi-ctrl - qcom,sm8350-dsi-ctrl
@@ -350,6 +351,7 @@ allOf: contains: enum: - qcom,sdm845-dsi-ctrl + - qcom,sm6115-dsi-ctrl then: properties: clocks:
Documentation/devicetree/bindings/display/msm/qcom,sm6115-mdss.yaml +8 -2
@@ -40,7 +40,13 @@ patternProperties: type: object properties: compatible: - const: qcom,dsi-ctrl-6g-qcm2290 + oneOf: + - items: + - const: qcom,sm6115-dsi-ctrl + - const: qcom,mdss-dsi-ctrl + - description: Old binding, please don't use + deprecated: true + const: qcom,dsi-ctrl-6g-qcm2290 "^phy@[0-9a-f]+$": type: object
@@ -114,7 +120,7 @@ examples: }; dsi@5e94000 { - compatible = "qcom,dsi-ctrl-6g-qcm2290"; + compatible = "qcom,sm6115-dsi-ctrl", "qcom,mdss-dsi-ctrl"; reg = <0x05e94000 0x400>; reg-names = "dsi_ctrl";
Signature · 1 line
2.39.2
Re: [PATCH v6 8/9] dt-bindings: display/msm: dsi-controller-main: Add SM6115
Quoted 5 lines · Konrad Dybcio
Add a compatible for the DSI on SM6115.
Acked-by Rob Herring <[email protected]>Reviewed-by Marijn Suijten <[email protected]>Signed-off-by Konrad Dybcio <[email protected]>
Best regards,
Krzysztof
PATCH v6 9/9 arm64: dts: qcom: sm6115: Use the correct DSI compatible
In reply to Konrad DybcioUse the non-deprecated, SoC-specific DSI compatible.
--- arch/arm64/boot/dts/qcom/sm6115.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm6115.dtsi +1 -1
@@ -1227,7 +1227,7 @@ opp-384000000 { }; mdss_dsi0: dsi@5e94000 { - compatible = "qcom,dsi-ctrl-6g-qcm2290"; + compatible = "qcom,sm6115-dsi-ctrl", "qcom,mdss-dsi-ctrl"; reg = <0x0 0x05e94000 0x0 0x400>; reg-names = "dsi_ctrl";
Signature · 1 line
2.39.2
Dmitry Baryshkov
AppliedQuoted 6 lines · Konrad Dybcio
v5 -> v6:
- Squash both fixes that concerned the deprecated QCM2290 compatible to avoid warnings
Quoted 7 lines
v4 -> v5:
- Drop superfluous items: level in [8/10]
- Remove the header define for the qcm2290 config in [6/10] instead of [7/10]
- Pick up tags[...]
Applied, thanks!
[1/9] dt-bindings: display/msm: dsi-controller-main: Fix deprecated QCM2290 compatible
https://gitlab.freedesktop.org/lumag/msm/-/commit/236502012d47 [2/9] drm/msm/dsi: Get rid of msm_dsi_config::num_dsi https://gitlab.freedesktop.org/lumag/msm/-/commit/607ce0e9d462 [3/9] drm/msm/dsi: Fix DSI index detection when version clash occurs https://gitlab.freedesktop.org/lumag/msm/-/commit/2e6105fe7570 [4/9] drm/msm/dsi: dsi_cfg: Deduplicate identical structs https://gitlab.freedesktop.org/lumag/msm/-/commit/41301c6d5e5d [5/9] drm/msm/dsi: dsi_cfg: Merge SC7180 config into SDM845 https://gitlab.freedesktop.org/lumag/msm/-/commit/38ba402f807d [6/9] drm/msm/dsi: Switch the QCM2290-specific compatible to index autodetection https://gitlab.freedesktop.org/lumag/msm/-/commit/34f84fcf81c8 [7/9] drm/msm/dsi: Remove custom DSI config handling https://gitlab.freedesktop.org/lumag/msm/-/commit/ff280b6cc5ef [8/9] dt-bindings: display/msm: dsi-controller-main: Add SM6115 https://gitlab.freedesktop.org/lumag/msm/-/commit/c7baf742a07b
Best regards,
Signature · 1 line
Dmitry Baryshkov <[email protected]>
Re: (subset) [PATCH v6 0/9] Fix DSI host idx detection on HW revision clash
In reply to Konrad DybcioQuoted 6 lines · Konrad Dybcio
v5 -> v6:
- Squash both fixes that concerned the deprecated QCM2290 compatible to avoid warnings
Quoted 7 lines
v4 -> v5:
- Drop superfluous items: level in [8/10]
- Remove the header define for the qcm2290 config in [6/10] instead of [7/10]
- Pick up tags[...]
Applied, thanks!
[9/9] arm64: dts: qcom: sm6115: Use the correct DSI compatible
commit: 1e6e0c1c971e5e02047a05c015510cc203530dc2
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>