From patchwork Wed Mar 8 16:39:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2791 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EFF3B414B5 for ; Wed, 8 Mar 2023 17:41:22 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id d3-20020a17090acd0300b00237659aae8dsf1278206pju.1 for ; Wed, 08 Mar 2023 08:41:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678293681; cv=pass; d=google.com; s=arc-20160816; b=vHWlqUPhjtFW/daQimsCf4CO62l7ejLUtD41+KaM+FBU5WQxhE9rQpbCv/DISO331k 0IPkdRZwOGy/s7q/mD0qiN2qXckF3haq6DHHn7N+fJFDi2DWJZw12Ld57KeT9atOjDTn tjkZABIs0k134NaxT2GpeWP/UTYT85iwqs4cYTUxXqbVWHudnS4vcn8U0nqN4LpFHyCU lU2iAXXsSjuVQggO4gGRnuF7ynLBt9fgQ3x998R0J2dS5ECLUxDIlSKC0QUWL3w86K04 T/dRzXg4F/yEYTl7gq1lNpsBfxO7vbo5KfzlOxoKmefYvZg05JuOdAlOjx1bfYquZfTs xz2Q== 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=l+VuiLg+BcM0IMBzlKbvIEY58x3JBRHMfphOxUVU1Ac=; b=jO1Pgdu9g+MuLcDNOrIC5LILtf0m/EiWD4Jp7Lho483JRIxYkajFpyL/4m5k/LDQ89 yvb+ty/31bO+tpQVOfIWw4WOFp+Fa53JtQ+a6xMYGtpj8hd0TN/JRDNsqscsbk0YVgAz u713if6hxIE+VuDmPLtaOzLjWAcTpPxTXpq9EmKt72r6POzTvWjquV+Uc6lNErieXDeS buHGjj03GaRxPhehjWIpODcV/HyO1kh4kZqkznJfGtgAd4IbrijswMwuIt4BZ3DQpv4F d2aGJD8+sOumuCGpJGxvvTyrDxfgvA/KBMUIiHwz/p+4PWwN6gn4NgLdal3yoA+4+4T0 H5Cw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o3ke2KJZ; 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; t=1678293681; 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=l+VuiLg+BcM0IMBzlKbvIEY58x3JBRHMfphOxUVU1Ac=; b=fE89repzZgNI1X/BBBvEMC85LrX7uicT30RHhdz72ZRWejEvKoq2pwpA1igAElqjCP 5zGezg+5MDumNZvkeTzxRrzYg+8/Du/N2nO4nUblTYMGX6bhuKCJ7PNgvy6P6gaffEqT c0dHzOikN+IpnSVbyPkTacBxH9P5A4YNeZHnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678293681; 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=l+VuiLg+BcM0IMBzlKbvIEY58x3JBRHMfphOxUVU1Ac=; b=IiAGsMqFwsOsPo3NpzAxLxhVScPTeO91+H4qG/i2R4vWy1QrFf1xnV545Lua0pLsBE EPSWqcPtFYaSzl1zSBDgMzBlk2OPvZ/3BO5qREShVe1+uycIjpozYJSsWtnO7qTvyWE0 TQ2jEpwWq8gk3DtvDJO2sWfNVd/e3UGWqRrlOWBSEFijmkuDk5BW5exWBQEiwzdEOx7g LLxXtNWzGehIhGuPdTOX5ZWJC1pDiSTGRHRtLPnu7SLArcoAic1YUBuv3QgOJtwkFHgE I35UtfKuG9W/OND/RR5mTxGIdZyx9lxA3AluscWbVug16eBzmugIKem+FJrXpHR9Ck6y 0aDA== X-Gm-Message-State: AO0yUKUC379QMbEHK/826CeC3TjAxAK9S4Q0ghl5kFFgEq2bayKjFxqt 86LrzAdZOtiys+QupLqKd5CxFjaK X-Google-Smtp-Source: AK7set+SP3kPcyja8ggPIHQzynzPZpi1wP6ngnR+YhBWugQBovFNfDbYbgNvMO2DMbtX4aMvwHY4cw== X-Received: by 2002:a17:90a:1c02:b0:234:bed1:1012 with SMTP id s2-20020a17090a1c0200b00234bed11012mr6761390pjs.6.1678293681753; Wed, 08 Mar 2023 08:41:21 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:be18:b0:199:50f5:6729 with SMTP id r24-20020a170902be1800b0019950f56729ls16325308pls.11.-pod-prod-gmail; Wed, 08 Mar 2023 08:41:21 -0800 (PST) X-Received: by 2002:a17:902:7807:b0:19c:e0fe:ed2b with SMTP id p7-20020a170902780700b0019ce0feed2bmr14089392pll.54.1678293680826; Wed, 08 Mar 2023 08:41:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678293680; cv=none; d=google.com; s=arc-20160816; b=dPWzkOBaPWWREROOFn9Bn19vYxAajYaKs+Ll/QK2BkQebjsdV83TTIoYg7T9fCaJEg O2i1yQKsaR+SPxBSEIK/us1Cz3LRYwWaAl9Zv4r0CEsqUxPaq7bezBjWEm1B7S8yt+Bw b68A8L9V7No5ihecx6h0cisZDG8+CjoGBaeEPw8l8bT3ohggy7xNXj7d6cOSKvSdg/gs NIIhDRTD6YqsAxmjbX8btyK2hfiBtkFlAFmOz3j27Cw55d8wjtEshojUHMdCpRRW8qUE uc6iQYU7dKm+ya+LDMzdE16daHO2T3M7KAC5lINhshzrck8urE1gpSIDpzjK0Vua9h+M FO/g== 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=nxcRYcAFiM6jXzQsrD3xe+grt23Ypaeq7iGojFVEogQ=; b=I9uaTOW2+0tiUZfeTCdwESKIcGI1m6T3fNyIVrwk2s9nfXHHEtYWM3FrKLMDxtw7Jb vBn5+qb7KE1Sf8j5IpUi7I+aviOhMTLGBuNqlEOBE+6uvMjbDbe1Mw4mfac7aFIxh/B4 M6gIZsq7EqJ9uz3vmGMKWixpCcAR/60bXk+/wCvxGanQxZtrvGkh4YvB/yu73r6Jck8q AT3lyMOvnDavzvM8g2cP6v0S0tbcOeDYvhvfnesKmdiIUWXsXtCSMXe+7dfRTaxoZCWH fqWlmKXd1wnBUuvHmOz1iNtrKfO9Q83WTtPHuGOA+UZRiBaa08AI0C/AC7kPDOBt0FMo u6tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=o3ke2KJZ; 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 t13-20020a1709027fcd00b0019a8a067bb5sor6481216plb.106.2023.03.08.08.41.20 for (Google Transport Security); Wed, 08 Mar 2023 08:41:20 -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:eb81:b0:19a:b6bf:1df6 with SMTP id q1-20020a170902eb8100b0019ab6bf1df6mr19864921plg.20.1678293680536; Wed, 08 Mar 2023 08:41:20 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a8a1:b545:91cc:80b2:f9fe]) by smtp.gmail.com with ESMTPSA id kq3-20020a170903284300b0019b9a075f1fsm10046540plb.80.2023.03.08.08.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Mar 2023 08:41:19 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Inki Dae , Marek Szyprowski , Neil Armstrong , Marek Vasut , Maxime Ripard Cc: Seung-Woo Kim , Kyungmin Park , Frieder Schrempf , Tim Harvey , Adam Ford , Matteo Lisi , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH v16 11/16] drm: exynos: dsi: Add host helper for te_irq_handler Date: Wed, 8 Mar 2023 22:09:48 +0530 Message-Id: <20230308163953.28506-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230308163953.28506-1-jagan@amarulasolutions.com> References: <20230308163953.28506-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=o3ke2KJZ; 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. Tested-by: Marek Szyprowski Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v16: - collect TB from Marek S Changes for v15: - remove leading underscores in function names - collect RB from Marek 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 01ed1677a4fd..b75b5cc88bc8 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); void (*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; } @@ -1771,6 +1771,17 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) return 0; } +static irqreturn_t exynos_dsim_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_dsim_host_attach(struct exynos_dsi *dsim, struct mipi_dsi_device *device) { @@ -2068,6 +2079,7 @@ static const struct exynos_dsim_host_ops exynos_dsi_host_ops = { .unregister_host = exynos_dsi_unregister_host, .attach = exynos_dsim_host_attach, .detach = exynos_dsim_host_detach, + .te_irq_handler = exynos_dsim_te_irq_handler, }; static const struct exynos_dsi_plat_data exynos3250_dsi_pdata = {