From patchwork Mon Feb 27 11:39:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2753 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1DAF03F9C2 for ; Mon, 27 Feb 2023 12:41:09 +0100 (CET) Received: by mail-pl1-f199.google.com with SMTP id z1-20020a170902d54100b00198bc9ba4edsf3524656plf.21 for ; Mon, 27 Feb 2023 03:41:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677498068; cv=pass; d=google.com; s=arc-20160816; b=Ne65oXR+d/ahlOBi6+BZu+GpbyGezh/Rmc3QLUxx7rEdg0jI8ps/QZnUdUJ4jwtIGs 90bizPM+WrPJVOtB1e5hq4XQGKXip6enIlYmY8F5eBXoJvR+/obSyFEUl98RgDPHppMb 3fuL58x0HSd/GuS4PQrbdBe2gX4IFZ4orTPJAWYlHPI166Z8ww3/zoYmx3SehqaLveF4 Cx7jqtQOpKhOwJqc/eKgVV9F+1zWuP5om4BlBYcTVw4MuziCELDz2k8lEIiP7LRcscsq 1CGl6OmSX6yEXEz8RsPz5qljDLRxTqrHHq5Oy7eY8ZPKgcroTap9U5y/IVZmehsFm1X3 VMSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4HKnPasbqN2givTjYW5kTJHWES5TxFJFVRL8E7tScKs=; b=iAYFEF3EKjMBt005hx5XsY8g3xHLhR7yOldlzrh1spmifCPY3zz0GOcCVpIp24PNH3 Qf0sTSjDcjEEpw9hWBHgy1PNixUWDAoxaAdunjlYWX+2wdSa4LrVQRGmYNkxnfhozz/p 4AiJl/3/iwW/91Zs/UdesC2XxPKcBvUKGRMbvfVvjBNrbX+Ls4EKN4voXt0RRGmkI+d2 Knn8phfoJFUzM6Q5EDx/hj96Dz+qf4ZGV9J0IIpaZWT8/lOIbQObWpxE63qJSHY7pMb2 4NzGoeea9+T3Ve5v2ock74iEN/U6BDBofbNxB54I/5jgSvkaPmiCP42r8y6PYIFt/MCV LpHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=etdN6B4M; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender: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=4HKnPasbqN2givTjYW5kTJHWES5TxFJFVRL8E7tScKs=; b=jdtksBdbctICRM8Ga3NNkK4JnTw11AELRc51lHg9GaYfbTJor2UfxvzyzhBmRqNbbA fypfRY+ib+eEO4B9vkgvkIlaJDFrtzlipUZA0ZwFW5Ab4gg98CGxvXbmBEBfUVcq+dov P0oFiaCzpyU/L9z0vG/VK9I744ZeNueszk0Gs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :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=4HKnPasbqN2givTjYW5kTJHWES5TxFJFVRL8E7tScKs=; b=l2B9fDNa957cMgg32QpBkiQmyh584zyFLsADFcjL0WN3iLqVMuzixBLeHvRXd+76A2 4jtBaQ/bqFEOi5VDus0Cu6czRymUqaYcOA201jTv92olCJBBvZICq+3Hfqz8wi02qvxG aUNleOA9WI4hs/FeHH8o9QS/rKDZfh0UM9+if1/6qbewtdlALbdTdFkdssZwmWwgPcwD 4T3/fqCDc/P6oapwwdnSf1D3gOWzbxiGwoZFO556j494NTXJfPLyyHgjJ0d/Gln6vHfD 7kGhVBD9bZ6KNquxzJ6LljXAM4iypr0csJntFHn+z51lH4Og2KKC18+RH3/PfV6ofs5C r2DQ== X-Gm-Message-State: AO0yUKW29m54j/uQH30mwcsULHz1/B8fCtV2Ntyk1NIZ1lOca9AqcX2o CwkxhC3c4cuxxXEume1hYDNbTvFC X-Google-Smtp-Source: AK7set/FGKs0bV2QYJu++HPWwwcwhuk38qlzRDdfgFJAeqQUDjt5lggtE5N976C1oHzbi2Lcs1ywqA== X-Received: by 2002:a17:90b:4b10:b0:22c:3ee1:db3b with SMTP id lx16-20020a17090b4b1000b0022c3ee1db3bmr4839956pjb.3.1677498067909; Mon, 27 Feb 2023 03:41:07 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:5d82:b0:234:2ef4:2e9 with SMTP id t2-20020a17090a5d8200b002342ef402e9ls8891044pji.0.-pod-control-gmail; Mon, 27 Feb 2023 03:41:07 -0800 (PST) X-Received: by 2002:a17:903:2ca:b0:19d:d960:122c with SMTP id s10-20020a17090302ca00b0019dd960122cmr862458plk.58.1677498067072; Mon, 27 Feb 2023 03:41:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677498067; cv=none; d=google.com; s=arc-20160816; b=oOLp494ERJsA3hQt8oPtYEzfzR1RobNwdsM+bq7of8SMI5H2LEzBND67qBwWVw1TIG OOFkDZ4CqBrlHKAbE9YQhpMLhissfoJMCJwxG4of651pIdzk3H44zGpEjwdz2/h9XxdF DUpov67W26CeXbjYmUnXIosmIIf6Fil8uDaQnMhrQM9v/DGyNflLbJaWHvtJBdwNZOEg SOaoyH0fFjf8Rzx0nHpnDp3u0/GM1WEDd/E30u3/eJe7br2d3opNLSPtE5VTNddvmxqN MhCpoBx7D9Djvnu7gA3C2NdtGlKlK+A4CeZ06LJ5sonhxWisAD/BO5tjVM6TV54rld/h vkUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=h/pvsdevlqP7CP6iuiZkDWC//vV9mr41wh5OsotB/Yc=; b=o0Ei8gLhN26ouDU46rQtR2WQc6e7/32qTLEEYYRxAIbZSNoorT6ZQlGT7dW/eqIocu YbkaL8MSkVdcIn/0amGFIrgYj/3XoxDzvSa+IxiJ/HjyZIQBgGiHmv7c+nI/QkFpN1fz xW2u8Ua3dh2jX32MOjhqtSitKPmVSpcUElRuY0p/gP+BXd5YIUlY28FFIGHpTF91DnXT lavWv0v7iOIMuGxyRiHR9P+qkYlo2L9Aku3DSq4a+/c3yGT7vhf0lylWJnZgYKIn0xku 8p5zlIEMMmp2Niv/SQiHYAyiQHKX9etepd4hgwzFRV6UpdGWK/XCQCtC3J4Nuoxgipne yZ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=etdN6B4M; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id y16-20020a170902b49000b0019cb7ed7172sor2314409plr.8.2023.02.27.03.41.07 for (Google Transport Security); Mon, 27 Feb 2023 03:41:07 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:902:f542:b0:19c:e405:4446 with SMTP id h2-20020a170902f54200b0019ce4054446mr8518208plf.30.1677498066732; Mon, 27 Feb 2023 03:41:06 -0800 (PST) Received: from localhost.localdomain ([94.140.8.120]) by smtp.gmail.com with ESMTPSA id k10-20020a170902ba8a00b0019c919bccf8sm4395277pls.86.2023.02.27.03.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 03:41:06 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Laurent Pinchart , 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 v13 13/18] drm: exynos: dsi: Add host helper for te_irq_handler Date: Mon, 27 Feb 2023 17:09:20 +0530 Message-Id: <20230227113925.875425-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227113925.875425-1-jagan@amarulasolutions.com> References: <20230227113925.875425-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=etdN6B4M; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , IRQ handler for te-gpio seems to be common across DSIM host. However, Exynos is handling this via CRTC drivers but there is no clear evidence on how the same has been handled in i.MX8MM. Keeping the handler as-it-is can be a viable option but adding DSIM bridge core in upcoming patches is not possible to call Exynos CRTC handler as DSIM bridge has to be common across DRM bridge core instead of platform specific DRM drivers like Exynos here. So, this patch handles the handler via platform host helper, so-that handling platform specific hook across Exynos and generic can be reasonable till it makes it generic across all platforms. Signed-off-by: Jagan Teki Reviewed-by: Marek Vasut --- Changes for v13: - none Changes for v12: - updated patch - suggested by Marek V Changes for v11: - none Changes for v10: - split from previous series patch "drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge" drivers/gpu/drm/exynos/exynos_drm_dsi.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index de8604450fb9..938bbc701d3c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -326,6 +326,7 @@ struct exynos_dsim_host_ops { void (*unregister_host)(struct exynos_dsi *dsim); int (*attach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); int (*detach)(struct exynos_dsi *dsim, struct mipi_dsi_device *device); + irqreturn_t (*te_irq_handler)(struct exynos_dsi *dsim); }; struct exynos_dsi_enc { @@ -1334,11 +1335,10 @@ static irqreturn_t exynos_dsi_irq(int irq, void *dev_id) static irqreturn_t exynos_dsi_te_irq_handler(int irq, void *dev_id) { struct exynos_dsi *dsi = (struct exynos_dsi *)dev_id; - struct exynos_dsi_enc *dsi_enc = dsi->priv; - struct drm_encoder *encoder = &dsi_enc->encoder; + const struct exynos_dsi_plat_data *pdata = dsi->plat_data; - if (dsi->state & DSIM_STATE_VIDOUT_AVAILABLE) - exynos_drm_crtc_te_handler(encoder->crtc); + if (pdata->host_ops && pdata->host_ops->te_irq_handler) + return pdata->host_ops->te_irq_handler(dsi); return IRQ_HANDLED; } @@ -1728,6 +1728,17 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) return 0; } +static irqreturn_t _exynos_dsi_te_irq_handler(struct exynos_dsi *dsim) +{ + struct exynos_dsi_enc *dsi_enc = dsim->priv; + struct drm_encoder *encoder = &dsi_enc->encoder; + + if (dsim->state & DSIM_STATE_VIDOUT_AVAILABLE) + exynos_drm_crtc_te_handler(encoder->crtc); + + return IRQ_HANDLED; +} + static int _exynos_dsi_host_attach(struct exynos_dsi *dsim, struct mipi_dsi_device *device) { @@ -2042,6 +2053,7 @@ static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { .unregister_host = exynos_dsi_unregister_host, .attach = _exynos_dsi_host_attach, .detach = _exynos_dsi_host_detach, + .te_irq_handler = _exynos_dsi_te_irq_handler, }; static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = {