]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit240e2c58490b537837374d3e3857b3bf2f6786d4
tree907adb9eab126c29cfce68357791ace2283eafef
parentfb17a914a57818ac87da72cde3a288606ded68ad
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