[media] media: i2c: ov2659: speedup probe if no device connected
authorGrygorii Strashko <grygorii.strashko@ti.com>
Mon, 21 Dec 2015 13:54:46 +0000 (11:54 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 25 Jan 2016 17:15:37 +0000 (15:15 -0200)
commit2e490139b137bbac3250d594cef3dcbc461ad4cc
treebc5b2a7886e474d0a7ad77cd78798d7ffb656be9
parentd5441ea58ccc70637b75b035dee61685b516a5ca
[media] media: i2c: ov2659: speedup probe if no device connected

The ov2659 driver performs device detection and initialization in the
following way:
 - send reset command REG_SOFTWARE_RESET
 - load array of predefined register's setting (~150 values)
 - read device version REG_SC_CHIP_ID_H/REG_SC_CHIP_ID_L
 - check version and exit if invalid.

As result, for not connected device there will be >~150 i2c transactions
executed before device version checking and exit (there are no
failures detected because ov2659 declared as I2C_CLIENT_SCCB and NACKs
are ignored in this case).

Let's fix that by checking the chip version first and start
initialization only if it's supported.

Cc: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/ov2659.c