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,