Message ID | 20220919-v2-2-8419dcf4f09d@baylibre.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp238507wrs; Fri, 14 Oct 2022 08:21:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5v4zMm17vAB+ikHPkTrllW1hBrQPn/YXdgap0qMxNGE2HUCwXbw3fhKq+jWY6WJj3De1mQ X-Received: by 2002:a05:6402:2791:b0:45d:3a94:3494 with SMTP id b17-20020a056402279100b0045d3a943494mr834460ede.91.1665760884593; Fri, 14 Oct 2022 08:21:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665760884; cv=none; d=google.com; s=arc-20160816; b=FQZKaZzUgNEjJObP73++0oOLLF+zWutpCWjfUWc9XfAbP4yd176K/VNN+5gwhMFDkk 01xPL54LhSrDvQKZXyAq0NMc1MYKQFJsSrK4di5Efj4USnxbGKLuC8gg8oqpzAMgxmHU CDGHrgPLEaBJ6UObgGb4zgvbXTfFCa6IWpEe91C2PuMW8oLgQmYn5oLbY2qeBO1uX1sn CU1HKMg0OJUPTmYXR7MyAMbRbCZBqBMZks9NxQowJIP7rNiIyt7aIFS7Nv0tNjp4rf8p Gko75gfZq0AbfzFFScek6iTyuHWJAgTHtE4PYyqmb37q4KcBarBhLvndm4dm5lFjTmxA ddow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=G+qRFSBJ+VCcrm8OgMqVSB4wBGSDumRukXHEi1aq3ic=; b=voftlYjKlolyyaJQvrtlcNE8l476NxIJ8/biwlM/gRCvvxrO3hfawqn+M5tdsSZvKM Nk5Z44qeiclRMauW0frQNbwMuYKEuqOtQRE3yRyzz1Jt5rMdHT7OwTrV7bVbOc6cu7iw hDzBBBHYsCD4sEfjnBn2m3KF2n2sR2WgULGO4kDg3nLa8SCk1kGg8KHtcEUxCGLaMjKO NCZcSqSedcd+KVJUYIlnelJsuRqIEANFNszpDBFR2QjZLnWPM7WggN/8sZ+eNmWsoTC5 aAGpCxx3W2wXIHHDFQZ4bUuqmtBu1mD8h77sFCF0lFyfoC+iQy45PyPy0MIoPtky1N6q zfUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=mNrZDV3K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020aa7df0c000000b00459fc3fcf3csi2308253edy.102.2022.10.14.08.20.59; Fri, 14 Oct 2022 08:21:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=mNrZDV3K; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230224AbiJNPUc (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Fri, 14 Oct 2022 11:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230090AbiJNPUM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 14 Oct 2022 11:20:12 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E778236BD9 for <linux-kernel@vger.kernel.org>; Fri, 14 Oct 2022 08:20:07 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id 6-20020a1c0206000000b003c6c154d528so621705wmc.4 for <linux-kernel@vger.kernel.org>; Fri, 14 Oct 2022 08:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=G+qRFSBJ+VCcrm8OgMqVSB4wBGSDumRukXHEi1aq3ic=; b=mNrZDV3KBcXf6FixJKWBJ1C3FABLGivwTv4I9P5qaHrzMf7zXZJbq5/pQpJsuyVA+U 4o21CcHjTPmSr31ckmhY+msDYTsX4QfcWC2HmxiRvsSl7A26y7IpYuCUS9l7zbEPuyVI JYCCbX99/d3FDyxccszQzz4mdzorR5hvP4L6+8Jsam0HeDcTtSqtQ0KDtEu9AiJialp5 9D7N0CNSvGhrK/yr6rxfp8VmMEQ9AivaCXr6m3EYRTn98BPj5/gIpzA7IO14IszJNdEE F8dvRC329BHZfS9T3KV9Keb/VadAFkiIKOeOHgZOu5He6AtliytBttcgpq6poXLOEey0 K5HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G+qRFSBJ+VCcrm8OgMqVSB4wBGSDumRukXHEi1aq3ic=; b=dTITgN4y+b5PUD/N5Ogy3xJBgE7A/QEq50ZuJIhWo5ZUx5g8RGLRdvu0FYiUEFG8jq Ml6EqKsCWJEwzjL0QD9uSmXlsf1XeQKTDy4Fde+DCNoFna0rmk/xzph4ypD4MFeFtC14 NqCLsj030CVy6oVTHA8+qWQW0o+VC7UYx/TgKG8io2HbTfTS1XwINeoU6qmq1N+GWFPd l+figeIrFrbsy18r6+cGhHKj0cGyqwqqdF2Gh8urNywfqSU9obqE0QaR4kaT2I6Qtgaf 6JY1VTGnAYtszQP+w4TM6RkDGEB6JlcpwulR+zL1w/p/qLRdLqxOLFbK+LNYOej+llyq unBw== X-Gm-Message-State: ACrzQf2Va2GszX4eCo/E5hdZjCdcVzjEF7ZfObI0SPxkM01gzYp5UWWW iD1MHE0OLpDhu4Mk1t+ajF1Xfw== X-Received: by 2002:a05:600c:a4c:b0:3b4:fc1b:81 with SMTP id c12-20020a05600c0a4c00b003b4fc1b0081mr3916369wmq.125.1665760805442; Fri, 14 Oct 2022 08:20:05 -0700 (PDT) Received: from [127.0.0.1] (2a02-8440-6241-7429-3074-96af-9642-0004.rev.sfr.net. [2a02:8440:6241:7429:3074:96af:9642:4]) by smtp.gmail.com with ESMTPSA id z11-20020a05600c0a0b00b003c6bd91caa5sm2818223wmp.17.2022.10.14.08.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 08:20:05 -0700 (PDT) From: Guillaume Ranquet <granquet@baylibre.com> Date: Fri, 14 Oct 2022 17:15:55 +0200 Subject: [PATCH v2 02/12] dt-bindings: display: mediatek: add MT8195 hdmi bindings MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20220919-v2-2-8419dcf4f09d@baylibre.com> References: <20220919-v2-0-8419dcf4f09d@baylibre.com> In-Reply-To: <20220919-v2-0-8419dcf4f09d@baylibre.com> To: Chunfeng Yun <chunfeng.yun@mediatek.com>, David Airlie <airlied@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Jitao shi <jitao.shi@mediatek.com>, CK Hu <ck.hu@mediatek.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@ti.com>, Matthias Brugger <matthias.bgg@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Chun-Kuang Hu <chunkuang.hu@kernel.org> Cc: Guillaume Ranquet <granquet@baylibre.com>, stuart.lee@mediatek.com, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, linux-kernel@vger.kernel.org, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, mac.shen@mediatek.com, linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org X-Mailer: b4 0.11.0-dev X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746676885022005907?= X-GMAIL-MSGID: =?utf-8?q?1746676885022005907?= |
Series |
Add MT8195 HDMI support
|
|
Commit Message
Guillaume Ranquet
Oct. 14, 2022, 3:15 p.m. UTC
Add mt8195 SoC bindings for hdmi and hdmi-ddc
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
---
.../bindings/display/mediatek/mediatek,hdmi.yaml | 67 +++++++++++++++++-----
.../display/mediatek/mediatek,mt8195-hdmi-ddc.yaml | 51 ++++++++++++++++
2 files changed, 104 insertions(+), 14 deletions(-)
Comments
On 14/10/2022 11:15, Guillaume Ranquet wrote: > Add mt8195 SoC bindings for hdmi and hdmi-ddc > > Signed-off-by: Guillaume Ranquet <granquet@baylibre.com> > --- > .../bindings/display/mediatek/mediatek,hdmi.yaml | 67 +++++++++++++++++----- > .../display/mediatek/mediatek,mt8195-hdmi-ddc.yaml | 51 ++++++++++++++++ > 2 files changed, 104 insertions(+), 14 deletions(-) > > diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml > index bdaf0b51e68c..955026cd7ca5 100644 > --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml > +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml > @@ -21,26 +21,21 @@ properties: > - mediatek,mt7623-hdmi > - mediatek,mt8167-hdmi > - mediatek,mt8173-hdmi > + - mediatek,mt8195-hdmi > > reg: > maxItems: 1 > > - interrupts: > - maxItems: 1 > - This change is not really explained in commit msg... > clocks: > - items: > - - description: Pixel Clock > - - description: HDMI PLL > - - description: Bit Clock > - - description: S/PDIF Clock > + minItems: 4 > + maxItems: 4 > > clock-names: > - items: > - - const: pixel > - - const: pll > - - const: bclk > - - const: spdif > + minItems: 4 > + maxItems: 4 > + > + interrupts: > + maxItems: 1 > > phys: > maxItems: 1 > @@ -58,6 +53,9 @@ properties: > description: | > phandle link and register offset to the system configuration registers. > > + power-domains: > + maxItems: 1 > + > ports: > $ref: /schemas/graph.yaml#/properties/ports > > @@ -86,9 +84,50 @@ required: > - clock-names > - phys > - phy-names > - - mediatek,syscon-hdmi > - ports > > +allOf: > + - if: > + properties: > + compatible: > + contains: > + const: mediatek,mt8195-hdmi > + then: > + properties: > + clocks: > + items: > + - description: APB > + - description: HDCP > + - description: HDCP 24M > + - description: Split HDMI > + clock-names: > + items: > + - const: hdmi_apb_sel > + - const: hdcp_sel > + - const: hdcp24_sel > + - const: split_hdmi > + > + required: > + - power-domains > + else: > + properties: > + clocks: > + items: > + - description: Pixel Clock > + - description: HDMI PLL > + - description: Bit Clock > + - description: S/PDIF Clock > + > + clock-names: > + items: > + - const: pixel > + - const: pll > + - const: bclk > + - const: spdif > + > + required: > + - mediatek,syscon-hdmi > + > additionalProperties: false > > examples: > diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml > new file mode 100644 > index 000000000000..0fe0a2a2f17f > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml > @@ -0,0 +1,51 @@ > +# 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 DDC for mt8195 > + > +maintainers: > + - CK Hu <ck.hu@mediatek.com> > + - Jitao shi <jitao.shi@mediatek.com> > + > +description: | > + The HDMI DDC i2c controller is used to interface with the HDMI DDC pins. > + > +properties: > + compatible: > + enum: > + - mediatek,mt8195-hdmi-ddc I think I wrote it - you already have bindings for HDMI DDC. I doubt that these are different and it looks like you model the bindings according to your driver. That's not the way. > + > + clocks: > + maxItems: 1 > + > + clock-names: > + items: > + - const: ddc > + > + mediatek,hdmi: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + A phandle to the mt8195 hdmi controller > + > +required: > + - compatible > + - clocks > + - clock-names > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + #include <dt-bindings/interrupt-controller/irq.h> > + hdmiddc0: ddc_i2c { Node names should be generic - ddc. https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation No underscores in node names. Additionally I2C devices have addresses on the bus. Why this one doesn't? > + compatible = "mediatek,mt8195-hdmi-ddc"; > + mediatek,hdmi = <&hdmi0>; > + clocks = <&clk26m>; > + clock-names = "ddc"; > + }; > + > +... > Best regards, Krzysztof
On Fri, 14 Oct 2022 18:08, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: >On 14/10/2022 11:15, Guillaume Ranquet wrote: >> Add mt8195 SoC bindings for hdmi and hdmi-ddc >> >> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com> >> --- >> .../bindings/display/mediatek/mediatek,hdmi.yaml | 67 +++++++++++++++++----- >> .../display/mediatek/mediatek,mt8195-hdmi-ddc.yaml | 51 ++++++++++++++++ >> 2 files changed, 104 insertions(+), 14 deletions(-) >> >> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >> index bdaf0b51e68c..955026cd7ca5 100644 >> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >> @@ -21,26 +21,21 @@ properties: >> - mediatek,mt7623-hdmi >> - mediatek,mt8167-hdmi >> - mediatek,mt8173-hdmi >> + - mediatek,mt8195-hdmi >> >> reg: >> maxItems: 1 >> >> - interrupts: >> - maxItems: 1 >> - > >This change is not really explained in commit msg... > >> clocks: >> - items: >> - - description: Pixel Clock >> - - description: HDMI PLL >> - - description: Bit Clock >> - - description: S/PDIF Clock >> + minItems: 4 >> + maxItems: 4 >> >> clock-names: >> - items: >> - - const: pixel >> - - const: pll >> - - const: bclk >> - - const: spdif >> + minItems: 4 >> + maxItems: 4 >> + >> + interrupts: >> + maxItems: 1 >> >> phys: >> maxItems: 1 >> @@ -58,6 +53,9 @@ properties: >> description: | >> phandle link and register offset to the system configuration registers. >> >> + power-domains: >> + maxItems: 1 >> + >> ports: >> $ref: /schemas/graph.yaml#/properties/ports >> >> @@ -86,9 +84,50 @@ required: >> - clock-names >> - phys >> - phy-names >> - - mediatek,syscon-hdmi >> - ports >> >> +allOf: >> + - if: >> + properties: >> + compatible: >> + contains: >> + const: mediatek,mt8195-hdmi >> + then: >> + properties: >> + clocks: >> + items: >> + - description: APB >> + - description: HDCP >> + - description: HDCP 24M >> + - description: Split HDMI >> + clock-names: >> + items: >> + - const: hdmi_apb_sel >> + - const: hdcp_sel >> + - const: hdcp24_sel >> + - const: split_hdmi >> + >> + required: >> + - power-domains >> + else: >> + properties: >> + clocks: >> + items: >> + - description: Pixel Clock >> + - description: HDMI PLL >> + - description: Bit Clock >> + - description: S/PDIF Clock >> + >> + clock-names: >> + items: >> + - const: pixel >> + - const: pll >> + - const: bclk >> + - const: spdif >> + >> + required: >> + - mediatek,syscon-hdmi >> + >> additionalProperties: false >> >> examples: >> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml >> new file mode 100644 >> index 000000000000..0fe0a2a2f17f >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml >> @@ -0,0 +1,51 @@ >> +# 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 DDC for mt8195 >> + >> +maintainers: >> + - CK Hu <ck.hu@mediatek.com> >> + - Jitao shi <jitao.shi@mediatek.com> >> + >> +description: | >> + The HDMI DDC i2c controller is used to interface with the HDMI DDC pins. >> + >> +properties: >> + compatible: >> + enum: >> + - mediatek,mt8195-hdmi-ddc > >I think I wrote it - you already have bindings for HDMI DDC. I doubt >that these are different and it looks like you model the bindings >according to your driver. That's not the way. Hi Krzysztof, I've made a separate binding as this new IP is integrated into the HDMI hw block. The difference it makes is that the hw is slightly simpler to describe as the IP doesn't have it's own range of registers or an interrupt line. I can use the "legacy mediatek mtk ddc binding" if I modify it to have the reg and interrupt properties not being required for mt8195. Would that work better for you? > >> + >> + clocks: >> + maxItems: 1 >> + >> + clock-names: >> + items: >> + - const: ddc >> + >> + mediatek,hdmi: >> + $ref: /schemas/types.yaml#/definitions/phandle >> + description: >> + A phandle to the mt8195 hdmi controller >> + >> +required: >> + - compatible >> + - clocks >> + - clock-names >> + >> +additionalProperties: false >> + >> +examples: >> + - | >> + #include <dt-bindings/interrupt-controller/arm-gic.h> >> + #include <dt-bindings/interrupt-controller/irq.h> >> + hdmiddc0: ddc_i2c { > >Node names should be generic - ddc. >https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation > >No underscores in node names. > >Additionally I2C devices have addresses on the bus. Why this one doesn't? > This is an i2c adapter, not a device. And as it lives inside the HDMI hw block, I've omitted using an address here. Is this valid? or should this be expressed differently? Thx, Guillaume. >> + compatible = "mediatek,mt8195-hdmi-ddc"; >> + mediatek,hdmi = <&hdmi0>; >> + clocks = <&clk26m>; >> + clock-names = "ddc"; >> + }; >> + >> +... >> > >Best regards, >Krzysztof >
On 02/11/2022 09:31, Guillaume Ranquet wrote: > On Fri, 14 Oct 2022 18:08, Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> On 14/10/2022 11:15, Guillaume Ranquet wrote: >>> Add mt8195 SoC bindings for hdmi and hdmi-ddc >>> >>> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com> >>> --- >>> .../bindings/display/mediatek/mediatek,hdmi.yaml | 67 +++++++++++++++++----- >>> .../display/mediatek/mediatek,mt8195-hdmi-ddc.yaml | 51 ++++++++++++++++ >>> 2 files changed, 104 insertions(+), 14 deletions(-) >>> >>> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >>> index bdaf0b51e68c..955026cd7ca5 100644 >>> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >>> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >>> @@ -21,26 +21,21 @@ properties: >>> - mediatek,mt7623-hdmi >>> - mediatek,mt8167-hdmi >>> - mediatek,mt8173-hdmi >>> + - mediatek,mt8195-hdmi >>> >>> reg: >>> maxItems: 1 >>> >>> - interrupts: >>> - maxItems: 1 >>> - >> >> This change is not really explained in commit msg... >> >>> clocks: >>> - items: >>> - - description: Pixel Clock >>> - - description: HDMI PLL >>> - - description: Bit Clock >>> - - description: S/PDIF Clock >>> + minItems: 4 >>> + maxItems: 4 >>> >>> clock-names: >>> - items: >>> - - const: pixel >>> - - const: pll >>> - - const: bclk >>> - - const: spdif >>> + minItems: 4 >>> + maxItems: 4 >>> + >>> + interrupts: >>> + maxItems: 1 >>> >>> phys: >>> maxItems: 1 >>> @@ -58,6 +53,9 @@ properties: >>> description: | >>> phandle link and register offset to the system configuration registers. >>> >>> + power-domains: >>> + maxItems: 1 >>> + >>> ports: >>> $ref: /schemas/graph.yaml#/properties/ports >>> >>> @@ -86,9 +84,50 @@ required: >>> - clock-names >>> - phys >>> - phy-names >>> - - mediatek,syscon-hdmi >>> - ports >>> >>> +allOf: >>> + - if: >>> + properties: >>> + compatible: >>> + contains: >>> + const: mediatek,mt8195-hdmi >>> + then: >>> + properties: >>> + clocks: >>> + items: >>> + - description: APB >>> + - description: HDCP >>> + - description: HDCP 24M >>> + - description: Split HDMI >>> + clock-names: >>> + items: >>> + - const: hdmi_apb_sel >>> + - const: hdcp_sel >>> + - const: hdcp24_sel >>> + - const: split_hdmi >>> + >>> + required: >>> + - power-domains >>> + else: >>> + properties: >>> + clocks: >>> + items: >>> + - description: Pixel Clock >>> + - description: HDMI PLL >>> + - description: Bit Clock >>> + - description: S/PDIF Clock >>> + >>> + clock-names: >>> + items: >>> + - const: pixel >>> + - const: pll >>> + - const: bclk >>> + - const: spdif >>> + >>> + required: >>> + - mediatek,syscon-hdmi >>> + >>> additionalProperties: false >>> >>> examples: >>> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml >>> new file mode 100644 >>> index 000000000000..0fe0a2a2f17f >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml >>> @@ -0,0 +1,51 @@ >>> +# 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 DDC for mt8195 >>> + >>> +maintainers: >>> + - CK Hu <ck.hu@mediatek.com> >>> + - Jitao shi <jitao.shi@mediatek.com> >>> + >>> +description: | >>> + The HDMI DDC i2c controller is used to interface with the HDMI DDC pins. >>> + >>> +properties: >>> + compatible: >>> + enum: >>> + - mediatek,mt8195-hdmi-ddc >> >> I think I wrote it - you already have bindings for HDMI DDC. I doubt >> that these are different and it looks like you model the bindings >> according to your driver. That's not the way. > > Hi Krzysztof, > > I've made a separate binding as this new IP is integrated into the > HDMI hw block. > The difference it makes is that the hw is slightly simpler to describe > as the IP doesn't > have it's own range of registers or an interrupt line. > > I can use the "legacy mediatek mtk ddc binding" if I modify it to have > the reg and > interrupt properties not being required for mt8195. OK, it is reasonable - such stuff should be in commit msg, so we won't keep asking. > > Would that work better for you? > >> >>> + >>> + clocks: >>> + maxItems: 1 >>> + >>> + clock-names: >>> + items: >>> + - const: ddc >>> + >>> + mediatek,hdmi: >>> + $ref: /schemas/types.yaml#/definitions/phandle >>> + description: >>> + A phandle to the mt8195 hdmi controller >>> + >>> +required: >>> + - compatible >>> + - clocks >>> + - clock-names >>> + >>> +additionalProperties: false >>> + >>> +examples: >>> + - | >>> + #include <dt-bindings/interrupt-controller/arm-gic.h> >>> + #include <dt-bindings/interrupt-controller/irq.h> >>> + hdmiddc0: ddc_i2c { >> >> Node names should be generic - ddc. >> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation >> >> No underscores in node names. >> >> Additionally I2C devices have addresses on the bus. Why this one doesn't? >> > > This is an i2c adapter, not a device. > And as it lives inside the HDMI hw block, I've omitted using an address here. > > Is this valid? or should this be expressed differently? What is an I2C adapter? Did you mean I2C controller (master)? Best regards, Krzysztof
On Thu, 03 Nov 2022 13:45, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: >On 02/11/2022 09:31, Guillaume Ranquet wrote: >> On Fri, 14 Oct 2022 18:08, Krzysztof Kozlowski >> <krzysztof.kozlowski@linaro.org> wrote: >>> On 14/10/2022 11:15, Guillaume Ranquet wrote: >>>> Add mt8195 SoC bindings for hdmi and hdmi-ddc >>>> >>>> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com> >>>> --- >>>> .../bindings/display/mediatek/mediatek,hdmi.yaml | 67 +++++++++++++++++----- >>>> .../display/mediatek/mediatek,mt8195-hdmi-ddc.yaml | 51 ++++++++++++++++ >>>> 2 files changed, 104 insertions(+), 14 deletions(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >>>> index bdaf0b51e68c..955026cd7ca5 100644 >>>> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >>>> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml >>>> @@ -21,26 +21,21 @@ properties: >>>> - mediatek,mt7623-hdmi >>>> - mediatek,mt8167-hdmi >>>> - mediatek,mt8173-hdmi >>>> + - mediatek,mt8195-hdmi >>>> >>>> reg: >>>> maxItems: 1 >>>> >>>> - interrupts: >>>> - maxItems: 1 >>>> - >>> >>> This change is not really explained in commit msg... >>> >>>> clocks: >>>> - items: >>>> - - description: Pixel Clock >>>> - - description: HDMI PLL >>>> - - description: Bit Clock >>>> - - description: S/PDIF Clock >>>> + minItems: 4 >>>> + maxItems: 4 >>>> >>>> clock-names: >>>> - items: >>>> - - const: pixel >>>> - - const: pll >>>> - - const: bclk >>>> - - const: spdif >>>> + minItems: 4 >>>> + maxItems: 4 >>>> + >>>> + interrupts: >>>> + maxItems: 1 >>>> >>>> phys: >>>> maxItems: 1 >>>> @@ -58,6 +53,9 @@ properties: >>>> description: | >>>> phandle link and register offset to the system configuration registers. >>>> >>>> + power-domains: >>>> + maxItems: 1 >>>> + >>>> ports: >>>> $ref: /schemas/graph.yaml#/properties/ports >>>> >>>> @@ -86,9 +84,50 @@ required: >>>> - clock-names >>>> - phys >>>> - phy-names >>>> - - mediatek,syscon-hdmi >>>> - ports >>>> >>>> +allOf: >>>> + - if: >>>> + properties: >>>> + compatible: >>>> + contains: >>>> + const: mediatek,mt8195-hdmi >>>> + then: >>>> + properties: >>>> + clocks: >>>> + items: >>>> + - description: APB >>>> + - description: HDCP >>>> + - description: HDCP 24M >>>> + - description: Split HDMI >>>> + clock-names: >>>> + items: >>>> + - const: hdmi_apb_sel >>>> + - const: hdcp_sel >>>> + - const: hdcp24_sel >>>> + - const: split_hdmi >>>> + >>>> + required: >>>> + - power-domains >>>> + else: >>>> + properties: >>>> + clocks: >>>> + items: >>>> + - description: Pixel Clock >>>> + - description: HDMI PLL >>>> + - description: Bit Clock >>>> + - description: S/PDIF Clock >>>> + >>>> + clock-names: >>>> + items: >>>> + - const: pixel >>>> + - const: pll >>>> + - const: bclk >>>> + - const: spdif >>>> + >>>> + required: >>>> + - mediatek,syscon-hdmi >>>> + >>>> additionalProperties: false >>>> >>>> examples: >>>> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml >>>> new file mode 100644 >>>> index 000000000000..0fe0a2a2f17f >>>> --- /dev/null >>>> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml >>>> @@ -0,0 +1,51 @@ >>>> +# 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 DDC for mt8195 >>>> + >>>> +maintainers: >>>> + - CK Hu <ck.hu@mediatek.com> >>>> + - Jitao shi <jitao.shi@mediatek.com> >>>> + >>>> +description: | >>>> + The HDMI DDC i2c controller is used to interface with the HDMI DDC pins. >>>> + >>>> +properties: >>>> + compatible: >>>> + enum: >>>> + - mediatek,mt8195-hdmi-ddc >>> >>> I think I wrote it - you already have bindings for HDMI DDC. I doubt >>> that these are different and it looks like you model the bindings >>> according to your driver. That's not the way. >> >> Hi Krzysztof, >> >> I've made a separate binding as this new IP is integrated into the >> HDMI hw block. >> The difference it makes is that the hw is slightly simpler to describe >> as the IP doesn't >> have it's own range of registers or an interrupt line. >> >> I can use the "legacy mediatek mtk ddc binding" if I modify it to have >> the reg and >> interrupt properties not being required for mt8195. > >OK, it is reasonable - such stuff should be in commit msg, so we won't >keep asking. > I'll sum this up in the commit msg for V3 then. >> >> Would that work better for you? >> >>> >>>> + >>>> + clocks: >>>> + maxItems: 1 >>>> + >>>> + clock-names: >>>> + items: >>>> + - const: ddc >>>> + >>>> + mediatek,hdmi: >>>> + $ref: /schemas/types.yaml#/definitions/phandle >>>> + description: >>>> + A phandle to the mt8195 hdmi controller >>>> + >>>> +required: >>>> + - compatible >>>> + - clocks >>>> + - clock-names >>>> + >>>> +additionalProperties: false >>>> + >>>> +examples: >>>> + - | >>>> + #include <dt-bindings/interrupt-controller/arm-gic.h> >>>> + #include <dt-bindings/interrupt-controller/irq.h> >>>> + hdmiddc0: ddc_i2c { >>> >>> Node names should be generic - ddc. >>> https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation >>> >>> No underscores in node names. >>> >>> Additionally I2C devices have addresses on the bus. Why this one doesn't? >>> >> >> This is an i2c adapter, not a device. >> And as it lives inside the HDMI hw block, I've omitted using an address here. >> >> Is this valid? or should this be expressed differently? > >What is an I2C adapter? Did you mean I2C controller (master)? Yes, a controller. This is an I2C controller connected to the HDMI connector, it is used to exchange data on the Display Data Channel with the display (such as EDID). Thx, Guillaume. > >Best regards, >Krzysztof >
On 03/11/2022 11:17, Guillaume Ranquet wrote: > On Thu, 03 Nov 2022 13:45, Krzysztof Kozlowski >>> This is an i2c adapter, not a device. >>> And as it lives inside the HDMI hw block, I've omitted using an address here. >>> >>> Is this valid? or should this be expressed differently? >> >> What is an I2C adapter? Did you mean I2C controller (master)? > > Yes, a controller. > This is an I2C controller connected to the HDMI connector, it is used > to exchange data on the Display Data Channel with > the display (such as EDID). OK, then the node name is "i2c". Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml index bdaf0b51e68c..955026cd7ca5 100644 --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml @@ -21,26 +21,21 @@ properties: - mediatek,mt7623-hdmi - mediatek,mt8167-hdmi - mediatek,mt8173-hdmi + - mediatek,mt8195-hdmi reg: maxItems: 1 - interrupts: - maxItems: 1 - clocks: - items: - - description: Pixel Clock - - description: HDMI PLL - - description: Bit Clock - - description: S/PDIF Clock + minItems: 4 + maxItems: 4 clock-names: - items: - - const: pixel - - const: pll - - const: bclk - - const: spdif + minItems: 4 + maxItems: 4 + + interrupts: + maxItems: 1 phys: maxItems: 1 @@ -58,6 +53,9 @@ properties: description: | phandle link and register offset to the system configuration registers. + power-domains: + maxItems: 1 + ports: $ref: /schemas/graph.yaml#/properties/ports @@ -86,9 +84,50 @@ required: - clock-names - phys - phy-names - - mediatek,syscon-hdmi - ports +allOf: + - if: + properties: + compatible: + contains: + const: mediatek,mt8195-hdmi + then: + properties: + clocks: + items: + - description: APB + - description: HDCP + - description: HDCP 24M + - description: Split HDMI + clock-names: + items: + - const: hdmi_apb_sel + - const: hdcp_sel + - const: hdcp24_sel + - const: split_hdmi + + required: + - power-domains + else: + properties: + clocks: + items: + - description: Pixel Clock + - description: HDMI PLL + - description: Bit Clock + - description: S/PDIF Clock + + clock-names: + items: + - const: pixel + - const: pll + - const: bclk + - const: spdif + + required: + - mediatek,syscon-hdmi + additionalProperties: false examples: diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml new file mode 100644 index 000000000000..0fe0a2a2f17f --- /dev/null +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,mt8195-hdmi-ddc.yaml @@ -0,0 +1,51 @@ +# 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 DDC for mt8195 + +maintainers: + - CK Hu <ck.hu@mediatek.com> + - Jitao shi <jitao.shi@mediatek.com> + +description: | + The HDMI DDC i2c controller is used to interface with the HDMI DDC pins. + +properties: + compatible: + enum: + - mediatek,mt8195-hdmi-ddc + + clocks: + maxItems: 1 + + clock-names: + items: + - const: ddc + + mediatek,hdmi: + $ref: /schemas/types.yaml#/definitions/phandle + description: + A phandle to the mt8195 hdmi controller + +required: + - compatible + - clocks + - clock-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/interrupt-controller/irq.h> + hdmiddc0: ddc_i2c { + compatible = "mediatek,mt8195-hdmi-ddc"; + mediatek,hdmi = <&hdmi0>; + clocks = <&clk26m>; + clock-names = "ddc"; + }; + +...