drm/mediatek: Add mt8195 DisplayPort driver
Subsystems (8)
v4 cover drm/mediatek: Add mt8195 DisplayPort driver
Hi everyone,
this series is built around the DisplayPort driver. The dpi/dpintf driver and the added helper functions are required for the DisplayPort driver to work.
In v4 I split the phy driver and dp driver into two patches as requested. Also I added an entry for phy-mtk-dp in MAINTAINERS and made tiny fixups to the binding files.
The series is based on v5.15-rc1 but also applies cleanly on linux-next.
Note: This patch series is currently tested on v5.10 and I am still working on testing it on v5.15.
Thanks in advance for any feedback and comments.
Best,
Markus
Functional dependencies are:
- Add Mediatek Soc DRM (vdosys0) support for mt8195
https://lore.kernel.org/linux-mediatek/[email protected]/
- Add MediaTek SoC DRM (vdosys1) support for mt8195
https://lore.kernel.org/linux-mediatek/[email protected]/
Older revisions:
RFC - https://lore.kernel.org/linux-mediatek/[email protected]/
v1 - https://lore.kernel.org/linux-mediatek/[email protected]/ v2 - https://lore.kernel.org/linux-mediatek/[email protected]/ v3 - https://lore.kernel.org/linux-mediatek/[email protected]/
Markus Schneider-Pargmann (7):
dt-bindings: mediatek,dpintf: Add DP_INTF binding
dt-bindings: mediatek,dp: Add Display Port binding drm/edid: Add cea_sad helpers for freq/length video/hdmi: Add audio_infoframe packing for DP drm/mediatek: dpi: Add dpintf support
phy: phy-mtk-dp: Add driver for DP phy drm/mediatek: Add mt8195 DisplayPort driver
.../display/mediatek/mediatek,dp.yaml | 89 + .../display/mediatek/mediatek,dpintf.yaml | 86 + MAINTAINERS | 1 + drivers/gpu/drm/drm_edid.c | 74 + drivers/gpu/drm/mediatek/Kconfig | 7 + drivers/gpu/drm/mediatek/Makefile | 2 + drivers/gpu/drm/mediatek/mtk_dp.c | 2825 +++++++++++++++++ drivers/gpu/drm/mediatek/mtk_dp_reg.h | 535 ++++ drivers/gpu/drm/mediatek/mtk_dpi.c | 248 +- drivers/gpu/drm/mediatek/mtk_dpi_regs.h | 12 + drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 4 + drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 1 + drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +- drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 + drivers/phy/mediatek/Kconfig | 8 + drivers/phy/mediatek/Makefile | 1 + drivers/phy/mediatek/phy-mtk-dp.c | 218 ++ drivers/video/hdmi.c | 83 +- include/drm/drm_dp_helper.h | 2 + include/drm/drm_edid.h | 18 +- include/linux/hdmi.h | 7 +- include/linux/soc/mediatek/mtk-mmsys.h | 2 + 22 files changed, 4156 insertions(+), 74 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.yaml create mode 100644 drivers/gpu/drm/mediatek/mtk_dp.c create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_reg.h create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c
Signature · 1 line
2.33.0
PATCH v4 1/7 dt-bindings: mediatek,dpintf: Add DP_INTF binding
DP_INTF is a similar functional block to mediatek,dpi but is different in that it serves the DisplayPort controller on mediatek SoCs and uses different clocks. Therefore this patch creates a new binding file for this functional block.
---
Notes:
Changes v3 -> v4:
- Fixed clock names in the example as the clock patch series is merged into next now
- Add missing ports decleration to the example
Changes v1 -> v2:
- Move the devicetree binding from mediatek,dpi into its own binding file.
.../display/mediatek/mediatek,dpintf.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.yaml
Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.yaml new file +86 -0
@@ -0,0 +1,86 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/mediatek/mediatek,dpintf.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek DP_INTF Controller Device Tree Bindings + +maintainers: + - CK Hu <[email protected]> + - Jitao shi <[email protected]> + +description: | + The Mediatek DP_INTF function block is a sink of the display subsystem + connected to the display port controller. + +properties: + compatible: + enum: + - mediatek,mt8195-dpintf + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: hf_fmm Clock + - description: hf_fdp Clock + - description: Pixel Clock + - description: DP_INTF PLL + + clock-names: + items: + - const: hf_fmm + - const: hf_fdp + - const: pixel + - const: pll + + port: + $ref: /schemas/graph.yaml#/properties/port + description: + Output port node. This port should be connected to the input port of an + attached display port controller. + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - port + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/clock/mt8195-clk.h> + + dp_intf1: dp_intf1@1c113000 { + compatible = "mediatek,mt8195-dpintf"; + reg = <0 0x1c113000 0 0x1000>; + interrupts = <GIC_SPI 513 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&vdosys1 CLK_VDO1_DP_INTF0_MM>, + <&vdosys1 CLK_VDO1_DPINTF>, + <&topckgen CLK_TOP_DP>, + <&topckgen CLK_APMIXED_TVDPLL2>; + clock-names = "hf_fmm", + "hf_fdp", + "pixel", + "pll"; + + ports { + port { + dpintf1_out: endpoint { + remote-endpoint = <&dp_in>; + }; + }; + }; + }; + +...
Signature · 1 line
2.33.0
Rob Herring
maintainerRe: [PATCH v4 1/7] dt-bindings: mediatek,dpintf: Add DP_INTF binding
Quoted 14 lines · Markus Schneider-Pargmann
DP_INTFis a similar functional block to mediatek,dpi but is different in that it serves the DisplayPort controller on mediatek SoCs and uses different clocks. Therefore this patch creates a new binding file for this functional block.Signed-off-by Markus Schneider-Pargmann <[email protected]>---
Notes:
Changes v3 -> v4:
- Fixed clock names in the example as the clock patch series is merged into next now
- Add missing ports decleration to the example
Quoted 7 lines
Changes v1 -> v2:
- Move the devicetree binding from mediatek,dpi into its own binding file..../display/mediatek/mediatek,dpintf.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.example.dts:21:18: fatal error: dt-bindings/clock/mt8195-clk.h: No such file or directory
21 | #include <dt-bindings/clock/mt8195-clk.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:385: Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1441: dt_binding_check] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1539196
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
Re: [PATCH v4 1/7] dt-bindings: mediatek,dpintf: Add DP_INTF binding
Hi,
Quoted 26 lines · Rob Herring
Quoted 14 lines · Markus Schneider-Pargmann
DP_INTFis a similar functional block to mediatek,dpi but is different in that it serves the DisplayPort controller on mediatek SoCs and uses different clocks. Therefore this patch creates a new binding file for this functional block.Signed-off-by Markus Schneider-Pargmann <[email protected]>---
Notes:
Changes v3 -> v4:
- Fixed clock names in the example as the clock patch series is merged into next now
- Add missing ports decleration to the exampleQuoted 7 lines
Changes v1 -> v2:
- Move the devicetree binding from mediatek,dpi into its own binding file..../display/mediatek/mediatek,dpintf.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.yamlMy bot found errors running 'make DT_CHECKER_FLAGS=-m
dt_binding_check' on your patch (DT_CHECKER_FLAGSis new in v5.13):
Quoted 6 lines
yamllint warnings/errors:
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.example.dts:21:18: fatal error:dt-bindings/clock/mt8195-clk.h: No such file or directory
21 | #include <dt-bindings/clock/mt8195-clk.h>| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The mt8195 clock series was already merged and is available in linux-next. I checked with make dt_binding_check before sending.
Thanks,
Markus
Quoted 20 lines
compilation terminated.
make[1]: *** [scripts/Makefile.lib:385:Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1441:dt_binding_check] Error 2doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1539196
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make
dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:pip3 install dtschema --upgrade
Please check and re-submit.
Rob Herring
maintainerRe: [PATCH v4 1/7] dt-bindings: mediatek,dpintf: Add DP_INTF binding
Quoted 32 lines · Markus Schneider-Pargmann
Hi,
Quoted 28 lines · Rob Herring
Quoted 14 lines · Markus Schneider-Pargmann
DP_INTFis a similar functional block to mediatek,dpi but is different in that it serves the DisplayPort controller on mediatek SoCs and uses different clocks. Therefore this patch creates a new binding file for this functional block.Signed-off-by Markus Schneider-Pargmann <[email protected]>---
Notes:
Changes v3 -> v4:
- Fixed clock names in the example as the clock patch series is merged into next now
- Add missing ports decleration to the exampleQuoted 7 lines
Changes v1 -> v2:
- Move the devicetree binding from mediatek,dpi into its own binding file..../display/mediatek/mediatek,dpintf.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.yamlMy bot found errors running 'make DT_CHECKER_FLAGS=-m
dt_binding_check' on your patch (DT_CHECKER_FLAGSis new in v5.13):yamllint warnings/errors:
Quoted 7 lines
Quoted 4 lines
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.example.dts:21:18: fatal error:dt-bindings/clock/mt8195-clk.h: No such file or directory
21 | #include <dt-bindings/clock/mt8195-clk.h>| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~The mt8195 clock series was already merged and is available in linux-next. I checked with make
dt_binding_checkbefore sending.
The bot has no way of knowing that, and the dependency is not called out in this patch for me to know that when reviewing the failures.
Rob
Re: [PATCH v4 1/7] dt-bindings: mediatek,dpintf: Add DP_INTF binding
In reply to Markus Schneider-PargmannQuoted 14 lines · Markus Schneider-Pargmann
DP_INTFis a similar functional block to mediatek,dpi but is different in that it serves the DisplayPort controller on mediatek SoCs and uses different clocks. Therefore this patch creates a new binding file for this functional block.Signed-off-by Markus Schneider-Pargmann <[email protected]>---
Notes:
Changes v3 -> v4:
- Fixed clock names in the example as the clock patch series is merged into next now
- Add missing ports decleration to the example
Quoted 7 lines
Changes v1 -> v2:
- Move the devicetree binding from mediatek,dpi into its own binding file..../display/mediatek/mediatek,dpintf.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.yaml
Re: [PATCH v4 1/7] dt-bindings: mediatek,dpintf: Add DP_INTF binding
Hi Rob,
Quoted 18 lines · Rob Herring
Quoted 17 lines · Markus Schneider-Pargmann
DP_INTFis a similar functional block to mediatek,dpi but is different in that it serves the DisplayPort controller on mediatek SoCs and uses different clocks. Therefore this patch creates a new binding file for this functional block.Signed-off-by Markus Schneider-Pargmann <[email protected]>---
Notes:
Changes v3 -> v4:
- Fixed clock names in the example as the clock patch series is merged into next now
- Add missing ports decleration to the exampleChanges v1 -> v2:
- Move the devicetree binding from mediatek,dpi into its own binding file.
Quoted 6 lines
Quoted 4 lines
.../display/mediatek/mediatek,dpintf.yaml | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dpintf.yamlReviewed-by Rob Herring <[email protected]>
Thanks a lot for reviewing. However I am going to recombine dpintf with dpi as Chun-Kuang helped me realize that the fdp clock is a parent of the pixel clock and therefore not a different clock. In the end the clocks are the same now for both dpi and dpintf, so no need for a separate document.
Best,
Markus
PATCH v4 2/7 dt-bindings: mediatek,dp: Add Display Port binding
In reply to Markus Schneider-PargmannThis controller is present on several mediatek hardware. Currently mt8195 and mt8395 have this controller without a functional difference, so only one compatible field is added.
The controller can have two forms, as a normal display port and as an embedded display port.
--- .../display/mediatek/mediatek,dp.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +89 -0
@@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/mediatek/mediatek,dp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek Display Port Controller + +maintainers: + - CK Hu <[email protected]> + - Jitao shi <[email protected]> + +description: | + Device tree bindings for the Mediatek (embedded) Display Port controller + present on some Mediatek SoCs. + +properties: + compatible: + enum: + - mediatek,mt8195-edp_tx + - mediatek,mt8195-dp_tx + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: faxi clock + + clock-names: + items: + - const: faxi + + power-domains: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Input endpoint of the controller, usually dp_intf + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output endpoint of the controller + +required: + - compatible + - reg + - interrupts + - ports + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/power/mt8195-power.h> + dp_tx: edp_tx@1c500000 { + compatible = "mediatek,mt8195-edp_tx"; + reg = <0 0x1c500000 0 0x8000>; + interrupts = <GIC_SPI 676 IRQ_TYPE_LEVEL_HIGH 0>; + power-domains = <&spm MT8195_POWER_DOMAIN_EPD_TX>; + pinctrl-names = "default"; + pinctrl-0 = <&edp_pin>; + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + edp_in: endpoint { + remote-endpoint = <&dp_intf0_out>; + }; + }; + port@1 { + reg = <1>; + edp_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + };
Signature · 1 line
2.33.0
Rob Herring
maintainerRe: [PATCH v4 2/7] dt-bindings: mediatek, dp: Add Display Port binding
Quoted 4 lines · Markus Schneider-Pargmann
This controller is present on several mediatek hardware. Currently mt8195 and mt8395 have this controller without a functional difference, so only one compatible field is added.
Quoted 9 lines
The controller can have two forms, as a normal display port and as an embedded display port.
Signed-off-by Markus Schneider-Pargmann <[email protected]>--- .../display/mediatek/mediatek,dp.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors:Documentation/devicetree/bindings/display/mediatek/mediatek,dp.example.dts:20:18: fatal error: dt-bindings/power/mt8195-power.h: No such file or directory
20 | #include <dt-bindings/power/mt8195-power.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:385: Documentation/devicetree/bindings/display/mediatek/mediatek,dp.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1441: dt_binding_check] Error 2
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1539195
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit.
Re: [PATCH v4 2/7] dt-bindings: mediatek, dp: Add Display Port binding
Hi,
Quoted 20 lines · Rob Herring
Quoted 4 lines · Markus Schneider-Pargmann
This controller is present on several mediatek hardware. Currently mt8195 and mt8395 have this controller without a functional difference, so only one compatible field is added.
Quoted 9 lines
The controller can have two forms, as a normal display port and as an embedded display port.
Signed-off-by Markus Schneider-Pargmann <[email protected]>--- .../display/mediatek/mediatek,dp.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yamlMy bot found errors running 'make DT_CHECKER_FLAGS=-m
dt_binding_check' on your patch (DT_CHECKER_FLAGSis new in v5.13):yamllint warnings/errors:
Quoted 8 lines
dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.example.dts:20:18: fatal error:dt-bindings/power/mt8195-power.h: No such file or directory
20 | #include <dt-bindings/power/mt8195-power.h>| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~compilation terminated.
make[1]: *** [scripts/Makefile.lib:385:Documentation/devicetree/bindings/display/mediatek/mediatek,dp.example.dt.yaml] Error 1 make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1441:dt_binding_check] Error 2
Yes, mt8195-power.h is unfortunately not merged yet.
Thanks,
Markus
Quoted 16 lines
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1539195
This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.
If you already ran 'make
dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:pip3 install dtschema --upgrade
Please check and re-submit.
Rob Herring
maintainerRe: [PATCH v4 2/7] dt-bindings: mediatek, dp: Add Display Port binding
In reply to Markus Schneider-PargmannQuoted 30 lines · Markus Schneider-Pargmann
This controller is present on several mediatek hardware. Currently mt8195 and mt8395 have this controller without a functional difference, so only one compatible field is added.
The controller can have two forms, as a normal display port and as an embedded display port.
Signed-off-by Markus Schneider-Pargmann <[email protected]>--- .../display/mediatek/mediatek,dp.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yamlDocumentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +11
-0@@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/mediatek/mediatek,dp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek Display Port Controller + +maintainers: + - CK Hu <[email protected]> + - Jitao shi <[email protected]>
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml line 21
Quoted 10 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +10
-0+ +description: | + Device tree bindings for the Mediatek (embedded) Display Port controller + present on some Mediatek SoCs. + +properties: + compatible: + enum: + - mediatek,mt8195-edp_tx + - mediatek,mt8195-dp_tx
Are these blocks different?
Quoted 39 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +39
-0+ + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: faxi clock + + clock-names: + items: + - const: faxi + + power-domains: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Input endpoint of the controller, usually dp_intf + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output endpoint of the controller + +required: + - compatible + - reg + - interrupts + - ports + +additionalProperties: false + +examples: + - |
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml line 70
Quoted 10 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +10
-0+ #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/power/mt8195-power.h> + dp_tx: edp_tx@1c500000 { + compatible = "mediatek,mt8195-edp_tx"; + reg = <0 0x1c500000 0 0x8000>; + interrupts = <GIC_SPI 676 IRQ_TYPE_LEVEL_HIGH 0>; + power-domains = <&spm MT8195_POWER_DOMAIN_EPD_TX>; + pinctrl-names = "default"; + pinctrl-0 = <&edp_pin>; + status = "okay";
Don't show status in examples.
Quoted 23 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +19
-0+ + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + edp_in: endpoint { + remote-endpoint = <&dp_intf0_out>; + }; + }; + port@1 { + reg = <1>; + edp_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + };Signature · 1 line
2.33.0
Re: [PATCH v4 2/7] dt-bindings: mediatek, dp: Add Display Port binding
Hi Rob,
Quoted 35 lines · Rob Herring
Quoted 34 lines · Markus Schneider-Pargmann
This controller is present on several mediatek hardware. Currently mt8195 and mt8395 have this controller without a functional difference, so only one compatible field is added.
The controller can have two forms, as a normal display port and as an embedded display port.
Signed-off-by Markus Schneider-Pargmann <[email protected]>--- .../display/mediatek/mediatek,dp.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yamlDocumentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +15
-0@@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/mediatek/mediatek,dp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek Display Port Controller + +maintainers: + - CK Hu <[email protected]> + - Jitao shi <[email protected]> + +description: | + Device tree bindings for the Mediatek (embedded) Display Port controller + present on some Mediatek SoCs.
Quoted 8 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml line 21
Quoted 6 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +6
-0+ +properties: + compatible: + enum: + - mediatek,mt8195-edp_tx + - mediatek,mt8195-dp_txAre these blocks different?
Good point, the registers of these blocks are described in its own chapter each. Also I do need to distinguish between both in the driver. Would you suggest making this distinction differently or keep it as two compatibles?
Quoted 44 lines
Quoted 44 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +43
-0+ + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: faxi clock + + clock-names: + items: + - const: faxi + + power-domains: + maxItems: 1 + + ports: + $ref: /schemas/graph.yaml#/properties/ports + properties: + port@0: + $ref: /schemas/graph.yaml#/properties/port + description: Input endpoint of the controller, usually dp_intf + + port@1: + $ref: /schemas/graph.yaml#/properties/port + description: Output endpoint of the controller + +required: + - compatible + - reg + - interrupts + - ports + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/power/mt8195-power.h> + dp_tx: edp_tx@1c500000 { + compatible = "mediatek,mt8195-edp_tx";
Quoted 8 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml line 70
Quoted 6 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +6
-0+ reg = <0 0x1c500000 0 0x8000>; + interrupts = <GIC_SPI 676 IRQ_TYPE_LEVEL_HIGH 0>; + power-domains = <&spm MT8195_POWER_DOMAIN_EPD_TX>; + pinctrl-names = "default"; + pinctrl-0 = <&edp_pin>; + status = "okay";Don't show status in examples.
Fixed.
Thank you Rob.
Best,
Markus
Quoted 24 lines
Quoted 24 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +19
-0+ + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + edp_in: endpoint { + remote-endpoint = <&dp_intf0_out>; + }; + }; + port@1 { + reg = <1>; + edp_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + };Signature · 1 line
2.33.0
Rob Herring
maintainerRe: [PATCH v4 2/7] dt-bindings: mediatek, dp: Add Display Port binding
Quoted 48 lines · Markus Schneider-Pargmann
Hi Rob,
Quoted 35 lines · Rob Herring
Quoted 34 lines · Markus Schneider-Pargmann
This controller is present on several mediatek hardware. Currently mt8195 and mt8395 have this controller without a functional difference, so only one compatible field is added.
The controller can have two forms, as a normal display port and as an embedded display port.
Signed-off-by Markus Schneider-Pargmann <[email protected]>--- .../display/mediatek/mediatek,dp.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yamlDocumentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +15
-0@@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/mediatek/mediatek,dp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek Display Port Controller + +maintainers: + - CK Hu <[email protected]> + - Jitao shi <[email protected]> + +description: | + Device tree bindings for the Mediatek (embedded) Display Port controller + present on some Mediatek SoCs.Quoted 8 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml line 21
Quoted 6 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +6
-0+ +properties: + compatible: + enum: + - mediatek,mt8195-edp_tx + - mediatek,mt8195-dp_txAre these blocks different?
Quoted 4 lines
Good point, the registers of these blocks are described in its own chapter each. Also I do need to distinguish between both in the driver. Would you suggest making this distinction differently or keep it as two compatibles?
If the registers are all the same, then it should be the same compatible. If you still need to distinguish, then you should have a panel or connector node that will let you do that.
Also, s/_/-/ in the compatible string.
Rob
Re: [PATCH v4 2/7] dt-bindings: mediatek, dp: Add Display Port binding
Hi Rob,
Quoted 50 lines · Rob Herring
Quoted 48 lines · Markus Schneider-Pargmann
Hi Rob,
Quoted 43 lines · Rob Herring
Quoted 30 lines · Markus Schneider-Pargmann
This controller is present on several mediatek hardware. Currently mt8195 and mt8395 have this controller without a functional difference, so only one compatible field is added.
The controller can have two forms, as a normal display port and as an embedded display port.
Signed-off-by Markus Schneider-Pargmann <[email protected]>--- .../display/mediatek/mediatek,dp.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yamlDocumentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +11
-0@@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/mediatek/mediatek,dp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek Display Port Controller + +maintainers: + - CK Hu <[email protected]> + - Jitao shi <[email protected]>Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml line 21
Quoted 10 lines
Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml new file +10
-0+ +description: | + Device tree bindings for the Mediatek (embedded) Display Port controller + present on some Mediatek SoCs. + +properties: + compatible: + enum: + - mediatek,mt8195-edp_tx + - mediatek,mt8195-dp_txAre these blocks different?
Quoted 8 lines
Quoted 4 lines
Good point, the registers of these blocks are described in its own chapter each. Also I do need to distinguish between both in the driver. Would you suggest making this distinction differently or keep it as two compatibles?
If the registers are all the same, then it should be the same compatible. If you still need to distinguish, then you should have a panel or connector node that will let you do that.
Thank you. Good idea to check with the connector node, I have changed it as you suggested.
Quoted 2 lines
Also, s/_/-/ in the compatible string.
Done.
Thanks,
Markus
PATCH v4 3/7 drm/edid: Add cea_sad helpers for freq/length
In reply to Markus Schneider-PargmannThis patch adds two helper functions that extract the frequency and word length from a struct cea_sad.
For these helper functions new defines are added that help translate the 'freq' and 'byte2' fields into real numbers.
---
Notes:
Changes v2 -> v3:
- Add DRM_ prefix to the CEA_SAD defines.
Changes v1 -> v2:
- Use const struct pointers.
- Add a check whether the format is actually uncompressed or not.
drivers/gpu/drm/drm_edid.c | 74 ++++++++++++++++++++++++++++++++++++++ include/drm/drm_edid.h | 18 ++++++++-- 2 files changed, 90 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_edid.c +74 -0
@@ -4666,6 +4666,80 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb) }EXPORT_SYMBOL (drm_edid_to_speaker_allocation); +/** +* drm_cea_sad_get_sample_rate - Extract the sample rate from cea_sad +* @sad: Pointer to the cea_sad struct +* +* Extracts the cea_sad frequency field and returns the sample rate in Hz. +* +* Return: Sample rate in Hz or a negative errno if parsing failed. +*/ +int drm_cea_sad_get_sample_rate (const struct cea_sad *sad) +{ +switch (sad->freq) { +case DRM_CEA_SAD_FREQ_32KHZ : +return 32000 ; +case DRM_CEA_SAD_FREQ_44KHZ : +return 44100 ; +case DRM_CEA_SAD_FREQ_48KHZ : +return 48000 ; +case DRM_CEA_SAD_FREQ_88KHZ : +return 88200 ; +case DRM_CEA_SAD_FREQ_96KHZ : +return 96000 ; +case DRM_CEA_SAD_FREQ_176KHZ : +return 176400 ; +case DRM_CEA_SAD_FREQ_192KHZ : +return 192000 ; +default : +return -EINVAL ; + } +} +EXPORT_SYMBOL (drm_cea_sad_get_sample_rate); + +static bool drm_cea_sad_is_uncompressed (const struct cea_sad *sad) +{ +switch (sad->format) { +case HDMI_AUDIO_CODING_TYPE_STREAM : +case HDMI_AUDIO_CODING_TYPE_PCM : +return true; +default : +return false; + } +} + +/** +* drm_cea_sad_get_uncompressed_word_length - Extract word length +* @sad: Pointer to the cea_sad struct +* +* Extracts the cea_sad byte2 field and returns the word length for an +* uncompressed stream. +* +* Note: This function may only be called for uncompressed audio. +* +* Return: Word length in bits or a negative errno if parsing failed. +*/ +int drm_cea_sad_get_uncompressed_word_length (const struct cea_sad *sad) +{ +if (!drm_cea_sad_is_uncompressed (sad)) { +DRM_WARN ("Unable to get the uncompressed word length for a compressed format: %u\n" , + sad->format); +return -EINVAL ; + } + +switch (sad->byte2) { +case DRM_CEA_SAD_UNCOMPRESSED_WORD_16BIT : +return 16 ; +case DRM_CEA_SAD_UNCOMPRESSED_WORD_20BIT : +return 20 ; +case DRM_CEA_SAD_UNCOMPRESSED_WORD_24BIT : +return 24 ; +default : +return -EINVAL ; + } +} +EXPORT_SYMBOL (drm_cea_sad_get_uncompressed_word_length); +/** * drm_av_sync_delay - compute the HDMI/DP sink audio-video sync delay * @connector: connector associated with the HDMI/DP sink
include/drm/drm_edid.h +16 -2
@@ -361,12 +361,24 @@ struct edid {/* Short Audio Descriptor */ struct cea_sad { -u8 format; +u8 format;/* See HDMI_AUDIO_CODING_TYPE_* */ u8 channels;/* max number of channels - 1 */ -u8 freq; +u8 freq;/* See CEA_SAD_FREQ_* */ u8 byte2;/* meaning depends on format */ }; +#define DRM_CEA_SAD_FREQ_32KHZ BIT(0) +#define DRM_CEA_SAD_FREQ_44KHZ BIT(1) +#define DRM_CEA_SAD_FREQ_48KHZ BIT(2) +#define DRM_CEA_SAD_FREQ_88KHZ BIT(3) +#define DRM_CEA_SAD_FREQ_96KHZ BIT(4) +#define DRM_CEA_SAD_FREQ_176KHZ BIT(5) +#define DRM_CEA_SAD_FREQ_192KHZ BIT(6) + +#define DRM_CEA_SAD_UNCOMPRESSED_WORD_16BIT BIT(0) +#define DRM_CEA_SAD_UNCOMPRESSED_WORD_20BIT BIT(1) +#define DRM_CEA_SAD_UNCOMPRESSED_WORD_24BIT BIT(2) +struct drm_encoder ;struct drm_connector ;struct drm_connector_state ;
@@ -374,6 +386,8 @@ struct drm_display_mode;int drm_edid_to_sad (struct edid *edid,struct cea_sad **sads);int drm_edid_to_speaker_allocation (struct edid *edid,u8 **sadb); +int drm_cea_sad_get_sample_rate (const struct cea_sad *sad); +int drm_cea_sad_get_uncompressed_word_length (const struct cea_sad *sad);int drm_av_sync_delay (struct drm_connector *connector,const struct drm_display_mode *mode);
Signature · 1 line
2.33.0
PATCH v4 4/7 video/hdmi: Add audio_infoframe packing for DP
In reply to Markus Schneider-PargmannSimilar to HDMI, DP uses audio infoframes as well which are structured very similar to the HDMI ones.
This patch adds a helper function to pack the HDMI audio infoframe for DP, called hdmi_audio_infoframe_pack_for_dp(). hdmi_audio_infoframe_pack_only() is split into two parts. One of them packs the payload only and can be used for HDMI and DP.
---
Notes:
Changes v1 -> v2:
- Create a define for HB2.
- Use struct dp_sdp to pass data in a better way.
drivers/video/hdmi.c | 83 ++++++++++++++++++++++++++++--------- include/drm/drm_dp_helper.h | 2 + include/linux/hdmi.h | 7 +++- 3 files changed, 72 insertions(+), 20 deletions(-)
drivers/video/hdmi.c +64 -19
@@ -21,6 +21,7 @@* DEALINGS IN THE SOFTWARE. */ +#include <drm/drm_dp_helper.h> #include <linux/bitops.h> #include <linux/bug.h> #include <linux/errno.h>
@@ -381,12 +382,34 @@ static int hdmi_audio_infoframe_check_only(const struct hdmi_audio_infoframe *fr* * Returns 0 on success or a negative error code on failure. */ -int hdmi_audio_infoframe_check (struct hdmi_audio_infoframe *frame) +int hdmi_audio_infoframe_check (const struct hdmi_audio_infoframe *frame) {return hdmi_audio_infoframe_check_only (frame); }EXPORT_SYMBOL (hdmi_audio_infoframe_check); +static void +hdmi_audio_infoframe_pack_payload (const struct hdmi_audio_infoframe *frame, +u8 *buffer) +{ +u8 channels; + +if (frame->channels >=2 ) + channels = frame->channels -1 ; +else + channels =0 ; + + buffer[0 ] = ((frame->coding_type &0xf ) <<4 ) | (channels &0x7 ); + buffer[1 ] = ((frame->sample_frequency &0x7 ) <<2 ) | + (frame->sample_size &0x3 ); + buffer[2 ] = frame->coding_type_ext &0x1f ; + buffer[3 ] = frame->channel_allocation; + buffer[4 ] = (frame->level_shift_value &0xf ) <<3 ; + +if (frame->downmix_inhibit) + buffer[4 ] |=BIT (7 ); +} +/** * hdmi_audio_infoframe_pack_only() - write HDMI audio infoframe to binary buffer * @frame: HDMI audio infoframe
@@ -404,7 +427,6 @@ EXPORT_SYMBOL(hdmi_audio_infoframe_check);ssize_t hdmi_audio_infoframe_pack_only (const struct hdmi_audio_infoframe *frame,void *buffer,size_t size) { -unsigned char channels;u8 *ptr = buffer;size_t length;int ret;
@@ -420,28 +442,13 @@ ssize_t hdmi_audio_infoframe_pack_only(const struct hdmi_audio_infoframe *frame,memset (buffer,0 , size); -if (frame->channels >=2 ) - channels = frame->channels -1 ; -else - channels =0 ; - ptr[0 ] = frame->type; ptr[1 ] = frame->version; ptr[2 ] = frame->length; ptr[3 ] =0 ;/* checksum */ -/* start infoframe payload */ - ptr +=HDMI_INFOFRAME_HEADER_SIZE ; - - ptr[0 ] = ((frame->coding_type &0xf ) <<4 ) | (channels &0x7 ); - ptr[1 ] = ((frame->sample_frequency &0x7 ) <<2 ) | - (frame->sample_size &0x3 ); - ptr[2 ] = frame->coding_type_ext &0x1f ; - ptr[3 ] = frame->channel_allocation; - ptr[4 ] = (frame->level_shift_value &0xf ) <<3 ; - -if (frame->downmix_inhibit) - ptr[4 ] |=BIT (7 ); +hdmi_audio_infoframe_pack_payload (frame, + ptr +HDMI_INFOFRAME_HEADER_SIZE );hdmi_infoframe_set_checksum (buffer, length);
@@ -479,6 +486,44 @@ ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, }EXPORT_SYMBOL (hdmi_audio_infoframe_pack); +/** +* hdmi_audio_infoframe_pack_for_dp - Pack a HDMI Audio infoframe for +* displayport +* +* @frame HDMI Audio infoframe +* @sdp secondary data packet for display port. This is filled with the +* appropriate data +* @dp_version Display Port version to be encoded in the header +* +* Packs a HDMI Audio Infoframe to be sent over Display Port. This function +* fills the secondary data packet to be used for Display Port. +* +* Return: Number of total written bytes or a negative errno on failure. +*/ +ssize_t +hdmi_audio_infoframe_pack_for_dp (const struct hdmi_audio_infoframe *frame, +struct dp_sdp *sdp,u8 dp_version) +{ +int ret; + + ret =hdmi_audio_infoframe_check (frame); +if (ret) +return ret; + +memset (sdp->db,0 ,sizeof (sdp->db)); + +// Secondary-data packet header + sdp->sdp_header.HB0 =0 ; + sdp->sdp_header.HB1 = frame->type; + sdp->sdp_header.HB2 =DP_SDP_AUDIO_INFOFRAME_HB2 ; + sdp->sdp_header.HB3 = (dp_version &0x3f ) <<2 ; + +hdmi_audio_infoframe_pack_payload (frame, sdp->db); + +return frame->length +4 ; +} +EXPORT_SYMBOL (hdmi_audio_infoframe_pack_for_dp); +/** * hdmi_vendor_infoframe_init() - initialize an HDMI vendor infoframe * @frame: HDMI vendor infoframe
include/drm/drm_dp_helper.h +2 -0
@@ -1524,6 +1524,8 @@ int drm_dp_bw_code_to_link_rate(u8 link_bw);#define DP_SDP_VSC_EXT_CEA 0x21/* DP 1.4 */ /* 0x80+ CEA-861 infoframe types */ +#define DP_SDP_AUDIO_INFOFRAME_HB2 0x1b +/** * struct dp_sdp_header - DP secondary data packet header * @HB0: Secondary Data Packet ID
include/linux/hdmi.h +6 -1
@@ -336,7 +336,12 @@ ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, void *buffer, size_t size);ssize_t hdmi_audio_infoframe_pack_only (const struct hdmi_audio_infoframe *frame,void *buffer,size_t size); -int hdmi_audio_infoframe_check (struct hdmi_audio_infoframe *frame); +int hdmi_audio_infoframe_check (const struct hdmi_audio_infoframe *frame); + +struct dp_sdp ; +ssize_t +hdmi_audio_infoframe_pack_for_dp (const struct hdmi_audio_infoframe *frame, +struct dp_sdp *sdp,u8 dp_version);enum hdmi_3d_structure {HDMI_3D_STRUCTURE_INVALID =-1 ,
Signature · 1 line
2.33.0
PATCH v4 5/7 drm/mediatek: dpi: Add dpintf support
In reply to Markus Schneider-Pargmanndpintf is the displayport interface hardware unit. This unit is similar to dpi and can reuse most of the code.
This patch adds support for mt8195-dpintf to this dpi driver. Main differences are:
- Some features/functional components are not available for dpintf which are now excluded from code execution once is_dpintf is set
- dpintf can and needs to choose between different clockdividers based on the clockspeed. This is done by choosing a different clock parent.
- There are two additional clocks that need to be managed. These are only set for dpintf and will be set to NULL if not supplied. The clk_* calls handle these as normal clocks then.
- Some register contents differ slightly between the two components. To work around this I added register bits/masks with a DPINTF_ prefix and use them where different.
Based on a separate driver for dpintf created by
Jason-JH.Lin <[email protected]>.
---
Notes:
Changes RFC -> v1:
- Remove setting parents and fully rely on the clock tree instead which already models a mux at the important place.
- Integrated mtk_dpi dpintf changes into the mediatek drm driver.
drivers/gpu/drm/mediatek/mtk_dpi.c | 248 ++++++++++++++++---- drivers/gpu/drm/mediatek/mtk_dpi_regs.h | 12 + drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 4 + drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 1 + drivers/gpu/drm/mediatek/mtk_drm_drv.c | 5 +- include/linux/soc/mediatek/mtk-mmsys.h | 2 + 6 files changed, 220 insertions(+), 52 deletions(-)
drivers/gpu/drm/mediatek/mtk_dpi.c +197 -51
@@ -71,6 +71,8 @@ struct mtk_dpi {void __iomem *regs;struct device *dev;struct clk *engine_clk; +struct clk *hf_fmm_clk; +struct clk *hf_fdp_clk;struct clk *pixel_clk;struct clk *tvd_clk;int irq;
@@ -125,6 +127,7 @@ struct mtk_dpi_conf {bool edge_sel_en;const u32 *output_fmts;u32 num_output_fmts; +bool is_dpintf; };static void mtk_dpi_mask (struct mtk_dpi *dpi,u32 offset,u32 val,u32 mask)
@@ -153,30 +156,52 @@ static void mtk_dpi_disable(struct mtk_dpi *dpi)static void mtk_dpi_config_hsync (struct mtk_dpi *dpi,struct mtk_dpi_sync_param *sync) { -mtk_dpi_mask (dpi,DPI_TGEN_HWIDTH , - sync->sync_width <<HPW ,HPW_MASK ); -mtk_dpi_mask (dpi,DPI_TGEN_HPORCH , - sync->back_porch <<HBP ,HBP_MASK ); -mtk_dpi_mask (dpi,DPI_TGEN_HPORCH , sync->front_porch <<HFP , -HFP_MASK ); +if (dpi->conf->is_dpintf) { +mtk_dpi_mask (dpi,DPI_TGEN_HWIDTH , + sync->sync_width <<HPW ,DPINTF_HPW_MASK ); +mtk_dpi_mask (dpi,DPI_TGEN_HPORCH , + sync->back_porch <<HBP ,DPINTF_HBP_MASK ); +mtk_dpi_mask (dpi,DPI_TGEN_HPORCH , sync->front_porch <<HFP , +DPINTF_HFP_MASK ); + }else { +mtk_dpi_mask (dpi,DPI_TGEN_HWIDTH , + sync->sync_width <<HPW ,HPW_MASK ); +mtk_dpi_mask (dpi,DPI_TGEN_HPORCH , + sync->back_porch <<HBP ,HBP_MASK ); +mtk_dpi_mask (dpi,DPI_TGEN_HPORCH , sync->front_porch <<HFP , +HFP_MASK ); + } }static void mtk_dpi_config_vsync (struct mtk_dpi *dpi,struct mtk_dpi_sync_param *sync,u32 width_addr,u32 porch_addr) { -mtk_dpi_mask (dpi, width_addr, - sync->sync_width <<VSYNC_WIDTH_SHIFT , -VSYNC_WIDTH_MASK );mtk_dpi_mask (dpi, width_addr, sync->shift_half_line <<VSYNC_HALF_LINE_SHIFT ,VSYNC_HALF_LINE_MASK ); -mtk_dpi_mask (dpi, porch_addr, - sync->back_porch <<VSYNC_BACK_PORCH_SHIFT , -VSYNC_BACK_PORCH_MASK ); -mtk_dpi_mask (dpi, porch_addr, - sync->front_porch <<VSYNC_FRONT_PORCH_SHIFT , -VSYNC_FRONT_PORCH_MASK ); + +if (dpi->conf->is_dpintf) { +mtk_dpi_mask (dpi, width_addr, + sync->sync_width <<VSYNC_WIDTH_SHIFT , +DPINTF_VSYNC_WIDTH_MASK ); +mtk_dpi_mask (dpi, porch_addr, + sync->back_porch <<VSYNC_BACK_PORCH_SHIFT , +DPINTF_VSYNC_BACK_PORCH_MASK ); +mtk_dpi_mask (dpi, porch_addr, + sync->front_porch <<VSYNC_FRONT_PORCH_SHIFT , +DPINTF_VSYNC_FRONT_PORCH_MASK ); + }else { +mtk_dpi_mask (dpi, width_addr, + sync->sync_width <<VSYNC_WIDTH_SHIFT , +VSYNC_WIDTH_MASK ); +mtk_dpi_mask (dpi, porch_addr, + sync->back_porch <<VSYNC_BACK_PORCH_SHIFT , +VSYNC_BACK_PORCH_MASK ); +mtk_dpi_mask (dpi, porch_addr, + sync->front_porch <<VSYNC_FRONT_PORCH_SHIFT , +VSYNC_FRONT_PORCH_MASK ); + } } static void mtk_dpi_config_vsync_lodd(struct mtk_dpi *dpi,
@@ -210,13 +235,20 @@ static void mtk_dpi_config_pol(struct mtk_dpi *dpi, struct mtk_dpi_polarities *dpi_pol) {unsigned int pol; +unsigned int mask; - pol = (dpi_pol->ck_pol ==MTK_DPI_POLARITY_RISING ?0 :CK_POL ) | - (dpi_pol->de_pol ==MTK_DPI_POLARITY_RISING ?0 :DE_POL ) | - (dpi_pol->hsync_pol ==MTK_DPI_POLARITY_RISING ?0 :HSYNC_POL ) | + mask =HSYNC_POL |VSYNC_POL ; + pol = (dpi_pol->hsync_pol ==MTK_DPI_POLARITY_RISING ?0 :HSYNC_POL ) | (dpi_pol->vsync_pol ==MTK_DPI_POLARITY_RISING ?0 :VSYNC_POL ); -mtk_dpi_mask (dpi,DPI_OUTPUT_SETTING , pol, -CK_POL |DE_POL |HSYNC_POL |VSYNC_POL ); +if (!dpi->conf->is_dpintf) { + mask |=CK_POL |DE_POL ; + pol |= (dpi_pol->ck_pol ==MTK_DPI_POLARITY_RISING ? +0 :CK_POL ) | + (dpi_pol->de_pol ==MTK_DPI_POLARITY_RISING ? +0 :DE_POL ); + } + +mtk_dpi_mask (dpi,DPI_OUTPUT_SETTING , pol, mask); }static void mtk_dpi_config_3d (struct mtk_dpi *dpi,bool en_3d)
@@ -231,8 +263,13 @@ static void mtk_dpi_config_interface(struct mtk_dpi *dpi, bool inter)static void mtk_dpi_config_fb_size (struct mtk_dpi *dpi,u32 width,u32 height) { -mtk_dpi_mask (dpi,DPI_SIZE , width <<HSIZE ,HSIZE_MASK ); -mtk_dpi_mask (dpi,DPI_SIZE , height <<VSIZE ,VSIZE_MASK ); +if (dpi->conf->is_dpintf) { +mtk_dpi_mask (dpi,DPI_SIZE , width <<HSIZE ,DPINTF_HSIZE_MASK ); +mtk_dpi_mask (dpi,DPI_SIZE , height <<VSIZE ,DPINTF_VSIZE_MASK ); + }else { +mtk_dpi_mask (dpi,DPI_SIZE , width <<HSIZE ,HSIZE_MASK ); +mtk_dpi_mask (dpi,DPI_SIZE , height <<VSIZE ,VSIZE_MASK ); + } } static void mtk_dpi_config_channel_limit(struct mtk_dpi *dpi,
@@ -332,12 +369,21 @@ static void mtk_dpi_config_channel_swap(struct mtk_dpi *dpi,break ; } -mtk_dpi_mask (dpi,DPI_OUTPUT_SETTING , val <<CH_SWAP ,CH_SWAP_MASK ); +if (dpi->conf->is_dpintf) +mtk_dpi_mask (dpi,DPI_OUTPUT_SETTING , val <<DPINTF_CH_SWAP , +DPINTF_CH_SWAP_MASK ); +else +mtk_dpi_mask (dpi,DPI_OUTPUT_SETTING , val <<CH_SWAP , +CH_SWAP_MASK ); }static void mtk_dpi_config_yuv422_enable (struct mtk_dpi *dpi,bool enable) { -mtk_dpi_mask (dpi,DPI_CON , enable ?YUV422_EN :0 ,YUV422_EN ); +if (dpi->conf->is_dpintf) +mtk_dpi_mask (dpi,DPI_CON , enable ?DPINTF_YUV422_EN :0 , +DPINTF_YUV422_EN ); +else +mtk_dpi_mask (dpi,DPI_CON , enable ?YUV422_EN :0 ,YUV422_EN ); }static void mtk_dpi_config_csc_enable (struct mtk_dpi *dpi,bool enable)
@@ -367,19 +413,25 @@ static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,if ((format ==MTK_DPI_COLOR_FORMAT_YCBCR_444 ) || (format ==MTK_DPI_COLOR_FORMAT_YCBCR_444_FULL )) {mtk_dpi_config_yuv422_enable (dpi, false); -mtk_dpi_config_csc_enable (dpi, true); -mtk_dpi_config_swap_input (dpi, false); +if (!dpi->conf->is_dpintf) { +mtk_dpi_config_csc_enable (dpi, true); +mtk_dpi_config_swap_input (dpi, false); + }mtk_dpi_config_channel_swap (dpi,MTK_DPI_OUT_CHANNEL_SWAP_BGR ); }else if ((format ==MTK_DPI_COLOR_FORMAT_YCBCR_422 ) || (format ==MTK_DPI_COLOR_FORMAT_YCBCR_422_FULL )) {mtk_dpi_config_yuv422_enable (dpi, true); -mtk_dpi_config_csc_enable (dpi, true); -mtk_dpi_config_swap_input (dpi, true); +if (!dpi->conf->is_dpintf) { +mtk_dpi_config_csc_enable (dpi, true); +mtk_dpi_config_swap_input (dpi, true); + }mtk_dpi_config_channel_swap (dpi,MTK_DPI_OUT_CHANNEL_SWAP_RGB ); }else {mtk_dpi_config_yuv422_enable (dpi, false); -mtk_dpi_config_csc_enable (dpi, false); -mtk_dpi_config_swap_input (dpi, false); +if (!dpi->conf->is_dpintf) { +mtk_dpi_config_csc_enable (dpi, false); +mtk_dpi_config_swap_input (dpi, false); + }mtk_dpi_config_channel_swap (dpi,MTK_DPI_OUT_CHANNEL_SWAP_RGB ); } }
@@ -410,6 +462,8 @@ static void mtk_dpi_power_off(struct mtk_dpi *dpi)pinctrl_select_state (dpi->pinctrl, dpi->pins_gpio);mtk_dpi_disable (dpi); +clk_disable_unprepare (dpi->hf_fdp_clk); +clk_disable_unprepare (dpi->hf_fmm_clk);clk_disable_unprepare (dpi->pixel_clk);clk_disable_unprepare (dpi->engine_clk); }
@@ -433,12 +487,28 @@ static int mtk_dpi_power_on(struct mtk_dpi *dpi) goto err_pixel; } + ret =clk_prepare_enable (dpi->hf_fmm_clk); +if (ret) { +dev_err (dpi->dev,"Failed to enable hf_fmm clock: %d\n" , ret); + goto err_hf_fmm; + } + + ret =clk_prepare_enable (dpi->hf_fdp_clk); +if (ret) { +dev_err (dpi->dev,"Failed to enable hf_fdp clock: %d\n" , ret); + goto err_hf_fdp; + } +if (dpi->pinctrl && dpi->pins_dpi)pinctrl_select_state (dpi->pinctrl, dpi->pins_dpi);mtk_dpi_enable (dpi);return 0 ; +err_hf_fdp: +clk_disable_unprepare (dpi->hf_fmm_clk); +err_hf_fmm: +clk_disable_unprepare (dpi->pixel_clk); err_pixel:clk_disable_unprepare (dpi->engine_clk); err_refcount:
@@ -472,22 +542,30 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi, pll_rate =clk_get_rate (dpi->tvd_clk); vm.pixelclock = pll_rate / factor; -if ((dpi->output_fmt ==MEDIA_BUS_FMT_RGB888_2X12_LE ) || - (dpi->output_fmt ==MEDIA_BUS_FMT_RGB888_2X12_BE )) +if (dpi->conf->is_dpintf) +clk_set_rate (dpi->pixel_clk, vm.pixelclock /4 ); +else if ((dpi->output_fmt ==MEDIA_BUS_FMT_RGB888_2X12_LE ) || + (dpi->output_fmt ==MEDIA_BUS_FMT_RGB888_2X12_BE ))clk_set_rate (dpi->pixel_clk, vm.pixelclock *2 );else clk_set_rate (dpi->pixel_clk, vm.pixelclock); - vm.pixelclock =clk_get_rate (dpi->pixel_clk);dev_dbg (dpi->dev,"Got PLL %lu Hz, pixel clock %lu Hz\n" , pll_rate, vm.pixelclock); - limit.c_bottom =0x0010 ; - limit.c_top =0x0FE0 ; - limit.y_bottom =0x0010 ; - limit.y_top =0x0FE0 ; +if (dpi->conf->is_dpintf) { + limit.c_bottom =0x0000 ; + limit.c_top =0xFFF ; + limit.y_bottom =0x0000 ; + limit.y_top =0xFFF ; + }else { + limit.c_bottom =0x0010 ; + limit.c_top =0x0FE0 ; + limit.y_bottom =0x0010 ; + limit.y_top =0x0FE0 ; + } dpi_pol.ck_pol =MTK_DPI_POLARITY_FALLING ; dpi_pol.de_pol =MTK_DPI_POLARITY_RISING ;
@@ -495,9 +573,15 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi, MTK_DPI_POLARITY_FALLING :MTK_DPI_POLARITY_RISING ; dpi_pol.vsync_pol = vm.flags &DISPLAY_FLAGS_VSYNC_HIGH ?MTK_DPI_POLARITY_FALLING :MTK_DPI_POLARITY_RISING ; - hsync.sync_width = vm.hsync_len; - hsync.back_porch = vm.hback_porch; - hsync.front_porch = vm.hfront_porch; +if (dpi->conf->is_dpintf) { + hsync.sync_width = vm.hsync_len /4 ; + hsync.back_porch = vm.hback_porch /4 ; + hsync.front_porch = vm.hfront_porch /4 ; + }else { + hsync.sync_width = vm.hsync_len; + hsync.back_porch = vm.hback_porch; + hsync.front_porch = vm.hfront_porch; + } hsync.shift_half_line = false; vsync_lodd.sync_width = vm.vsync_len; vsync_lodd.back_porch = vm.vback_porch;
@@ -539,11 +623,16 @@ static int mtk_dpi_set_display_mode(struct mtk_dpi *dpi,mtk_dpi_config_channel_limit (dpi, &limit);mtk_dpi_config_bit_num (dpi, dpi->bit_num);mtk_dpi_config_channel_swap (dpi, dpi->channel_swap); -mtk_dpi_config_yc_map (dpi, dpi->yc_map);mtk_dpi_config_color_format (dpi, dpi->color_format); -mtk_dpi_config_2n_h_fre (dpi); -mtk_dpi_dual_edge (dpi); -mtk_dpi_config_disable_edge (dpi); +if (dpi->conf->is_dpintf) { +mtk_dpi_mask (dpi,DPI_CON ,DPINTF_INPUT_2P_EN , +DPINTF_INPUT_2P_EN ); + }else { +mtk_dpi_config_yc_map (dpi, dpi->yc_map); +mtk_dpi_config_2n_h_fre (dpi); +mtk_dpi_dual_edge (dpi); +mtk_dpi_config_disable_edge (dpi); + }mtk_dpi_sw_reset (dpi, false);return 0 ;
@@ -687,6 +776,17 @@ static const struct drm_bridge_funcs mtk_dpi_bridge_funcs = { .atomic_reset = drm_atomic_helper_bridge_reset, }; +static const struct drm_bridge_funcs mtk_dpintf_bridge_funcs = { + .attach = mtk_dpi_bridge_attach, + .mode_set = mtk_dpi_bridge_mode_set, + .disable = mtk_dpi_bridge_disable, + .enable = mtk_dpi_bridge_enable, + .atomic_check = mtk_dpi_bridge_atomic_check, + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, +}; +void mtk_dpi_start (struct device *dev) {struct mtk_dpi *dpi =dev_get_drvdata (dev);
@@ -781,6 +881,16 @@ static unsigned int mt8183_calculate_factor(int clock)return 2 ; } +static unsigned int mt8195_dpintf_calculate_factor (int clock) +{ +if (clock <70000 ) +return 4 ; +else if (clock <200000 ) +return 2 ; +else +return 1 ; +} +static const u32 mt8173_output_fmts[] = {MEDIA_BUS_FMT_RGB888_1X24 , };
@@ -796,6 +906,7 @@ static const struct mtk_dpi_conf mt8173_conf = { .max_clock_khz = 300000, .output_fmts = mt8173_output_fmts, .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), + .is_dpintf = false, };static const struct mtk_dpi_conf mt2701_conf = {
@@ -805,6 +916,7 @@ static const struct mtk_dpi_conf mt2701_conf = { .max_clock_khz = 150000, .output_fmts = mt8173_output_fmts, .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), + .is_dpintf = false, };static const struct mtk_dpi_conf mt8183_conf = {
@@ -813,6 +925,7 @@ static const struct mtk_dpi_conf mt8183_conf = { .max_clock_khz = 100000, .output_fmts = mt8183_output_fmts, .num_output_fmts = ARRAY_SIZE(mt8183_output_fmts), + .is_dpintf = false, };static const struct mtk_dpi_conf mt8192_conf = {
@@ -821,6 +934,12 @@ static const struct mtk_dpi_conf mt8192_conf = { .max_clock_khz = 150000, .output_fmts = mt8173_output_fmts, .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), + .is_dpintf = false, +}; + +static const struct mtk_dpi_conf mt8195_dpintf_conf = { + .cal_factor = mt8195_dpintf_calculate_factor, + .is_dpintf = true, };static int mtk_dpi_probe (struct platform_device *pdev)
@@ -866,13 +985,16 @@ static int mtk_dpi_probe(struct platform_device *pdev)return ret; } - dpi->engine_clk =devm_clk_get (dev,"engine" ); -if (IS_ERR (dpi->engine_clk)) { - ret =PTR_ERR (dpi->engine_clk); -if (ret != -EPROBE_DEFER ) -dev_err (dev,"Failed to get engine clock: %d\n" , ret); +if (!dpi->conf->is_dpintf) { + dpi->engine_clk =devm_clk_get (dev,"engine" ); +if (IS_ERR (dpi->engine_clk)) { + ret =PTR_ERR (dpi->engine_clk); +if (ret != -EPROBE_DEFER ) +dev_err (dev,"Failed to get engine clock: %d\n" , + ret); -return ret; +return ret; + } } dpi->pixel_clk =devm_clk_get (dev,"pixel" );
@@ -893,6 +1015,24 @@ static int mtk_dpi_probe(struct platform_device *pdev)return ret; } + dpi->hf_fmm_clk =devm_clk_get_optional (dev,"hf_fmm" ); +if (IS_ERR (dpi->hf_fmm_clk)) { + ret =PTR_ERR (dpi->hf_fmm_clk); +if (ret != -EPROBE_DEFER ) +dev_err (dev,"Failed to get hf_fmm clock: %d\n" , ret); + +return ret; + } + + dpi->hf_fdp_clk =devm_clk_get_optional (dev,"hf_fdp" ); +if (IS_ERR (dpi->hf_fdp_clk)) { + ret =PTR_ERR (dpi->hf_fdp_clk); +if (ret != -EPROBE_DEFER ) +dev_err (dev,"Failed to get hf_fdp clock: %d\n" , ret); + +return ret; + } + dpi->irq =platform_get_irq (pdev,0 );if (dpi->irq <=0 )return -EINVAL ;
@@ -906,7 +1046,10 @@ static int mtk_dpi_probe(struct platform_device *pdev)platform_set_drvdata (pdev, dpi); - dpi->bridge.funcs = &mtk_dpi_bridge_funcs; +if (dpi->conf->is_dpintf) + dpi->bridge.funcs = &mtk_dpintf_bridge_funcs; +else + dpi->bridge.funcs = &mtk_dpi_bridge_funcs; dpi->bridge.of_node = dev->of_node; dpi->bridge.type =DRM_MODE_CONNECTOR_DPI ;
@@ -945,6 +1088,9 @@ static const struct of_device_id mtk_dpi_of_ids[] = { { .compatible = "mediatek,mt8192-dpi", .data = &mt8192_conf, }, + { .compatible = "mediatek,mt8195-dpintf", + .data = &mt8195_dpintf_conf, + }, { }, };MODULE_DEVICE_TABLE (of, mtk_dpi_of_ids);
drivers/gpu/drm/mediatek/mtk_dpi_regs.h +12 -0
@@ -40,10 +40,14 @@#define FAKE_DE_LEVEN BIT(21)#define FAKE_DE_RODD BIT(22)#define FAKE_DE_REVEN BIT(23) +#define DPINTF_YUV422_EN BIT(24) +#define DPINTF_INPUT_2P_EN BIT(29)#define DPI_OUTPUT_SETTING 0x14#define CH_SWAP 0 +#define DPINTF_CH_SWAP BIT(1)#define CH_SWAP_MASK (0x7 << 0) +#define DPINTF_CH_SWAP_MASK (0x7 << 1)#define SWAP_RGB 0x00#define SWAP_GBR 0x01#define SWAP_BRG 0x02
@@ -80,8 +84,10 @@#define DPI_SIZE 0x18#define HSIZE 0#define HSIZE_MASK (0x1FFF << 0) +#define DPINTF_HSIZE_MASK (0xFFFF << 0)#define VSIZE 16#define VSIZE_MASK (0x1FFF << 16) +#define DPINTF_VSIZE_MASK (0xFFFF << 16)#define DPI_DDR_SETTING 0x1C#define DDR_EN BIT(0)
@@ -93,24 +99,30 @@#define DPI_TGEN_HWIDTH 0x20#define HPW 0#define HPW_MASK (0xFFF << 0) +#define DPINTF_HPW_MASK (0xFFFF << 0)#define DPI_TGEN_HPORCH 0x24#define HBP 0#define HBP_MASK (0xFFF << 0) +#define DPINTF_HBP_MASK (0xFFFF << 0)#define HFP 16#define HFP_MASK (0xFFF << 16) +#define DPINTF_HFP_MASK (0xFFFF << 16)#define DPI_TGEN_VWIDTH 0x28#define DPI_TGEN_VPORCH 0x2C#define VSYNC_WIDTH_SHIFT 0#define VSYNC_WIDTH_MASK (0xFFF << 0) +#define DPINTF_VSYNC_WIDTH_MASK (0xFFFF << 0)#define VSYNC_HALF_LINE_SHIFT 16#define VSYNC_HALF_LINE_MASK BIT(16)#define VSYNC_BACK_PORCH_SHIFT 0#define VSYNC_BACK_PORCH_MASK (0xFFF << 0) +#define DPINTF_VSYNC_BACK_PORCH_MASK (0xFFFF << 0)#define VSYNC_FRONT_PORCH_SHIFT 16#define VSYNC_FRONT_PORCH_MASK (0xFFF << 16) +#define DPINTF_VSYNC_FRONT_PORCH_MASK (0xFFFF << 16)#define DPI_BG_HCNTL 0x30#define BG_RIGHT (0x1FFF << 0)
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c +4 -0
@@ -317,6 +317,7 @@ static const char * const mtk_ddp_comp_stem[MTK_DDP_COMP_TYPE_MAX] = { [MTK_DISP_UFOE] = "ufoe", [MTK_DSI] = "dsi", [MTK_DPI] = "dpi", + [MTK_DP_INTF] = "dp-intf", [MTK_DISP_PWM] = "pwm", [MTK_DISP_MUTEX] = "mutex", [MTK_DISP_OD] = "od",
@@ -339,6 +340,8 @@ static const struct mtk_ddp_comp_match mtk_ddp_matches[DDP_COMPONENT_ID_MAX] = { [DDP_COMPONENT_DITHER] = { MTK_DISP_DITHER, 0, &ddp_dither }, [DDP_COMPONENT_DPI0] = { MTK_DPI, 0, &ddp_dpi }, [DDP_COMPONENT_DPI1] = { MTK_DPI, 1, &ddp_dpi }, + [DDP_COMPONENT_DP_INTF0]= { MTK_DP_INTF, 0, &ddp_dpi }, + [DDP_COMPONENT_DP_INTF1]= { MTK_DP_INTF, 1, &ddp_dpi }, [DDP_COMPONENT_DSI0] = { MTK_DSI, 0, &ddp_dsi }, [DDP_COMPONENT_DSI1] = { MTK_DSI, 1, &ddp_dsi }, [DDP_COMPONENT_DSI2] = { MTK_DSI, 2, &ddp_dsi },
@@ -476,6 +479,7 @@ int mtk_ddp_comp_init(struct device_node *node, struct mtk_ddp_comp *comp, type ==MTK_DISP_COLOR || type ==MTK_DISP_GAMMA || type ==MTK_DPI || + type ==MTK_DP_INTF || type ==MTK_DSI || type ==MTK_DISP_OVL || type == MTK_DISP_OVL_2L ||
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h +1 -0
@@ -30,6 +30,7 @@ enum mtk_ddp_comp_type {MTK_DISP_UFOE ,MTK_DSI ,MTK_DPI , +MTK_DP_INTF ,MTK_DISP_PWM ,MTK_DISP_MUTEX , MTK_DISP_OD,
drivers/gpu/drm/mediatek/mtk_drm_drv.c +4 -1
@@ -459,6 +459,8 @@ static const struct of_device_id mtk_ddp_comp_dt_ids[] = { .data = (void *)MTK_DPI }, { .compatible = "mediatek,mt8183-dpi", .data = (void *)MTK_DPI }, + { .compatible = "mediatek,mt8195-dpintf", + .data = (void *)MTK_DP_INTF }, { .compatible = "mediatek,mt2701-disp-mutex", .data = (void *)MTK_DISP_MUTEX }, { .compatible = "mediatek,mt2712-disp-mutex",
@@ -569,7 +571,8 @@ static int mtk_drm_probe(struct platform_device *pdev) comp_type == MTK_DISP_OVL_2L || comp_type == MTK_DISP_RDMA || comp_type == MTK_DSI || - comp_type == MTK_DPI) { + comp_type == MTK_DPI || + comp_type == MTK_DP_INTF) {dev_info (dev,"Adding component match for %pOF\n" , node); drm_of_component_match_add(dev, &match, compare_of,
include/linux/soc/mediatek/mtk-mmsys.h +2 -0
@@ -19,6 +19,8 @@ enum mtk_ddp_comp_id {DDP_COMPONENT_DITHER ,DDP_COMPONENT_DPI0 ,DDP_COMPONENT_DPI1 , +DDP_COMPONENT_DP_INTF0 , +DDP_COMPONENT_DP_INTF1 ,DDP_COMPONENT_DSI0 ,DDP_COMPONENT_DSI1 , DDP_COMPONENT_DSI2,
Signature · 1 line
2.33.0
PATCH v4 6/7 phy: phy-mtk-dp: Add driver for DP phy
In reply to Markus Schneider-PargmannThis is a new driver that supports the integrated DisplayPort phy for mediatek SoCs, especially the mt8195. The phy is integrated into the DisplayPort controller and will be created by the mtk-dp driver. This driver expects a struct regmap to be able to work on the same registers as the DisplayPort controller. It sets the device data to be the struct phy so that the DisplayPort controller can easily work with it.
The driver does not have any devicetree bindings because the datasheet does not list the controller and the phy as distinct units.
The interaction with the controller can be covered by the configure callback of the phy framework and its displayport parameters.
---
Notes:
Changes v3 -> v4:
- Split DP controller driver and phy driver into separate patches.
- Add entry to MAINTAINERS for this phy driver
MAINTAINERS | 1 + drivers/phy/mediatek/Kconfig | 8 ++ drivers/phy/mediatek/Makefile | 1 + drivers/phy/mediatek/phy-mtk-dp.c | 218 ++++++++++++++++++++++++++++++ 4 files changed, 228 insertions(+) create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c
MAINTAINERS +1 -0
@@ -6276,6 +6276,7 @@ L: [email protected] (moderated for non-subscribers) S: Supported F: Documentation/devicetree/bindings/display/mediatek/ F: drivers/gpu/drm/mediatek/ +F: drivers/phy/mediatek/phy-mtk-dp.c F: drivers/phy/mediatek/phy-mtk-hdmi* F: drivers/phy/mediatek/phy-mtk-mipi*
drivers/phy/mediatek/Kconfig +8 -0
@@ -55,3 +55,11 @@ config PHY_MTK_MIPI_DSI select GENERIC_PHY help Support MIPI DSI for Mediatek SoCs. + +config PHY_MTK_DP + tristate "MediaTek DP-PHY Driver" + depends on ARCH_MEDIATEK || COMPILE_TEST + depends on OF + select GENERIC_PHY + help + Support DisplayPort PHY for Mediatek SoCs.
drivers/phy/mediatek/Makefile +1 -0
@@ -3,6 +3,7 @@ # Makefile for the phy drivers. # +obj-$(CONFIG_PHY_MTK_DP) += phy-mtk-dp.o obj-$(CONFIG_PHY_MTK_TPHY) += phy-mtk-tphy.o obj-$(CONFIG_PHY_MTK_UFS) += phy-mtk-ufs.o obj-$(CONFIG_PHY_MTK_XSPHY) += phy-mtk-xsphy.o
drivers/phy/mediatek/phy-mtk-dp.c new file +218 -0
218 lines not on this page · raw message
Signature · 1 line
2.33.0
PATCH v4 7/7 drm/mediatek: Add mt8195 DisplayPort driver
In reply to Markus Schneider-PargmannThis patch adds a DisplayPort driver for the Mediatek mt8195 SoC and a according phy driver mediatek-dp-phy.
It supports both functional units on the mt8195, the embedded DisplayPort as well as the external DisplayPort units. It offers hot-plug-detection, audio up to 8 channels, and DisplayPort 1.4 with up to 4 lanes.
The driver creates a child device for the phy. The child device will never exist without the parent being active. As they are sharing a register range, the parent passes a regmap pointer to the child so that both can work with the same register range. The phy driver sets device data that is read by the parent to get the phy device that can be used to control the phy properties.
This driver is based on an initial version by
Jason-JH.Lin <[email protected]>.
---
Notes:
Changes v2 -> v3:
- Solve TODOs and add defines for undescribed registers
- Remove TODOs that were irrelevant
Changes v1 -> v2:
- Fix checkpatch --strict suggestions
- General cleanups of the code.
- Remove all remaining non-atomic functions.
- Remove unused includes and sort them.
- Remove unused select GENERIC_PHY
- Rename phy registers DP_PHY -> MTK_DP_PHY
- Replace usage of delays with usleep_range.
- Split the phy register accesses into a separate phy driver.
- Use a lock to guard access to mtk_dp->edid as it can be allocated/used/freed in different threads
- use struct dp_sdp for sdp packets.
Changes RFC -> v1:
- Removed unused register definitions.
- Replaced workqueue with threaded irq.
- Removed connector code.
- Move to atomic_* drm functions.
- General cleanups of the code.
- Remove unused select GENERIC_PHY.
drivers/gpu/drm/mediatek/Kconfig | 7 + drivers/gpu/drm/mediatek/Makefile | 2 + drivers/gpu/drm/mediatek/mtk_dp.c | 2825 ++++++++++++++++++++++++ drivers/gpu/drm/mediatek/mtk_dp_reg.h | 535 +++++ drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + drivers/gpu/drm/mediatek/mtk_drm_drv.h | 1 + 6 files changed, 3371 insertions(+) create mode 100644 drivers/gpu/drm/mediatek/mtk_dp.c create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_reg.h
drivers/gpu/drm/mediatek/Kconfig +7 -0
@@ -28,3 +28,10 @@ config DRM_MEDIATEK_HDMI select PHY_MTK_HDMI help DRM/KMS HDMI driver for Mediatek SoCs + +config MTK_DPTX_SUPPORT + tristate "DRM DPTX Support for Mediatek SoCs" + depends on DRM_MEDIATEK + select PHY_MTK_DP + help + DRM/KMS Display Port driver for Mediatek SoCs.
drivers/gpu/drm/mediatek/Makefile +2 -0
@@ -21,3 +21,5 @@ mediatek-drm-hdmi-objs := mtk_cec.o \ mtk_hdmi_ddc.o obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mediatek-drm-hdmi.o + +obj-$(CONFIG_MTK_DPTX_SUPPORT) += mtk_dp.o
drivers/gpu/drm/mediatek/mtk_dp.c new file +2825 -0
2,825 lines not on this page · raw message
drivers/gpu/drm/mediatek/mtk_dp_reg.h new file +535 -0
160 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.33.0
Part of the diff is not shown here. View the raw message.
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Markus,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on pza/reset/next linus/master v5.15-rc5 next-20211011] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Markus-Schneider-Pargmann/drm-mediatek-Add-mt8195-DisplayPort-driver/20211011-174743 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arm64-randconfig-r005-20211011 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project f95d9c95bbf4cf662b9a181245fc6dcede39f590)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/dbbfbf0abd862cfc9b617b8a770a10a18d0183a9
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Markus-Schneider-Pargmann/drm-mediatek-Add-mt8195-DisplayPort-driver/20211011-174743 git checkout dbbfbf0abd862cfc9b617b8a770a10a18d0183a9
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: mtk_dp_driver >>> referenced by mtk_drm_drv.c >>> gpu/drm/mediatek/mtk_drm_drv.o:(mtk_drm_drivers) in archive drivers/built-in.a >>> did you mean: mtk_dpi_driver >>> defined in: drivers/built-in.a(gpu/drm/mediatek/mtk_dpi.o)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Markus,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on pza/reset/next linus/master v5.15-rc5 next-20211011] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Markus-Schneider-Pargmann/drm-mediatek-Add-mt8195-DisplayPort-driver/20211011-174743 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arm64-randconfig-r025-20211011 (attached as .config) compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/dbbfbf0abd862cfc9b617b8a770a10a18d0183a9
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Markus-Schneider-Pargmann/drm-mediatek-Add-mt8195-DisplayPort-driver/20211011-174743 git checkout dbbfbf0abd862cfc9b617b8a770a10a18d0183a9
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
aarch64-linux-ld: Unexpected GOT/PLT entries detected!
aarch64-linux-ld: Unexpected run-time procedure linkages detected!
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_set_suspend':
drm_fb_helper.c:(.text+0x25c): undefined reference to `fb_set_suspend'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_resume_worker':
drm_fb_helper.c:(.text+0x28c): undefined reference to `fb_set_suspend'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_unregister_fbi':
drm_fb_helper.c:(.text+0x2b4): undefined reference to `unregister_framebuffer'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_sys_read':
drm_fb_helper.c:(.text+0x2cc): undefined reference to `fb_sys_read'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_fini':
drm_fb_helper.c:(.text+0xde4): undefined reference to `framebuffer_release'
aarch64-linux-ld: drm_fb_helper.c:(.text+0xe58): undefined reference to `fb_dealloc_cmap'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_alloc_fbi':
drm_fb_helper.c:(.text+0xfa4): undefined reference to `framebuffer_alloc'
aarch64-linux-ld: drm_fb_helper.c:(.text+0xfc0): undefined reference to `fb_alloc_cmap'
aarch64-linux-ld: drm_fb_helper.c:(.text+0xfd0): undefined reference to `framebuffer_release'
aarch64-linux-ld: drm_fb_helper.c:(.text+0x1034): undefined reference to `fb_dealloc_cmap'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `__drm_fb_helper_initial_config_and_unlock':
drm_fb_helper.c:(.text+0x10d8): undefined reference to `register_framebuffer'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_generic_probe':
drm_fb_helper.c:(.text+0x175c): undefined reference to `fb_deferred_io_init'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_set_suspend_unlocked':
drm_fb_helper.c:(.text+0x1868): undefined reference to `fb_set_suspend'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fbdev_cleanup':
drm_fb_helper.c:(.text+0x1b30): undefined reference to `fb_deferred_io_cleanup'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fbdev_client_unregister':
drm_fb_helper.c:(.text+0x1bd4): undefined reference to `unregister_framebuffer'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_cfb_imageblit':
drm_fb_helper.c:(.text+0x2aa8): undefined reference to `cfb_imageblit'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_cfb_copyarea':
drm_fb_helper.c:(.text+0x2ae4): undefined reference to `cfb_copyarea'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_cfb_fillrect':
drm_fb_helper.c:(.text+0x2b18): undefined reference to `cfb_fillrect'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_sys_imageblit':
drm_fb_helper.c:(.text+0x2b54): undefined reference to `sys_imageblit'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_sys_copyarea':
drm_fb_helper.c:(.text+0x2b88): undefined reference to `sys_copyarea'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_sys_fillrect':
drm_fb_helper.c:(.text+0x2bc4): undefined reference to `sys_fillrect'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_sys_write':
drm_fb_helper.c:(.text+0x2bf4): undefined reference to `fb_sys_write'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fbdev_fb_copyarea':
drm_fb_helper.c:(.text+0x2cfc): undefined reference to `cfb_copyarea'
aarch64-linux-ld: drm_fb_helper.c:(.text+0x2d1c): undefined reference to `sys_copyarea'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fbdev_fb_fillrect':
drm_fb_helper.c:(.text+0x2d6c): undefined reference to `cfb_fillrect'
aarch64-linux-ld: drm_fb_helper.c:(.text+0x2d8c): undefined reference to `sys_fillrect'
aarch64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fbdev_fb_imageblit':
drm_fb_helper.c:(.text+0x2ddc): undefined reference to `cfb_imageblit'
aarch64-linux-ld: drm_fb_helper.c:(.text+0x2dfc): undefined reference to `sys_imageblit'
aarch64-linux-ld: drivers/gpu/drm/vmwgfx/vmwgfx_fb.o: in function `vmw_fb_imageblit':
vmwgfx_fb.c:(.text+0x684): undefined reference to `cfb_imageblit'
aarch64-linux-ld: drivers/gpu/drm/vmwgfx/vmwgfx_fb.o: in function `vmw_fb_copyarea':
vmwgfx_fb.c:(.text+0x6b8): undefined reference to `cfb_copyarea'
aarch64-linux-ld: drivers/gpu/drm/vmwgfx/vmwgfx_fb.o: in function `vmw_fb_fillrect':
vmwgfx_fb.c:(.text+0x6f4): undefined reference to `cfb_fillrect'
aarch64-linux-ld: drivers/gpu/drm/vmwgfx/vmwgfx_fb.o: in function `vmw_fb_init':
vmwgfx_fb.c:(.text+0xdfc): undefined reference to `framebuffer_alloc'
aarch64-linux-ld: vmwgfx_fb.c:(.text+0xe8c): undefined reference to `framebuffer_release'
aarch64-linux-ld: vmwgfx_fb.c:(.text+0xffc): undefined reference to `fb_deferred_io_init'
aarch64-linux-ld: vmwgfx_fb.c:(.text+0x1004): undefined reference to `register_framebuffer'
aarch64-linux-ld: vmwgfx_fb.c:(.text+0x1040): undefined reference to `fb_deferred_io_cleanup'
aarch64-linux-ld: drivers/gpu/drm/vmwgfx/vmwgfx_fb.o: in function `vmw_fb_close':
vmwgfx_fb.c:(.text+0x1080): undefined reference to `fb_deferred_io_cleanup'
aarch64-linux-ld: vmwgfx_fb.c:(.text+0x1094): undefined reference to `unregister_framebuffer'
aarch64-linux-ld: vmwgfx_fb.c:(.text+0x10c0): undefined reference to `framebuffer_release'
>> aarch64-linux-ld: drivers/gpu/drm/mediatek/mtk_drm_drv.o:(.rodata+0x38): undefined reference to `mtk_dp_driver'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Markus,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on pza/reset/next linus/master v5.15-rc5 next-20211011] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Markus-Schneider-Pargmann/drm-mediatek-Add-mt8195-DisplayPort-driver/20211011-174743 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arm-allyesconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/dbbfbf0abd862cfc9b617b8a770a10a18d0183a9
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Markus-Schneider-Pargmann/drm-mediatek-Add-mt8195-DisplayPort-driver/20211011-174743 git checkout dbbfbf0abd862cfc9b617b8a770a10a18d0183a9
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/mediatek/mtk_dp.c:1031:6: error: no previous prototype for 'mtk_dp_initialize_settings' [-Werror=missing-prototypes]
1031 | void mtk_dp_initialize_settings(struct mtk_dp *mtk_dp)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/device.h:15,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from include/drm/drm_crtc.h:28,
from include/drm/drm_atomic_helper.h:31,
from drivers/gpu/drm/mediatek/mtk_dp.c:7:
drivers/gpu/drm/mediatek/mtk_dp.c: In function 'mtk_dp_hpd_sink_event':
>> include/drm/drm_print.h:412:39: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} [-Werror=format=]
412 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
| ^~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:150:58: note: in expansion of macro 'dev_fmt'
150 | dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
include/drm/drm_print.h:412:9: note: in expansion of macro 'dev_info'
412 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
| ^~~~
include/drm/drm_print.h:416:9: note: in expansion of macro '__drm_printk'
416 | __drm_printk((drm), info,, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~
drivers/gpu/drm/mediatek/mtk_dp.c:1445:17: note: in expansion of macro 'drm_info'
1445 | drm_info(mtk_dp->drm_dev,
| ^~~~~~~~
>> include/drm/drm_print.h:412:39: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} [-Werror=format=]
412 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
| ^~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:150:58: note: in expansion of macro 'dev_fmt'
150 | dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
include/drm/drm_print.h:412:9: note: in expansion of macro 'dev_info'
412 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
| ^~~~
include/drm/drm_print.h:416:9: note: in expansion of macro '__drm_printk'
416 | __drm_printk((drm), info,, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~
drivers/gpu/drm/mediatek/mtk_dp.c:1452:17: note: in expansion of macro 'drm_info'
1452 | drm_info(mtk_dp->drm_dev,
| ^~~~~~~~
>> include/drm/drm_print.h:412:39: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t' {aka 'int'} [-Werror=format=]
412 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
| ^~~~~~~~
include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
110 | _p_func(dev, fmt, ##__VA_ARGS__); \
| ^~~
include/linux/dev_printk.h:150:58: note: in expansion of macro 'dev_fmt'
150 | dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~
include/drm/drm_print.h:412:9: note: in expansion of macro 'dev_info'
412 | dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
| ^~~~
include/drm/drm_print.h:416:9: note: in expansion of macro '__drm_printk'
416 | __drm_printk((drm), info,, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~~
drivers/gpu/drm/mediatek/mtk_dp.c:1460:17: note: in expansion of macro 'drm_info'
1460 | drm_info(mtk_dp->drm_dev, "Read link status failed: %ld\n",
| ^~~~~~~~cc1: all warnings being treated as errors
vim +/mtk_dp_initialize_settings +1031 drivers/gpu/drm/mediatek/mtk_dp.c
1030
> 1031 void mtk_dp_initialize_settings(struct mtk_dp *mtk_dp)
1032 {
1033 mtk_dp_update_bits(mtk_dp, MTK_DP_TRANS_P0_342C,
1034 XTAL_FREQ_DP_TRANS_P0_DEFAULT,
1035 XTAL_FREQ_DP_TRANS_P0_MASK);
1036 mtk_dp_update_bits(mtk_dp, MTK_DP_TRANS_P0_3540,
1037 BIT(FEC_CLOCK_EN_MODE_DP_TRANS_P0_SHIFT),
1038 FEC_CLOCK_EN_MODE_DP_TRANS_P0_MASK);
1039 mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_31EC,
1040 BIT(AUDIO_CH_SRC_SEL_DP_ENC0_P0_SHIFT),
1041 AUDIO_CH_SRC_SEL_DP_ENC0_P0_MASK);
1042 mtk_dp_update_bits(mtk_dp, MTK_DP_ENC0_P0_304C, 0,
1043 SDP_VSYNC_RISING_MASK_DP_ENC0_P0_MASK);
1044 mtk_dp_update_bits(mtk_dp, MTK_DP_TOP_IRQ_MASK, IRQ_MASK_AUX_TOP_IRQ,
1045 IRQ_MASK_AUX_TOP_IRQ);
1046 }
1047
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org