aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Schaefer <fschaefer.oss@googlemail.com>2013-04-11 14:56:47 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-14 19:04:36 -0400
commit61ff5d69dc39fecfe52ee5c8d4695a0ad4444d34 (patch)
tree24e5a61abf7251cdc44ed9102f41ee3b0a33f7f8
parent2b64cbd1da7a026e0779a1ba61e83ac5fcf544e7 (diff)
[media] em28xx: improve em2710/em2820 distinction
Chip id 18 is used by the em2710 and em2820. The current code assumes that if the device is a camera, the chip is an em2710 and an em2820 otherwise. But it turned out that the em2820 is also used in camera devices. "Silvercrest 1.3 MPix" webcams for example are available with both chips. Fortunately both variants are using different generic USD IDs which give us a hint about the used chip. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/usb/em28xx/em28xx-cards.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index a3c305598b4b..54ead1ec71a8 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -2909,6 +2909,14 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
2909 break; 2909 break;
2910 case CHIP_ID_EM2820: 2910 case CHIP_ID_EM2820:
2911 chip_name = "em2710/2820"; 2911 chip_name = "em2710/2820";
2912 if (dev->udev->descriptor.idVendor == 0xeb1a) {
2913 __le16 idProd = dev->udev->descriptor.idProduct;
2914 if (le16_to_cpu(idProd) == 0x2710)
2915 chip_name = "em2710";
2916 else if (le16_to_cpu(idProd) == 0x2820)
2917 chip_name = "em2820";
2918 }
2919 /* NOTE: the em2820 is used in webcams, too ! */
2912 break; 2920 break;
2913 case CHIP_ID_EM2840: 2921 case CHIP_ID_EM2840:
2914 chip_name = "em2840"; 2922 chip_name = "em2840";
@@ -2974,14 +2982,6 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
2974 2982
2975 em28xx_pre_card_setup(dev); 2983 em28xx_pre_card_setup(dev);
2976 2984
2977 if (dev->chip_id == CHIP_ID_EM2820) {
2978 if (dev->board.is_webcam)
2979 chip_name = "em2710";
2980 else
2981 chip_name = "em2820";
2982 snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
2983 }
2984
2985 if (!dev->board.is_em2800) { 2985 if (!dev->board.is_em2800) {
2986 /* Resets I2C speed */ 2986 /* Resets I2C speed */
2987 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); 2987 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);