From patchwork Thu Jan 26 14:44:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2686 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4AA483F046 for ; Thu, 26 Jan 2023 15:47:25 +0100 (CET) Received: by mail-pj1-f72.google.com with SMTP id on9-20020a17090b1d0900b0022955c2f0f4sf3420378pjb.1 for ; Thu, 26 Jan 2023 06:47:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674744444; cv=pass; d=google.com; s=arc-20160816; b=mmbjCc728E+NQmqqw5fSqxDn8Vq7JZliwUnEadq3/2vtjHXen9J1IHVl4iAkwFNh+J lEpkjyYqhuQkMQJ22PlKg1xg8wo6SYXqBAHAwpWu13Y7oBqM78Xa7FL7p0Xv0+h9K8/A U2vIfMRQQ9AUvB9wmHcVgKVVjbZTuvdaJ9/vHHrU+c8Mm7mO0rMcsfZSMNji++9FNUBo +EnkMfDubRW2p+FX32VLcbTEyP/F43cf90uC0nBpVMj2HEUwBbTWO4IJGldmkEu6JRq9 8sgOlOGJ1W7o5S+lPLQoQenkEHEKRtJGdAZA1lsucZ/XjITvsyPclxhzKB6d8AscbtOV 0OWA== 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=Cw2G8jcsU2qHsTBFDSrxxpXB5Bfg4rPNZJoqepKnbzg=; b=nf4qwuPu0OIUsVdlOUyeEOvl4VhHo2bSrx0u/d8hVR7LoUO29XrSEHc0HiWdwNX0bX e+sZ5kvuH8DpaTzbTZU6Xj6/0ZoIanHSrqJeJl95Y7YFX7AF/BD0+FL9OGD7DOftH2sW cyXDezCFoWNqEvWVfvRDS5Yp92mGkzqTOcLTW2s3C0EgIh9QCxxhy0c6MWoAnnDZ5Lgs qp6gxrVguPH+cT7rPZxaYkzSc6YxxdsuvT3EXwN+3bB0hm9bZXJejZ4LGoNxLgQOnjR9 y0BIlPXPjaf75IIISEHwjO6r+gDbeTWZoJzyeq0uSM5XGC19bZggktG3V16/riqywaR/ GPzQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lMOybId8; 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=Cw2G8jcsU2qHsTBFDSrxxpXB5Bfg4rPNZJoqepKnbzg=; b=FPA6147kZiLuYfyVaNOKvPOalSkPPMXqC+aelgm/74b51m9pUnOGDjhPiLkGt7uuAi H2RTJ1/YNCVzWdzmAJ1tSGTUvhxUtWzw7iKlBLoi6EBBY4RurdiRG2N5cAcIaK6dKcBT bD2aP4XFNwwUn8Vc5ycmuEDaoaD2bn4zQmEEQ= 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=Cw2G8jcsU2qHsTBFDSrxxpXB5Bfg4rPNZJoqepKnbzg=; b=iGkMNv8aTdh8HK1YQfbPVCSVWy7yuFunT2Tc0Upejk2gFk7ZUHgMraesVgv9MlHxrn Cz3bHkB9OnhgNyqDej1MFoPx6HnjhUw8aze7q4h8Wc864tXJSKI0UYSuaMpffj6Gu9KT qCg3tG7Re8hQVQuPhdfXL8oh/bChd/Y6j2BRaSmHEnMcd1baNqmRP+iwijkLEY3NDLPb 3Depy3QTdSJlppTg/zcK2atjHAWvOwTEOyVRYcnhgHYz+u0UT/1O2ludQUgHtLVLMTD1 XQBufAawWGvEqMPr2697tf/aQYa88ACgv6YIl6d5VPHA5EBRQZpAGsRIFJ56WAb72jen miDw== X-Gm-Message-State: AFqh2kodFah9oqj3HvElvHCIChB26RwlUYmj71W2nBcrhVfxIesDPjXO V5vrT6IgBaZx3pVaO7HfEy45aC14 X-Google-Smtp-Source: AMrXdXuS/15wcLpdPzr/SCy4jf6yWLYHHw3g9M/L3mbcv8gNzVZuA/hcXfdD44rWrccuGyBdvYK/9w== X-Received: by 2002:aa7:8ecd:0:b0:581:2379:f591 with SMTP id b13-20020aa78ecd000000b005812379f591mr3704993pfr.38.1674744444001; Thu, 26 Jan 2023 06:47:24 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:988f:b0:192:76dc:bdd0 with SMTP id s15-20020a170902988f00b0019276dcbdd0ls2366951plp.5.-pod-prod-gmail; Thu, 26 Jan 2023 06:47:23 -0800 (PST) X-Received: by 2002:a17:902:ea01:b0:196:37a4:772a with SMTP id s1-20020a170902ea0100b0019637a4772amr5195540plg.65.1674744443184; Thu, 26 Jan 2023 06:47:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674744443; cv=none; d=google.com; s=arc-20160816; b=uKSIROaIxJ4nQCnvSyATBdIEaFb26CP97KtiPlqVlxf56SI03TmgsfcnvJJLswAFMt prITX+bx+zbN3pIu7Nqght9E5Et7Il3ldBBkc2hcsIzXmNUS/NWvtRmdhC/y1cktgNxZ LWbhW2++iTb3CuKDNkUlL/GvHoAxgjQDIm+ww6bNWXKcTQaJWCkbFiCOT8Amup05cR4a 7E3SwYIR/3Drbl9iaB6099opxStSWzVi1thd03xwRdhaC5avVOz1PxpvmIg/R0DqVFGa 2TCKOiiue5HhkiqRSOGxKIPuwywsxZJNNxfBbJPrvAWQj+oyF7MMjJBsNq+9oVVq3Ied pCBw== 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=A1BDEAt+rxWWloQDlKB/2I6ZLTZG0ASWjyAAcB7oGTE=; b=pskTqPAKI5HLGHSB8DSyDuF/5QHrklTbjnvC3aa7LBLUaBlC6eQmwB2Es7XCwBrMmh wnzASIsLVqy4LmF+4l/Q5qb1tEh/2yshQwF0xh6khhe0W+pWzVWI3RvV7DwrUEMIXRuf vchhSKj210Ln0MlSbdq0zON1srwwiiCqYZOKVDLn933S5qQQphKi6RBzbc2KdMd2o9MH EaW1v990n5ybMbAKUrKx5H7GBRTSUuiF6PAR3iXAdZSPLT/+NARfRtI2qK6gdHquk64Z dV80KWBr54SE2pIlyNWSUFVXoF5eLd1D4hq1b2LdOtRLJ98Rp8CttZ7YdfqqqQLRQNXt R9/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lMOybId8; 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 b19-20020a170902d41300b00196064bf2cesor731177ple.74.2023.01.26.06.47.23 for (Google Transport Security); Thu, 26 Jan 2023 06:47:23 -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:a05:6a21:3381:b0:af:6cc0:5b3d with SMTP id yy1-20020a056a21338100b000af6cc05b3dmr50400165pzb.7.1674744442878; Thu, 26 Jan 2023 06:47:22 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a238:3cb1:2156:ef87:8af5]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042988a04bfdsm823660pga.9.2023.01.26.06.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Jan 2023 06:47:22 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Robert Foss , 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 v12 13/18] drm: exynos: dsi: Add host helper for te_irq_handler Date: Thu, 26 Jan 2023 20:14:22 +0530 Message-Id: <20230126144427.607098-14-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126144427.607098-1-jagan@amarulasolutions.com> References: <20230126144427.607098-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=lMOybId8; 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 --- 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 488fae218205..1d95909391e2 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -325,6 +325,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 { @@ -1333,11 +1334,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; } @@ -1716,6 +1716,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) { @@ -2030,6 +2041,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 = {