Commit ae81553c authored by Russell King's avatar Russell King

drm/i2c: tda998x: allow interrupt to be shared

Some TDA998x contain several different I2C devices - there is the HDMI
encoder, and there is a TDA9950 CEC engine.  These two share the same
interrupt signal.

In order to allow a driver for the CEC engine to work, we need to be
able to share the interrupt with the CEC driver, so convert the handler
and registration to allow this to happen.
Tested-by: default avatarBrian Starkey <brian.starkey@arm.com>
Reviewed-by: default avatarBrian Starkey <brian.starkey@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 9476ed2e
...@@ -634,6 +634,7 @@ static irqreturn_t tda998x_irq_thread(int irq, void *data) ...@@ -634,6 +634,7 @@ static irqreturn_t tda998x_irq_thread(int irq, void *data)
bool handled = false; bool handled = false;
sta = cec_read(priv, REG_CEC_INTSTATUS); sta = cec_read(priv, REG_CEC_INTSTATUS);
if (sta & CEC_INTSTATUS_HDMI) {
cec = cec_read(priv, REG_CEC_RXSHPDINT); cec = cec_read(priv, REG_CEC_RXSHPDINT);
lvl = cec_read(priv, REG_CEC_RXSHPDLEV); lvl = cec_read(priv, REG_CEC_RXSHPDLEV);
flag0 = reg_read(priv, REG_INT_FLAGS_0); flag0 = reg_read(priv, REG_INT_FLAGS_0);
...@@ -657,6 +658,7 @@ static irqreturn_t tda998x_irq_thread(int irq, void *data) ...@@ -657,6 +658,7 @@ static irqreturn_t tda998x_irq_thread(int irq, void *data)
wake_up(&priv->wq_edid); wake_up(&priv->wq_edid);
handled = true; handled = true;
} }
}
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
...@@ -1544,7 +1546,7 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv) ...@@ -1544,7 +1546,7 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
/* initialize the optional IRQ */ /* initialize the optional IRQ */
if (client->irq) { if (client->irq) {
int irqf_trigger; unsigned long irq_flags;
/* init read EDID waitqueue and HDP work */ /* init read EDID waitqueue and HDP work */
init_waitqueue_head(&priv->wq_edid); init_waitqueue_head(&priv->wq_edid);
...@@ -1554,11 +1556,11 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv) ...@@ -1554,11 +1556,11 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
reg_read(priv, REG_INT_FLAGS_1); reg_read(priv, REG_INT_FLAGS_1);
reg_read(priv, REG_INT_FLAGS_2); reg_read(priv, REG_INT_FLAGS_2);
irqf_trigger = irq_flags =
irqd_get_trigger_type(irq_get_irq_data(client->irq)); irqd_get_trigger_type(irq_get_irq_data(client->irq));
irq_flags |= IRQF_SHARED | IRQF_ONESHOT;
ret = request_threaded_irq(client->irq, NULL, ret = request_threaded_irq(client->irq, NULL,
tda998x_irq_thread, tda998x_irq_thread, irq_flags,
irqf_trigger | IRQF_ONESHOT,
"tda998x", priv); "tda998x", priv);
if (ret) { if (ret) {
dev_err(&client->dev, dev_err(&client->dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment