aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-07-13 00:28:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-24 13:03:24 -0400
commitb04fb6615285d18df34ffd6cdd51db7a8a78dda0 (patch)
tree0091474355e5547e657563752a36aadab7438e25 /drivers/media/video/em28xx/em28xx-cards.c
parent9873740b2f41b37ec074afd4b8910b87dbebc0db (diff)
V4L/DVB (12238): em28xx: call sensor detection code for all webcam entries
With the previous approach, autodetection were working only for the two generic entries (em275x and em2820 unknown ones). So, if someone would try to force probing an specific device, the code would not properly run the autodetection code. With the new approach, the sensor autodetection will be run not only for the two generic entries, but also do webcam specific ones. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 530170ae0167..1318766b35bb 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -234,6 +234,7 @@ struct em28xx_board em28xx_boards[] = {
234 [EM2820_BOARD_UNKNOWN] = { 234 [EM2820_BOARD_UNKNOWN] = {
235 .name = "Unknown EM2750/28xx video grabber", 235 .name = "Unknown EM2750/28xx video grabber",
236 .tuner_type = TUNER_ABSENT, 236 .tuner_type = TUNER_ABSENT,
237 .is_webcam = 1, /* To enable sensor probe */
237 }, 238 },
238 [EM2750_BOARD_DLCW_130] = { 239 [EM2750_BOARD_DLCW_130] = {
239 /* Beijing Huaqi Information Digital Technology Co., Ltd */ 240 /* Beijing Huaqi Information Digital Technology Co., Ltd */
@@ -1719,10 +1720,6 @@ static int em28xx_hint_sensor(struct em28xx *dev)
1719 __be16 version_be; 1720 __be16 version_be;
1720 u16 version; 1721 u16 version;
1721 1722
1722 if (dev->model != EM2820_BOARD_UNKNOWN &&
1723 dev->model != EM2750_BOARD_UNKNOWN)
1724 return 0;
1725
1726 dev->i2c_client.addr = 0xba >> 1; 1723 dev->i2c_client.addr = 0xba >> 1;
1727 cmd = 0; 1724 cmd = 0;
1728 i2c_master_send(&dev->i2c_client, &cmd, 1); 1725 i2c_master_send(&dev->i2c_client, &cmd, 1);
@@ -1777,10 +1774,7 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1777 em28xx_info("chip ID is em2750\n"); 1774 em28xx_info("chip ID is em2750\n");
1778 break; 1775 break;
1779 case CHIP_ID_EM2820: 1776 case CHIP_ID_EM2820:
1780 if (dev->board.is_webcam) 1777 em28xx_info("chip ID is em2710 or em2820\n");
1781 em28xx_info("chip is em2710\n");
1782 else
1783 em28xx_info("chip ID is em2820\n");
1784 break; 1778 break;
1785 case CHIP_ID_EM2840: 1779 case CHIP_ID_EM2840:
1786 em28xx_info("chip ID is em2840\n"); 1780 em28xx_info("chip ID is em2840\n");
@@ -2415,7 +2409,13 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
2415 return errCode; 2409 return errCode;
2416 } 2410 }
2417 2411
2418 em28xx_hint_sensor(dev); 2412 /*
2413 * If the device can be a webcam, seek for a sensor.
2414 * If sensor is not found, then it isn't a webcam.
2415 */
2416 if (dev->board.is_webcam)
2417 if (em28xx_hint_sensor(dev) < 0)
2418 dev->board.is_webcam = 0;
2419 2419
2420 /* Do board specific init and eeprom reading */ 2420 /* Do board specific init and eeprom reading */
2421 em28xx_card_setup(dev); 2421 em28xx_card_setup(dev);