From patchwork Fri Mar 3 14:51:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 2774 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 3495B44AA6 for ; Fri, 3 Mar 2023 15:53:15 +0100 (CET) Received: by mail-pj1-f71.google.com with SMTP id m18-20020a17090a7f9200b002375a3cbc9bsf1299239pjl.9 for ; Fri, 03 Mar 2023 06:53:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677855194; cv=pass; d=google.com; s=arc-20160816; b=WRaHxW6g5UPXGcHJN8lZJTJWdgsOZfuIW92AstNKFyL/wnyC1wkUkCv9emlHJEzUyr 5qG3Yu3XHztOTcvMmXuGGVb5wP3DDq4kdyhkRfeGZoCryOSbc+mYd/KNSN/6bhpbggvA qNW+TgH/ZWJe0ONFDeT4hnMJmGy2OIJsKd0+kHT83uUCEYyo2sMXOmYTB6HAl3PlLPcP RZqptKP6sCYiW9W5tCsxQF9Y7zQANDXrLKEjnDa+0kMPMSnLTmpxkUkBvw3iInQHkrwJ 5ZjfEUkCcuoniEuIRwklvW4LtroktfIOlZfp6zi8G9IBF4txOv9nSe07X3KDYu74HUAV ylZw== 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=04dYGxSKIKNWdyEzietfYpJQpfbzh8aGP2Kw5A4LN1Q=; b=g3JUZoD1QckZIyYnyf4ruY2v1+Wi5tHgigRFFM3Hg0cjSKba/gF8bD+IS3xqUKALt+ CMYq4YJKgsEFhGe1VhTLbYZFPOdA2K1/Fe9cyaad5oslqZIqxudQp15pQ3jVMokCF8jj yPZIkZ8VCl21jcoqrVkz1jAcl6JrQXGLm3uvfvZsF+sPPXoMVSJ1N7KAvBnKDTmQQgD+ yKkJyiHj7hKpbTY2aHaHgG/tw3O/6OtfKy7moGq65Su/qmfe9T/V279FJC3uh2guM0XL cUKSOz0KbXEl6EA+WhJWIbnKjDUp3c8/HzmgwXNMnu48bm+iWJ1I+DEvSEKLcyzVjKnv vpsw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MECwk9Yw; 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=1677855194; 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=04dYGxSKIKNWdyEzietfYpJQpfbzh8aGP2Kw5A4LN1Q=; b=mfsnxkzdb3AVWgTB5SPHEYg8ZMauhJy7g9i/fSib0XFtetprcJCIyoTS2Ax3B8XG5z bwwA+HUtb0oWcMm2oBgpwMCvC9cjywg+7wgjcJAOapR25I2cehZfWa6tizqxxgBU/8Vs u0EsZIK/lflv22QetINbfHin3aUiXdcZ/FEYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677855194; 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=04dYGxSKIKNWdyEzietfYpJQpfbzh8aGP2Kw5A4LN1Q=; b=Z/b+0e9aRaJr4wCW+ck6gOosDz1DrkuJj1zR6GkWJSkqGRoYkQqo+8bqoihzbqKMbI 4130IudekJK6fV/vzfnanjVlfTHEGUiugdY3kSe38KucNpIP+aJ4NcCIy6/79Yv8rD8o EFU9HzgmN/WZ+swSbfF1Qpe6Tbw2XOTZw2RDNPuWVpLbqZGk8ywZwld3YZ/VYYdFPiwg 1h1bZgPZazPFLBDjWmGlsY2op6pRmItU+lhme58R7esUdJbTJybis99ISqcJAS+zm/7J RcFO1RxFI8UE09mNqDwUMph4+8Hh8oWjhDahI2jr5pjZoYISuMUamqktjqYstqWAc44f XEug== X-Gm-Message-State: AO0yUKW2rDNNLdR+/79NzP3AFF/8tJiP86Qxewmxava6S4tk16YJ3AzK 9e1s2nTSJsc0gXmsMfjdw19VCDcO X-Google-Smtp-Source: AK7set8lKk9mtPrTPkXdNE+4Xs/F0sUnE0Dsxybm6pt1ik2qowrwNpz6ycAbgNDk33JBVkhIsJfQPA== X-Received: by 2002:a17:903:281:b0:19a:fdca:e3f1 with SMTP id j1-20020a170903028100b0019afdcae3f1mr840336plr.3.1677855193957; Fri, 03 Mar 2023 06:53:13 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:7043:b0:199:182b:34bf with SMTP id h3-20020a170902704300b00199182b34bfls3208738plt.3.-pod-prod-gmail; Fri, 03 Mar 2023 06:53:13 -0800 (PST) X-Received: by 2002:a17:90b:4c88:b0:237:7acf:8649 with SMTP id my8-20020a17090b4c8800b002377acf8649mr2058433pjb.13.1677855192925; Fri, 03 Mar 2023 06:53:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677855192; cv=none; d=google.com; s=arc-20160816; b=m8HaymmNsPdXW9icm3CwHiVsYttWV3etSO0/TnNEZ04eKk16S/BxEPYC4rWW6ffcLw e2BYcaarr6Iy2QLYX92qE7IOV8FN0syjHlXABLpOZGpZc4gL+ZKDSIGHjL4cTeTdbPr0 FzXP/iTyogRKOotbxQJu5BsbCu03OXyrfRR9+pxpWOytZ+V+oTMmslsRbZHqjWC1Rjzx xQmhg4jlIzy5vJhzuoz06DhsreqJKAczumKBhdQt7uJq8sRG59F5V8q+pNnBukDv9YNi 2CaGdtmZEeahnVFqsdcE8oywRjE2vKzEcHt0vSYrv9BTk/NY+zHbEQTNGpplOT+otmvi XkLg== 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=jZ7rcemt848q2zQcT+lSKMTmWxXIUz+vskppcEdmPWE=; b=BZIzmkQ6xKY9ehlmgLpFGZKudIQGt8Dsv6ZT2EXQynfN3T4bsWqGSZWhsv1uYWp+6X /LgiQtUK6SExoYlFqGh9+V5o4SxMMX4107w2ke1/nccHdbnlrcozUa8LIXyZ1iLSImKA xub1WqgMpHhdP5YbHJkq7L3GsFpK9yD7uU9d+Yi4dGqe2vnlrgZBdK/Y2m86zH4s4gjK 0ObrPGkumCeijRxb9WZp8P1uCd8hHj+AE76S7j26hwuU4tE6v7XCA2bHpAL0tLZcWLE1 unEQAqiQ+HhUM9d9GKhTeVshHHEZJXiCtpqdhfD5LPNoq2ZnXPn2LH3RAN17kb9VyCOb 6Blw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=MECwk9Yw; 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 j1-20020a170903024100b001947221dc94sor1033554plh.153.2023.03.03.06.53.12 for (Google Transport Security); Fri, 03 Mar 2023 06:53:12 -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:6a20:9386:b0:cc:d762:64a with SMTP id x6-20020a056a20938600b000ccd762064amr3085837pzh.8.1677855192602; Fri, 03 Mar 2023 06:53:12 -0800 (PST) Received: from localhost.localdomain ([183.83.137.89]) by smtp.gmail.com with ESMTPSA id z4-20020a63e544000000b00502fd70b0bdsm1660856pgj.52.2023.03.03.06.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 06:53:12 -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 v15 11/16] drm: exynos: dsi: Add host helper for te_irq_handler Date: Fri, 3 Mar 2023 20:21:33 +0530 Message-Id: <20230303145138.29233-12-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230303145138.29233-1-jagan@amarulasolutions.com> References: <20230303145138.29233-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=MECwk9Yw; 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. Reviewed-by: Marek Vasut Signed-off-by: Jagan Teki --- 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 = {