diff options
Diffstat (limited to 'drivers/media/video/tvp5150.c')
-rw-r--r-- | drivers/media/video/tvp5150.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index fad9ea0ae4f2..1864423b3046 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c | |||
@@ -746,24 +746,27 @@ static int tvp5150_set_std(struct i2c_client *c, v4l2_std_id std) | |||
746 | 746 | ||
747 | static inline void tvp5150_reset(struct i2c_client *c) | 747 | static inline void tvp5150_reset(struct i2c_client *c) |
748 | { | 748 | { |
749 | u8 type, ver_656, msb_id, lsb_id, msb_rom, lsb_rom; | 749 | u8 msb_id, lsb_id, msb_rom, lsb_rom; |
750 | struct tvp5150 *decoder = i2c_get_clientdata(c); | 750 | struct tvp5150 *decoder = i2c_get_clientdata(c); |
751 | 751 | ||
752 | type=tvp5150_read(c,TVP5150_AUTOSW_MSK); | ||
753 | msb_id=tvp5150_read(c,TVP5150_MSB_DEV_ID); | 752 | msb_id=tvp5150_read(c,TVP5150_MSB_DEV_ID); |
754 | lsb_id=tvp5150_read(c,TVP5150_LSB_DEV_ID); | 753 | lsb_id=tvp5150_read(c,TVP5150_LSB_DEV_ID); |
755 | msb_rom=tvp5150_read(c,TVP5150_ROM_MAJOR_VER); | 754 | msb_rom=tvp5150_read(c,TVP5150_ROM_MAJOR_VER); |
756 | lsb_rom=tvp5150_read(c,TVP5150_ROM_MINOR_VER); | 755 | lsb_rom=tvp5150_read(c,TVP5150_ROM_MINOR_VER); |
757 | 756 | ||
758 | if (type==0xdc) { | 757 | if ((msb_rom==4)&&(lsb_rom==0)) { /* Is TVP5150AM1 */ |
759 | ver_656=tvp5150_read(c,TVP5150_REV_SELECT); | 758 | tvp5150_info("tvp%02x%02xam1 detected.\n",msb_id, lsb_id); |
760 | tvp5150_info("tvp%02x%02xam1 detected 656 version is %d.\n",msb_id, lsb_id,ver_656); | 759 | |
761 | } else if (type==0xfc) { | 760 | /* ITU-T BT.656.4 timing */ |
762 | tvp5150_info("tvp%02x%02xa detected.\n",msb_id, lsb_id); | 761 | tvp5150_write(c,TVP5150_REV_SELECT,0); |
763 | } else { | 762 | } else { |
764 | tvp5150_info("unknown tvp%02x%02x chip detected(%d).\n",msb_id,lsb_id,type); | 763 | if ((msb_rom==3)||(lsb_rom==0x21)) { /* Is TVP5150A */ |
764 | tvp5150_info("tvp%02x%02xa detected.\n",msb_id, lsb_id); | ||
765 | } else { | ||
766 | tvp5150_info("*** unknown tvp%02x%02x chip detected.\n",msb_id,lsb_id); | ||
767 | tvp5150_info("*** Rom ver is %d.%d\n",msb_rom,lsb_rom); | ||
768 | } | ||
765 | } | 769 | } |
766 | tvp5150_info("Rom ver is %d.%d\n",msb_rom,lsb_rom); | ||
767 | 770 | ||
768 | /* Initializes TVP5150 to its default values */ | 771 | /* Initializes TVP5150 to its default values */ |
769 | tvp5150_write_inittab(c, tvp5150_init_default); | 772 | tvp5150_write_inittab(c, tvp5150_init_default); |
@@ -893,6 +896,17 @@ static int tvp5150_command(struct i2c_client *c, | |||
893 | } | 896 | } |
894 | case DECODER_GET_STATUS: | 897 | case DECODER_GET_STATUS: |
895 | { | 898 | { |
899 | int *iarg = arg; | ||
900 | int status; | ||
901 | int res=0; | ||
902 | status = tvp5150_read(c, 0x88); | ||
903 | if(status&0x08){ | ||
904 | res |= DECODER_STATUS_COLOR; | ||
905 | } | ||
906 | if(status&0x04 && status&0x02){ | ||
907 | res |= DECODER_STATUS_GOOD; | ||
908 | } | ||
909 | *iarg=res; | ||
896 | break; | 910 | break; |
897 | } | 911 | } |
898 | 912 | ||