Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'mediatek-drm-next-5.14' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next

Mediatek DRM Next for Linux 5.14

1. Add MT8167 HDMI support
2. Fix PM reference leak
3. Add MT8183 DPI dual edge support

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210616150301.292-1-chunkuang.hu@kernel.org

+384 -143
+52
Documentation/devicetree/bindings/display/mediatek/mediatek,cec.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/mediatek/mediatek,cec.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mediatek HDMI CEC Controller Device Tree Bindings 8 + 9 + maintainers: 10 + - CK Hu <ck.hu@mediatek.com> 11 + - Jitao shi <jitao.shi@mediatek.com> 12 + 13 + description: | 14 + The HDMI CEC controller handles hotplug detection and CEC communication. 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - mediatek,mt7623-cec 20 + - mediatek,mt8167-cec 21 + - mediatek,mt8173-cec 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + interrupts: 27 + maxItems: 1 28 + 29 + clocks: 30 + maxItems: 1 31 + 32 + required: 33 + - compatible 34 + - reg 35 + - interrupts 36 + - clocks 37 + 38 + additionalProperties: false 39 + 40 + examples: 41 + - | 42 + #include <dt-bindings/clock/mt8173-clk.h> 43 + #include <dt-bindings/interrupt-controller/arm-gic.h> 44 + #include <dt-bindings/interrupt-controller/irq.h> 45 + cec: cec@10013000 { 46 + compatible = "mediatek,mt8173-cec"; 47 + reg = <0x10013000 0xbc>; 48 + interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_LOW>; 49 + clocks = <&infracfg CLK_INFRA_CEC>; 50 + }; 51 + 52 + ...
+58
Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/mediatek/mediatek,hdmi-ddc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mediatek HDMI DDC Device Tree Bindings 8 + 9 + maintainers: 10 + - CK Hu <ck.hu@mediatek.com> 11 + - Jitao shi <jitao.shi@mediatek.com> 12 + 13 + description: | 14 + The HDMI DDC i2c controller is used to interface with the HDMI DDC pins. 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - mediatek,mt7623-hdmi-ddc 20 + - mediatek,mt8167-hdmi-ddc 21 + - mediatek,mt8173-hdmi-ddc 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + interrupts: 27 + maxItems: 1 28 + 29 + clocks: 30 + maxItems: 1 31 + 32 + clock-names: 33 + items: 34 + - const: ddc-i2c 35 + 36 + required: 37 + - compatible 38 + - reg 39 + - interrupts 40 + - clocks 41 + - clock-names 42 + 43 + additionalProperties: false 44 + 45 + examples: 46 + - | 47 + #include <dt-bindings/clock/mt8173-clk.h> 48 + #include <dt-bindings/interrupt-controller/arm-gic.h> 49 + #include <dt-bindings/interrupt-controller/irq.h> 50 + hdmi_ddc0: i2c@11012000 { 51 + compatible = "mediatek,mt8173-hdmi-ddc"; 52 + reg = <0x11012000 0x1c>; 53 + interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_LOW>; 54 + clocks = <&pericfg CLK_PERI_I2C5>; 55 + clock-names = "ddc-i2c"; 56 + }; 57 + 58 + ...
-136
Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.txt
··· 1 - Mediatek HDMI Encoder 2 - ===================== 3 - 4 - The Mediatek HDMI encoder can generate HDMI 1.4a or MHL 2.0 signals from 5 - its parallel input. 6 - 7 - Required properties: 8 - - compatible: Should be "mediatek,<chip>-hdmi". 9 - - the supported chips are mt2701, mt7623 and mt8173 10 - - reg: Physical base address and length of the controller's registers 11 - - interrupts: The interrupt signal from the function block. 12 - - clocks: device clocks 13 - See Documentation/devicetree/bindings/clock/clock-bindings.txt for details. 14 - - clock-names: must contain "pixel", "pll", "bclk", and "spdif". 15 - - phys: phandle link to the HDMI PHY node. 16 - See Documentation/devicetree/bindings/phy/phy-bindings.txt for details. 17 - - phy-names: must contain "hdmi" 18 - - mediatek,syscon-hdmi: phandle link and register offset to the system 19 - configuration registers. For mt8173 this must be offset 0x900 into the 20 - MMSYS_CONFIG region: <&mmsys 0x900>. 21 - - ports: A node containing input and output port nodes with endpoint 22 - definitions as documented in Documentation/devicetree/bindings/graph.txt. 23 - - port@0: The input port in the ports node should be connected to a DPI output 24 - port. 25 - - port@1: The output port in the ports node should be connected to the input 26 - port of a connector node that contains a ddc-i2c-bus property, or to the 27 - input port of an attached bridge chip, such as a SlimPort transmitter. 28 - 29 - HDMI CEC 30 - ======== 31 - 32 - The HDMI CEC controller handles hotplug detection and CEC communication. 33 - 34 - Required properties: 35 - - compatible: Should be "mediatek,<chip>-cec" 36 - - the supported chips are mt7623 and mt8173 37 - - reg: Physical base address and length of the controller's registers 38 - - interrupts: The interrupt signal from the function block. 39 - - clocks: device clock 40 - 41 - HDMI DDC 42 - ======== 43 - 44 - The HDMI DDC i2c controller is used to interface with the HDMI DDC pins. 45 - The Mediatek's I2C controller is used to interface with I2C devices. 46 - 47 - Required properties: 48 - - compatible: Should be "mediatek,<chip>-hdmi-ddc" 49 - - the supported chips are mt7623 and mt8173 50 - - reg: Physical base address and length of the controller's registers 51 - - clocks: device clock 52 - - clock-names: Should be "ddc-i2c". 53 - 54 - HDMI PHY 55 - ======== 56 - See phy/mediatek,hdmi-phy.yaml 57 - 58 - Example: 59 - 60 - cec: cec@10013000 { 61 - compatible = "mediatek,mt8173-cec"; 62 - reg = <0 0x10013000 0 0xbc>; 63 - interrupts = <GIC_SPI 167 IRQ_TYPE_LEVEL_LOW>; 64 - clocks = <&infracfg CLK_INFRA_CEC>; 65 - }; 66 - 67 - hdmi_phy: hdmi-phy@10209100 { 68 - compatible = "mediatek,mt8173-hdmi-phy"; 69 - reg = <0 0x10209100 0 0x24>; 70 - clocks = <&apmixedsys CLK_APMIXED_HDMI_REF>; 71 - clock-names = "pll_ref"; 72 - clock-output-names = "hdmitx_dig_cts"; 73 - mediatek,ibias = <0xa>; 74 - mediatek,ibias_up = <0x1c>; 75 - #clock-cells = <0>; 76 - #phy-cells = <0>; 77 - }; 78 - 79 - hdmi_ddc0: i2c@11012000 { 80 - compatible = "mediatek,mt8173-hdmi-ddc"; 81 - reg = <0 0x11012000 0 0x1c>; 82 - interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_LOW>; 83 - clocks = <&pericfg CLK_PERI_I2C5>; 84 - clock-names = "ddc-i2c"; 85 - }; 86 - 87 - hdmi0: hdmi@14025000 { 88 - compatible = "mediatek,mt8173-hdmi"; 89 - reg = <0 0x14025000 0 0x400>; 90 - interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_LOW>; 91 - clocks = <&mmsys CLK_MM_HDMI_PIXEL>, 92 - <&mmsys CLK_MM_HDMI_PLLCK>, 93 - <&mmsys CLK_MM_HDMI_AUDIO>, 94 - <&mmsys CLK_MM_HDMI_SPDIF>; 95 - clock-names = "pixel", "pll", "bclk", "spdif"; 96 - pinctrl-names = "default"; 97 - pinctrl-0 = <&hdmi_pin>; 98 - phys = <&hdmi_phy>; 99 - phy-names = "hdmi"; 100 - mediatek,syscon-hdmi = <&mmsys 0x900>; 101 - assigned-clocks = <&topckgen CLK_TOP_HDMI_SEL>; 102 - assigned-clock-parents = <&hdmi_phy>; 103 - 104 - ports { 105 - #address-cells = <1>; 106 - #size-cells = <0>; 107 - 108 - port@0 { 109 - reg = <0>; 110 - 111 - hdmi0_in: endpoint { 112 - remote-endpoint = <&dpi0_out>; 113 - }; 114 - }; 115 - 116 - port@1 { 117 - reg = <1>; 118 - 119 - hdmi0_out: endpoint { 120 - remote-endpoint = <&hdmi_con_in>; 121 - }; 122 - }; 123 - }; 124 - }; 125 - 126 - connector { 127 - compatible = "hdmi-connector"; 128 - type = "a"; 129 - ddc-i2c-bus = <&hdmiddc0>; 130 - 131 - port { 132 - hdmi_con_in: endpoint { 133 - remote-endpoint = <&hdmi0_out>; 134 - }; 135 - }; 136 - };
+133
Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/display/mediatek/mediatek,hdmi.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mediatek HDMI Encoder Device Tree Bindings 8 + 9 + maintainers: 10 + - CK Hu <ck.hu@mediatek.com> 11 + - Jitao shi <jitao.shi@mediatek.com> 12 + 13 + description: | 14 + The Mediatek HDMI encoder can generate HDMI 1.4a or MHL 2.0 signals from 15 + its parallel input. 16 + 17 + properties: 18 + compatible: 19 + enum: 20 + - mediatek,mt2701-hdmi 21 + - mediatek,mt7623-hdmi 22 + - mediatek,mt8167-hdmi 23 + - mediatek,mt8173-hdmi 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + interrupts: 29 + maxItems: 1 30 + 31 + clocks: 32 + items: 33 + - description: Pixel Clock 34 + - description: HDMI PLL 35 + - description: Bit Clock 36 + - description: S/PDIF Clock 37 + 38 + clock-names: 39 + items: 40 + - const: pixel 41 + - const: pll 42 + - const: bclk 43 + - const: spdif 44 + 45 + phys: 46 + maxItems: 1 47 + 48 + phy-names: 49 + items: 50 + - const: hdmi 51 + 52 + mediatek,syscon-hdmi: 53 + $ref: '/schemas/types.yaml#/definitions/phandle-array' 54 + maxItems: 1 55 + description: | 56 + phandle link and register offset to the system configuration registers. 57 + 58 + ports: 59 + $ref: /schemas/graph.yaml#/properties/ports 60 + 61 + properties: 62 + port@0: 63 + $ref: /schemas/graph.yaml#/properties/port 64 + description: | 65 + Input port node. This port should be connected to a DPI output port. 66 + 67 + port@1: 68 + $ref: /schemas/graph.yaml#/properties/port 69 + description: | 70 + Output port node. This port should be connected to the input port of a connector 71 + node that contains a ddc-i2c-bus property, or to the input port of an attached 72 + bridge chip, such as a SlimPort transmitter. 73 + 74 + required: 75 + - port@0 76 + - port@1 77 + 78 + required: 79 + - compatible 80 + - reg 81 + - interrupts 82 + - clocks 83 + - clock-names 84 + - phys 85 + - phy-names 86 + - mediatek,syscon-hdmi 87 + - ports 88 + 89 + additionalProperties: false 90 + 91 + examples: 92 + - | 93 + #include <dt-bindings/clock/mt8173-clk.h> 94 + #include <dt-bindings/interrupt-controller/arm-gic.h> 95 + #include <dt-bindings/interrupt-controller/irq.h> 96 + hdmi0: hdmi@14025000 { 97 + compatible = "mediatek,mt8173-hdmi"; 98 + reg = <0x14025000 0x400>; 99 + interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_LOW>; 100 + clocks = <&mmsys CLK_MM_HDMI_PIXEL>, 101 + <&mmsys CLK_MM_HDMI_PLLCK>, 102 + <&mmsys CLK_MM_HDMI_AUDIO>, 103 + <&mmsys CLK_MM_HDMI_SPDIF>; 104 + clock-names = "pixel", "pll", "bclk", "spdif"; 105 + pinctrl-names = "default"; 106 + pinctrl-0 = <&hdmi_pin>; 107 + phys = <&hdmi_phy>; 108 + phy-names = "hdmi"; 109 + mediatek,syscon-hdmi = <&mmsys 0x900>; 110 + 111 + ports { 112 + #address-cells = <1>; 113 + #size-cells = <0>; 114 + 115 + port@0 { 116 + reg = <0>; 117 + 118 + hdmi0_in: endpoint { 119 + remote-endpoint = <&dpi0_out>; 120 + }; 121 + }; 122 + 123 + port@1 { 124 + reg = <1>; 125 + 126 + hdmi0_out: endpoint { 127 + remote-endpoint = <&hdmi_con_in>; 128 + }; 129 + }; 130 + }; 131 + }; 132 + 133 + ...
+123 -6
drivers/gpu/drm/mediatek/mtk_dpi.c
··· 83 83 struct pinctrl *pinctrl; 84 84 struct pinctrl_state *pins_gpio; 85 85 struct pinctrl_state *pins_dpi; 86 + u32 output_fmt; 86 87 int refcount; 87 88 }; 88 89 ··· 123 122 u32 reg_h_fre_con; 124 123 u32 max_clock_khz; 125 124 bool edge_sel_en; 125 + const u32 *output_fmts; 126 + u32 num_output_fmts; 126 127 }; 127 128 128 129 static void mtk_dpi_mask(struct mtk_dpi *dpi, u32 offset, u32 val, u32 mask) ··· 384 381 } 385 382 } 386 383 384 + static void mtk_dpi_dual_edge(struct mtk_dpi *dpi) 385 + { 386 + if ((dpi->output_fmt == MEDIA_BUS_FMT_RGB888_2X12_LE) || 387 + (dpi->output_fmt == MEDIA_BUS_FMT_RGB888_2X12_BE)) { 388 + mtk_dpi_mask(dpi, DPI_DDR_SETTING, DDR_EN | DDR_4PHASE, 389 + DDR_EN | DDR_4PHASE); 390 + mtk_dpi_mask(dpi, DPI_OUTPUT_SETTING, 391 + dpi->output_fmt == MEDIA_BUS_FMT_RGB888_2X12_LE ? 392 + EDGE_SEL : 0, EDGE_SEL); 393 + } else { 394 + mtk_dpi_mask(dpi, DPI_DDR_SETTING, DDR_EN | DDR_4PHASE, 0); 395 + } 396 + } 397 + 387 398 static void mtk_dpi_power_off(struct mtk_dpi *dpi) 388 399 { 389 400 if (WARN_ON(dpi->refcount == 0)) ··· 472 455 pll_rate = clk_get_rate(dpi->tvd_clk); 473 456 474 457 vm.pixelclock = pll_rate / factor; 475 - clk_set_rate(dpi->pixel_clk, vm.pixelclock); 458 + if ((dpi->output_fmt == MEDIA_BUS_FMT_RGB888_2X12_LE) || 459 + (dpi->output_fmt == MEDIA_BUS_FMT_RGB888_2X12_BE)) 460 + clk_set_rate(dpi->pixel_clk, vm.pixelclock * 2); 461 + else 462 + clk_set_rate(dpi->pixel_clk, vm.pixelclock); 463 + 464 + 476 465 vm.pixelclock = clk_get_rate(dpi->pixel_clk); 477 466 478 467 dev_dbg(dpi->dev, "Got PLL %lu Hz, pixel clock %lu Hz\n", ··· 542 519 mtk_dpi_config_yc_map(dpi, dpi->yc_map); 543 520 mtk_dpi_config_color_format(dpi, dpi->color_format); 544 521 mtk_dpi_config_2n_h_fre(dpi); 522 + mtk_dpi_dual_edge(dpi); 545 523 mtk_dpi_config_disable_edge(dpi); 546 524 mtk_dpi_sw_reset(dpi, false); 525 + 526 + return 0; 527 + } 528 + 529 + static u32 *mtk_dpi_bridge_atomic_get_output_bus_fmts(struct drm_bridge *bridge, 530 + struct drm_bridge_state *bridge_state, 531 + struct drm_crtc_state *crtc_state, 532 + struct drm_connector_state *conn_state, 533 + unsigned int *num_output_fmts) 534 + { 535 + struct mtk_dpi *dpi = bridge_to_dpi(bridge); 536 + u32 *output_fmts; 537 + 538 + *num_output_fmts = 0; 539 + 540 + if (!dpi->conf->output_fmts) { 541 + dev_err(dpi->dev, "output_fmts should not be null\n"); 542 + return NULL; 543 + } 544 + 545 + output_fmts = kcalloc(dpi->conf->num_output_fmts, sizeof(*output_fmts), 546 + GFP_KERNEL); 547 + if (!output_fmts) 548 + return NULL; 549 + 550 + *num_output_fmts = dpi->conf->num_output_fmts; 551 + 552 + memcpy(output_fmts, dpi->conf->output_fmts, 553 + sizeof(*output_fmts) * dpi->conf->num_output_fmts); 554 + 555 + return output_fmts; 556 + } 557 + 558 + static u32 *mtk_dpi_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, 559 + struct drm_bridge_state *bridge_state, 560 + struct drm_crtc_state *crtc_state, 561 + struct drm_connector_state *conn_state, 562 + u32 output_fmt, 563 + unsigned int *num_input_fmts) 564 + { 565 + u32 *input_fmts; 566 + 567 + *num_input_fmts = 0; 568 + 569 + input_fmts = kcalloc(1, sizeof(*input_fmts), 570 + GFP_KERNEL); 571 + if (!input_fmts) 572 + return NULL; 573 + 574 + *num_input_fmts = 1; 575 + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; 576 + 577 + return input_fmts; 578 + } 579 + 580 + static int mtk_dpi_bridge_atomic_check(struct drm_bridge *bridge, 581 + struct drm_bridge_state *bridge_state, 582 + struct drm_crtc_state *crtc_state, 583 + struct drm_connector_state *conn_state) 584 + { 585 + struct mtk_dpi *dpi = bridge->driver_private; 586 + unsigned int out_bus_format; 587 + 588 + out_bus_format = bridge_state->output_bus_cfg.format; 589 + 590 + dev_dbg(dpi->dev, "input format 0x%04x, output format 0x%04x\n", 591 + bridge_state->input_bus_cfg.format, 592 + bridge_state->output_bus_cfg.format); 593 + 594 + dpi->output_fmt = out_bus_format; 595 + dpi->bit_num = MTK_DPI_OUT_BIT_NUM_8BITS; 596 + dpi->channel_swap = MTK_DPI_OUT_CHANNEL_SWAP_RGB; 597 + dpi->yc_map = MTK_DPI_OUT_YC_MAP_RGB; 598 + dpi->color_format = MTK_DPI_COLOR_FORMAT_RGB; 547 599 548 600 return 0; 549 601 } ··· 675 577 .mode_valid = mtk_dpi_bridge_mode_valid, 676 578 .disable = mtk_dpi_bridge_disable, 677 579 .enable = mtk_dpi_bridge_enable, 580 + .atomic_check = mtk_dpi_bridge_atomic_check, 581 + .atomic_get_output_bus_fmts = mtk_dpi_bridge_atomic_get_output_bus_fmts, 582 + .atomic_get_input_bus_fmts = mtk_dpi_bridge_atomic_get_input_bus_fmts, 583 + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, 584 + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, 585 + .atomic_reset = drm_atomic_helper_bridge_reset, 678 586 }; 679 587 680 588 void mtk_dpi_start(struct device *dev) ··· 726 622 goto err_cleanup; 727 623 } 728 624 drm_connector_attach_encoder(dpi->connector, &dpi->encoder); 729 - 730 - dpi->bit_num = MTK_DPI_OUT_BIT_NUM_8BITS; 731 - dpi->channel_swap = MTK_DPI_OUT_CHANNEL_SWAP_RGB; 732 - dpi->yc_map = MTK_DPI_OUT_YC_MAP_RGB; 733 - dpi->color_format = MTK_DPI_COLOR_FORMAT_RGB; 734 625 735 626 return 0; 736 627 ··· 779 680 return 2; 780 681 } 781 682 683 + static const u32 mt8173_output_fmts[] = { 684 + MEDIA_BUS_FMT_RGB888_1X24, 685 + }; 686 + 687 + static const u32 mt8183_output_fmts[] = { 688 + MEDIA_BUS_FMT_RGB888_2X12_LE, 689 + MEDIA_BUS_FMT_RGB888_2X12_BE, 690 + }; 691 + 782 692 static const struct mtk_dpi_conf mt8173_conf = { 783 693 .cal_factor = mt8173_calculate_factor, 784 694 .reg_h_fre_con = 0xe0, 785 695 .max_clock_khz = 300000, 696 + .output_fmts = mt8173_output_fmts, 697 + .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), 786 698 }; 787 699 788 700 static const struct mtk_dpi_conf mt2701_conf = { ··· 801 691 .reg_h_fre_con = 0xb0, 802 692 .edge_sel_en = true, 803 693 .max_clock_khz = 150000, 694 + .output_fmts = mt8173_output_fmts, 695 + .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), 804 696 }; 805 697 806 698 static const struct mtk_dpi_conf mt8183_conf = { 807 699 .cal_factor = mt8183_calculate_factor, 808 700 .reg_h_fre_con = 0xe0, 809 701 .max_clock_khz = 100000, 702 + .output_fmts = mt8183_output_fmts, 703 + .num_output_fmts = ARRAY_SIZE(mt8183_output_fmts), 810 704 }; 811 705 812 706 static const struct mtk_dpi_conf mt8192_conf = { 813 707 .cal_factor = mt8183_calculate_factor, 814 708 .reg_h_fre_con = 0xe0, 815 709 .max_clock_khz = 150000, 710 + .output_fmts = mt8173_output_fmts, 711 + .num_output_fmts = ARRAY_SIZE(mt8173_output_fmts), 816 712 }; 817 713 818 714 static int mtk_dpi_probe(struct platform_device *pdev) ··· 834 718 835 719 dpi->dev = dev; 836 720 dpi->conf = (struct mtk_dpi_conf *)of_device_get_match_data(dev); 721 + dpi->output_fmt = MEDIA_BUS_FMT_RGB888_1X24; 837 722 838 723 dpi->pinctrl = devm_pinctrl_get(&pdev->dev); 839 724 if (IS_ERR(dpi->pinctrl)) {
+1 -1
drivers/gpu/drm/mediatek/mtk_drm_crtc.c
··· 260 260 drm_connector_list_iter_end(&conn_iter); 261 261 } 262 262 263 - ret = pm_runtime_get_sync(crtc->dev->dev); 263 + ret = pm_runtime_resume_and_get(crtc->dev->dev); 264 264 if (ret < 0) { 265 265 DRM_ERROR("Failed to enable power domain: %d\n", ret); 266 266 return ret;
+17
drivers/gpu/drm/mediatek/mtk_hdmi.c
··· 148 148 149 149 struct mtk_hdmi_conf { 150 150 bool tz_disabled; 151 + bool cea_modes_only; 152 + unsigned long max_mode_clock; 151 153 }; 152 154 153 155 struct mtk_hdmi { ··· 1224 1222 return MODE_BAD; 1225 1223 } 1226 1224 1225 + if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode)) 1226 + return MODE_BAD; 1227 + 1228 + if (hdmi->conf->max_mode_clock && 1229 + mode->clock > hdmi->conf->max_mode_clock) 1230 + return MODE_CLOCK_HIGH; 1231 + 1227 1232 if (mode->clock < 27000) 1228 1233 return MODE_CLOCK_LOW; 1229 1234 if (mode->clock > 297000) ··· 1787 1778 .tz_disabled = true, 1788 1779 }; 1789 1780 1781 + static const struct mtk_hdmi_conf mtk_hdmi_conf_mt8167 = { 1782 + .max_mode_clock = 148500, 1783 + .cea_modes_only = true, 1784 + }; 1785 + 1790 1786 static const struct of_device_id mtk_drm_hdmi_of_ids[] = { 1791 1787 { .compatible = "mediatek,mt2701-hdmi", 1792 1788 .data = &mtk_hdmi_conf_mt2701, 1789 + }, 1790 + { .compatible = "mediatek,mt8167-hdmi", 1791 + .data = &mtk_hdmi_conf_mt8167, 1793 1792 }, 1794 1793 { .compatible = "mediatek,mt8173-hdmi", 1795 1794 },