aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2009-12-11 09:34:50 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-16 06:27:21 -0500
commit6d74e5f361bdacfdcfe14220868d562368aaadc2 (patch)
tree0a55c5587b29aaf0c8aa7853f8982153d5b7ab93
parent35b23b522696118b5ec5b84ba6846ee96aa2743e (diff)
V4L/DVB (13652): tw9910: Add revision control
Also fix a badly chosen macro name. Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/tw9910.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c
index 35373d8bf6a0..e3a4942e0f37 100644
--- a/drivers/media/video/tw9910.c
+++ b/drivers/media/video/tw9910.c
@@ -29,7 +29,7 @@
29#include <media/tw9910.h> 29#include <media/tw9910.h>
30 30
31#define GET_ID(val) ((val & 0xF8) >> 3) 31#define GET_ID(val) ((val & 0xF8) >> 3)
32#define GET_ReV(val) (val & 0x07) 32#define GET_REV(val) (val & 0x07)
33 33
34/* 34/*
35 * register offset 35 * register offset
@@ -225,6 +225,7 @@ struct tw9910_priv {
225 struct v4l2_subdev subdev; 225 struct v4l2_subdev subdev;
226 struct tw9910_video_info *info; 226 struct tw9910_video_info *info;
227 const struct tw9910_scale_ctrl *scale; 227 const struct tw9910_scale_ctrl *scale;
228 u32 revision;
228}; 229};
229 230
230/* 231/*
@@ -575,8 +576,11 @@ static int tw9910_enum_input(struct soc_camera_device *icd,
575static int tw9910_g_chip_ident(struct v4l2_subdev *sd, 576static int tw9910_g_chip_ident(struct v4l2_subdev *sd,
576 struct v4l2_dbg_chip_ident *id) 577 struct v4l2_dbg_chip_ident *id)
577{ 578{
579 struct i2c_client *client = sd->priv;
580 struct tw9910_priv *priv = to_tw9910(client);
581
578 id->ident = V4L2_IDENT_TW9910; 582 id->ident = V4L2_IDENT_TW9910;
579 id->revision = 0; 583 id->revision = priv->revision;
580 584
581 return 0; 585 return 0;
582} 586}
@@ -886,16 +890,18 @@ static int tw9910_video_probe(struct soc_camera_device *icd,
886 * So far only revisions 0 and 1 have been seen 890 * So far only revisions 0 and 1 have been seen
887 */ 891 */
888 val = i2c_smbus_read_byte_data(client, ID); 892 val = i2c_smbus_read_byte_data(client, ID);
893 priv->revision = GET_REV(val);
889 894
890 if (0x0B != GET_ID(val) || 895 if (0x0B != GET_ID(val) ||
891 0x01 < GET_ReV(val)) { 896 0x01 < priv->revision) {
892 dev_err(&client->dev, 897 dev_err(&client->dev,
893 "Product ID error %x:%x\n", GET_ID(val), GET_ReV(val)); 898 "Product ID error %x:%x\n",
899 GET_ID(val), priv->revision);
894 return -ENODEV; 900 return -ENODEV;
895 } 901 }
896 902
897 dev_info(&client->dev, 903 dev_info(&client->dev,
898 "tw9910 Product ID %0x:%0x\n", GET_ID(val), GET_ReV(val)); 904 "tw9910 Product ID %0x:%0x\n", GET_ID(val), priv->revision);
899 905
900 icd->vdev->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL; 906 icd->vdev->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL;
901 icd->vdev->current_norm = V4L2_STD_NTSC; 907 icd->vdev->current_norm = V4L2_STD_NTSC;