From patchwork Fri Dec 9 15:23:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069741 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 70855C4332F for ; Fri, 9 Dec 2022 15:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RZryQuvnkr0i5CBpijr65UD8tuxmp+o4/Q2M0HO5Vdw=; b=wpvRpi8Rpw6/GP piyE+8wPOoMqAGPvUqRLrTtoaFY8VxBOCTQIG+5cy1Xq4+7Pv7wPiCeh4NFJXEjdyXr4JCTsSreOE w3bbDKH9u4sHLBXOdm1LDt03WfFWdEylfcTKucKHq2w/wm3/QKyxj6Ts8eQYrt9QlDsCN3fvd07nv zG/o3FFnpt51A+7xck9iXbGx68zNPnu0jORihhXQm1HAhcSDmv6eiaeFPv/N9ywjsEeMoUf2yrJK6 oOTou+BM3/mwqoAowIHiVKKWffXdLCXIsFoJp2hAcJKMGC28mpH9YcI1BbVv0fflgZ94ftIeKRVee fP5pp7ilUozJOHoQ/rmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fFC-008xrT-Dc; Fri, 09 Dec 2022 15:24:58 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fF3-008xms-RA for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:24:51 +0000 Received: by mail-pl1-x62a.google.com with SMTP id s7so5212640plk.5 for ; Fri, 09 Dec 2022 07:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=eTlIC0zI1Wi04nUSq7MlTOuX//tM1g/xJ2R4VB/eGys=; b=g1b6XAl8aH+YaD6otDmNaD3Bue22WRopExSEMZUBXh96YiL+lLM3JtmYqZwoFW7wcF 3UgsImB2AnViVJD/2slwmg6c29rY7vpgsLm25JFYkMajOJ4RMtuczXdWw3fyiGNqVW7+ 7W4vDEYSB0L/iGmPCosUvm0TP8XGfs6rObHHY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=eTlIC0zI1Wi04nUSq7MlTOuX//tM1g/xJ2R4VB/eGys=; b=TZtDj2j0jkKWjp2HRtBpixWbftCudH9HyFX6+q0I//rPEK2JRqWmvsX9uYbpY2qYl3 ueguYUCNz7pyh+XCJsQcea5F6TA82t9y44nTUpd6W0clAM2Dfpcdc8ZzqfokmChgh0IO dy0JRy1ns5M6Bae+/R1Qcl6TMdHXVvSu9MuuBLNY9ejkqxdUsE7y+9/5Q6hHzuaCVJLQ ygVVHzzISKYAO/rIJelfcgqHS0F4RRejoQ0NaY1es3C8RA8d9DYmWOXGYltrsTsEzVhh bvEt1IOgY8WKJhi9CVh4QTGg8u8B0dOlmdpFAGOhIjcWreNoYpczbzGgtI+RGRP8qgjq hN0w== X-Gm-Message-State: ANoB5plIJJWZuYh08UyaE7lheIq/poBQBV1Oj8UKXIEtll1uUpOdg7p6 BWVQaku2Sz5LOUQa0PncVxZNMg== X-Google-Smtp-Source: AA0mqf5cQQSzU9aFwm47EhabJSc6yk+HBn2AkQ718jULfiQnBSs+wvKclsDN7KSCgGIi5nUDX4SqeQ== X-Received: by 2002:a17:902:a9c6:b0:189:e7e:7843 with SMTP id b6-20020a170902a9c600b001890e7e7843mr5805033plr.32.1670599486009; Fri, 09 Dec 2022 07:24:46 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:24:45 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 01/18] drm: panel: Enable prepare_prev_first flag for samsung-s6e panels Date: Fri, 9 Dec 2022 20:53:26 +0530 Message-Id: <20221209152343.180139-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072449_916299_37403285 X-CRM114-Status: GOOD ( 11.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Enable the drm panel prepare_prev_first flag so-that the previous controller should be prepared first before the prepare for the panel is called.     samsung-s6e3ha2, samsung-s6e63j0x03 and samsung-s6e8aa0 are the effected samsung-s6e panels for this change.     This makes sure that the previous controller, likely to be a DSI host controller should be initialized to LP-11 before the panel is powered up. Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v9: - new patch drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 1 + drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c | 1 + drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 1 + 3 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c index 5c621b15e84c..1355b2c27932 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c @@ -731,6 +731,7 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi) drm_panel_init(&ctx->panel, dev, &s6e3ha2_drm_funcs, DRM_MODE_CONNECTOR_DSI); + ctx->panel.prepare_prev_first = true; drm_panel_add(&ctx->panel); diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c index e06fd35de814..3223a9d06a50 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c @@ -462,6 +462,7 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi) drm_panel_init(&ctx->panel, dev, &s6e63j0x03_funcs, DRM_MODE_CONNECTOR_DSI); + ctx->panel.prepare_prev_first = true; ctx->bl_dev = backlight_device_register("s6e63j0x03", dev, ctx, &s6e63j0x03_bl_ops, NULL); diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c index 54213beafaf5..362eb10f10ce 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c @@ -1018,6 +1018,7 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi) drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs, DRM_MODE_CONNECTOR_DSI); + ctx->panel.prepare_prev_first = true; drm_panel_add(&ctx->panel); From patchwork Fri Dec 9 15:23:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069742 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9031CC4332F for ; Fri, 9 Dec 2022 15:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YbWyEiD2db2G3OSY3xMMwjtAcKEPJ1X/cx/zCKnxOjI=; b=CVBqYohsWtVBT6 +ds3/ST6BSUOrdaWYss6p/A/YYD9PmqV9A/8b0ORl2l1lOUA4/ga+8hbSDF47/KWDhYBStrvvu366 JFuezvNVAvPygm1oL/vAgucJx3KkBCzKtYiiVr6iK935sfctyJqWGL5Kk2Z9x/pQcmGKQpYu/eE2G 3TkksZ4zqkb/C1/iOmzbx1IDGIl1BIyhSK55ZKWB+vRNgSqxdzTS7xd7x+dtmzdLj5qNiJJPPXdO3 h3U1mzlXhEjX4tMMe1MlJbA6zEaVa5zjdySOQKbRpm7V0cuh2EUlX6gkP4xlch6e4N8/coZnfa+rq 0bcBlu+YK+IJKrA6u2ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fFZ-008y1c-1n; Fri, 09 Dec 2022 15:25:21 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fFI-008xms-AC for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:25:07 +0000 Received: by mail-pl1-x62a.google.com with SMTP id s7so5213642plk.5 for ; Fri, 09 Dec 2022 07:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=H0bkfE/NcofHpZ784ykKYOCGEROmx5jroWhn+xMWIFY=; b=eJ9/BncMiZUP6tyio2c5dxhR4akKO8sbrLzdigRs0sWHSF2tDdt8HHFUTamDhZqS1y Se98Nh1glWWeK0/aPQmisXFcUNTIT5gVajJadORR47SozG+o8lKQerc4DDjfQYFYv0zJ nwp4DnvtDf3SdjXO8RYhMVPN01NIU24glAQ1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=H0bkfE/NcofHpZ784ykKYOCGEROmx5jroWhn+xMWIFY=; b=K2E8ybsY2mwEceOukLFPC8BXEl8eP+lNVGVd+ZzFLM3oVOv7mKf6Dn0gWYHMyTyILm bI4qw+//QOwrA1FnhNGvUhtoJdNuXseP7UHORY1Gg2QqePvSomhGabKCf555sDclVIlq lTLxlTbfzjmr/liWqjdRJyqapMt6t/fQ8myg2Tn4QkPAcV+E7KMcwVDpngZGHzPFGzEK m9+a2CMzx9cAWHJI4768k2ZVCIvUVvRdvtXHADr53XXetV70/oQd+LYBR/Oa42CtJR9N 0hJVQLt8REbY740QCyUCw1Xe+ndIwjLljT7FACXCw+GyiXdFy+yq/oHFuh8DKQ2dKGWI +vag== X-Gm-Message-State: ANoB5pl1GpSbMSpcMgaTaZYOzaZ5OjHCgquuCxkR2rIrjRstlZK0Jmof Y2K42AC4oxloZa0A+KxrhMSfEw== X-Google-Smtp-Source: AA0mqf7FzJBBotDaa2r+o1ZDMAzGBSGDePLkRq8t9eln0607UPuyfEwdDluW2xioJrmKEHZSLoHHkA== X-Received: by 2002:a17:902:6bcc:b0:186:d89d:f0c1 with SMTP id m12-20020a1709026bcc00b00186d89df0c1mr5247211plt.42.1670599503903; Fri, 09 Dec 2022 07:25:03 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:25:03 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 02/18] drm/bridge: tc358764: Enable pre_enable_prev_first flag Date: Fri, 9 Dec 2022 20:53:27 +0530 Message-Id: <20221209152343.180139-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072504_404119_EC790751 X-CRM114-Status: GOOD ( 10.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Marek Szyprowski Enable the drm bridge pre_enable_prev_first flag so that the previous bridge pre_enable should be called first before the pre_enable for the tc358764 bridge is called. This makes sure that the previous bridge should be initialized properly before the tc358764 bridge is powered up. Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes for v9: - new patch drivers/gpu/drm/bridge/tc358764.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c index 53259c12d777..f85654f1b104 100644 --- a/drivers/gpu/drm/bridge/tc358764.c +++ b/drivers/gpu/drm/bridge/tc358764.c @@ -369,6 +369,7 @@ static int tc358764_probe(struct mipi_dsi_device *dsi) ctx->bridge.funcs = &tc358764_bridge_funcs; ctx->bridge.of_node = dev->of_node; + ctx->bridge.pre_enable_prev_first = true; drm_bridge_add(&ctx->bridge); From patchwork Fri Dec 9 15:23:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069743 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 1F333C4332F for ; Fri, 9 Dec 2022 15:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4cxVGV4bDZ40OAR3nRzt6Jhd4vYhlDajF3Q6c8QdfYM=; b=fmDVxL9vy4h7Sl J5Ydmu+rgWuJJo19Aj7Ourv9QnMynA2jBAbDJBlkaExrRcxR+gFucVN5vCQuoZN0OdwJoc26Uz1cS ILWKO0AOXZxfNFfOgLPsJLSU12TDJSMyuBNVLfiWpvEecjnAacph1AcfoPsYoOFcZTK4c5VIsP+mu ciBB06/0P+sypeui0T1R3W9Wz1a5wIlJakAvP6jcQtSfWgcBwgJJqY+c1pLfs8m9wuO8vNo1Rffyh 9xH1BugNAgSK3CQPcgMrd8Fc80KLSzwOkIwwr/RB6aHTrKZg8T0mC+PdcJZncQL4nNsTybsIcuhyV 0Kgn6naptgtDZCemVM2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fGq-008yYL-63; Fri, 09 Dec 2022 15:26:40 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fFb-008y2L-7A for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:25:24 +0000 Received: by mail-pj1-x1030.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so8458037pjs.4 for ; Fri, 09 Dec 2022 07:25:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=PD94MxZvqnUHdTxMPOsMMefL4P5i3Lz9kxEOBEFMSCo=; b=fgweV2Uq8N0wlYzgaQf47mr3LjVRC1L35wZBye2l2ywZp+X8ADFusTUNhQw0f6lk9P 27uxEklHfJHgkztkRzT1ebKwWhf2Udt8AhGxxpIPfi97mUiVEHs+clm3w73iqJ7r9QNu FXBQ4h7VvNyx0yT2X5+zkU0QluR+oe92T2T3o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=PD94MxZvqnUHdTxMPOsMMefL4P5i3Lz9kxEOBEFMSCo=; b=b2wmSBjBKMBoA7rrGuI2kHcqHMM/ZUjsy4iNVa7yD1UvzWzx9htXI2oA2bjuQ9mzyr 4aqVvNB3IWyAhelkcET7Wk0TAjbPdlzUu65B+roAvRYAEy3gaZZnRubxZp0dxS8wV9d3 yX40LkvUqb/zTNZ72CQ5SIT5LIO9nNhkVuxgkrLUh4zGg9jFnmSqdZTQuqdFsPhH0nNm it2FMIAaLPUU4htpklY7Kh8hqRR257E5N8EBOVPr8AiJzQeJTnDyzGGkZEFFgh+hrtKe NvKSxMSUOK1D297pnxvHq+aa1xHr5V318zs0KqBNEwS9KRNeKBPfc0z9sSeu8Bg+CGV/ oDbQ== X-Gm-Message-State: ANoB5pljq7uGCtxHBUaBcti2RkAbgL+qd+IsmwC8TYBXq+MdhGtscYMo zPw9DOetbrCu+vla2EhqR4o86w== X-Google-Smtp-Source: AA0mqf55QoYZLG6Nui2W9ugkOWOA5s1EfgG0BbVEJCTMmNiChg7PB7qm/TxsNC8i1BTTAMeUFXU6Ww== X-Received: by 2002:a17:902:e845:b0:189:f8d0:7b8f with SMTP id t5-20020a170902e84500b00189f8d07b8fmr6620275plg.63.1670599521074; Fri, 09 Dec 2022 07:25:21 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:25:20 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 03/18] drm: exynos: dsi: Restore proper bridge chain order Date: Fri, 9 Dec 2022 20:53:28 +0530 Message-Id: <20221209152343.180139-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072523_296339_A1B2E3CD X-CRM114-Status: GOOD ( 12.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Marek Szyprowski Restore the proper bridge chain by finding the previous bridge in the chain instead of passing NULL. This establishes a proper bridge chain while attaching downstream bridges. v9, v4: * none v3: * new patch Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index ec673223d6b7..e5b1540c4ae4 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1428,7 +1428,8 @@ static int exynos_dsi_attach(struct drm_bridge *bridge, { struct exynos_dsi *dsi = bridge_to_dsi(bridge); - return drm_bridge_attach(bridge->encoder, dsi->out_bridge, NULL, flags); + return drm_bridge_attach(bridge->encoder, dsi->out_bridge, bridge, + flags); } static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = { @@ -1474,7 +1475,10 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host, drm_bridge_add(&dsi->bridge); - drm_bridge_attach(encoder, &dsi->bridge, NULL, 0); + drm_bridge_attach(encoder, &dsi->bridge, + list_first_entry_or_null(&encoder->bridge_chain, + struct drm_bridge, + chain_node), 0); /* * This is a temporary solution and should be made by more generic way. From patchwork Fri Dec 9 15:23:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069744 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2872BC4332F for ; Fri, 9 Dec 2022 15:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HXIDGzZo2RFeLX9uFpPL4JuAIwTCjWwKAYRLbi0r2nU=; b=VUS0Uj1H6OTnJ9 ctKeMXA3AIP0eXvuOufsTgDLXXKks5itJmSjL2ff3r1Q4iqjUzC5+vHJdGCoCySeLIh94whrLzBHz HogMVR+LLAiuVLmHXGqzyO6kzW8ayvRkZz3+ruD9W14EaX2cB8bDhhWDBdhvdsAPTmx5l6Z/FlJIS RgMaGySnwUDgtZlGl+i/H2tRMzGui1DlWX4vsFsTLYurWFM+OU7ne/+JL+aRhFOmtpq2RbgA0tpgE wH7v0r+62BMPBnYWkDwkfsH3ucZl3uOCMIOPVE4XpzmJJPPi5yrHcjfob1NogwFXYkMp23D8MqMxt k7k5KIcbE8VXluSNA5ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fHK-008yk4-QZ; Fri, 09 Dec 2022 15:27:11 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fFq-008y9o-TK for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:25:40 +0000 Received: by mail-pj1-x1032.google.com with SMTP id o12so5142096pjo.4 for ; Fri, 09 Dec 2022 07:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=6CUJYu0PBu1wfIOC7kGOkRHJr7T1+ycl/j32CgnvDxw=; b=BNqDuX9tCXUwEPPEht+0AtSFgnlyXtEfwk5mlTDou/QjBGbxg9H0RiKTcLx1xGgD9j +PD333SYes27F95zWb5J9dfT6mlpPftq+QRAoPUzZe7i/+/UEWt4Ov4wFOsG6GYubiSe SBSSVq3qOVziT57z4MuOHJh21bupHIvwL6QCc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=6CUJYu0PBu1wfIOC7kGOkRHJr7T1+ycl/j32CgnvDxw=; b=Mjx5WRzXAtBm+DN+H2cv+VURMJAC6F+Mtdpk6j4EOOjr2LMkbYnX+3inWoXeo6KAbY O5ipJDQAniRuyXIM0JVYjO7pqKdhJu3jZAgugMyOgepJQDvZACOF91ymCIRqxxNxzXcd 78R5yeuN7lyOHoHiqjtXqs49XNTSMVVAz8DhzQ8JDczaN8g0PeSh4lGZpcwKmAC4CqmF rGSkVT7sM9gNK1sbzgf7J+wJTzrDWqeEjrFdgHRFp5Ef1qMfUlnvuCvaMdg3iSk9cIwW 7MVgDe7APKVYu3JYVZQLlnYRTwpjSigb7Tlfx27nktBNicLxdnJ7dJev8sCuNuBbujIX X1Dg== X-Gm-Message-State: ANoB5pmsuElho3iOXeYl+5Zf7uM7ApMMVA8cLGLAAUAEgMMUZi4uqgI8 rDxnIKLYUvrn1BaWVIwLPYIThg== X-Google-Smtp-Source: AA0mqf465vsLSnLp/ogCPrLxZJp71LtF3FRDfQ+QQy3YrIC+dGWepCwsDCXMx3VH4Fq/lJnFoIGrqQ== X-Received: by 2002:a17:902:c745:b0:189:9519:87b6 with SMTP id q5-20020a170902c74500b00189951987b6mr5017053plq.5.1670599538323; Fri, 09 Dec 2022 07:25:38 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:25:37 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Subject: [PATCH v9 04/18] drm: exynos: dsi: Fix MIPI_DSI*_NO_* mode flags Date: Fri, 9 Dec 2022 20:53:29 +0530 Message-Id: <20221209152343.180139-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072538_984329_94E34431 X-CRM114-Status: GOOD ( 11.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Matteo Lisi , dri-devel@lists.freedesktop.org, Nicolas Boichat , NXP Linux Team , linux-amarula , linux-arm-kernel@lists.infradead.org, Jagan Teki Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org HFP/HBP/HSA/EOT_PACKET modes in Exynos DSI host specifies 0 = Enable and 1 = Disable. The logic for checking these mode flags was correct before the MIPI_DSI*_NO_* mode flag conversion. Fix the MIPI_DSI*_NO_* mode flags handling. Fixes: <0f3b68b66a6d> ("drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features") Reviewed-by: Nicolas Boichat Reported-by: Sébastien Szymanski Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v9: - none drivers/gpu/drm/exynos/exynos_drm_dsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index e5b1540c4ae4..50a2a9ca88a9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -805,15 +805,15 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) reg |= DSIM_AUTO_MODE; if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_HSE) reg |= DSIM_HSE_MODE; - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HFP)) + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HFP) reg |= DSIM_HFP_MODE; - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HBP)) + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HBP) reg |= DSIM_HBP_MODE; - if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HSA)) + if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HSA) reg |= DSIM_HSA_MODE; } - if (!(dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)) + if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) reg |= DSIM_EOT_DISABLE; switch (dsi->format) { From patchwork Fri Dec 9 15:23:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069872 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0208DC4332F for ; Fri, 9 Dec 2022 15:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DKW7F9u2A0p7eu/GO6kUg3VennwEI3x7giLgQcEttHg=; b=C65DMEWAoYAs2H AWaJtDfXq1Ris3EDtEKECgAEv/cNxF1FPT8Dbs3lO8L0ZGdJZZnzfZpAkytAORmWE0aSZPQMGFijQ 54HzinIx54QE9wwd5i08tE7UfStAUky29bbr6FBf/+AsfgPJdA18H9FywMvKgt2VYuvLzaZ9W4YCM r06SwovCH7K0twwguDI6cBYEryGFyB89D64YT3SEwxToWl9hYUUprYQACCGnvPb+nYtco3nAAvnjP qNzvbR6ZmZkQRMBdZY62llL2yN9/bLJD4uRDYF6FB9Q89NgtW8Hz844V3fErKCaAyhzkQ0xFOeRIx FkhBv4K1pfwe13Gnq++Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fK9-008zvb-2t; Fri, 09 Dec 2022 15:30:05 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fG8-008yFW-J6 for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:25:58 +0000 Received: by mail-pl1-x62c.google.com with SMTP id y17so5222925plp.3 for ; Fri, 09 Dec 2022 07:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=LFDauSpXdcfcdulBlIlfj04e257Z0kmZtXLY+iJX2Pg=; b=ryEFa27h8SLc1qWdmoMlBp0bx55NLrrGgH8Zv2/ERI2Xh22eUHA7BUmUDn/Gc7LQBT hYdFsZFpSKssP6unOy5EqipGJ6JuD+hZ7QZ1x4lS9Ym95THHWxHBTsodhxHcgjl24yMq nubrbGC+/k210FrvNnYYGqWDjg7PARSDn65NY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=LFDauSpXdcfcdulBlIlfj04e257Z0kmZtXLY+iJX2Pg=; b=owoPFJcELrF+XSh5+RDoIF7NTBcH35iyxiFufKJXROtUrtYrUz/dcL5LRJeebgg/ou y3wK9jKLX9nXXD7DetPkuCw08pXyEhCd7W2sKLYIvMcv71YpgxECI+G9wvZPcADskkAr Sxl9m8dihMv8Xq0rrQBSkUgK0SZKpQUbO7kjjzo1f0BscDp+WP/c77uAvnZnvGJOH/V7 4qz0LXcqbwYOQZKiclzKN+WhZpKRqF2qoaQ1IW8w1x8IBP0DLGXx22EJNI8ETOy+EOc1 lodojjsA6Qpj+BJV6+pfQ5qfBofzbpR338LZbhwFWlns1L+H7JqmPakrFV5GDdBSkloC Wvgg== X-Gm-Message-State: ANoB5pmsDVujdng9wJRL4hoI0iLFsWsgfG7AuAw4AmxM2D/oIXRIytaO 1k7sPLqoz0qEBHMZF3lSf5b29w== X-Google-Smtp-Source: AA0mqf4L+0It51zXy3WVW7YZtaQAOe0SU2ffTuGt5Qne8mX7Sf8W244wwyLuWxnnc1tRpHva6L5yfA== X-Received: by 2002:a17:902:e787:b0:187:1d13:f6d1 with SMTP id cp7-20020a170902e78700b001871d13f6d1mr5927784plb.52.1670599552412; Fri, 09 Dec 2022 07:25:52 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:25:51 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki , Nicolas Boichat Subject: [PATCH v9 05/18] drm: exynos: dsi: Properly name HSA/HBP/HFP/HSE bits Date: Fri, 9 Dec 2022 20:53:30 +0530 Message-Id: <20221209152343.180139-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072556_655748_A8AC3F1A X-CRM114-Status: GOOD ( 14.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org HSA/HBP/HFP/HSE mode bits in Processor Reference Manuals specify a naming conversion as 'disable mode bit' due to its bit definition, 0 = Enable and 1 = Disable. For HSE bit, the i.MX 8M Mini/Nano/Plus Applications Processor Reference Manual named this bit as 'HseDisableMode' but the bit definition is quite opposite like 0 = Disables transfer 1 = Enables transfer which clearly states that HSE is not a disable bit. HSE is named as per the manual even though it is not a disable bit however the driver logic for handling HSE is based on the MIPI_DSI_MODE_VIDEO_HSE flag itself. Cc: Nicolas Boichat Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v9: - new patch drivers/gpu/drm/exynos/exynos_drm_dsi.c | 33 +++++++++++++++++++------ 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 50a2a9ca88a9..b64bb6006b7d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -75,10 +75,27 @@ #define DSIM_MAIN_PIX_FORMAT_RGB565 (0x4 << 12) #define DSIM_SUB_VC (((x) & 0x3) << 16) #define DSIM_MAIN_VC (((x) & 0x3) << 18) -#define DSIM_HSA_MODE (1 << 20) -#define DSIM_HBP_MODE (1 << 21) -#define DSIM_HFP_MODE (1 << 22) -#define DSIM_HSE_MODE (1 << 23) +#define DSIM_HSA_DISABLE_MODE (1 << 20) +#define DSIM_HBP_DISABLE_MODE (1 << 21) +#define DSIM_HFP_DISABLE_MODE (1 << 22) +/* + * The i.MX 8M Mini Applications Processor Reference Manual, + * Rev. 3, 11/2020 Page 4091 + * The i.MX 8M Nano Applications Processor Reference Manual, + * Rev. 2, 07/2022 Page 3058 + * The i.MX 8M Plus Applications Processor Reference Manual, + * Rev. 1, 06/2021 Page 5436 + * named this bit as 'HseDisableMode' but the bit definition + * is quite opposite like + * 0 = Disables transfer + * 1 = Enables transfer + * which clearly states that HSE is not a disable bit. + * + * This bit is named as per the manual even though it is not + * a disable bit however the driver logic for handling HSE + * is based on the MIPI_DSI_MODE_VIDEO_HSE flag itself. + */ +#define DSIM_HSE_DISABLE_MODE (1 << 23) #define DSIM_AUTO_MODE (1 << 24) #define DSIM_VIDEO_MODE (1 << 25) #define DSIM_BURST_MODE (1 << 26) @@ -804,13 +821,13 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_AUTO_VERT) reg |= DSIM_AUTO_MODE; if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_HSE) - reg |= DSIM_HSE_MODE; + reg |= DSIM_HSE_DISABLE_MODE; if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HFP) - reg |= DSIM_HFP_MODE; + reg |= DSIM_HFP_DISABLE_MODE; if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HBP) - reg |= DSIM_HBP_MODE; + reg |= DSIM_HBP_DISABLE_MODE; if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HSA) - reg |= DSIM_HSA_MODE; + reg |= DSIM_HSA_DISABLE_MODE; } if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) From patchwork Fri Dec 9 15:23:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069873 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3AC3DC4332F for ; Fri, 9 Dec 2022 15:33:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qzTQoWMhFeS2POQ/3d4YQNRi0WvNVm2NBYZhbZg0HMY=; b=cl01bed0AS/t8c oox045b4R39/DvgBp2Bw6SZiVWA5bb/bCJ/UbSzKMfMrR0qaSDoYPl9Zg+/oWtGSnf1JiTPu1KYgM BFJVe1z/7XoFWa8qUvjuGOdBDRV3W+b1gWt4P2p1DpiZudbREGpUUcXT0oBuuGqz8zU+SKDRh/+PJ k2inYN2I/bArWN5wEl1hQXdrioYcQQbGIcweLOYnSJa7itPMJh95pgR1wUcrjdl5vTM8kfGbl5NS5 T7+jrDddFA4636QEXCGLKeEc3JgM1i52z1Fbl6qSflfiY31daFpCF93kyAnll2kdxUkRf9b9jhsj7 7yhQX74dzKnCGBidFawA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fM3-0090jE-Bk; Fri, 09 Dec 2022 15:32:03 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fGa-008yQV-EV for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:26:26 +0000 Received: by mail-pj1-x102a.google.com with SMTP id t17so5146745pjo.3 for ; Fri, 09 Dec 2022 07:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=7alrY0O9Akksq12nbFzgGTxh+9A05HRUPxTUPucPztw=; b=ToUboGH3BM1m3Vrj9P6QZxWYUgu4WQnRrgO+S052AGV/vZ7DP6+sDlt8zJAMdTI2l5 /eOcaNl4MmXKQbC2hg5QHKlG5QatmB0dULlgOgZN3lAbTdlRfTy+NAQGKp3+MqoUTPHE Ujk03ocmiVV14KYspRnF5OjkcI1tM5QZmksQ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7alrY0O9Akksq12nbFzgGTxh+9A05HRUPxTUPucPztw=; b=W10bYRpAZNhdRmzq0/Sbbp6NkaKij2fVqskKabwfCiNqwLx9/J+GbTMGPzsyMQlXTS GhL9Iqo2b5FxxBwFH37AgjUqGA8zx/7GLriwkXzigzNweyNAPvnHSQdOYN8QpbGvQCH4 YCk052w5zx5GHIyWfljV8pmAcTzuEUGHQCNrRiyfWJnNhG4At584k36T7cFFr07U+qoK 7/14qTsPnJldqf9/3zMbZQSKwhd1OMq4GwO2P+COFU/GTJRwINgTDZVTBdQXJ7g3eTA1 H1nfaHURp23piDpjvDl9Uw/9qmuKGyBrh/qBBc8uHTCLDbvFCk7nTxkrlUPDEOWEi2xm ZVWw== X-Gm-Message-State: ANoB5pkgSsqQeZcLQrmWIfusHh6KcUDY7oGawkIxtcIizmKfulc17WDN 53R6c3xJi3TrIkfw6pGdK0BKfw== X-Google-Smtp-Source: AA0mqf4IYYBnSZUc0czfg0jnwpcGWCSneZ85QtRkFpYhsK4rzZ+RAbNPZsoDdRJDTbxjc/+TcXQxag== X-Received: by 2002:a17:902:bb98:b0:188:edd2:318c with SMTP id m24-20020a170902bb9800b00188edd2318cmr6345852pls.26.1670599581253; Fri, 09 Dec 2022 07:26:21 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:26:20 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 07/18] drm: bridge: samsung-dsim: Lookup OF-graph or Child node devices Date: Fri, 9 Dec 2022 20:53:32 +0530 Message-Id: <20221209152343.180139-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072624_607718_EB05CB7F X-CRM114-Status: GOOD ( 18.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The child devices in MIPI DSI can be binding with OF-graph and also via child nodes. The OF-graph interface represents the child devices via remote and associated endpoint numbers like dsi { compatible = "fsl,imx8mm-mipi-dsim"; ports { port@0 { reg = <0>; dsi_in_lcdif: endpoint@0 { reg = <0>; remote-endpoint = <&lcdif_out_dsi>; }; }; port@1 { reg = <1>; dsi_out_bridge: endpoint { remote-endpoint = <&bridge_in_dsi>; }; }; }; The child node interface represents the child devices via conventional child nodes on given DSI parent like dsi { compatible = "samsung,exynos5433-mipi-dsi"; ports { port@0 { reg = <0>; dsi_to_mic: endpoint { remote-endpoint = <&mic_to_dsi>; }; }; }; panel@0 { reg = <0>; }; }; As Samsung DSIM bridge is common DSI IP across all Exynos DSI and NXP i.MX8M host controllers, this patch adds support to lookup the child devices whether its bindings on the associated host represent OF-graph or child node interfaces. v9, v8, v7, v6, v5, v4, v3: * none v2: * new patch Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 38 +++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index baad09b2daeb..a4379c2ccb77 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1356,18 +1356,52 @@ static int samsung_dsim_host_attach(struct mipi_dsi_host *host, struct samsung_dsim *dsi = host_to_dsi(host); const struct samsung_dsim_plat_data *pdata = dsi->plat_data; struct device *dev = dsi->dev; + struct device_node *np = dev->of_node; + struct device_node *remote; struct drm_panel *panel; int ret; - panel = of_drm_find_panel(device->dev.of_node); + /** + * Devices can also be child nodes when we also control that device + * through the upstream device (ie, MIPI-DCS for a MIPI-DSI device). + * + * Lookup for a child node of the given parent that isn't either port + * or ports. + */ + for_each_available_child_of_node(np, remote) { + if (of_node_name_eq(remote, "port") || + of_node_name_eq(remote, "ports")) + continue; + + goto of_find_panel_or_bridge; + } + + /* + * of_graph_get_remote_node() produces a noisy error message if port + * node isn't found and the absence of the port is a legit case here, + * so at first we silently check whether graph presents in the + * device-tree node. + */ + if (!of_graph_is_present(np)) + return -ENODEV; + + remote = of_graph_get_remote_node(np, 1, 0); + +of_find_panel_or_bridge: + if (!remote) + return -ENODEV; + + panel = of_drm_find_panel(remote); if (!IS_ERR(panel)) { dsi->out_bridge = devm_drm_panel_bridge_add(dev, panel); } else { - dsi->out_bridge = of_drm_find_bridge(device->dev.of_node); + dsi->out_bridge = of_drm_find_bridge(remote); if (!dsi->out_bridge) dsi->out_bridge = ERR_PTR(-EINVAL); } + of_node_put(remote); + if (IS_ERR(dsi->out_bridge)) { ret = PTR_ERR(dsi->out_bridge); DRM_DEV_ERROR(dev, "failed to find the bridge: %d\n", ret); From patchwork Fri Dec 9 15:23:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069883 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A2975C4332F for ; Fri, 9 Dec 2022 15:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=O7UqQHAa7Bj4dGPdSPrCS861a85pEQkFb7HK9gGcbPE=; b=Vlxo45krH2Vqxi lhOCv2TLx7WFwGgsQI0CWLNlVj/8Nh/V5jgZ3EAb9NeE0aBZ3cZtgyIk8lTgyuMU4PvwiD0l7EP8b 2VAYd0UGuQCnIWRbCuMdpR8AEK9roX+lfil9ZuPWFKHCngbPLTSN+AWEFUkneNwlCPJdKjnhj08nR RcOkisXkPXXjF3HlWrBMZ6MFe4VEFCmwFgYXi3Te3uq2icSzO1ewciXEHwEqu6EmDNmQiAgvh/HGf xGuCPOuPvkmqIkNlTtap8nZjs539j96wz5ZvXejilRcWnibG14R+UzpLdVfijIHEZqEYHvCy7h/CE bjc8pndU/5nntwVNI5Hw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fMw-00913H-NS; Fri, 09 Dec 2022 15:32:59 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fGq-008yXU-Ti for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:26:42 +0000 Received: by mail-pj1-x102b.google.com with SMTP id u5so5135271pjy.5 for ; Fri, 09 Dec 2022 07:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=XR2mP1JnKgTB9iSs6i/XkB+If2tnTWx4uTgT0kVlzzU=; b=nH7zUYD6q2rqs/QwFd5s+oyAxIFpR/90LVBW/zgcFhv/Q98L/S9pQV3FqLiTRPR5+S oXaLpFWkhZ9MrPk0GowiWMvdUoDQRJUOjOevXAavcMcX9bBuElp1n3fO6nO2CyaryWSo nTWpEbO9JjT7T6YQvGoIgA4GgQ/NYLbQ2uDhU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=XR2mP1JnKgTB9iSs6i/XkB+If2tnTWx4uTgT0kVlzzU=; b=w7iYtHWQo5v83jLnKXtS5u2Jh57tiViNy8YwsXWhv7G20VghDROLkPPt7vX25zAbBG 91nJyyeUI0QHXOcalC+uSCL//D+nwaXooKuos+hY9HetR+RGusmfk8Kl/Ob3/Vs0v3x/ LuMRS7QdkTO6f5awRVIvaJXUeZmvr5QarbvYH7iqJ3AhQapl1cvWBf73Log3SvNv+2b3 uC44e+m4VP92QtbIg4aCsID9o5MuSHFwHnjNCwSNU8h7IY11LOO1U4EzXb1ob3GjWCs3 JnQs3ChCJkJWrkLqPmUbHEVItvb3ZoYVIzEpSzactz+TRvOHMHezEdB/DWs+56T4gR0K uHrA== X-Gm-Message-State: ANoB5plM8M71sw8nRtKd3yInY4DTp5O6e3JQUIsbEXg8gvJt4r0uOiot R37DPQ5oOunixgbUKTkXTdwWng== X-Google-Smtp-Source: AA0mqf5Enm27VsCjbegzhTYWKdUDXU0bR4IfimOQ30n1+c/PruYmuWUPkY7qzhoSTOwBV2ovqLqI0g== X-Received: by 2002:a17:902:6b8b:b0:188:a4a3:7bb3 with SMTP id p11-20020a1709026b8b00b00188a4a37bb3mr6207536plk.9.1670599597601; Fri, 09 Dec 2022 07:26:37 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:26:37 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 08/18] drm: bridge: samsung-dsim: Mark PHY as optional Date: Fri, 9 Dec 2022 20:53:33 +0530 Message-Id: <20221209152343.180139-9-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072640_995992_AACDDAB7 X-CRM114-Status: GOOD ( 13.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In i.MX8M Mini/Nano SoC the DSI Phy requires a MIPI DPHY bit to reset in order to activate the PHY and that can be done via upstream i.MX8M blk-ctrl driver. So, mark the phy get as optional. v9, v8, v7, v6, v5, v4, v3, v2: * none v1: * new patch Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- drivers/gpu/drm/bridge/samsung-dsim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index a4379c2ccb77..9adab5d372cc 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1584,7 +1584,7 @@ int samsung_dsim_probe(struct platform_device *pdev) if (IS_ERR(dsi->reg_base)) return PTR_ERR(dsi->reg_base); - dsi->phy = devm_phy_get(dev, "dsim"); + dsi->phy = devm_phy_optional_get(dev, "dsim"); if (IS_ERR(dsi->phy)) { dev_info(dev, "failed to get dsim phy\n"); return PTR_ERR(dsi->phy); From patchwork Fri Dec 9 15:23:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069884 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 91508C4332F for ; Fri, 9 Dec 2022 15:34:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+9mnykbfUxtBJO27aXxmFeiRgyPNBbSuoLmQbsFYJZY=; b=cNCUInpbPYgTCI a+h4kyp/FL+0ntVZfGORDfPo9s6kIz5cyGCF4D7mnWzxj9Pp4jEUz5WzftNIq4t8waLRDCZ9LsVp6 lmipQCTTrHnPWwv0CWaTxTVrgf8dAAqy3nAMeBLstFjRJ9acSRdJtr1Bl5PJC9/cBmO1WEc278k5e n0PBK83PiEGs6szUemM4x92Jv/iOfmAjBaCZeAVcFt3xbcrym18g/qfTSQm9Hyziid17pQb/nLUXI WILF0FspJcRf6ZGDEjQAClMhJmgN6SpLxARCO4+A3oW5Jz/TkOddOeQI32+CZSATavMenPXmwAmSg a4QtL/l6+H1PSSJBGPvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fNZ-0091JU-HJ; Fri, 09 Dec 2022 15:33:38 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fHH-008yjX-T0 for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:27:10 +0000 Received: by mail-pj1-x1031.google.com with SMTP id t17so5148595pjo.3 for ; Fri, 09 Dec 2022 07:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=D8mPqEQPN2em8iTEeAt5Sl90+CybIe48O5qmPtt0W8M=; b=XmeybZQm3pTPGYPcvjrGnRGTBkdUVOxBTsXvAOMWMkQQYxNdVwo6zPcoIDahOR0ZlG yqqRApqHHwoyxylzsm08kWfQybEcjDK7/Oj/ETS2GFORmd8IDGwqozEmTz8mRKqO11gN neLl4HdiTexT9aYZ+6Dm0SjpblU7xCEbWjVs8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=D8mPqEQPN2em8iTEeAt5Sl90+CybIe48O5qmPtt0W8M=; b=hO6OjBvDP9+r7x0Ori7F/qf3kjNpwQKF6bI4Go1Q0feF7nbG7knO7QmJfZNh4URzMB PfQCRM+/ZPSrS2Bw2YTO57GXzl9i1UobK76IGn9Fhm50kVPrEMaQBc6U8q0S3z9+dloR xv9MwxnRT667dFJCR0zP/kBz/KT8i5vWu5usx2YcmqRf6LHLeNluABckEu4PM3H4x0kc D8PV4wBw1lFLHn14NqnvDhRctNhvIfMAI+wViCLocDdT2kmfgJYNO6VhFMqkW8DLNd4V oV8ng4EPoyGG1Sk2i/pbK3ldX0fETc64AdXSqjDCrsGps+4gkjGeNIu4vlneFf/Vz016 5kEQ== X-Gm-Message-State: ANoB5pmbx6cDN4fip/b8TyognhL+nTT9YIYIrxAgd1GtBJ4qWWgvK/K9 k5XgwCtkmpWOp41yV8jklJ0syw== X-Google-Smtp-Source: AA0mqf76JqBQs9d553vjd8kdTr5hxdTfGn7UBuUCvJ9UY3SyZ6glN8E/72q9iSEsQt37yAV6zCDUug== X-Received: by 2002:a17:902:8c8d:b0:187:262a:7955 with SMTP id t13-20020a1709028c8d00b00187262a7955mr5610383plo.9.1670599625243; Fri, 09 Dec 2022 07:27:05 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:27:04 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 09/18] drm: bridge: samsung-dsim: Add host init in pre_enable Date: Fri, 9 Dec 2022 20:53:34 +0530 Message-Id: <20221209152343.180139-10-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072707_987639_30A40ABA X-CRM114-Status: GOOD ( 15.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Host transfer() in DSI master will invoke only when the DSI commands are sent from DSI devices like DSI Panel or DSI bridges and this host transfer wouldn't invoke for I2C-based-DSI bridge drivers. Handling DSI host initialization in transfer calls misses the controller setup for I2C configured DSI bridges. This patch adds the DSI initialization from transfer to bridge pre_enable as the bridge pre_enable API is invoked by core as it is common across all classes of DSI device drivers. v9: * added the patch again v3: * none v2: * check initialized state in samsung_dsim_init v1: * keep DSI init in host transfer Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 9adab5d372cc..2e15d753fdd0 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1250,10 +1250,13 @@ static void samsung_dsim_disable_irq(struct samsung_dsim *dsi) disable_irq(dsi->irq); } -static int samsung_dsim_init(struct samsung_dsim *dsi) +static int samsung_dsim_init(struct samsung_dsim *dsi, unsigned int flag) { const struct samsung_dsim_driver_data *driver_data = dsi->driver_data; + if (dsi->state & flag) + return 0; + samsung_dsim_reset(dsi); samsung_dsim_enable_irq(dsi); @@ -1266,6 +1269,8 @@ static int samsung_dsim_init(struct samsung_dsim *dsi) samsung_dsim_set_phy_ctrl(dsi); samsung_dsim_init_link(dsi); + dsi->state |= flag; + return 0; } @@ -1285,6 +1290,10 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, } dsi->state |= DSIM_STATE_ENABLED; + + ret = samsung_dsim_init(dsi, DSIM_STATE_INITIALIZED); + if (ret) + return; } static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, @@ -1458,12 +1467,9 @@ static ssize_t samsung_dsim_host_transfer(struct mipi_dsi_host *host, if (!(dsi->state & DSIM_STATE_ENABLED)) return -EINVAL; - if (!(dsi->state & DSIM_STATE_INITIALIZED)) { - ret = samsung_dsim_init(dsi); - if (ret) - return ret; - dsi->state |= DSIM_STATE_INITIALIZED; - } + ret = samsung_dsim_init(dsi, DSIM_STATE_INITIALIZED); + if (ret) + return ret; ret = mipi_dsi_create_packet(&xfer.packet, msg); if (ret < 0) From patchwork Fri Dec 9 15:23:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069885 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 385D1C4332F for ; Fri, 9 Dec 2022 15:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S574JYko0LB+YlvULBPVl6tcxBQJuRqB/sYdLLBCEZI=; b=F+DsEQG+7qVHN8 Q+OkRanzWv2WqSYEwOTh/cAiuVbhGLfXvJGsqQb/SflWxz1o4WdQj0o6II/2X1jDwSSUtcgpQDFzj tK9Sw+hIjvNSnUpunHgyCSrj8UThGAOALwFpha/SXnK3UtRTWR+avfkT/ZvEmD75fALW2vNamUTqQ aNrB8LCFC1qniQtMyEVz5GYWiyeayJaRfU2xqXa7xDtUc8W95+Y3eUzYrItMsAwAJOBbbgWCxVBuQ KE6hh/fsOfdybAFpYia5PSWKc4rIUNvvt/xoUoSgJ8cmn2/ojk1KXr5k+NCsoC3/DtVb9yt7AimcG kVwLXMJbj4pxQFaI0G2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fP2-0091vw-V1; Fri, 09 Dec 2022 15:35:09 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fHU-008ypU-Px for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:27:22 +0000 Received: by mail-pj1-x102c.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so8464240pjs.4 for ; Fri, 09 Dec 2022 07:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=dwbU4HbazHtFryGlvubFfUrK1mgrKcuqi1e+gJ7LS7g=; b=ckqoKKbezKZk83zXcRQfiBvuby6RvzG9fhQvFweJ01TM0SsQ1k0MW6KJIWNICOWbz3 u+do6PHSKy3ob4Nirg0DOjbfLxTx+bcdhvqgRu4WlNY1fnzKI8der9cuWFGga2WazdBg Wd9qw7qipidER0G9nidklJwhKNLdQc+mfCvRU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dwbU4HbazHtFryGlvubFfUrK1mgrKcuqi1e+gJ7LS7g=; b=6b/hIoc92cl+Dsa3NysPwDHpw57WXQ3Svfd5MuoG67GnvNw8pLxOc3LFoXo/7DUpro WJ6vQA9CAUc6TjjjlQEZ11Kc3sBH7LrrY1bzhfO804/FdlgyIS4GoJZhRV7Nojo6dcoU e2LBbSEoeP07pJMftZOXZtTrtbiJloMCk6YH41WYuUzw6gLROtDr77B9bcvdM+EobPiL y9zizxZ+4vI0ACdSHFc9ajwCFKiCzh1yVIKBKRxXf6jYIOwjtTwgHWjztbT6I1pPQz5C orgkB2HZbPKPYG5tSccKov4mkFoEMTyagM938VDDaH11VRK+1S42jz8Vx1Wzy37ATk/c TQMg== X-Gm-Message-State: ANoB5pkWtsa9kvk09ydwfJKEor2kj+99g9deDbI6v2Y3mFRB4QYImKNQ oKfOgFQOlh0plJH3K+kQFv9BHQ== X-Google-Smtp-Source: AA0mqf78qn5I9yDPESKk8dAmyKjyOAK+ZO2uuDs81rvrAHV6rkDEscyNrRqFMEe/caZJKtzZ1LS1Pw== X-Received: by 2002:a17:902:ce08:b0:189:d2e4:9829 with SMTP id k8-20020a170902ce0800b00189d2e49829mr10001128plg.15.1670599639006; Fri, 09 Dec 2022 07:27:19 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:27:18 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 10/18] drm: bridge: samsung-dsim: Init exynos host for first DSI transfer Date: Fri, 9 Dec 2022 20:53:35 +0530 Message-Id: <20221209152343.180139-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072720_878797_47B5CB5B X-CRM114-Status: GOOD ( 16.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The existing drm panels and bridges in Exynos required host initialization during the first DSI command transfer even though the initialization was done before. This host reinitialization is handled via DSIM_STATE_REINITIALIZED flag and triggers from host transfer. Do this exclusively for Exynos. Initial logic is derived from Marek Szyprowski changes. Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- Changes from v9: - derived from v8 - added comments drivers/gpu/drm/bridge/samsung-dsim.c | 15 ++++++++++++++- include/drm/bridge/samsung-dsim.h | 5 +++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 2e15d753fdd0..ec3ab679afd9 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1254,6 +1254,19 @@ static int samsung_dsim_init(struct samsung_dsim *dsi, unsigned int flag) { const struct samsung_dsim_driver_data *driver_data = dsi->driver_data; + /* + * FIXME: + * The existing drm panels and bridges in Exynos required host + * initialization during the first DSI command transfer even though + * the initialization was done before. + * + * This host reinitialization is handled via DSIM_STATE_REINITIALIZED + * flag and triggers from host transfer. Do this exclusively for Exynos. + */ + if ((dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) && + dsi->state & DSIM_STATE_REINITIALIZED) + return 0; + if (dsi->state & flag) return 0; @@ -1467,7 +1480,7 @@ static ssize_t samsung_dsim_host_transfer(struct mipi_dsi_host *host, if (!(dsi->state & DSIM_STATE_ENABLED)) return -EINVAL; - ret = samsung_dsim_init(dsi, DSIM_STATE_INITIALIZED); + ret = samsung_dsim_init(dsi, DSIM_STATE_REINITIALIZED); if (ret) return ret; diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index b8132bf8e36f..0c5a905f3de7 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -17,8 +17,9 @@ struct samsung_dsim; #define DSIM_STATE_ENABLED BIT(0) #define DSIM_STATE_INITIALIZED BIT(1) -#define DSIM_STATE_CMD_LPM BIT(2) -#define DSIM_STATE_VIDOUT_AVAILABLE BIT(3) +#define DSIM_STATE_REINITIALIZED BIT(2) +#define DSIM_STATE_CMD_LPM BIT(3) +#define DSIM_STATE_VIDOUT_AVAILABLE BIT(4) enum samsung_dsim_type { SAMSUNG_DSIM_TYPE_EXYNOS3250, From patchwork Fri Dec 9 15:23:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069886 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 19B06C4332F for ; Fri, 9 Dec 2022 15:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=skv7Z8X8ygsve7/6KWvx0ocTvlfp8sPALjixYCAbicc=; b=tvjPlXtfM7Sh4i SqvtNwoHWCMqixC3hI0OIlPZhUb983kvHT9vVzn/3wJrt+80Af/PmjsrGl1UnANr0N16LdD7M9fRM FtPiGBObsl/l0A249hYTaOSJ+3G8EoaQfbnRZ46QfFXNZ7wApsofecC/dicEa1txp4ZDxAUU31RgH lE6QPnsEH+Yp9c5hbRLA5Akh/yVas65mj6ArK+kRf8RYPG/UJhPJ0kYWzULUdSF4QGDrgMIiIjEhz UUpxt94MyjOMPAW7NyX8uGdWABCkL6gZJoMfwNe6PcXFMyQ8gsrYXVjB78EfXfj2GGHCgE4PxzQCW 4ZfVw4/5hqg+ptFuBxww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fQB-0092Oq-3o; Fri, 09 Dec 2022 15:36:19 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fHg-008ytx-QL for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:27:34 +0000 Received: by mail-pl1-x632.google.com with SMTP id jn7so5194890plb.13 for ; Fri, 09 Dec 2022 07:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=OfCnS0osLOS8xaWpCmO4LYnynxznfz+nnT8/dn7VQfk=; b=nSJNeITl9fnTfPnvJhvt7rcK/xV7j/NWCI0p9//tsOA/UM56OFpEr7ygGEIbx7Y1No XWJd/V2u6MoDaGZXuAZBIhc/UHZa2e2QokYR6Zih3+5iRVGEpIU3l0EEftElSRDOjPN1 n96YN33rgcOTAZC9jUXZndGbTxC/brxMpVgfE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=OfCnS0osLOS8xaWpCmO4LYnynxznfz+nnT8/dn7VQfk=; b=puxxdMruvVySa+BCWLhkUPZwQHjjST0QnzOxddVHE9tLANNdpEgWPacaViT/IEPaUh +6bv7/bhLzJ0SATiYyIFu8zHRwPPPvqXFSR2ctp6iVfncxyS6CPb1bEPW+nJT8J2lu9c PWDbFPTsMAgkm64qjza3cfRrDc5RN0HXVb+qoLD//6I4fAPBRLxARppVqO+ylLnBOhuF D90v4pkLVJGTjjeSZKdRv1R7LvARy6o5JVABf8GeJRnRWl1R1G/IMcKVwNz3D0/HINEP qJOgLSZYy9kgXknjSaiMCh/BUU5fc3peFY+5XgA5SHKH5oZWimOtdZ4QtOKT67ddjz2M tkoA== X-Gm-Message-State: ANoB5pmvSjJjtEQdc2fRR0YzQ5697eTjYI37banOOQpy4i0dZkeEkb4p AN4Ku/LMNfVa78P1XrSAfdR50w== X-Google-Smtp-Source: AA0mqf5RMvL/6/KcRoodcz3nCDPqXEouCFOwfCuTdoOSewQ5pw+uHy3hlJMsbykq4AKHdpBGOhdd1Q== X-Received: by 2002:a17:902:e807:b0:189:63be:8acb with SMTP id u7-20020a170902e80700b0018963be8acbmr8774321plg.59.1670599649351; Fri, 09 Dec 2022 07:27:29 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:27:28 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 11/18] drm: bridge: samsung-dsim: Add atomic_check Date: Fri, 9 Dec 2022 20:53:36 +0530 Message-Id: <20221209152343.180139-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072732_936863_70B04E1B X-CRM114-Status: GOOD ( 15.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Look like an explicit fixing up of mode_flags is required for DSIM IP present in i.MX8M Mini/Nano SoCs. At least the LCDIF + DSIM needs active low sync polarities in order to correlate the correct sync flags of the surrounding components in the chain to make sure the whole pipeline can work properly. On the other hand the i.MX 8M Mini Applications Processor Reference Manual, Rev. 3, 11/2020 says. "13.6.3.5.2 RGB interface Vsync, Hsync, and VDEN are active high signals." i.MX 8M Mini Applications Processor Reference Manual Rev. 3, 11/2020 3.6.3.5.2 RGB interface i.MX 8M Nano Applications Processor Reference Manual Rev. 2, 07/2022 13.6.2.7.2 RGB interface both claim "Vsync, Hsync, and VDEN are active high signals.", the LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. No clear evidence about whether it can be documentation issues or something, so added a comment FIXME for this and updated the active low sync polarities using SAMSUNG_DSIM_TYPE_IMX8MM hw_type. v9: * none v8: * update the comments about sync signals polarities * added clear commit message by including i.MX8M Nano details v7: * fix the hw_type checking logic v6: * none v5: * rebase based new bridge changes [mszyprow] * remove DSIM_QUIRK_FIXUP_SYNC_POL * add hw_type check for sync polarities change. v4: * none v3: * add DSIM_QUIRK_FIXUP_SYNC_POL to handle mode_flasg fixup v2: * none v1: * fix mode flags in atomic_check instead of mode_fixup Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index ec3ab679afd9..c79f7dc49e17 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1342,6 +1342,32 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +static int samsung_dsim_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct samsung_dsim *dsi = bridge_to_dsi(bridge); + struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode; + + /* + * The i.MX8M Mini/Nano glue logic between LCDIF and DSIM + * inverts HS/VS/DE sync signals polarity, therefore, while + * i.MX 8M Mini Applications Processor Reference Manual Rev. 3, 11/2020 + * 13.6.3.5.2 RGB interface + * i.MX 8M Nano Applications Processor Reference Manual Rev. 2, 07/2022 + * 13.6.2.7.2 RGB interface + * both claim "Vsync, Hsync, and VDEN are active high signals.", the + * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. + */ + if (dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) { + adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + } + + return 0; +} + static void samsung_dsim_mode_set(struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) @@ -1364,6 +1390,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_check = samsung_dsim_atomic_check, .atomic_pre_enable = samsung_dsim_atomic_pre_enable, .atomic_enable = samsung_dsim_atomic_enable, .atomic_disable = samsung_dsim_atomic_disable, From patchwork Fri Dec 9 15:23:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069887 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A8F67C4167B for ; Fri, 9 Dec 2022 15:38:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GXeIdIQq5bWX6o1T13pr4S2SScgTj/QOkgE4Vno5YhU=; b=hP8KqAdDeZdDUj P+LbhHeaiZnhkIpp/EAD/1v97HIUibeRjGbbEhgwh3PmmLKavAHRSYIoQErCv7+X36gg+HLt7nsp7 N8v0cVT+59JnCTADcSt1EFe3uWPVb91upmK5Jro83huDo7CRvenRd0KcJKZsyqbKf7e6iQvvPt666 2Kz1AHonbDjkvv7R4fuG48kwpX9aoXEOuGKj6Vz+SR/Z+AeMzTCUsA2mSquB1GW/G0AZRHOyorGot CirKX/BbMj8J8Ueb4f5uL4/PWfopKWxAB/TAvjCSg6rYMQkN+qUE5rCtM2YH+A40rUmXEFnnxnmkc xWXV7ryQjICpHn/NsxFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fR1-0092kQ-HC; Fri, 09 Dec 2022 15:37:12 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fHw-008z0z-Op for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:27:50 +0000 Received: by mail-pj1-x102a.google.com with SMTP id b13-20020a17090a5a0d00b0021906102d05so5269083pjd.5 for ; Fri, 09 Dec 2022 07:27:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=vW9M8s0Vbvr7hHyCYd21b5KP7VTw4GLG2GncUlEkbew=; b=NyjM87Fw1znhbUtkTX8bX/aSJ515F1qoxZq895EWlcvLl/oQI3o4uJX5uZZr5tIeGb jKbKxjDD2LLCA0FLQq+fN46AiZ686YowlSFLix0kSQ6OxN13pzYItAkJcQDWQn3zMHf4 gL1cbeARQ7juB5+C0ou2pq8OFYYS5yqBSuCgE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=vW9M8s0Vbvr7hHyCYd21b5KP7VTw4GLG2GncUlEkbew=; b=dtC0cib9HSuvk8K2JWu17pV7O2XcqTMLJ8auivvhRlfRhGIo5Qkwzt8XG6stux2rpp StslKks/09VqFIv8UuRKns/2U4klvmzbbaJnwRuLlviTqWyMWP3Lpfcu04pVo31MAUsb 5DLKlygSdQnNwf2FtBEJy2nMxGehqrvHTzfKq0WZvC28TxY5ZUd6cOmdOKxWd+cjCNch hWm3sL6E+5V2ncRmMqjLZHbktQRbPPzLewwQDuLYwve1b25eO+U6JpHPUIlba3ItlWWD sDkB096+pgif9eCU258I96mfEutLnkKwt3314OtQS18Um9m9OCQkIVAhmvjytikZEQ1b NIGA== X-Gm-Message-State: ANoB5pksUGYLdTTd97M9yuYsju3xM8d9CFhqKsmbVAfZNhhqsfjcJl+I 65m8l8C1ytUkm5bEICxNcNYijQ== X-Google-Smtp-Source: AA0mqf6lDnzLDqv+LJEzSJh3VXV+6beDMGziJ58tM0raeBEJGuy15tVGywik7bFInGC4ZSBn6kmvtQ== X-Received: by 2002:a17:902:e743:b0:185:4880:91bc with SMTP id p3-20020a170902e74300b00185488091bcmr7928096plf.60.1670599668115; Fri, 09 Dec 2022 07:27:48 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:27:47 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 12/18] drm: bridge: samsung-dsim: Add platform PLL_P (PMS_P) offset Date: Fri, 9 Dec 2022 20:53:37 +0530 Message-Id: <20221209152343.180139-13-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072748_862067_90C715D0 X-CRM114-Status: GOOD ( 18.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Look like PLL PMS_P offset value varies between platforms that have Samsung DSIM IP. However, there is no clear evidence for it as both Exynos and i.MX 8M Mini Application Processor Reference Manual is still referring the PMS_P offset as 13. The offset 13 is not working for i.MX8M Mini SoCs but the downstream NXP sec-dsim.c driver is using offset 14 for i.MX8M Mini SoC platforms [1] [2]. PMS_P value set in sec_mipi_dsim_check_pll_out using PLLCTRL_SET_P() with offset 13 and then an additional offset of one bit added in sec_mipi_dsim_config_pll via PLLCTRL_SET_PMS(). Not sure whether it is reference manual documentation or something else but this patch trusts the downstream code and handle PLL_P offset via platform driver data so-that imx8mm driver data shall use pll_p_offset to 14. Similar to Mini the i.MX8M Nano/Plus also has P=14, unlike Exynos. [1] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n210 [2] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/gpu/drm/bridge/sec-dsim.c?h=imx_5.4.47_2.2.0#n211 v9: * none v8: * updated commit message for 8M Nano/Plus v7, v6: * none v5: * updated clear commit message v4, v3, v2: * none v1: * updated commit message * add downstream driver link Reviewed-by: Marek Vasut Signed-off-by: Frieder Schrempf Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 10 ++++++++-- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index c79f7dc49e17..9203116f1efb 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -184,7 +184,7 @@ /* DSIM_PLLCTRL */ #define DSIM_FREQ_BAND(x) ((x) << 24) #define DSIM_PLL_EN (1 << 23) -#define DSIM_PLL_P(x) ((x) << 13) +#define DSIM_PLL_P(x, offset) ((x) << (offset)) #define DSIM_PLL_M(x) ((x) << 4) #define DSIM_PLL_S(x) ((x) << 1) @@ -384,6 +384,7 @@ static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -396,6 +397,7 @@ static const struct samsung_dsim_driver_data exynos4_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -406,6 +408,7 @@ static const struct samsung_dsim_driver_data exynos5_dsi_driver_data = { .max_freq = 1000, .wait_for_reset = 1, .num_bits_resol = 11, + .pll_p_offset = 13, .reg_values = reg_values, }; @@ -417,6 +420,7 @@ static const struct samsung_dsim_driver_data exynos5433_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 0, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5433_reg_values, }; @@ -428,6 +432,7 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .max_freq = 1500, .wait_for_reset = 1, .num_bits_resol = 12, + .pll_p_offset = 13, .reg_values = exynos5422_reg_values, }; @@ -559,7 +564,8 @@ static unsigned long samsung_dsim_set_pll(struct samsung_dsim *dsi, writel(driver_data->reg_values[PLL_TIMER], dsi->reg_base + driver_data->plltmr_reg); - reg = DSIM_PLL_EN | DSIM_PLL_P(p) | DSIM_PLL_M(m) | DSIM_PLL_S(s); + reg = DSIM_PLL_EN | DSIM_PLL_P(p, driver_data->pll_p_offset) | + DSIM_PLL_M(m) | DSIM_PLL_S(s); if (driver_data->has_freqband) { static const unsigned long freq_bands[] = { diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index 0c5a905f3de7..df3d030daec6 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -53,6 +53,7 @@ struct samsung_dsim_driver_data { unsigned int max_freq; unsigned int wait_for_reset; unsigned int num_bits_resol; + unsigned int pll_p_offset; const unsigned int *reg_values; }; From patchwork Fri Dec 9 15:23:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069888 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 26A39C4332F for ; Fri, 9 Dec 2022 15:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kesiSPGbT8sh9Aw3YUGSkaD1uv0l2oXSbKw/ciHas28=; b=mD9YraZWvazgEo O38H788yhPsSevyuLNRiPhS4qd3cqXEX3uo87zDnxvqTgggwWkxm/209Jk8C91cvllqmfT0Vi8xXX YjyYpvaDOm0sqk7rVFEZIlTNXXiR5EkdPvS6vlnrOXgDkR62RU04jP7yuc4Oq14VjF5AEnyq0Urgr F7xmKg+29ovbND4JjZiUnuA9izpgM1tvH0RCPS39nxJRD39+vXobDkuWD5Vj43hx50t7pUnyMrJ6s VxsPOcblpOvvelIgwA4QgYP/hsIlqOZk1EUAkmAlbagmqY4IabVXsVUGxNqrg0Z6l8CK7D2tZMDLC blugDTbrkM8usKp1AAdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fSI-0093Nk-TA; Fri, 09 Dec 2022 15:38:31 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fIJ-008zA2-Kr for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:28:13 +0000 Received: by mail-pl1-x62e.google.com with SMTP id p24so5234249plw.1 for ; Fri, 09 Dec 2022 07:28:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=Ymr+DEOHacJTvc2Uck5JB4sOzfEDxvLbYqSHqNsRapU=; b=lq0Dd3U+vIK/vr5aRMFNeSULQoc0THFbOnL6NRIu3WthVZznvyYe5MqC8+h4jclNzG Ih2u3D58wnAqyN3XQ9hWynCRuxYFrQTpnI0qhLxz3WcAWuKcqIKJsNOJuQkETkPDq5F8 hrl8DJE583MagpI/cQpccpnlZFvYitrsPVIss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Ymr+DEOHacJTvc2Uck5JB4sOzfEDxvLbYqSHqNsRapU=; b=stiforQBtZf0I4r5Fop6ptUgMyGw9ltLK+cwlQmrRPPxz+i6SoA1wbyXNYfzEiwXaL /hsBHmF/z42NDDsTdJ9/OBNOGCxk2bVaFlq+Y5zebqB0Np2ULWLGvWAVZ9uTqW5iZk5I +l3heTk1hjVzPWxQQHwqgp5FzWDwAutz32cvbwqgaZBRQRrNZqmBJndhrZAf4X7qGUDA BkpGpoPECvVSzjxedLXV2PUx3IOmliKpgwj0nzGA/m7S1igD9SL0W02FXi8ReDnz34Dj E+UOiG7+ZLGTKPbZnNe36g5fL8wfD1o6Zg0o+VdalCEDJh2qvCG1dp80fRBULvf5vGPq PUsQ== X-Gm-Message-State: ANoB5plE7OuNMaYeDJUQyBtjkZtvku6Ay8ve+ASl3SwGi3etoS/ejzi+ lKKlpnkgPevppe2mtCaH8a1SBA== X-Google-Smtp-Source: AA0mqf68YgV/o1c4fxAysjrC3qcV0mPVebM+Q1QCWs/JKU+KjkPgVtx3HFMnVPbSd1oBfKXqthDveQ== X-Received: by 2002:a17:902:e806:b0:185:4421:72e5 with SMTP id u6-20020a170902e80600b00185442172e5mr7789428plg.42.1670599690133; Fri, 09 Dec 2022 07:28:10 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:28:09 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 13/18] drm: bridge: samsung-dsim: Add atomic_get_input_bus_fmts Date: Fri, 9 Dec 2022 20:53:38 +0530 Message-Id: <20221209152343.180139-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072811_716112_05A044FE X-CRM114-Status: GOOD ( 18.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Finding the right input bus format throughout the pipeline is hard so add atomic_get_input_bus_fmts callback and initialize with the proper input format from list of supported output formats. This format can be used in pipeline for negotiating bus format between the DSI-end of this bridge and the other component closer to pipeline components. List of Pixel formats are taken from, AN13573 i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 3.7.4 Pixel formats Table 14. DSI pixel packing formats v9: * added MEDIA_BUS_FMT_FIXED * return MEDIA_BUS_FMT_RGB888_1X24 output_fmt if supported output_fmt list is unsupported. * added MEDIA_BUS_FMT_YUYV10_1X20, MEDIA_BUS_FMT_YUYV12_1X24 v8: * added pixel formats supported by NXP AN13573 i.MX 8/RT MIPI DSI/CSI-2 v7, v6, v5, v4: * none v3: * include media-bus-format.h v2: * none v1: * new patch Tested-by: Marek Szyprowski Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 69 +++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 9203116f1efb..ef0d802d25bf 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -1348,6 +1349,73 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge, pm_runtime_put_sync(dsi->dev); } +/* + * This pixel output formats list referenced from, + * AN13573 i.MX 8/RT MIPI DSI/CSI-2, Rev. 0, 21 March 2022 + * 3.7.4 Pixel formats + * Table 14. DSI pixel packing formats + */ +static const u32 samsung_dsim_pixel_output_fmts[] = { + MEDIA_BUS_FMT_YUYV10_1X20, + MEDIA_BUS_FMT_YUYV12_1X24, + MEDIA_BUS_FMT_UYVY8_1X16, + MEDIA_BUS_FMT_RGB101010_1X30, + MEDIA_BUS_FMT_RGB121212_1X36, + MEDIA_BUS_FMT_RGB565_1X16, + MEDIA_BUS_FMT_RGB666_1X18, + MEDIA_BUS_FMT_RGB888_1X24, + + MEDIA_BUS_FMT_FIXED, +}; + +static bool samsung_dsim_pixel_output_fmt_supported(u32 fmt) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(samsung_dsim_pixel_output_fmts); i++) { + if (samsung_dsim_pixel_output_fmts[i] == fmt) + return true; + } + + return false; +} + +static u32 * +samsung_dsim_atomic_get_input_bus_fmts(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state, + u32 output_fmt, + unsigned int *num_input_fmts) +{ + u32 *input_fmts; + + if (!samsung_dsim_pixel_output_fmt_supported(output_fmt)) + /* + * Some bridge/display drivers are still not able to pass the + * correct format, so handle those pipelines by falling back + * to the default format till the supported formats finalized. + */ + output_fmt = MEDIA_BUS_FMT_RGB888_1X24; + + input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL); + if (!input_fmts) + return NULL; + + switch (output_fmt) { + case MEDIA_BUS_FMT_FIXED: + input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X24; + break; + default: + input_fmts[0] = output_fmt; + break; + } + + *num_input_fmts = 1; + + return input_fmts; +} + static int samsung_dsim_atomic_check(struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, @@ -1396,6 +1464,7 @@ static const struct drm_bridge_funcs samsung_dsim_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = samsung_dsim_atomic_get_input_bus_fmts, .atomic_check = samsung_dsim_atomic_check, .atomic_pre_enable = samsung_dsim_atomic_pre_enable, .atomic_enable = samsung_dsim_atomic_enable, From patchwork Fri Dec 9 15:23:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069889 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 09430C4332F for ; Fri, 9 Dec 2022 15:41:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hy5VS+/4ngYHPs93d1lT1x2Ri6K+T/venkX9pW6ku0Y=; b=jcyBESdnFU0sCv 4mJJygi6xpsUb+CCyEVZ4618fiYEbMGtwdT1WgTHJcCQGl2JqtxnkN7hLOmya8jgi+54IGDa45GMY S/126a5UZQznkJ5+pq15ncdApZLh+TxW5b59yVH1U996kvSjOg4yaNI75i9Kz1iRmbIxv4Rbbjepv L0oqb7UMUoM/qm9w3WTuRamTVmZrtj9TWe5Fq34yvUimqG4Pwww8/GDbpm1kw/Xu1fU6mmS0ecHPK dhdwYLBV5FfqRdxXFw4dwlYOSw+JG8U44B16e3mAs6w6k6XLRrmwTJS7lUO9bsKpNdyf6x3kdTH6T AzpY0a5PKcUWsf/XHy+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fTR-0093qh-UM; Fri, 09 Dec 2022 15:39:43 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fIe-008zIk-FR for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:28:33 +0000 Received: by mail-pl1-x62b.google.com with SMTP id w23so5201622ply.12 for ; Fri, 09 Dec 2022 07:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=m44vPnqg/tFp5+4q15ZzrAAsZWANQlxSVTxmtXu3/9A=; b=EUVyUp9GaIYxpqTpKsJZA/dslfBr1LQitUAbqIQCAmaGpjJ+uCb3d+CQOig4xPRcPc aFC+TX0zNZGmuptvTlgK64AboxxKY5AGoJiETrXiBwSjqibNuz4epAy6S9ePy8OL6lS8 Ojj5+y2GeN5ihsePK5GcNwaRNUE+BrBo9UPmA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=m44vPnqg/tFp5+4q15ZzrAAsZWANQlxSVTxmtXu3/9A=; b=qRrsRFkRrnSLMAGaa0Y4WQLQ2yb1IioyXPO949x3E8xDmZYSHLKYlMHdyats2A9lhB Bu0XtP52tHySr0pIjdfZbAHttHlmr1872RDyUiw9eWDNiWicK0NwYXL/eBs5SbekdgaC kvLp+wO0JTmyMCy+sQQ3Y1Mv6ItZKtj0hz9qF+2vsiIvUl1M888DuxQaj8GNh8nTmRN0 6sP9dMTUShKMWjB6cfq7RSjDfzrG7zjNyTkVr9BhDCCsk5SsY2itqZMaqdKCVWw9cSSt Neql65dfaeLiKicPhHGN1T1+EibBpf+5ke7f3INfPO7537Czy04+WCrN2lKNyebygiOd zGzg== X-Gm-Message-State: ANoB5pkrmTc+rBExB6H2U/jMzJ80APRbyrbMoO6FDtpnnm1j7CE89yQQ WfB34g+a+LaJyR6+wjjgh+9TNg== X-Google-Smtp-Source: AA0mqf6dQt+VkYj1h/ciPSlfHKO+5DZj9mgOoawK+JvVkI95FUXfGcdlpDfODYugKo8sr8nE2IExCw== X-Received: by 2002:a17:902:e892:b0:188:f0da:c25c with SMTP id w18-20020a170902e89200b00188f0dac25cmr9238571plg.14.1670599708957; Fri, 09 Dec 2022 07:28:28 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:28:28 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 14/18] drm: bridge: samsung-dsim: Add input_bus_flags Date: Fri, 9 Dec 2022 20:53:39 +0530 Message-Id: <20221209152343.180139-15-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072832_550684_7AF3AB69 X-CRM114-Status: GOOD ( 12.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org LCDIF-DSIM glue logic inverts the HS/VS/DE signals and expecting the i.MX8M Mini/Nano DSI host to add additional Data Enable signal active low (DE_LOW). This makes the valid data transfer on each horizontal line. So, add additional bus flags DE_LOW setting via input_bus_flags for i.MX8M Mini/Nano platforms. v9: * none v8: * add DE_LOW for i.MX8M Mini/Nano platforms. v7, v6: * none v5: * rebased based on updated bridge changes v4, v3, v2, v1: * none Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index ef0d802d25bf..4de1294f29b3 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1654,6 +1654,10 @@ static const struct samsung_dsim_host_ops samsung_dsim_generic_host_ops = { .unregister_host = samsung_dsim_unregister_host, }; +static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_low = { + .input_bus_flags = DRM_BUS_FLAG_DE_LOW, +}; + int samsung_dsim_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1736,6 +1740,10 @@ int samsung_dsim_probe(struct platform_device *pdev) dsi->bridge.of_node = dev->of_node; dsi->bridge.type = DRM_MODE_CONNECTOR_DSI; + /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ + if (dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) + dsi->bridge.timings = &samsung_dsim_bridge_timings_de_low; + if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) ret = dsi->plat_data->host_ops->register_host(dsi); From patchwork Fri Dec 9 15:23:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069890 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A0274C4332F for ; Fri, 9 Dec 2022 15:42:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MHF3aiNK9E5+UVDgSIY7VVjEcKiCwXpJZIgIDfhd3gk=; b=EjyMVwVClKw/9S bkFKgtKUw9B2ePsSFJIWhWxRw7Gr4nu1kBll6CW43YlxI6M68x98F7Ays7u98fROT7yik/QoSqZa5 wESwdTvp2ax+vYeGszp3C+e96g1/uq5mKQyu6Csr4xPLmFa0RY5skaHcnF9T/rIgIAWKJzmqrlZzS 0IuXvCVhKH46au7PgKrMMK25fgPgop3W8vbQOaJD64dXs1wEQge6NdR4EQpC5wRvFAu4CVnmB7OII IoItXmqUc+Bk88IK9ZqPSotjwYim7k8lxzcRos0F5Z38GHGkvLcyzUfaBWaDGuqDm1ZqeVi/W9XRb kjGKUr9tHLdf6rMwGfVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fUb-0094MA-UT; Fri, 09 Dec 2022 15:40:54 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fJ2-008zRg-ST for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:28:58 +0000 Received: by mail-pj1-x1033.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso8503866pjt.0 for ; Fri, 09 Dec 2022 07:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=8p9dxhpDEUaFEM6i9u4TLkBBVBUWb0qAkL73zpJR35M=; b=WqAhRmTfaE1uP5V7v5oPhs2j9JbsB9dzNO8h4T/RMEk8iF/m2H8QUpZHH7rc1ZKWjo SfV6DYb8cWbrApPZp6YnEkBtbtJehtmX5xaqT9JI/Y4+NDMBmmZ6yYh7xqiLn15XlVvY i9V1dFR4zy7R4rVJqWVI2sxW+h6MsZhopwgag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=8p9dxhpDEUaFEM6i9u4TLkBBVBUWb0qAkL73zpJR35M=; b=MrHdB8+W2oFEKkXoWnxPSbDAbd/X+7f/fuuJ3zXMZcV83jI+mZXcNRjAFpndvY44s6 LZR7WOGnLDde1B0RSPCN8IXW8gOlWAU0ieGpVUoB7JrwUQ674X3KE6Sfawto0DKjA40K Mpfx5lLxo6mjrMVdlnNlhFZPbHLt/CCgd2hqGvEgvAl/+dQVM03gmXeG7tuOIMj9tXT7 DfIk9+TIu9G0fcRWBGTY5UztU/v75VdCjWnDcNY8ydv+3WoMurCQ6iv1uqv/FUZEzaG7 gNjKEsiJWRH+PVbl+G/oqdjQW3TPwSwIyo5XgWEBcNDCBUUJfsF3KbXmoI7o5Axr+MQk ctJA== X-Gm-Message-State: ANoB5pmlU46UfzcStcZGU7Tb3d4n5DpA6jKMA7OMaF0Hy7W9pYxLfZjb b+CiTAxmPTH/SlDlhQVO5DYN+Q== X-Google-Smtp-Source: AA0mqf7/OotqOappfZc8v6yh5v3mGpz5PlKhFLaT389Uh2ISaD6ESdcdD7ej1WqilpE5rytaXYbZbw== X-Received: by 2002:a05:6a20:a599:b0:a4:3203:40c9 with SMTP id bc25-20020a056a20a59900b000a4320340c9mr7741002pzb.59.1670599734187; Fri, 09 Dec 2022 07:28:54 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:28:53 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki , Rob Herring Subject: [PATCH v9 15/18] dt-bindings: display: exynos: dsim: Add NXP i.MX8M Mini/Nano support Date: Fri, 9 Dec 2022 20:53:40 +0530 Message-Id: <20221209152343.180139-16-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072856_967381_055D3501 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Samsung MIPI DSIM bridge can also be found in i.MX8M Mini/Nano SoC. Add dt-bingings for it. v9: * none v8: * add comment to include i.MX8M Nano. v7, v6, v5, v4: * none v3: * collect Rob Acked-by v2: * updated comments v1: * new patch Acked-by: Rob Herring Signed-off-by: Jagan Teki --- Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt b/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt index be377786e8cd..5133d4d39190 100644 --- a/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +++ b/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt @@ -7,6 +7,7 @@ Required properties: "samsung,exynos5410-mipi-dsi" /* for Exynos5410/5420/5440 SoCs */ "samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */ "samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */ + "fsl,imx8mm-mipi-dsim" /* for i.MX8M Mini/Nano SoCs */ - reg: physical base address and length of the registers set for the device - interrupts: should contain DSI interrupt - clocks: list of clock specifiers, must contain an entry for each required From patchwork Fri Dec 9 15:23:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069891 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 A1884C4332F for ; Fri, 9 Dec 2022 15:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ly+DRYI6iBuxiaH1JdxFrOF+Z7aqzLg64I1PJu8+WR4=; b=cHo4mlH1OVWMMr ModANmyqu6omXLL5IeJ1Z0lLlu7OOtgm6zh0QJadLLXvUFqlQs5t8HN4PjGWvt5/E7DHp83EwFb+u kd5eUNL624YLRdqRBhkxQfhHOw4fui1dScEX5+2pFDlH+77ZG8E/7CIGEdNF0CX3n2nLAZeiv/paQ ZifTlTR5VPtGpB3INEc/DuNDMqxsvHHpiwHR8VLgwqQc7VUAK8J/99V414Tr2MXOuxi0ogGL/ak3/ t3HBqtWqLtwS7oLKJ34MWR3obDCQ5k0CCkKHWPPmXr2iB90yr9+2G+kdZbtgONN5B14aby1QBQIKx HRnXXIGqfKv56zDEnJBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fVV-0094kV-Jm; Fri, 09 Dec 2022 15:41:51 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fJI-008zZn-HM for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:29:14 +0000 Received: by mail-pl1-x629.google.com with SMTP id p24so5237376plw.1 for ; Fri, 09 Dec 2022 07:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=eSNOc+bqWhWXNl6JS/X0v2ej/6qOLiMK7cWS2dLY9bo=; b=pqKNlGd1L6MkLcGapDn1ddT9qsRA2tBBcsH/QwAPPKVOuIWBuxFMvYRlHNHXTwGqhr P5hpvucfwEjVdBGeuUHz4cVkMVjA+3+p3TwykepSuU9vkgK5yEG1WtncA10tzkl04I6x ZTeYXaQwN9uVhbWlBge1sHAM8RH52rdfSaP9c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=eSNOc+bqWhWXNl6JS/X0v2ej/6qOLiMK7cWS2dLY9bo=; b=ZhxvWlzvJui793bNiDhBF/SKF3453i9E36d5s3LurPuOQ70gMsrjDXiGdPNoyYft+9 9K61Rd76aXVGV2+ka/nKk7u6QxDD2sTU9oh+KA82b1gdyYSGL+imrkok8peL9/JbIdIu 68j537uD6GUEYWazoJ9DS0dZ1AKpKJMnvaYjk4FRhMWWYzzJE9ibl2F1DiHtHR603juI J5fmjNfadft80TyFTl5/AqWSQhIyFt81YHnw01hOYaaYCXC3lPsa9PterEIOP30e9cgK JVmycPzxHoW0191eI8Xvd0JWNS8DxPMgAF6SemhYtumCxZkb+KecxQ6ymopmm92A2pHA i8xQ== X-Gm-Message-State: ANoB5pm3IVg7/5zhXkDj4vAfe2Lr4FWy7yBPjx01m5lXzf39H5A3sKXH RyFu/jECg8grucJ1JEgtqyibnw== X-Google-Smtp-Source: AA0mqf4I4nr7C18GgZjZywVz0pFfmRw151lDEA1ZdLvNYhmFL+Lm8B1w9wdAw4niSM9XIzKn6+2n5g== X-Received: by 2002:a17:902:b210:b0:186:c544:8b38 with SMTP id t16-20020a170902b21000b00186c5448b38mr6269597plr.67.1670599751490; Fri, 09 Dec 2022 07:29:11 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.28.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:29:10 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki , Laurent Pinchart Subject: [PATCH v9 16/18] drm: bridge: samsung-dsim: Add i.MX8M Mini/Nano support Date: Fri, 9 Dec 2022 20:53:41 +0530 Message-Id: <20221209152343.180139-17-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072912_637313_C3BA83DB X-CRM114-Status: GOOD ( 14.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Samsung MIPI DSIM master can also be found in i.MX8M Mini/Nano SoC. Add compatible and associated driver_data for it. v9: * none v8: * fix and update the comment v7, v6: * none v3: * enable DSIM_QUIRK_FIXUP_SYNC_POL quirk v5: * [mszyprow] rebased and adjusted to the new driver initialization * drop quirk v4: * none v3: * enable DSIM_QUIRK_FIXUP_SYNC_POL quirk v2: * collect Laurent r-b v1: * none Reviewed-by: Laurent Pinchart Signed-off-by: Marek Szyprowski Signed-off-by: Jagan Teki --- drivers/gpu/drm/bridge/samsung-dsim.c | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 4de1294f29b3..7ff10308a7ad 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -376,6 +376,24 @@ static const unsigned int exynos5433_reg_values[] = { [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0c), }; +static const unsigned int imx8mm_dsim_reg_values[] = { + [RESET_TYPE] = DSIM_SWRST, + [PLL_TIMER] = 500, + [STOP_STATE_CNT] = 0xf, + [PHYCTRL_ULPS_EXIT] = 0, + [PHYCTRL_VREG_LP] = 0, + [PHYCTRL_SLEW_UP] = 0, + [PHYTIMING_LPX] = DSIM_PHYTIMING_LPX(0x06), + [PHYTIMING_HS_EXIT] = DSIM_PHYTIMING_HS_EXIT(0x0b), + [PHYTIMING_CLK_PREPARE] = DSIM_PHYTIMING1_CLK_PREPARE(0x07), + [PHYTIMING_CLK_ZERO] = DSIM_PHYTIMING1_CLK_ZERO(0x26), + [PHYTIMING_CLK_POST] = DSIM_PHYTIMING1_CLK_POST(0x0d), + [PHYTIMING_CLK_TRAIL] = DSIM_PHYTIMING1_CLK_TRAIL(0x08), + [PHYTIMING_HS_PREPARE] = DSIM_PHYTIMING2_HS_PREPARE(0x08), + [PHYTIMING_HS_ZERO] = DSIM_PHYTIMING2_HS_ZERO(0x0d), + [PHYTIMING_HS_TRAIL] = DSIM_PHYTIMING2_HS_TRAIL(0x0b), +}; + static const struct samsung_dsim_driver_data exynos3_dsi_driver_data = { .reg_ofs = exynos_reg_ofs, .plltmr_reg = 0x50, @@ -437,6 +455,22 @@ static const struct samsung_dsim_driver_data exynos5422_dsi_driver_data = { .reg_values = exynos5422_reg_values, }; +static const struct samsung_dsim_driver_data imx8mm_dsi_driver_data = { + .reg_ofs = exynos5433_reg_ofs, + .plltmr_reg = 0xa0, + .has_clklane_stop = 1, + .num_clks = 2, + .max_freq = 2100, + .wait_for_reset = 0, + .num_bits_resol = 12, + /* + * Unlike Exynos, PLL_P(PMS_P) offset 14 is used in i.MX8M Mini/Nano/Plus + * downstream driver - drivers/gpu/drm/bridge/sec-dsim.c + */ + .pll_p_offset = 14, + .reg_values = imx8mm_dsim_reg_values, +}; + static const struct samsung_dsim_driver_data * samsung_dsim_types[SAMSUNG_DSIM_TYPE_COUNT] = { [SAMSUNG_DSIM_TYPE_EXYNOS3250] = &exynos3_dsi_driver_data, @@ -444,6 +478,7 @@ samsung_dsim_types[SAMSUNG_DSIM_TYPE_COUNT] = { [SAMSUNG_DSIM_TYPE_EXYNOS5410] = &exynos5_dsi_driver_data, [SAMSUNG_DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, [SAMSUNG_DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, + [SAMSUNG_DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, }; static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) @@ -1843,7 +1878,16 @@ const struct dev_pm_ops samsung_dsim_pm_ops = { }; EXPORT_SYMBOL_GPL(samsung_dsim_pm_ops); +static const struct samsung_dsim_plat_data samsung_dsim_imx8mm_pdata = { + .hw_type = SAMSUNG_DSIM_TYPE_IMX8MM, + .host_ops = &samsung_dsim_generic_host_ops, +}; + static const struct of_device_id samsung_dsim_of_match[] = { + { + .compatible = "fsl,imx8mm-mipi-dsim", + .data = &samsung_dsim_imx8mm_pdata, + }, { /* sentinel. */ } }; MODULE_DEVICE_TABLE(of, samsung_dsim_of_match); From patchwork Fri Dec 9 15:23:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069893 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 32CAFC4332F for ; Fri, 9 Dec 2022 15:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TfxMCY2+D6HSP0VnAGKaCIEoCe4GhVhttBkEpOCYTNQ=; b=c6YHqyJp88BTGc YmXR+FVBl0mSxSEfnqevSKKBC/nuKfEihjS+knTEY/2pPKpWXqmmEzeFKM+QM1wQ37KqQR136F+tj At8+Qv45LiUB5XNoCk3GTLPgN/nHxCCu1haA5PW8ED51nY7TMObjDeO0wp0XlemWExal5EF1s1Hk3 0DOKU3OZau7IJnH/s8ionxBydqb07BHVd9nFi07wOEpcohrkgaQR3nlXEbWwUxKB9SWFGFrwSBSAx cJEAbP6o0o9lukfYEIhS50UjQJNaXcrUtMgVF7xbWhTXHg/lmPqnBvOzdvPmHlQ3fKwcj622kwdTM NBbrlOWrNIBQoxUdbtsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fWJ-0095C4-GG; Fri, 09 Dec 2022 15:42:40 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fJc-008zj5-9K for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:29:33 +0000 Received: by mail-pj1-x102c.google.com with SMTP id gt4so3505154pjb.1 for ; Fri, 09 Dec 2022 07:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=Vr1sFCYK6xOgp3HQgvixcoPvVesJ0tGc4yiJdF9vU7Q=; b=WJm32FtNO32Uq6dyQjp+U7K3bEFMiAf/BDAHSMli3f/GCcTuV2vrlFDTUTFLxJp4Hm X9pXpcqpCOhLclUpKSB1MK8xyDFh+JcbBPrYukM37whKWOOtOQKxw1NslI7FGueYRrxY Wc5vKftoUrY93bRfFcwW0MRXBYbsVy4qGhryQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Vr1sFCYK6xOgp3HQgvixcoPvVesJ0tGc4yiJdF9vU7Q=; b=GzUc2F4tyHW0LmenCBjLKWab26l+yQSauGTZ8Sfn/6ImbOAXK40Mkd+J7ifx1O2CqX kTJeSqzhWOOSW2gSL10KtA/2qWco+J+3x/P+D4lqj2MjqlhcFEdopNOL1QX894CvaFoE SCu1NUM5fPuzW12nQbT2aNwzCtJticAtK6gQZoka4E5t+r6/n0NdwGiB92eJHwBnYU6O B+NHSA1xGAF4mWOE5tSRkJGCQJNr/Lay4mZgoHlUXVDtnHUGUWI0P/wY+6hLqcFmsiG8 Q7TG1JE5COhJKb01iBmLBqsnNtH9vsHr6bptURa0HsHnTOHxwfpBRf8hafUsRun2r5xc NWAw== X-Gm-Message-State: ANoB5pn1rU/BZNU8Z9sicntgH26nEuwCMHJ76Zv1vfvhw+mOV2XX6dYR R9ElLN5mndQn98yLUfgU9eU/7A== X-Google-Smtp-Source: AA0mqf4shV/8b45XYewsg+kisEutSfSMO8MruxZiTRFGYFHREZsuwHm/fHCbQf+yjOaxny7ov6nEKg== X-Received: by 2002:a17:903:328b:b0:189:f7c2:7245 with SMTP id jh11-20020a170903328b00b00189f7c27245mr6350308plb.45.1670599771703; Fri, 09 Dec 2022 07:29:31 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:29:31 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 17/18] dt-bindings: display: exynos: dsim: Add NXP i.MX8M Plus support Date: Fri, 9 Dec 2022 20:53:42 +0530 Message-Id: <20221209152343.180139-18-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072932_373541_79D78316 X-CRM114-Status: GOOD ( 11.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Samsung MIPI DSIM bridge can also be found in i.MX8M Plus SoC. Add dt-bingings for it. Signed-off-by: Jagan Teki --- Changes for v9: - none Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt b/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt index 5133d4d39190..2a5f0889ec32 100644 --- a/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +++ b/Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt @@ -8,6 +8,7 @@ Required properties: "samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */ "samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */ "fsl,imx8mm-mipi-dsim" /* for i.MX8M Mini/Nano SoCs */ + "fsl,imx8mp-mipi-dsim" /* for i.MX8M Plus SoCs */ - reg: physical base address and length of the registers set for the device - interrupts: should contain DSI interrupt - clocks: list of clock specifiers, must contain an entry for each required From patchwork Fri Dec 9 15:23:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13069894 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6800BC4332F for ; Fri, 9 Dec 2022 15:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oskVclotTNOVrnXwlzV8iHe95c8caNY2sgXSvNBf+ks=; b=Kxu17MGAMUZBwr YiKi4mC5QOvMxqQPk/EuMy6LhrU7jSOAwQ7zAuFKsXNiU8C+JCQYJ3UJJKkiJ42V2a+mbyTsRRFwZ Ukv2LUH1IRKAiK7TFUWT8ifpx/sN6K4cKi6SVAKaSh0fWUxgmWynXzFVZjYWExY9UCwy/bo27gwP1 ttv7ffAEZLJl/13/Y6CV42nIAz26t/AfA+blcg0ang/VPqMY+0iIIingxwLb5aeuK4l0/YgZUSW7n p2U2qUpeLar7GMoquK2WwoBCkc+gFEWMtWuniy1ltKuN1RdT0neQ1pWxehqOE8PQR70hLZDzLucA7 jxmQZL1QxaJbrhHJmUsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fXS-0095j8-9E; Fri, 09 Dec 2022 15:43:52 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3fJp-008zZn-Aa for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 15:29:46 +0000 Received: by mail-pl1-x629.google.com with SMTP id p24so5239106plw.1 for ; Fri, 09 Dec 2022 07:29:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=xNNQvL6gmHJgo6OwoezUZSB4ceELF3kYUZfEbLlRThk=; b=UMsZ3eNi6sRQPXBTi2kiU/rR25gBozLv89OKl8jLxQ7mPZiMhiLehdkjROAqNMPYFK 2SGAbFjUmvkHClPfJOp7pbc4UBx0m3HDotebjKF4f4V8IRPqLCoqBJu1bch9iitAw/4U Pp1ivi3v2b83VeO747qREcLi6vCZYDPIfOvLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=xNNQvL6gmHJgo6OwoezUZSB4ceELF3kYUZfEbLlRThk=; b=b7VeIHxLAw//h94xfiGQjh+6Fm5093A0DnL/vUlIPO6tsw0xy7DkvXDV4tGGE7R947 ccTtwXVSieDc2UJoB3uyNwOenBGXZT3domA4SasuL+rDzm9shrrocNILY0+d8aujflQU 4Gugl86NHqbuPJnvOURz2MLeyzCp3TJoprP6Qdx4Rz0m25x7B4JmpJb9cgmcpmayJ8bK EWAu5b3yz+TchkDRFZFoWLYeKAhZx1JSxZO/L7Oc5UchGHd9L1mx1ldG9mFnt9nLhMrj c89Fj3hCYC1lQPjTNohjMs4ZhnJYHQjYrXIu0ShlFwPBwLKV3AeldsL/cCxX2g7YGcPh sjUA== X-Gm-Message-State: ANoB5pnI1JtkVkNcWhgtzAjjFtziee/1fSaB0eJgZvnfehiehAdldFVV rshYXH0fAxjyI9sas8YFTV74hA== X-Google-Smtp-Source: AA0mqf51MIJwtIR7uEW8WMm8FAaHgBA1nquudNxkRWq2jrYhralxkuwSBPCCGGTIDNPiZWq5m6nTXg== X-Received: by 2002:a17:902:a60c:b0:189:f990:24af with SMTP id u12-20020a170902a60c00b00189f99024afmr5692194plq.20.1670599784952; Fri, 09 Dec 2022 07:29:44 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a809:6ba1:bbda:c542:ba0b]) by smtp.gmail.com with ESMTPSA id x14-20020a170902ec8e00b00188c5f0f9e9sm1477587plg.199.2022.12.09.07.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:29:44 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Fancy Fang , Tim Harvey , Michael Nazzareno Trimarchi , Adam Ford , Neil Armstrong , Robert Foss , Laurent Pinchart , Tommaso Merciai , Marek Vasut Cc: Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP Linux Team , linux-amarula , Jagan Teki Subject: [PATCH v9 18/18] drm: bridge: samsung-dsim: Add i.MX8M Plus support Date: Fri, 9 Dec 2022 20:53:43 +0530 Message-Id: <20221209152343.180139-19-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221209152343.180139-1-jagan@amarulasolutions.com> References: <20221209152343.180139-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_072945_406006_BB47EE4A X-CRM114-Status: GOOD ( 18.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add extras to support i.MX8M Plus. The main change is the removal of HS/VS/DE signal inversion in the LCDIFv3-DSIM glue logic, otherwise the implementation of this IP in i.MX8M Plus is very much compatible with the i.MX8M Mini/Nano one. Signed-off-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v9: - added im8mp in DSIM_STATE_REINITIALIZED check drivers/gpu/drm/bridge/samsung-dsim.c | 26 +++++++++++++++++++++++++- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index 7ff10308a7ad..6e9ad955ebd3 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -479,6 +479,7 @@ samsung_dsim_types[SAMSUNG_DSIM_TYPE_COUNT] = { [SAMSUNG_DSIM_TYPE_EXYNOS5422] = &exynos5422_dsi_driver_data, [SAMSUNG_DSIM_TYPE_EXYNOS5433] = &exynos5433_dsi_driver_data, [SAMSUNG_DSIM_TYPE_IMX8MM] = &imx8mm_dsi_driver_data, + [SAMSUNG_DSIM_TYPE_IMX8MP] = &imx8mm_dsi_driver_data, }; static inline struct samsung_dsim *host_to_dsi(struct mipi_dsi_host *h) @@ -1305,7 +1306,8 @@ static int samsung_dsim_init(struct samsung_dsim *dsi, unsigned int flag) * This host reinitialization is handled via DSIM_STATE_REINITIALIZED * flag and triggers from host transfer. Do this exclusively for Exynos. */ - if ((dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) && + if ((dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM || + dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MP) && dsi->state & DSIM_STATE_REINITIALIZED) return 0; @@ -1468,10 +1470,17 @@ static int samsung_dsim_atomic_check(struct drm_bridge *bridge, * 13.6.2.7.2 RGB interface * both claim "Vsync, Hsync, and VDEN are active high signals.", the * LCDIF must generate inverted HS/VS/DE signals, i.e. active LOW. + * + * The i.MX8M Plus glue logic between LCDIFv3 and DSIM does not + * implement the same behavior, therefore LCDIFv3 must generate + * HS/VS/DE signals active HIGH. */ if (dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) { adjusted_mode->flags |= (DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); adjusted_mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); + } else if (dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MP) { + adjusted_mode->flags &= ~(DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC); + adjusted_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); } return 0; @@ -1689,6 +1698,10 @@ static const struct samsung_dsim_host_ops samsung_dsim_generic_host_ops = { .unregister_host = samsung_dsim_unregister_host, }; +static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_high = { + .input_bus_flags = DRM_BUS_FLAG_DE_HIGH, +}; + static const struct drm_bridge_timings samsung_dsim_bridge_timings_de_low = { .input_bus_flags = DRM_BUS_FLAG_DE_LOW, }; @@ -1778,6 +1791,8 @@ int samsung_dsim_probe(struct platform_device *pdev) /* DE_LOW: i.MX8M Mini/Nano LCDIF-DSIM glue logic inverts HS/VS/DE */ if (dsi->plat_data->hw_type == SAMSUNG_DSIM_TYPE_IMX8MM) dsi->bridge.timings = &samsung_dsim_bridge_timings_de_low; + else + dsi->bridge.timings = &samsung_dsim_bridge_timings_de_high; if (dsi->plat_data->host_ops && dsi->plat_data->host_ops->register_host) ret = dsi->plat_data->host_ops->register_host(dsi); @@ -1883,11 +1898,20 @@ static const struct samsung_dsim_plat_data samsung_dsim_imx8mm_pdata = { .host_ops = &samsung_dsim_generic_host_ops, }; +static const struct samsung_dsim_plat_data samsung_dsim_imx8mp_pdata = { + .hw_type = SAMSUNG_DSIM_TYPE_IMX8MP, + .host_ops = &samsung_dsim_generic_host_ops, +}; + static const struct of_device_id samsung_dsim_of_match[] = { { .compatible = "fsl,imx8mm-mipi-dsim", .data = &samsung_dsim_imx8mm_pdata, }, + { + .compatible = "fsl,imx8mp-mipi-dsim", + .data = &samsung_dsim_imx8mp_pdata, + }, { /* sentinel. */ } }; MODULE_DEVICE_TABLE(of, samsung_dsim_of_match); diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung-dsim.h index df3d030daec6..3789f9dbb238 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -28,6 +28,7 @@ enum samsung_dsim_type { SAMSUNG_DSIM_TYPE_EXYNOS5422, SAMSUNG_DSIM_TYPE_EXYNOS5433, SAMSUNG_DSIM_TYPE_IMX8MM, + SAMSUNG_DSIM_TYPE_IMX8MP, SAMSUNG_DSIM_TYPE_COUNT, };