From patchwork Wed Mar 29 13:04:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13192368 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 22039C6FD18 for ; Wed, 29 Mar 2023 13:04:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 399C610EAA6; Wed, 29 Mar 2023 13:04:29 +0000 (UTC) Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 81DDB10EAA2 for ; Wed, 29 Mar 2023 13:04:26 +0000 (UTC) Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-17aaa51a911so16114001fac.5 for ; Wed, 29 Mar 2023 06:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680095065; x=1682687065; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ruA4RM4hHwK5/3naD/sja9/lwOJ8mtV77wdWda/c6wY=; b=NTK3ldykso7B72PreBcP92SQ8c9Tc1DuQG7Un+/WeuzvxZijPnGiEHphAcn40hmBqT GIwMv7ORE8rdKqJBK5ETeLmdLh/m8GMNGOqphvuvJkXxKTDYYuta9Z4hSPzN3ViEcd7j 1La7Qnj8+ahpJ+Vl8LAo06IIq0Cj1dFPCyuIInod044dkT7ISwH9qz0XJMaIhCGF4lGZ QWHwx/s1CUsIrTlzllTAVaYRGcuXNETGJukll4bifJBB9qt08+3tWvhr4xBjAVlVumHL IJY3Wk2Djk/YccKy9sxt26O5FAEF8R9aZXlhugiOJKYWo+12Hy8+bttZEhrllzVqV/z8 TwEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680095065; x=1682687065; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ruA4RM4hHwK5/3naD/sja9/lwOJ8mtV77wdWda/c6wY=; b=4MLPYVyDMSxezs4g0Q8I+30ba4ds6Vr/65gTJKze7YKOgsFHBbqT64RK2PkWCO57GG FmbiQk7nzA/YwJ6W97YmkaEqZrO6Esdm0prEeeNf11l5sNtoOzgEz1hEWnpTe6+/sNHc yjZFF8MpY0F7prJ9kZXhp9Heo7pd02c9dCpx3GpMyfZUgBNVTlpeCsLgTT6po0E5ATNc nCkLn9JF6iDE3MkEJKMahREQdagEh2/wkTW+8IhU1nxwG6oonnhYguyKsEeo5WsPRH2i mx3wIXP+K7RZUeNif/lOaYtahMw9jQPSduVy6IiH2x4mcdE1fLp2ZxOs2n+M5dLOqU29 Oy0w== X-Gm-Message-State: AAQBX9e21vX4s1s9c5AGgEnj59nws3A3EE56L33xTdXNetCqPLXuIBuH xDf5OPNSMZyz6iS7IPJDpFs= X-Google-Smtp-Source: AKy350Yw05MiS/wqizw5O54Ri+I9y0JW1pKsuowoI4g7KOGB2eLbMlq0kAgam4wxBVIwM9JGB4hbIA== X-Received: by 2002:a05:6870:a2d0:b0:176:3c73:2ef1 with SMTP id w16-20020a056870a2d000b001763c732ef1mr11400890oak.4.1680095065591; Wed, 29 Mar 2023 06:04:25 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b69:1c2d:271:d34:84ea]) by smtp.gmail.com with ESMTPSA id vh22-20020a0568710d1600b00177c21c3ae1sm11756738oab.54.2023.03.29.06.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 06:04:25 -0700 (PDT) From: Fabio Estevam To: neil.armstrong@linaro.org Subject: [PATCH 1/2] dt-bindings: display: bridge: ldb: Add i.MX6SX support Date: Wed, 29 Mar 2023 10:04:12 -0300 Message-Id: <20230329130413.683636-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 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: marex@denx.de, devicetree@vger.kernel.org, Fabio Estevam , dri-devel@lists.freedesktop.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam i.MX6SX has a single LVDS port and share a similar LDB_CTRL register layout with i.MX8MP and i.MX93. Signed-off-by: Fabio Estevam --- .../devicetree/bindings/display/bridge/fsl,ldb.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml index 6e0e3ba9b49e..4f842bcfba1a 100644 --- a/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml +++ b/Documentation/devicetree/bindings/display/bridge/fsl,ldb.yaml @@ -17,6 +17,7 @@ description: | properties: compatible: enum: + - fsl,imx6sx-ldb - fsl,imx8mp-ldb - fsl,imx93-ldb @@ -60,6 +61,16 @@ required: - ports allOf: + - if: + properties: + compatible: + contains: + const: fsl,imx6sx-ldb + then: + properties: + ports: + properties: + port@2: false - if: properties: compatible: From patchwork Wed Mar 29 13:04:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13192369 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 88D1AC6FD18 for ; Wed, 29 Mar 2023 13:04:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2DF810EAA7; Wed, 29 Mar 2023 13:04:37 +0000 (UTC) Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3378C10EAA2 for ; Wed, 29 Mar 2023 13:04:29 +0000 (UTC) Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-69f00c18059so430524a34.0 for ; Wed, 29 Mar 2023 06:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680095068; x=1682687068; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W2nlDdxQ+8oqnxMfAmS2IM4hfEcDsCHfoeDDJXGLcGs=; b=Ghnd82MukIsklEvY2FPCOYreW8VJlcWxEqiwIg3Dw0YJxNPuMmo3Ncx00mnTor7maz n9KTPnc/dAtLKMmbaibtTY2bLdQQxLkNRitcIx7fwCqdv458HruOTuNVzU5SuscqzrsL L8Au8dwLlD2529piZbHwzX1/Jx3Ksv9UOQW7aduiGy8tFRBkusVpLg+eqHzqdZdSOdA1 LGHhWCUQVs+vLEplE/lHjYMJn6h7xdKJgNOj1kK4kEDtx/7SCurB1RIGba/VI7/xTOB2 FSQo/WBGqJv6afMqHFMiCUoKwjNgUYvUKDMHO3qy2etCof5aG1QJ/naT6EZqCYoWqBBJ vpsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680095068; x=1682687068; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W2nlDdxQ+8oqnxMfAmS2IM4hfEcDsCHfoeDDJXGLcGs=; b=6LRg294DGEnhTliDU+GhRYlcVxypy+afa9NVouj70g/zHwpOn9UUs6GNpDBO1Hcc4Y F2MJfUW/W/2Mh3MHD6PLsaPJHAsPAQvu9Pn/To/tEX0toQOIvfgQXVYiidAEkfR4W0WN w2436sZ7v1TkqRe+ZH6vptr3uYtoij0mnZgfH7wg5Al41BgFLh0ge2oTxIgy1pyWowwr CZ+q8YKvG86Ig/E9eU7KGe0Il4XZSzutfwGZQX+6CLim3htJxRsgmJzqIFEoUhTLcDeo L0FgQwUsMUzh4wVm+McscOuDmRsiYxUKArD4DLcIE13L9W++UGILIXdOFk4a8FqMFioP 7/+Q== X-Gm-Message-State: AO0yUKUcBWjlfdmP3DSY3z+n2m4m6rG6wX/q3MYpDqu2GCjPfJ9+qzNB /vTbfS/tEimfwR+JSfqxsD4= X-Google-Smtp-Source: AKy350bKUi+LEKXbWkxah0X0OpfbGYrotDH6ZTw7UY8XP7oE/qIJgJiTYuMSFNAHUUxwW4pG885Myg== X-Received: by 2002:a05:6870:b14c:b0:177:8383:7287 with SMTP id a12-20020a056870b14c00b0017783837287mr10879516oal.5.1680095068471; Wed, 29 Mar 2023 06:04:28 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b69:1c2d:271:d34:84ea]) by smtp.gmail.com with ESMTPSA id vh22-20020a0568710d1600b00177c21c3ae1sm11756738oab.54.2023.03.29.06.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 06:04:28 -0700 (PDT) From: Fabio Estevam To: neil.armstrong@linaro.org Subject: [PATCH 2/2] drm/bridge: fsl-ldb: Add i.MX6SX support Date: Wed, 29 Mar 2023 10:04:13 -0300 Message-Id: <20230329130413.683636-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230329130413.683636-1-festevam@gmail.com> References: <20230329130413.683636-1-festevam@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: marex@denx.de, devicetree@vger.kernel.org, Fabio Estevam , dri-devel@lists.freedesktop.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam i.MX6SX has a single LVDS port and share a similar LDB_CTRL register layout with i.MX8MP and i.MX93. There is no LVDS CTRL register on the i.MX6SX, so only write to this register on the appropriate SoCs. Add support for the i.MX6SX LDB. Tested on a imx6sx-sdb board with a Hannstar HSD100PXN1 LVDS panel and also on a custom i.MX6SX-based board. Signed-off-by: Fabio Estevam --- drivers/gpu/drm/bridge/fsl-ldb.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/fsl-ldb.c b/drivers/gpu/drm/bridge/fsl-ldb.c index 450b352914f4..f8e5d8ab98e3 100644 --- a/drivers/gpu/drm/bridge/fsl-ldb.c +++ b/drivers/gpu/drm/bridge/fsl-ldb.c @@ -56,6 +56,7 @@ #define LVDS_CTRL_VBG_ADJ_MASK GENMASK(19, 17) enum fsl_ldb_devtype { + IMX6SX_LDB, IMX8MP_LDB, IMX93_LDB, }; @@ -64,9 +65,14 @@ struct fsl_ldb_devdata { u32 ldb_ctrl; u32 lvds_ctrl; bool lvds_en_bit; + bool not_lvds_ctrl; }; static const struct fsl_ldb_devdata fsl_ldb_devdata[] = { + [IMX6SX_LDB] = { + .ldb_ctrl = 0x18, + .not_lvds_ctrl = true, + }, [IMX8MP_LDB] = { .ldb_ctrl = 0x5c, .lvds_ctrl = 0x128, @@ -202,6 +208,9 @@ static void fsl_ldb_atomic_enable(struct drm_bridge *bridge, regmap_write(fsl_ldb->regmap, fsl_ldb->devdata->ldb_ctrl, reg); + if (fsl_ldb->devdata->not_lvds_ctrl) + return; + /* Program LVDS_CTRL */ reg = LVDS_CTRL_CC_ADJ(2) | LVDS_CTRL_PRE_EMPH_EN | LVDS_CTRL_PRE_EMPH_ADJ(3) | LVDS_CTRL_VBG_EN; @@ -228,7 +237,8 @@ static void fsl_ldb_atomic_disable(struct drm_bridge *bridge, regmap_write(fsl_ldb->regmap, fsl_ldb->devdata->lvds_ctrl, LVDS_CTRL_LVDS_EN); else - regmap_write(fsl_ldb->regmap, fsl_ldb->devdata->lvds_ctrl, 0); + if (!fsl_ldb->devdata->not_lvds_ctrl) + regmap_write(fsl_ldb->regmap, fsl_ldb->devdata->lvds_ctrl, 0); regmap_write(fsl_ldb->regmap, fsl_ldb->devdata->ldb_ctrl, 0); clk_disable_unprepare(fsl_ldb->clk); @@ -355,6 +365,8 @@ static void fsl_ldb_remove(struct platform_device *pdev) } static const struct of_device_id fsl_ldb_match[] = { + { .compatible = "fsl,imx6sx-ldb", + .data = &fsl_ldb_devdata[IMX6SX_LDB], }, { .compatible = "fsl,imx8mp-ldb", .data = &fsl_ldb_devdata[IMX8MP_LDB], }, { .compatible = "fsl,imx93-ldb",