[media] em28xx: simplify ID-reading from Micron sensors
authorFrank Schaefer <fschaefer.oss@googlemail.com>
Sun, 16 Apr 2017 17:41:52 +0000 (14:41 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 17 Apr 2017 20:29:51 +0000 (17:29 -0300)
commit4d58443696a8e2a4bcae3fc6d32b0bee71ad9fa1
tree6681476d6b0059959209face2f786e29bb6b84b7
parente7080d4471d805d921a9ea21b32f911a91e248cb
[media] em28xx: simplify ID-reading from Micron sensors

Use i2c_smbus_read_word_data() instead of i2c_master_send() and
i2c_master_recv() for reading the ID of Micorn sensors.

i2c_smbus_read_word_data() assumes that byes are in little-endian,
so, it uses:
data->word = msgbuf1[0] | (msgbuf1[1] << 8);

However, Micron datasheet describes the ID as if they were read
in big-endian. So, we need to change the byte order in order to
match the ID number as described on their datasheets.

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