OSDN Git Service

media: imx274: add helper to read multibyte registers
authorLuca Ceresoli <luca@lucaceresoli.net>
Fri, 24 Aug 2018 16:35:24 +0000 (12:35 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 17 Sep 2018 19:13:09 +0000 (15:13 -0400)
commitca017467c78bd0e451facea2e512cfa8881eb003
tree907adb9eab126c29cfce68357791ace2283eafef
parent1657c28d82e8f89f0cb7d327f31515071bd0577a
media: imx274: add helper to read multibyte registers

Currently 2-bytes and 3-bytes registers are read one byte at a time,
doing the needed shift & mask each time.

Replace all of this code by a unique helper function that calls
regmap_bulk_read(), which has two advantages:
 - reads all the bytes in a unique I2C transaction
 - simplifies code to read multibyte registers

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/imx274.c