lm3554: restructure i2c communications
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 16 Apr 2012 10:57:23 +0000 (13:57 +0300)
committerbuildbot <buildbot@intel.com>
Wed, 25 Apr 2012 08:36:49 +0000 (01:36 -0700)
commit26069ecfbdba26ac0662616a741190ab21db3eef
tree21deabf00264e2d53a6d232fc6ed9ea98507e721
parent7cb56f092be06fca1b1945c8c95731eec9012c78
lm3554: restructure i2c communications

BZ: 32196

Currently the driver uses the lm3554 registers as a storage for the values. Due
to this it communicates too often in both ways with the chip. It's a bit
suboptimal (*) and even potentialy wrong in some cases (**).

* driver uses an additional mutex for serialization and the
  read-before-write technique

** when driver had used power on or off for the chip, the storage would have
   become to the inconsistent state.

Thus this patch addresses mentioned inconveniences. It moves storege from
hardware to the struct lm3554 fields and uses only sequential writes to set a
value.

Change-Id: I3ec755d43999ea07384c4f18e31013dd8e4c69f6
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-on: http://android.intel.com:8080/43707
Reviewed-by: Shevchenko, Andriy <andriy.shevchenko@intel.com>
Reviewed-by: Toivonen, Tuukka <tuukka.toivonen@intel.com>
Reviewed-by: Cohen, David A <david.a.cohen@intel.com>
Tested-by: Koski, Anttu <anttu.koski@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/media/video/lm3554.c
drivers/media/video/lm3554.h