diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-03-11 06:12:22 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-04-03 07:21:54 -0400 |
commit | ba8975f15bb93d7f3ebd995a41c2e4b6945bad78 (patch) | |
tree | b99823bf145cb337056da81745e83369499e687b | |
parent | 101e996b8d321514c45136bef4dd0b1d3c577036 (diff) |
drm/i2c: tda998x: always disable and clear interrupts at probe
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>
-rw-r--r-- | drivers/gpu/drm/i2c/tda998x_drv.c | 14 |
1 files 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) | |||
1546 | cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL, | 1546 | cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL, |
1547 | CEC_FRO_IM_CLK_CTRL_GHOST_DIS | CEC_FRO_IM_CLK_CTRL_IMCLK_SEL); | 1547 | CEC_FRO_IM_CLK_CTRL_GHOST_DIS | CEC_FRO_IM_CLK_CTRL_IMCLK_SEL); |
1548 | 1548 | ||
1549 | /* ensure interrupts are disabled */ | ||
1550 | cec_write(priv, REG_CEC_RXSHPDINTENA, 0); | ||
1551 | |||
1552 | /* clear pending interrupts */ | ||
1553 | cec_read(priv, REG_CEC_RXSHPDINT); | ||
1554 | reg_read(priv, REG_INT_FLAGS_0); | ||
1555 | reg_read(priv, REG_INT_FLAGS_1); | ||
1556 | reg_read(priv, REG_INT_FLAGS_2); | ||
1557 | |||
1549 | /* initialize the optional IRQ */ | 1558 | /* initialize the optional IRQ */ |
1550 | if (client->irq) { | 1559 | if (client->irq) { |
1551 | unsigned long irq_flags; | 1560 | unsigned long irq_flags; |
@@ -1553,11 +1562,6 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv) | |||
1553 | /* init read EDID waitqueue and HDP work */ | 1562 | /* init read EDID waitqueue and HDP work */ |
1554 | init_waitqueue_head(&priv->wq_edid); | 1563 | init_waitqueue_head(&priv->wq_edid); |
1555 | 1564 | ||
1556 | /* clear pending interrupts */ | ||
1557 | reg_read(priv, REG_INT_FLAGS_0); | ||
1558 | reg_read(priv, REG_INT_FLAGS_1); | ||
1559 | reg_read(priv, REG_INT_FLAGS_2); | ||
1560 | |||
1561 | irq_flags = | 1565 | irq_flags = |
1562 | irqd_get_trigger_type(irq_get_irq_data(client->irq)); | 1566 | irqd_get_trigger_type(irq_get_irq_data(client->irq)); |
1563 | irq_flags |= IRQF_SHARED | IRQF_ONESHOT; | 1567 | irq_flags |= IRQF_SHARED | IRQF_ONESHOT; |