Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
	Inki Dae <inki.dae@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Marek Vasut <marex@denx.de>, Maxime Ripard <mripard@kernel.org>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Frieder Schrempf <frieder.schrempf@kontron.de>,
	Tim Harvey <tharvey@gateworks.com>,
	Adam Ford <aford173@gmail.com>,
	Matteo Lisi <matteo.lisi@engicam.com>,
	dri-devel@lists.freedesktop.org,
	linux-samsung-soc@vger.kernel.org,
	linux-amarula <linux-amarula@amarulasolutions.com>,
	Jagan Teki <jagan@amarulasolutions.com>
Subject: [PATCH v15 11/16] drm: exynos: dsi: Add host helper for te_irq_handler
Date: Fri,  3 Mar 2023 20:21:33 +0530	[thread overview]
Message-ID: <20230303145138.29233-12-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com>

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.

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
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 afe2d293c785..2fc166ebe3c7 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;
 }
@@ -1761,6 +1761,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)
 {
@@ -2075,6 +2086,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 = {
-- 
2.25.1


  parent reply	other threads:[~2023-03-03 14:53 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230303145219eucas1p218c2e302e41464432627c8ac074302f8@eucas1p2.samsung.com>
2023-03-03 14:51 ` [PATCH v15 00/16] drm: Add Samsung MIPI DSIM bridge Jagan Teki
2023-03-03 14:51   ` [PATCH v15 01/16] drm: exynos: dsi: Drop explicit call to bridge detach Jagan Teki
2023-03-03 16:39     ` Marek Vasut
2023-03-03 14:51   ` [PATCH v15 02/16] drm: exynos: dsi: Lookup OF-graph or Child node devices Jagan Teki
2023-03-03 16:41     ` Marek Vasut
2023-03-03 14:51   ` [PATCH v15 03/16] drm: exynos: dsi: Mark PHY as optional Jagan Teki
2023-03-03 14:51   ` [PATCH v15 04/16] drm: exynos: dsi: Add platform PLL_P (PMS_P) offset Jagan Teki
2023-03-03 14:51   ` [PATCH v15 05/16] drm: exynos: dsi: Introduce hw_type platform data Jagan Teki
2023-03-03 14:51   ` [PATCH v15 06/16] drm: exynos: dsi: Handle proper host initialization Jagan Teki
2023-03-03 14:51   ` [PATCH v15 07/16] drm: exynos: dsi: Add atomic check Jagan Teki
2023-03-03 14:51   ` [PATCH v15 08/16] drm: exynos: dsi: Add input_bus_flags Jagan Teki
2023-03-03 15:00     ` Maxime Ripard
2023-03-03 15:02       ` Maxime Ripard
2023-03-03 14:51   ` [PATCH v15 09/16] drm: exynos: dsi: Add atomic_get_input_bus_fmts Jagan Teki
2023-03-03 14:51   ` [PATCH v15 10/16] drm: exynos: dsi: Consolidate component and bridge Jagan Teki
2023-03-03 14:51   ` Jagan Teki [this message]
2023-03-03 14:51   ` [PATCH v15 13/16] dt-bindings: display: exynos: dsim: Add NXP i.MX8M Mini/Nano support Jagan Teki
2023-03-03 14:51   ` [PATCH v15 14/16] drm: bridge: samsung-dsim: Add " Jagan Teki
2023-03-03 14:51   ` [PATCH v15 15/16] dt-bindings: display: exynos: dsim: Add NXP i.MX8M Plus support Jagan Teki
2023-03-03 14:51   ` [PATCH v15 16/16] drm: bridge: samsung-dsim: Add " Jagan Teki
     [not found]   ` <20230303145138.29233-13-jagan@amarulasolutions.com>
2023-03-03 15:08     ` [PATCH v15 12/16] drm: bridge: Generalize Exynos-DSI driver into a Samsung DSIM bridge Maxime Ripard
2023-03-03 15:11       ` Jagan Teki
2023-03-03 22:26   ` [PATCH v15 00/16] drm: Add Samsung MIPI " Marek Szyprowski
2023-03-04 18:59     ` Jagan Teki
2023-03-06 11:02       ` Marek Szyprowski
2023-03-06 17:24         ` Jagan Teki
2023-03-06 22:41           ` Marek Szyprowski
2023-03-07  7:55             ` Jagan Teki
2023-03-07  9:22               ` Jagan Teki
2023-03-07 10:44                 ` Marek Szyprowski
2023-03-06  5:24   ` 대인기/Tizen Platform Lab(SR)/삼성전자
2023-03-06  8:48     ` Jagan Teki
2023-03-14  0:31     ` Fabio Estevam
     [not found]       ` <CAAQKjZM66M6wgtoBmAcQifq8LgBUos0bZfbTkRBqnOb7E-05tQ@mail.gmail.com>
2023-03-23 15:34         ` Fabio Estevam
2023-03-27 14:08           ` Neil Armstrong
     [not found]             ` <CAAQKjZPmYcdUphP9w7i_O65rhXwsw2rCxAnDJ1JG73-RuLP4UQ@mail.gmail.com>
2023-03-28  7:53               ` Neil Armstrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230303145138.29233-12-jagan@amarulasolutions.com \
    --to=jagan@amarulasolutions.com \
    --cc=aford173@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frieder.schrempf@kontron.de \
    --cc=inki.dae@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=marex@denx.de \
    --cc=matteo.lisi@engicam.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sw0312.kim@samsung.com \
    --cc=tharvey@gateworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox