From: Antti Palosaari Date: Thu, 7 Apr 2011 19:04:48 +0000 (-0300) Subject: [media] em28xx: add support for EM28174 chip X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bc022694d7da1c848e395f18eaf856abc9dd0b09;p=mv-sheeva.git [media] em28xx: add support for EM28174 chip EM28174 is very similar as already supported EM2874. I am not sure what are differences, but it could be analog support. Signed-off-by: Antti Palosaari Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index bdd8618dad3..9a5ac562ee3 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c @@ -2810,6 +2810,11 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, dev->reg_gpio_num = EM2874_R80_GPIO; dev->wait_after_write = 0; break; + case CHIP_ID_EM28174: + em28xx_info("chip ID is em28174\n"); + dev->reg_gpio_num = EM2874_R80_GPIO; + dev->wait_after_write = 0; + break; case CHIP_ID_EM2883: em28xx_info("chip ID is em2882/em2883\n"); dev->wait_after_write = 0; diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 44c63cbd6dd..92b6dd84f1f 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -614,7 +614,7 @@ int em28xx_capture_start(struct em28xx *dev, int start) { int rc; - if (dev->chip_id == CHIP_ID_EM2874) { + if (dev->chip_id == CHIP_ID_EM2874 || dev->chip_id == CHIP_ID_EM28174) { /* The Transport Stream Enable Register moved in em2874 */ if (!start) { rc = em28xx_write_reg_bits(dev, EM2874_R5F_TS_ENABLE, @@ -1111,6 +1111,10 @@ int em28xx_isoc_dvb_max_packetsize(struct em28xx *dev) /* FIXME - for now assume 564 like it was before, but the em2874 code should be added to return the proper value... */ packet_size = 564; + } else if (dev->chip_id == CHIP_ID_EM28174) { + /* FIXME same as em2874. 564 was enough for 22 Mbit DVB-T + but too much for 44 Mbit DVB-C. */ + packet_size = 752; } else { /* TS max packet size stored in bits 1-0 of R01 */ chip_cfg2 = em28xx_read_reg(dev, EM28XX_R01_CHIPCFG2); diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c index 71474d31e15..4739fc7e6eb 100644 --- a/drivers/media/video/em28xx/em28xx-i2c.c +++ b/drivers/media/video/em28xx/em28xx-i2c.c @@ -332,7 +332,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len) struct em28xx_eeprom *em_eeprom = (void *)eedata; int i, err, size = len, block; - if (dev->chip_id == CHIP_ID_EM2874) { + if (dev->chip_id == CHIP_ID_EM2874 || dev->chip_id == CHIP_ID_EM28174) { /* Empia switched to a 16-bit addressable eeprom in newer devices. While we could certainly write a routine to read the eeprom, there is nothing of use in there that cannot be diff --git a/drivers/media/video/em28xx/em28xx-reg.h b/drivers/media/video/em28xx/em28xx-reg.h index 91e90559642..e92a28ede43 100644 --- a/drivers/media/video/em28xx/em28xx-reg.h +++ b/drivers/media/video/em28xx/em28xx-reg.h @@ -201,6 +201,7 @@ enum em28xx_chip_id { CHIP_ID_EM2870 = 35, CHIP_ID_EM2883 = 36, CHIP_ID_EM2874 = 65, + CHIP_ID_EM28174 = 113, }; /*