Skip to content

Commit

Permalink
V4L/DVB (9585): Skip reading eeprom in newer Empia devices
Browse files Browse the repository at this point in the history
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 accessed through registers, and there is the risk that
we could corrupt the eeprom (since a 16-bit read call is interpreted as a
write call by 8-bit eeproms).  So just be safe and bail out of the function.

Thanks for Ray Lu from Empia for providing the em2874 datasheet.

Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent 6a1acc3 commit a527c9f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/media/video/em28xx/em28xx-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,17 @@ 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) {
/* 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
accessed through registers, and there is the risk that we
could corrupt the eeprom (since a 16-bit read call is
interpreted as a write call by 8-bit eeproms).
*/
return 0;
}

dev->i2c_client.addr = 0xa0 >> 1;

/* Check if board has eeprom */
Expand Down

0 comments on commit a527c9f

Please sign in to comment.