All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Maling list - DRI developers <dri-devel@lists.freedesktop.org>
Subject: omap4: how to get the HDMI core IRQ?
Date: Thu, 24 Mar 2016 22:20:48 +0100	[thread overview]
Message-ID: <56F45A30.4070701@xs4all.nl> (raw)

Hi Tomi,

I hope you (or someone else on this list) can help me find the problem in this code.

I am working on a kernel framework for HDMI CEC (see https://lwn.net/Articles/680942/).
In order to get as much experience with different devices as possible I am trying to
implement it on my omap4430 Pandaboard. The big problem I am facing is that the CEC
interrupts come in through the HDMI_IRQ_CORE interrupt, and that just refuses to
trigger.

The code below adds support for this core interrupt and it is supposed to trigger it
using the Software Induced interrupt to keep the code as simple as possible.

On boot I get this debug line from the pr_info in my code:

irqstat 02000000 wp_irq 06000001 raw 20010000 intr_state 00000001 intr1 00000080 unmask1 00000080 intr_ctrl 0000000a

As far as I can see everything looks perfectly fine, except for the fact that bit 0
of the irqstat is stubbornly 0.

This is using kernel 4.5 with only this patch applied.

What am I missing?

The reward for the right answer will be HDMI CEC support for omap4 (and any other TI device
with the same CEC IP).

Regards,

	Hans

diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 7103c65..999b5ec 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -75,6 +75,14 @@ static irqreturn_t hdmi_irq_handler(int irq, void *data)
 	irqstatus = hdmi_wp_get_irqstatus(wp);
 	hdmi_wp_set_irqstatus(wp, irqstatus);

+	pr_info("irqstat %08x wp_irq %08x raw %08x intr_state %08x intr1 %08x unmask1 %08x intr_ctrl %08x\n",
+		irqstatus,
+		hdmi_read_reg(hdmi.wp.base, HDMI_WP_IRQENABLE_SET),
+		hdmi_read_reg(hdmi.wp.base, HDMI_WP_IRQSTATUS_RAW),
+		hdmi_read_reg(hdmi.core.base, HDMI_CORE_SYS_INTR_STATE),
+		hdmi_read_reg(hdmi.core.base, HDMI_CORE_SYS_INTR1),
+		hdmi_read_reg(hdmi.core.base, HDMI_CORE_SYS_INTR_UNMASK1),
+		hdmi_read_reg(hdmi.core.base, HDMI_CORE_SYS_INTR_CTRL));
 	if ((irqstatus & HDMI_IRQ_LINK_CONNECT) &&
 			irqstatus & HDMI_IRQ_LINK_DISCONNECT) {
 		/*
@@ -94,6 +102,13 @@ static irqreturn_t hdmi_irq_handler(int irq, void *data)
 	} else if (irqstatus & HDMI_IRQ_LINK_DISCONNECT) {
 		hdmi_wp_set_phy_pwr(wp, HDMI_PHYPWRCMD_LDOON);
 	}
+	if (irqstatus & HDMI_IRQ_CORE) {
+		u32 intr1 = hdmi_read_reg(hdmi.core.base, HDMI_CORE_SYS_INTR1);
+
+		hdmi_write_reg(hdmi.core.base, HDMI_CORE_SYS_INTR_CTRL, 2);
+		pr_info("clear sw irq\n");
+		hdmi_write_reg(hdmi.core.base, HDMI_CORE_SYS_INTR1, intr1);
+	}

 	return IRQ_HANDLED;
 }
@@ -222,9 +237,12 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
 	if (r)
 		goto err_mgr_enable;

+	hdmi_write_reg(hdmi.core.base, HDMI_CORE_SYS_INTR_UNMASK1, 0x80);
 	hdmi_wp_set_irqenable(wp,
-		HDMI_IRQ_LINK_CONNECT | HDMI_IRQ_LINK_DISCONNECT);
+		HDMI_IRQ_LINK_CONNECT | HDMI_IRQ_LINK_DISCONNECT | HDMI_IRQ_CORE);

+	pr_info("set sw irq\n");
+	hdmi_write_reg(hdmi.core.base, HDMI_CORE_SYS_INTR_CTRL, 0xa);
 	return 0;

 err_mgr_enable:
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2016-03-24 21:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 21:20 Hans Verkuil [this message]
2016-03-30 10:37 ` omap4: how to get the HDMI core IRQ? Tomi Valkeinen
2016-04-01  0:46   ` Hans Verkuil
2016-04-01  7:03     ` Tomi Valkeinen
2016-04-01  7:35       ` Tomi Valkeinen
2016-04-01 16:56         ` Hans Verkuil
2016-04-01 16:59           ` Tomi Valkeinen
2016-04-10 12:02         ` Hans Verkuil
2016-04-01 16:51       ` Hans Verkuil

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=56F45A30.4070701@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=tomi.valkeinen@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.