From: Russell King <rmk+kernel@armlinux.org.uk>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-media@vger.kernel.org
Subject: [PATCH v3 4/7] drm/i2c: tda998x: always disable and clear interrupts at probe
Date: Mon, 09 Apr 2018 13:16:27 +0100 [thread overview]
Message-ID: <E1f5Vil-0002Lc-OH@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <20180409121529.GA31403@n2100.armlinux.org.uk>
Always disable and clear interrupts at probe time to ensure that the
TDA998x is in a sane state. This ensures that the interrupt line,
which is also the CEC clock calibration signal, is always deasserted.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/gpu/drm/i2c/tda998x_drv.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index 7f2762fab5c9..16e0439cad44 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -1546,6 +1546,15 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL,
CEC_FRO_IM_CLK_CTRL_GHOST_DIS | CEC_FRO_IM_CLK_CTRL_IMCLK_SEL);
+ /* ensure interrupts are disabled */
+ cec_write(priv, REG_CEC_RXSHPDINTENA, 0);
+
+ /* clear pending interrupts */
+ cec_read(priv, REG_CEC_RXSHPDINT);
+ reg_read(priv, REG_INT_FLAGS_0);
+ reg_read(priv, REG_INT_FLAGS_1);
+ reg_read(priv, REG_INT_FLAGS_2);
+
/* initialize the optional IRQ */
if (client->irq) {
unsigned long irq_flags;
@@ -1553,11 +1562,6 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
/* init read EDID waitqueue and HDP work */
init_waitqueue_head(&priv->wq_edid);
- /* clear pending interrupts */
- reg_read(priv, REG_INT_FLAGS_0);
- reg_read(priv, REG_INT_FLAGS_1);
- reg_read(priv, REG_INT_FLAGS_2);
-
irq_flags =
irqd_get_trigger_type(irq_get_irq_data(client->irq));
irq_flags |= IRQF_SHARED | IRQF_ONESHOT;
--
2.7.4
next prev parent reply other threads:[~2018-04-09 12:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 12:15 [PATCH v3 0/7] TDA998x CEC support Russell King - ARM Linux
2018-04-09 12:16 ` [PATCH v3 1/7] drm/i2c: tda998x: move mutex/waitqueue/timer/work init early Russell King
2018-04-09 12:16 ` [PATCH v3 2/7] drm/i2c: tda998x: fix error cleanup paths Russell King
2018-04-09 12:16 ` [PATCH v3 3/7] drm/i2c: tda998x: move CEC device initialisation later Russell King
2018-04-09 12:16 ` Russell King [this message]
2018-04-09 12:16 ` [PATCH v3 5/7] drm/i2c: tda9950: add CEC driver Russell King
2018-04-20 15:31 ` Russell King - ARM Linux
2018-04-20 15:48 ` Hans Verkuil
2018-04-20 16:07 ` Russell King - ARM Linux
2018-04-24 9:27 ` Hans Verkuil
2018-04-09 12:16 ` [PATCH v3 6/7] drm/i2c: tda998x: add CEC support Russell King
2018-04-24 9:27 ` Hans Verkuil
2018-04-09 12:16 ` [PATCH v3 7/7] dt-bindings: tda998x: add the calibration gpio Russell King
2018-04-24 9:27 ` Hans Verkuil
2018-04-24 9:29 ` [PATCH v3 0/7] TDA998x CEC support Hans Verkuil
2018-04-24 9:42 ` Russell King - ARM Linux
2018-04-24 9:57 ` 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=E1f5Vil-0002Lc-OH@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=airlied@linux.ie \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/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