Commit e31b74b1 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'mediatek-drm-next-20250515' of...

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

 into drm-next

Mediatek DRM Next - 20250515

1. Prepare for support MT8195/88 HDMIv2 and DDCv2
2. DPI: Cleanups and add support for more formats
3. Cleanups and sanitization
4. Replace custom compare_dev with component_compare_of

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

From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Link: https://lore.kernel.org/r/20250514233647.15907-1-chunkuang.hu@kernel.org
parents e11c70cc 07c39476
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek HDMI MT8195 series HDMI Display Data Channel (DDC)

maintainers:
  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
  - CK Hu <ck.hu@mediatek.com>

properties:
  compatible:
    oneOf:
      - const: mediatek,mt8195-hdmi-ddc
      - items:
          - const: mediatek,mt8188-hdmi-ddc
          - const: mediatek,mt8195-hdmi-ddc

  clocks:
    maxItems: 1

  power-domains:
    maxItems: 1

required:
  - compatible
  - clocks

additionalProperties: false

examples:
  - |
    hdmi {
        hdmi_ddc: i2c {
            compatible = "mediatek,mt8195-hdmi-ddc";
            clocks = <&clk26m>;
        };
    };
...
+151 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/display/mediatek/mediatek,mt8195-hdmi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek MT8195 series HDMI-TX Encoder

maintainers:
  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
  - CK Hu <ck.hu@mediatek.com>

description:
  The MediaTek HDMI-TX v2 encoder can generate HDMI format data based on
  the HDMI Specification 2.0b.

properties:
  compatible:
    enum:
      - mediatek,mt8188-hdmi-tx
      - mediatek,mt8195-hdmi-tx

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: HDMI Peripheral Bus (APB) clock
      - description: HDCP and HDMI_TOP clock
      - description: HDCP, HDMI_TOP and HDMI Audio reference clock
      - description: VPP HDMI Split clock

  clock-names:
    items:
      - const: bus
      - const: hdcp
      - const: hdcp24m
      - const: hdmi-split

  i2c:
    type: object
    $ref: /schemas/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml
    unevaluatedProperties: false
    description: HDMI DDC I2C controller

  phys:
    maxItems: 1
    description: PHY providing clocking TMDS and pixel to controller

  phy-names:
    items:
      - const: hdmi

  power-domains:
    maxItems: 1

  '#sound-dai-cells':
    const: 1

  ports:
    $ref: /schemas/graph.yaml#/properties/ports

    properties:
      port@0:
        $ref: /schemas/graph.yaml#/properties/port
        description:
          Input port, usually connected to the output port of a DPI

      port@1:
        $ref: /schemas/graph.yaml#/properties/port
        description:
          Output port that must be connected either to the input port of
          a HDMI connector node containing a ddc-i2c-bus, or to the input
          port of an attached bridge chip, such as a SlimPort transmitter.

    required:
      - port@0
      - port@1

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - power-domains
  - phys
  - phy-names
  - ports

allOf:
  - $ref: /schemas/sound/dai-common.yaml#

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/mt8195-clk.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/power/mt8195-power.h>

    soc {
        #address-cells = <2>;
        #size-cells = <2>;

        hdmi@1c300000 {
            compatible = "mediatek,mt8195-hdmi-tx";
            reg = <0 0x1c300000 0 0x1000>;
            clocks = <&topckgen CLK_TOP_HDMI_APB>,
                     <&topckgen CLK_TOP_HDCP>,
                     <&topckgen CLK_TOP_HDCP_24M>,
                     <&vppsys1 CLK_VPP1_VPP_SPLIT_HDMI>;
            clock-names = "bus", "hdcp", "hdcp24m", "hdmi-split";
            interrupts = <GIC_SPI 677 IRQ_TYPE_LEVEL_HIGH 0>;
            phys = <&hdmi_phy>;
            phy-names = "hdmi";
            power-domains = <&spm MT8195_POWER_DOMAIN_HDMI_TX>;
            pinctrl-names = "default";
            pinctrl-0 = <&hdmi_pins>;
            #sound-dai-cells = <1>;

            hdmitx_ddc: i2c {
                compatible = "mediatek,mt8195-hdmi-ddc";
                clocks = <&clk26m>;
            };

            ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                    reg = <0>;

                    hdmi_in: endpoint {
                        remote-endpoint = <&dpi1_out>;
                    };
                };

                port@1 {
                    reg = <1>;

                    hdmi_out: endpoint {
                        remote-endpoint = <&hdmi_connector_in>;
                    };
                };
            };
        };
    };
+3 −5
Original line number Diff line number Diff line
@@ -21,10 +21,8 @@ mediatek-drm-y := mtk_crtc.o \

obj-$(CONFIG_DRM_MEDIATEK) += mediatek-drm.o

mediatek-drm-hdmi-objs := mtk_cec.o \
			  mtk_hdmi.o \
			  mtk_hdmi_ddc.o

obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mediatek-drm-hdmi.o
obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mtk_cec.o
obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mtk_hdmi.o
obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mtk_hdmi_ddc.o

obj-$(CONFIG_DRM_MEDIATEK_DP) += mtk_dp.o
+6 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
#include <linux/platform_device.h>

#include "mtk_cec.h"
#include "mtk_hdmi.h"
#include "mtk_drm_drv.h"

#define TR_CONFIG		0x00
@@ -102,6 +101,7 @@ void mtk_cec_set_hpd_event(struct device *dev,
	cec->hpd_event = hpd_event;
	spin_unlock_irqrestore(&cec->lock, flags);
}
EXPORT_SYMBOL_NS_GPL(mtk_cec_set_hpd_event, "DRM_MTK_HDMI_V1");

bool mtk_cec_hpd_high(struct device *dev)
{
@@ -112,6 +112,7 @@ bool mtk_cec_hpd_high(struct device *dev)

	return (status & (HDMI_PORD | HDMI_HTPLG)) == (HDMI_PORD | HDMI_HTPLG);
}
EXPORT_SYMBOL_NS_GPL(mtk_cec_hpd_high, "DRM_MTK_HDMI_V1");

static void mtk_cec_htplg_irq_init(struct mtk_cec *cec)
{
@@ -247,3 +248,7 @@ struct platform_driver mtk_cec_driver = {
		.of_match_table = mtk_cec_of_ids,
	},
};
module_platform_driver(mtk_cec_driver);

MODULE_DESCRIPTION("MediaTek HDMI CEC Driver");
MODULE_LICENSE("GPL");
+1 −6
Original line number Diff line number Diff line
@@ -492,11 +492,6 @@ static const struct of_device_id mtk_ovl_adaptor_comp_dt_ids[] = {
	{ /* sentinel */ }
};

static int compare_of(struct device *dev, void *data)
{
	return dev->of_node == data;
}

static int ovl_adaptor_of_get_ddp_comp_type(struct device_node *node,
					    enum mtk_ovl_adaptor_comp_type *ctype)
{
@@ -567,7 +562,7 @@ static int ovl_adaptor_comp_init(struct device *dev, struct component_match **ma

		priv->ovl_adaptor_comp[id] = &comp_pdev->dev;

		drm_of_component_match_add(dev, match, compare_of, node);
		drm_of_component_match_add(dev, match, component_compare_of, node);
		dev_dbg(dev, "Adding component match for %pOF\n", node);
	}

Loading