aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-02-21 22:10:22 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 19:32:04 -0400
commit0e09a3c92bfd54a6ac03f8225c4fd10f50111beb (patch)
treea053d9d5bb646bfe2a2826b4ff22c0a4078025ca /drivers/media
parent437f5fa34225db0d981536692678afc590e5c87f (diff)
[media] tvp5150: device detection should be done only once
Having the device detection happening at reset is bad, as every time, it will produce a message like: tvp5150 2-005c: tvp5150am1 detected. This only polutes the log and for an accidental kernel hacker, it looks like a real problem. So, move those printk's to happen during device probe. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/tvp5150.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index 959d690363bb..e927d25e0d35 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -737,27 +737,6 @@ static int tvp5150_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
737static int tvp5150_reset(struct v4l2_subdev *sd, u32 val) 737static int tvp5150_reset(struct v4l2_subdev *sd, u32 val)
738{ 738{
739 struct tvp5150 *decoder = to_tvp5150(sd); 739 struct tvp5150 *decoder = to_tvp5150(sd);
740 u8 msb_id, lsb_id, msb_rom, lsb_rom;
741
742 msb_id = tvp5150_read(sd, TVP5150_MSB_DEV_ID);
743 lsb_id = tvp5150_read(sd, TVP5150_LSB_DEV_ID);
744 msb_rom = tvp5150_read(sd, TVP5150_ROM_MAJOR_VER);
745 lsb_rom = tvp5150_read(sd, TVP5150_ROM_MINOR_VER);
746
747 if (msb_rom == 4 && lsb_rom == 0) { /* Is TVP5150AM1 */
748 v4l2_info(sd, "tvp%02x%02xam1 detected.\n", msb_id, lsb_id);
749
750 /* ITU-T BT.656.4 timing */
751 tvp5150_write(sd, TVP5150_REV_SELECT, 0);
752 } else {
753 if (msb_rom == 3 || lsb_rom == 0x21) { /* Is TVP5150A */
754 v4l2_info(sd, "tvp%02x%02xa detected.\n", msb_id, lsb_id);
755 } else {
756 v4l2_info(sd, "*** unknown tvp%02x%02x chip detected.\n",
757 msb_id, lsb_id);
758 v4l2_info(sd, "*** Rom ver is %d.%d\n", msb_rom, lsb_rom);
759 }
760 }
761 740
762 /* Initializes TVP5150 to its default values */ 741 /* Initializes TVP5150 to its default values */
763 tvp5150_write_inittab(sd, tvp5150_init_default); 742 tvp5150_write_inittab(sd, tvp5150_init_default);
@@ -977,6 +956,7 @@ static int tvp5150_probe(struct i2c_client *c,
977{ 956{
978 struct tvp5150 *core; 957 struct tvp5150 *core;
979 struct v4l2_subdev *sd; 958 struct v4l2_subdev *sd;
959 u8 msb_id, lsb_id, msb_rom, lsb_rom;
980 960
981 /* Check if the adapter supports the needed features */ 961 /* Check if the adapter supports the needed features */
982 if (!i2c_check_functionality(c->adapter, 962 if (!i2c_check_functionality(c->adapter,
@@ -992,6 +972,26 @@ static int tvp5150_probe(struct i2c_client *c,
992 v4l_info(c, "chip found @ 0x%02x (%s)\n", 972 v4l_info(c, "chip found @ 0x%02x (%s)\n",
993 c->addr << 1, c->adapter->name); 973 c->addr << 1, c->adapter->name);
994 974
975 msb_id = tvp5150_read(sd, TVP5150_MSB_DEV_ID);
976 lsb_id = tvp5150_read(sd, TVP5150_LSB_DEV_ID);
977 msb_rom = tvp5150_read(sd, TVP5150_ROM_MAJOR_VER);
978 lsb_rom = tvp5150_read(sd, TVP5150_ROM_MINOR_VER);
979
980 if (msb_rom == 4 && lsb_rom == 0) { /* Is TVP5150AM1 */
981 v4l2_info(sd, "tvp%02x%02xam1 detected.\n", msb_id, lsb_id);
982
983 /* ITU-T BT.656.4 timing */
984 tvp5150_write(sd, TVP5150_REV_SELECT, 0);
985 } else {
986 if (msb_rom == 3 || lsb_rom == 0x21) { /* Is TVP5150A */
987 v4l2_info(sd, "tvp%02x%02xa detected.\n", msb_id, lsb_id);
988 } else {
989 v4l2_info(sd, "*** unknown tvp%02x%02x chip detected.\n",
990 msb_id, lsb_id);
991 v4l2_info(sd, "*** Rom ver is %d.%d\n", msb_rom, lsb_rom);
992 }
993 }
994
995 core->norm = V4L2_STD_ALL; /* Default is autodetect */ 995 core->norm = V4L2_STD_ALL; /* Default is autodetect */
996 core->input = TVP5150_COMPOSITE1; 996 core->input = TVP5150_COMPOSITE1;
997 core->enable = 1; 997 core->enable = 1;