diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2014-01-25 12:14:41 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-02-13 14:41:50 -0500 |
commit | 0d44ea190387e21a7e6f6d7c9dd44df2e85d007a (patch) | |
tree | 5e3fb264d71c37539a44261ea3c93414c5571d49 /drivers/gpu/drm/i2c | |
parent | 81b53a166f5cdf4e5bec47fc8884c994de82dc6b (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/i2c')
-rw-r--r-- | drivers/gpu/drm/i2c/tda998x_drv.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index d31e1c170bb6..1ea4d43781f2 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c | |||
@@ -1172,6 +1172,8 @@ tda998x_encoder_init(struct i2c_client *client, | |||
1172 | struct drm_encoder_slave *encoder_slave) | 1172 | struct drm_encoder_slave *encoder_slave) |
1173 | { | 1173 | { |
1174 | struct tda998x_priv *priv; | 1174 | struct tda998x_priv *priv; |
1175 | struct device_node *np = client->dev.of_node; | ||
1176 | u32 video; | ||
1175 | int rev_lo, rev_hi, ret; | 1177 | int rev_lo, rev_hi, ret; |
1176 | 1178 | ||
1177 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 1179 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
@@ -1245,6 +1247,17 @@ tda998x_encoder_init(struct i2c_client *client, | |||
1245 | cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL, | 1247 | cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL, |
1246 | CEC_FRO_IM_CLK_CTRL_GHOST_DIS | CEC_FRO_IM_CLK_CTRL_IMCLK_SEL); | 1248 | CEC_FRO_IM_CLK_CTRL_GHOST_DIS | CEC_FRO_IM_CLK_CTRL_IMCLK_SEL); |
1247 | 1249 | ||
1250 | if (!np) | ||
1251 | return 0; /* non-DT */ | ||
1252 | |||
1253 | /* get the optional video properties */ | ||
1254 | ret = of_property_read_u32(np, "video-ports", &video); | ||
1255 | if (ret == 0) { | ||
1256 | priv->vip_cntrl_0 = video >> 16; | ||
1257 | priv->vip_cntrl_1 = video >> 8; | ||
1258 | priv->vip_cntrl_2 = video; | ||
1259 | } | ||
1260 | |||
1248 | return 0; | 1261 | return 0; |
1249 | 1262 | ||
1250 | fail: | 1263 | fail: |
@@ -1259,6 +1272,14 @@ fail: | |||
1259 | return -ENXIO; | 1272 | return -ENXIO; |
1260 | } | 1273 | } |
1261 | 1274 | ||
1275 | #ifdef CONFIG_OF | ||
1276 | static const struct of_device_id tda998x_dt_ids[] = { | ||
1277 | { .compatible = "nxp,tda998x", }, | ||
1278 | { } | ||
1279 | }; | ||
1280 | MODULE_DEVICE_TABLE(of, tda998x_dt_ids); | ||
1281 | #endif | ||
1282 | |||
1262 | static struct i2c_device_id tda998x_ids[] = { | 1283 | static struct i2c_device_id tda998x_ids[] = { |
1263 | { "tda998x", 0 }, | 1284 | { "tda998x", 0 }, |
1264 | { } | 1285 | { } |
@@ -1271,6 +1292,7 @@ static struct drm_i2c_encoder_driver tda998x_driver = { | |||
1271 | .remove = tda998x_remove, | 1292 | .remove = tda998x_remove, |
1272 | .driver = { | 1293 | .driver = { |
1273 | .name = "tda998x", | 1294 | .name = "tda998x", |
1295 | .of_match_table = of_match_ptr(tda998x_dt_ids), | ||
1274 | }, | 1296 | }, |
1275 | .id_table = tda998x_ids, | 1297 | .id_table = tda998x_ids, |
1276 | }, | 1298 | }, |