From patchwork Tue Jun 28 18:18:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12898697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F40FC43334 for ; Tue, 28 Jun 2022 18:19:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5CD7910FDFA; Tue, 28 Jun 2022 18:19:23 +0000 (UTC) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by gabe.freedesktop.org (Postfix) with ESMTPS id D062411250F for ; Tue, 28 Jun 2022 18:19:21 +0000 (UTC) Received: by mail-ej1-x633.google.com with SMTP id g26so27476543ejb.5 for ; Tue, 28 Jun 2022 11:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uCqC8GW9HKHpFH4wlDQrjFsLE8xAOLT85EC6wVnCbqE=; b=oQPMOr1hl7nMjOGc021ayJnlDHmo0YsdtCqmr12Q+NJnCBe3TtOuMP7ZP2QWsWgZOS PM++Gv4Z2N+KZ/KMDnUUZPv4BIaSVuCiTER94aNfvJTVno7FaOMmzWU+M1h2HYKWOyuB lCEnleDaxrk8uR/TN9qlgSaCVW6x4XQRhFsuMMHLAEPJSt4JWC1yBGHH/cRAKg/zHdrK t7CWgzOaWLR+1F08DigV6cFlQS/7OaZzu3QimOeI4DbSvpFRjBjb6jvgIKSKc/S6H8hX kpFjKwFnWuDQ1sVVpsmiWPGxdo2YmCyrTF3DhOnyUKNibpEHzgiuwldS9LO4czF3Ty78 +DBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uCqC8GW9HKHpFH4wlDQrjFsLE8xAOLT85EC6wVnCbqE=; b=JoqorM0OQX1VWIEKF/xT6lvKlCsRoA5NgOnOhd7Euw6mX1F2ew535ax4saM6/A+9vW Hf7vuM5rI8D7q98dOMkcSxn/YqWFlUaAoM9oUNcx5dVM8DyFVspjYuRZ5oDazQrMNkfO Q0N/gctQKB1SJeEu4Atjr91H6wAPxEFyf9gpcMsN0+GFMQNoPxY7PZDK3W6ykFSJ7Hj+ F2IAO3ki6UY88fx2z/2YxqEMn6yQJJWboLyMZZw4WPZheG0A142AmUT3RJos6saryxgw xOiOazypGfhCHk9Pjx77AhGlAfdGrlHKb0LClidkb68ab/rrM8EUqj4NB8lixCZkTA3W XiTw== X-Gm-Message-State: AJIora/dYFgj4x4eK+VTxqzgIKv2PJcSD6CA0tNaKLbZv6PY1M054Hos 5qvcl3Ik1p1/qYWyxc6/8Mc= X-Google-Smtp-Source: AGRyM1sSqfRLsI0RsDDkEx/dMXLezB/q0XsKNxmge2U196i4Gi1R19bmaPHDDrtVUGfpn8tDCQYSVA== X-Received: by 2002:a17:907:2d2b:b0:726:a628:d1ae with SMTP id gs43-20020a1709072d2b00b00726a628d1aemr11401718ejc.336.1656440360397; Tue, 28 Jun 2022 11:19:20 -0700 (PDT) Received: from linuxdev2.toradex.int (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id r1-20020a17090638c100b007219c20dcd8sm6730824ejd.196.2022.06.28.11.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 11:19:19 -0700 (PDT) From: Max Krummenacher To: max.krummenacher@toradex.com Subject: [PATCH v3 1/4] dt-bindings: display: panel-common: allow for additional port node properties Date: Tue, 28 Jun 2022 20:18:35 +0200 Message-Id: <20220628181838.2031-2-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220628181838.2031-1-max.oss.09@gmail.com> References: <20220628181838.2031-1-max.oss.09@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Laurent Pinchart , Krzysztof Kozlowski , Dave Stevenson , David Airlie , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Thierry Reding , Laurent Pinchart , Francesco Dolcini , Christoph Niedermaier Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Max Krummenacher Allow bindings which reference panel-common.yaml to add additional properties under the port node. I.e. 'panel-dpi' needs to add a new property to 'port/endpoint'. Signed-off-by: Max Krummenacher --- Changes in v3: - New commit to allow for additional port node properties .../devicetree/bindings/display/panel/panel-common.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/panel/panel-common.yaml b/Documentation/devicetree/bindings/display/panel/panel-common.yaml index 5b38dc89cb21..ff8dc07ef3b5 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-common.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-common.yaml @@ -68,7 +68,7 @@ properties: # Connectivity port: - $ref: /schemas/graph.yaml#/properties/port + $ref: /schemas/graph.yaml#/$defs/port-base ddc-i2c-bus: $ref: /schemas/types.yaml#/definitions/phandle From patchwork Tue Jun 28 18:18:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12898699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E15F4CCA47E for ; Tue, 28 Jun 2022 18:19:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C9ED1121B5; Tue, 28 Jun 2022 18:19:27 +0000 (UTC) Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 20CE611250F for ; Tue, 28 Jun 2022 18:19:22 +0000 (UTC) Received: by mail-ej1-x62e.google.com with SMTP id ay16so27496925ejb.6 for ; Tue, 28 Jun 2022 11:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QDzRSgTFisXj4PhtHzenD5g/xgSjfVV7DuADmvvCFi4=; b=KjOrEhBWvtHjEyKbpXF7eQD4bLkJuwue0iuwTZJTw5hNgkEN3O8cqoFiHp+R0M4qIB hUKCXk0gVivWEe2CV525KldBaU74ez+Dftnz1LAn5nhEow3JsRXIdzxrqcsG+/1jXMW8 i2YDIRSMtjoPBIC3qlsemd6lYJI7q1vRHBTMjqO1HccKPG1yEp8xyOplZzUU2xqDgOd4 FNh4mBA2WnIZOjMUJaVeCeMM9FZ1SZbgCdcWGENLoAUz1txjfIU5v3MyVZE1d8piLRHw 2zxvdhlNcPxImU9pyVOt4je3tu4t9JZmwhXA8BH20N1AURbZRn6cRp5jrLk/uRA2pBL9 Htug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QDzRSgTFisXj4PhtHzenD5g/xgSjfVV7DuADmvvCFi4=; b=he9oierOnB0xEQ2XosnwX2QbvDsoKObG/SoRX5yjvqLHlnOmNg5Uro/9MetSH0R0RQ o5Se+IQNF0XhbaH+nQsogVsEjNKSKhcMWkjnvjlXwC5qT937UvXVu//+2iqIuxKyBesC 28JYlw4056hxA3wkB+LXiAVcR/bUbgZeT5pGXcbComSuOXqQHMz3WYQPJ2Us0h+6IkfQ QqgCFK867GAW0ghFfLUk3HCc/FP9yYgHjdjxacJt1Pf04gbB2UQEMeP1HVxij0Q9G6Tp hbjQaIUM4uMxfAg7pDGeCZetwavdvCwVvHzpAvUlAhAxBoPGsyBCSpHVer2VwGf9UUg7 nEjA== X-Gm-Message-State: AJIora91LjfQDW+r38pNdGrXoKW4fzNBbPtIMXysgQgRWKJUm5PyJmvG 2ZOYzlLdKd4/0UeezAA+bho= X-Google-Smtp-Source: AGRyM1vBJjG4uIergMlENJ7RYpKM+QuPhC2nbICQYgDNlFIIXLBRz8dC3CqcVT568BW5XQ2Qui0HdQ== X-Received: by 2002:a17:907:60c8:b0:726:d5c1:385c with SMTP id hv8-20020a17090760c800b00726d5c1385cmr3812511ejc.490.1656440361725; Tue, 28 Jun 2022 11:19:21 -0700 (PDT) Received: from linuxdev2.toradex.int (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id r1-20020a17090638c100b007219c20dcd8sm6730824ejd.196.2022.06.28.11.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 11:19:21 -0700 (PDT) From: Max Krummenacher To: max.krummenacher@toradex.com Subject: [PATCH v3 2/4] dt-bindings: display: add new bus-format property for panel-dpi Date: Tue, 28 Jun 2022 20:18:36 +0200 Message-Id: <20220628181838.2031-3-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220628181838.2031-1-max.oss.09@gmail.com> References: <20220628181838.2031-1-max.oss.09@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Krzysztof Kozlowski , Dave Stevenson , David Airlie , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Thierry Reding , Laurent Pinchart , Francesco Dolcini , Christoph Niedermaier Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Max Krummenacher The property is used to set the enum bus_format and infer the bpc for a panel defined by 'panel-dpi'. This specifies how the panel is connected to the display interface. Signed-off-by: Max Krummenacher --- Changes in v3: - Changed the V4L number space as suggested by Rob Herring - Set constraints for bus-format as suggested by Rob Herring, used the range reserved for RGB formats. - Editorial changes as suggested by Rob Herring - Moved the bus-format property under the port/endpoint node as suggested by Rob Herring Changes in v2: - Fix errors found by dt_binding_check .../bindings/display/panel/panel-dpi.yaml | 26 ++++++++++++++++++- .../dt-bindings/display/dt-media-bus-format.h | 23 ++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 include/dt-bindings/display/dt-media-bus-format.h diff --git a/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml b/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml index dae0676b5c6e..52f5db03b6a8 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-dpi.yaml @@ -26,7 +26,28 @@ properties: height-mm: true label: true panel-timing: true - port: true + + port: + $ref: /schemas/graph.yaml#/$defs/port-base + description: + Input port node, receives the panel data. + + properties: + endpoint: + $ref: /schemas/graph.yaml#/$defs/endpoint-base + + properties: + bus-format: + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0x1001 + maximum: 0x1fff + description: | + Describes how the display panel is connected to the display interface. + Valid values are defined in . + The mapping between the color/significance of the panel lines to the + parallel data lines are defined in: + https://www.kernel.org/doc/html/v5.17/userspace-api/media/v4l/subdev-formats.html#packed-rgb-formats + power-supply: true reset-gpios: true width-mm: true @@ -39,6 +60,8 @@ additionalProperties: false examples: - | + #include + panel { compatible = "startek,startek-kd050c", "panel-dpi"; label = "osddisplay"; @@ -47,6 +70,7 @@ examples: port { lcd_in: endpoint { + bus-format = ; remote-endpoint = <&dpi_out>; }; }; diff --git a/include/dt-bindings/display/dt-media-bus-format.h b/include/dt-bindings/display/dt-media-bus-format.h new file mode 100644 index 000000000000..a032d9724ed4 --- /dev/null +++ b/include/dt-bindings/display/dt-media-bus-format.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ +/* + * Copyright 2022 Max Krummenacher + */ + +#ifndef __DT_BINDINGS_DT_MEDIA_BUS_FORMAT_H +#define __DT_BINDINGS_DT_MEDIA_BUS_FORMAT_H + +/* + * Attention: Keep these macro names in sync with + * include/uapi/linux/media-bus-format.h + */ + +#define DT_MEDIA_BUS_FMT_RGB565_1X16 0x1017 +#define DT_MEDIA_BUS_FMT_RGB666_1X18 0x1009 +#define DT_MEDIA_BUS_FMT_RBG888_1X24 0x100e +#define DT_MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015 +#define DT_MEDIA_BUS_FMT_BGR888_1X24 0x1013 +#define DT_MEDIA_BUS_FMT_GBR888_1X24 0x1014 +#define DT_MEDIA_BUS_FMT_RGB888_1X24 0x100a +#define DT_MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f + +#endif /* __DT_BINDINGS_DT_MEDIA_BUS_FORMAT_H */ From patchwork Tue Jun 28 18:18:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12898698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E9A2CCA47F for ; Tue, 28 Jun 2022 18:19:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D23610FE11; Tue, 28 Jun 2022 18:19:26 +0000 (UTC) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9522E10FE11 for ; Tue, 28 Jun 2022 18:19:24 +0000 (UTC) Received: by mail-ej1-x629.google.com with SMTP id u12so27426933eja.8 for ; Tue, 28 Jun 2022 11:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MZmdSXyK7MtJsa+B/2L5AP7mAzbY702Ape25QJtokg0=; b=VsmkR5qJY0evJ3fm7iM52bgRkE8I9EHXpVN8fHRFZwqPDIm+EbxuoYe1h6fAkoC6/F fU/Acpk9fzIEvvuGx2pTJUgQZq+Mxdn81e/xNQbLysGJmJyyJhcGnaAYqBw0IFbI/4oW ZBXUj0vxAbyUD5vj4V6xcGqVWCtWnNY4g6VHi+6ny5ckCNUNuD6yN44bqWGq+Yhq9ZPj Y+mXPudo+13LbYWaityCt5anaCoSLm02ofIneVlO6tklFAt9vuble+ktxS8eo+ymYLs7 g5JcgvkSUh2OXOwb3y7ykw3tVOp3kTmwgUPWPfCYRzUaNbgd2F4D+CZKkSKe99jDalbx uFCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MZmdSXyK7MtJsa+B/2L5AP7mAzbY702Ape25QJtokg0=; b=dthc9K1arRq0dxRD2EqNTGN2ylWEKlp6FKoj0ehghhcBTtSsvVqWZdghKqtU9zB8bk g1o3ZYuNfJBFwdMb3mmpv8PDQsaKM6dOe5aqMRfEHTMIMyHZP5ImLB4Eg4e5whdugJ6i AgtUtm5tvZmpTnaadUGu32Y5+BEfO0mNudSUT86Lf1mM3SIOSzJ6dMregU3nbrZ+RUys UtyToyoZaxkM/wAEsewXXVYXLCkFXlhld3ua1xxpKCKAbj9HzWfViqMPUmCvOjCfSPSa 9EIwetjultdAO5KQb0g/kVcDQ73o/QWN1hUimPSdiIJvXy8HZ7ULD+MD5fR7h3d5DT8s PyGQ== X-Gm-Message-State: AJIora9kjdU27VGcSMrYr/t8wsdixGpKxkqTbs5OhXJmlYgFJyFBM7aA AuCJfoIPVqq055LeSdEou5w= X-Google-Smtp-Source: AGRyM1u6+ZHcJMTYJAMJeLySWF0XNIa0o5fEsh08zyXa+XE/G0OH2joLIthF8b9FEB9yiwxGeMcAYg== X-Received: by 2002:a17:907:608d:b0:722:ebcc:b108 with SMTP id ht13-20020a170907608d00b00722ebccb108mr18528050ejc.94.1656440363047; Tue, 28 Jun 2022 11:19:23 -0700 (PDT) Received: from linuxdev2.toradex.int (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id r1-20020a17090638c100b007219c20dcd8sm6730824ejd.196.2022.06.28.11.19.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 11:19:22 -0700 (PDT) From: Max Krummenacher To: max.krummenacher@toradex.com Subject: [PATCH v3 3/4] dt-bindings: display: startek, startek-kd050c: allow bus-format property Date: Tue, 28 Jun 2022 20:18:37 +0200 Message-Id: <20220628181838.2031-4-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220628181838.2031-1-max.oss.09@gmail.com> References: <20220628181838.2031-1-max.oss.09@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Krzysztof Kozlowski , Dave Stevenson , David Airlie , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Thierry Reding , Laurent Pinchart , Francesco Dolcini , Christoph Niedermaier , Nikita Kiryanov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Max Krummenacher Allow to specify the optional bus-format property newly added to panel-dpi. Signed-off-by: Max Krummenacher --- (no changes since v2) Changes in v2: - New commit allowing bus-format property for derived startek yaml .../bindings/display/panel/startek,startek-kd050c.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/panel/startek,startek-kd050c.yaml b/Documentation/devicetree/bindings/display/panel/startek,startek-kd050c.yaml index fd668640afd1..05306713044e 100644 --- a/Documentation/devicetree/bindings/display/panel/startek,startek-kd050c.yaml +++ b/Documentation/devicetree/bindings/display/panel/startek,startek-kd050c.yaml @@ -19,6 +19,7 @@ properties: - {} # panel-dpi, but not listed here to avoid false select backlight: true + bus-format: true enable-gpios: true height-mm: true label: true From patchwork Tue Jun 28 18:18:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Krummenacher X-Patchwork-Id: 12898700 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 376F3C433EF for ; Tue, 28 Jun 2022 18:19:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E1ED112545; Tue, 28 Jun 2022 18:19:33 +0000 (UTC) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by gabe.freedesktop.org (Postfix) with ESMTPS id D661E10FE11 for ; Tue, 28 Jun 2022 18:19:25 +0000 (UTC) Received: by mail-ed1-x534.google.com with SMTP id eq6so18736356edb.6 for ; Tue, 28 Jun 2022 11:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tQ21Qe6/HH0PqwPXeho4j5BRYRtlFJgSmNIlYUUtH/g=; b=PmczDm6uIboA4bFF/FIMmGWl1NBWMB8ITGdyjJnQQRaWxoTfziOven4LtQBPx96NtX y49ow+C3A41T92WECRrRu3KZ83dIbdL1QeVl6NSieUODMA+WUsngHmsuAgbmVJbvuO8M /BUrzhCWzSMaSX03DJ5LzeXwCCITW9LFFQ3PAdhTulrgkxKIGdIXGpPS7pJ+qrQIhhge R418VGLzfiparjpmAHWAr4Kr81S8BTx4c5on8+1Ashzq2dx2OKTxz6Yaugb6mHkllzdp WI5JC8RtnVN5D2oj/KpyIsRYX6TaxxmK4cm/ufXBwS5BRfR9v6QZqgOYQaALa4uxEcRd 0PSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tQ21Qe6/HH0PqwPXeho4j5BRYRtlFJgSmNIlYUUtH/g=; b=unFeacXTr5PnzB94Glyngo7PCOSexp8z+l0U3e2tY23lGiaffAmBBb19sKqs1WtBTe tOkAsazl73nZmsrpTknpNdhdnSsRpMR3LWoLN99uEXqtiN40mkz0AvJk1dstskonX5Q8 Qvtcl2eDXoGGFY2ASgS9CAqeNSjlX+lD8VYtUOKiUlKGjJ3tQdfRXxB2nPW4c+QMa7ZY wx7MAlN2I6Q//5C0XM/ZKLd6u1VndgRsujH8fvBlFBP0lcMBNbMOLwVdgM+19G2VaiJt dJOXuJ+b7ftxstENtTSkUu6MwF6QG477UVyVzEExVzEEFGb+K+fItbMqsBEBQQTiHNCB PsQA== X-Gm-Message-State: AJIora8HyUODOGSMEKod5DwfSHU2YSiOUVr6eTDK+8K/5uMeLkRNUG4u ZI1M68XnNopq6fxx2xnOqzo= X-Google-Smtp-Source: AGRyM1sfzeHqz9BmBxhOpol3io6Vf9MypkibuGC9+3ldWD5awns9qn/8hQhrcs/OSOeVi5NRYzwqtQ== X-Received: by 2002:a05:6402:1a4d:b0:435:74ce:7b36 with SMTP id bf13-20020a0564021a4d00b0043574ce7b36mr24501675edb.94.1656440364333; Tue, 28 Jun 2022 11:19:24 -0700 (PDT) Received: from linuxdev2.toradex.int (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id r1-20020a17090638c100b007219c20dcd8sm6730824ejd.196.2022.06.28.11.19.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 11:19:23 -0700 (PDT) From: Max Krummenacher To: max.krummenacher@toradex.com Subject: [PATCH v3 4/4] drm/panel: simple: add bus-format support for panel-dpi Date: Tue, 28 Jun 2022 20:18:38 +0200 Message-Id: <20220628181838.2031-5-max.oss.09@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220628181838.2031-1-max.oss.09@gmail.com> References: <20220628181838.2031-1-max.oss.09@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Dave Stevenson , David Airlie , Sam Ravnborg , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Thierry Reding , Laurent Pinchart , Francesco Dolcini , Christoph Niedermaier Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Max Krummenacher Evaluate the device tree bus-format property to set bus_format for a 'panel-dpi' panel. Additionally infer the bpc value from the given bus-format. Valid values for bus-format are found in: This completes the addition of panel-dpi to completely specify a panel-simple panel from the device tree. Signed-off-by: Max Krummenacher Reviewed-by: Aradhya Bhatia --- Changes in v3: - Moved the bus-format property under the port/endpoint node as suggested by Rob Herring Changes in v2: - Fix errors found by dt_binding_check drivers/gpu/drm/panel/panel-simple.c | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 4a2e580a2f7b..f1a457f1069e 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -21,9 +21,11 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include #include #include +#include #include #include #include @@ -449,10 +451,12 @@ static int panel_dpi_probe(struct device *dev, struct panel_simple *panel) { struct display_timing *timing; + struct device_node *endpoint; const struct device_node *np; struct panel_desc *desc; unsigned int bus_flags; struct videomode vm; + u32 bus_format; int ret; np = dev->of_node; @@ -477,6 +481,51 @@ static int panel_dpi_probe(struct device *dev, of_property_read_u32(np, "width-mm", &desc->size.width); of_property_read_u32(np, "height-mm", &desc->size.height); + endpoint = of_graph_get_endpoint_by_regs(np, -1, -1); + if (endpoint && + !of_property_read_u32(endpoint, "bus-format", &bus_format)) { + /* infer bpc from bus-format */ + switch (bus_format) { + case DT_MEDIA_BUS_FMT_RGB565_1X16: + desc->bus_format = MEDIA_BUS_FMT_RGB565_1X16; + desc->bpc = 6; + break; + case DT_MEDIA_BUS_FMT_RGB666_1X18: + desc->bus_format = MEDIA_BUS_FMT_RGB666_1X18; + desc->bpc = 6; + break; + case DT_MEDIA_BUS_FMT_RGB666_1X24_CPADHI: + desc->bus_format = MEDIA_BUS_FMT_RGB666_1X24_CPADHI; + desc->bpc = 6; + break; + case DT_MEDIA_BUS_FMT_BGR888_1X24: + desc->bus_format = MEDIA_BUS_FMT_BGR888_1X24; + desc->bpc = 8; + break; + case DT_MEDIA_BUS_FMT_GBR888_1X24: + desc->bus_format = MEDIA_BUS_FMT_GBR888_1X24; + desc->bpc = 8; + break; + case DT_MEDIA_BUS_FMT_RBG888_1X24: + desc->bus_format = MEDIA_BUS_FMT_RBG888_1X24; + desc->bpc = 8; + break; + case DT_MEDIA_BUS_FMT_RGB888_1X24: + desc->bus_format = MEDIA_BUS_FMT_RGB888_1X24; + desc->bpc = 8; + break; + case DT_MEDIA_BUS_FMT_RGB888_1X32_PADHI: + desc->bus_format = MEDIA_BUS_FMT_RGB888_1X32_PADHI; + desc->bpc = 8; + break; + default: + dev_err(dev, "%pOF: unknown bus-format property\n", np); + return -EINVAL; + } + } + + of_node_put(endpoint); + /* Extract bus_flags from display_timing */ bus_flags = 0; vm.flags = timing->flags;