diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-11-17 18:40:26 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2018-04-03 07:21:54 -0400 |
commit | 101e996b8d321514c45136bef4dd0b1d3c577036 (patch) | |
tree | 956a676d8de258c75164d527316be3cc93aed363 | |
parent | 6a765c3fe5497359c11536dfbdcf7526ccb2a33f (diff) |
drm/i2c: tda998x: move CEC device initialisation later
We no longer use the CEC client to access the CEC part itself, so we can
move this later in the initialisation sequence.
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 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 2a99930f1bda..7f2762fab5c9 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c | |||
@@ -1489,9 +1489,6 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv) | |||
1489 | priv->cec_addr = 0x34 + (client->addr & 0x03); | 1489 | priv->cec_addr = 0x34 + (client->addr & 0x03); |
1490 | priv->current_page = 0xff; | 1490 | priv->current_page = 0xff; |
1491 | priv->hdmi = client; | 1491 | priv->hdmi = client; |
1492 | priv->cec = i2c_new_dummy(client->adapter, priv->cec_addr); | ||
1493 | if (!priv->cec) | ||
1494 | return -ENODEV; | ||
1495 | 1492 | ||
1496 | /* wake up the device: */ | 1493 | /* wake up the device: */ |
1497 | cec_write(priv, REG_CEC_ENAMODS, | 1494 | cec_write(priv, REG_CEC_ENAMODS, |
@@ -1578,6 +1575,12 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv) | |||
1578 | cec_write(priv, REG_CEC_RXSHPDINTENA, CEC_RXSHPDLEV_HPD); | 1575 | cec_write(priv, REG_CEC_RXSHPDINTENA, CEC_RXSHPDLEV_HPD); |
1579 | } | 1576 | } |
1580 | 1577 | ||
1578 | priv->cec = i2c_new_dummy(client->adapter, priv->cec_addr); | ||
1579 | if (!priv->cec) { | ||
1580 | ret = -ENODEV; | ||
1581 | goto fail; | ||
1582 | } | ||
1583 | |||
1581 | /* enable EDID read irq: */ | 1584 | /* enable EDID read irq: */ |
1582 | reg_set(priv, REG_INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD); | 1585 | reg_set(priv, REG_INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD); |
1583 | 1586 | ||
@@ -1594,14 +1597,14 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv) | |||
1594 | 1597 | ||
1595 | ret = tda998x_get_audio_ports(priv, np); | 1598 | ret = tda998x_get_audio_ports(priv, np); |
1596 | if (ret) | 1599 | if (ret) |
1597 | goto err_audio; | 1600 | goto fail; |
1598 | 1601 | ||
1599 | if (priv->audio_port[0].format != AFMT_UNUSED) | 1602 | if (priv->audio_port[0].format != AFMT_UNUSED) |
1600 | tda998x_audio_codec_init(priv, &client->dev); | 1603 | tda998x_audio_codec_init(priv, &client->dev); |
1601 | 1604 | ||
1602 | return 0; | 1605 | return 0; |
1603 | 1606 | ||
1604 | err_audio: | 1607 | fail: |
1605 | if (client->irq) | 1608 | if (client->irq) |
1606 | free_irq(client->irq, priv); | 1609 | free_irq(client->irq, priv); |
1607 | err_irq: | 1610 | err_irq: |