[media] em28xx: consider the message length limitation of the i2c adapter when readin...
authorFrank Schaefer <fschaefer.oss@googlemail.com>
Thu, 3 Jan 2013 17:27:06 +0000 (14:27 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Jan 2013 03:19:11 +0000 (01:19 -0200)
commit72900ead868b4630f88a209a97ba86b47cdd66cb
tree835dacdbba69b36c8d9bff440147f4ae4c9ea068
parent86de10878e4c4887a50aa3a1cbdc2c97653edda8
[media] em28xx: consider the message length limitation of the i2c adapter when reading the eeprom

EEPROMs are currently read in blocks of 16 bytes, but the em2800 is limited
to 4 bytes per read. All other chip variants support reading of max. 64 bytes
at once (according to the em258x datasheet; also verified with em2710, em2882,
and em28174).
Since em2800_i2c_recv_bytes() has been fixed to return with -EOPNOTSUPP when
more than 4 bytes are requested, EEPROM reading with this chip is broken.
It was actually broken before that change, too, it just didn't throw an error
because the i2c adapter silently returned trash data (for all reads >1 byte !).

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/em28xx/em28xx-i2c.c