drm/i2c: tda998x: add DT support
This patch adds DT support to the tda998x. Tested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
81b53a166f
commit
0d44ea1903
|
@ -1172,6 +1172,8 @@ tda998x_encoder_init(struct i2c_client *client,
|
||||||
struct drm_encoder_slave *encoder_slave)
|
struct drm_encoder_slave *encoder_slave)
|
||||||
{
|
{
|
||||||
struct tda998x_priv *priv;
|
struct tda998x_priv *priv;
|
||||||
|
struct device_node *np = client->dev.of_node;
|
||||||
|
u32 video;
|
||||||
int rev_lo, rev_hi, ret;
|
int rev_lo, rev_hi, ret;
|
||||||
|
|
||||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||||
|
@ -1245,6 +1247,17 @@ tda998x_encoder_init(struct i2c_client *client,
|
||||||
cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL,
|
cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL,
|
||||||
CEC_FRO_IM_CLK_CTRL_GHOST_DIS | CEC_FRO_IM_CLK_CTRL_IMCLK_SEL);
|
CEC_FRO_IM_CLK_CTRL_GHOST_DIS | CEC_FRO_IM_CLK_CTRL_IMCLK_SEL);
|
||||||
|
|
||||||
|
if (!np)
|
||||||
|
return 0; /* non-DT */
|
||||||
|
|
||||||
|
/* get the optional video properties */
|
||||||
|
ret = of_property_read_u32(np, "video-ports", &video);
|
||||||
|
if (ret == 0) {
|
||||||
|
priv->vip_cntrl_0 = video >> 16;
|
||||||
|
priv->vip_cntrl_1 = video >> 8;
|
||||||
|
priv->vip_cntrl_2 = video;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
@ -1259,6 +1272,14 @@ fail:
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_OF
|
||||||
|
static const struct of_device_id tda998x_dt_ids[] = {
|
||||||
|
{ .compatible = "nxp,tda998x", },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, tda998x_dt_ids);
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct i2c_device_id tda998x_ids[] = {
|
static struct i2c_device_id tda998x_ids[] = {
|
||||||
{ "tda998x", 0 },
|
{ "tda998x", 0 },
|
||||||
{ }
|
{ }
|
||||||
|
@ -1271,6 +1292,7 @@ static struct drm_i2c_encoder_driver tda998x_driver = {
|
||||||
.remove = tda998x_remove,
|
.remove = tda998x_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "tda998x",
|
.name = "tda998x",
|
||||||
|
.of_match_table = of_match_ptr(tda998x_dt_ids),
|
||||||
},
|
},
|
||||||
.id_table = tda998x_ids,
|
.id_table = tda998x_ids,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue