CHROMIUM: mfd: max77686: don't read when updating if mask is 0xff
authorDaniel Kurtz <djkurtz@chromium.org>
Wed, 15 Aug 2012 07:26:25 +0000 (15:26 +0800)
committerGerrit <chrome-bot@google.com>
Fri, 17 Aug 2012 07:56:05 +0000 (00:56 -0700)
commit7803d9775835d08b4b2cf48582cb0250d3ce06e7
tree5b8980d42824104597a992bbdef91c1ccef89d2c
parent9c3b070d3ad895ef286db2d9e671debb6510872a
CHROMIUM: mfd: max77686: don't read when updating if mask is 0xff

If an update is going to set all of the bits of a register, there is no
reason to read its value first.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chrome-os-partner:10891
TEST=builds clean and snow boots;
TEST=ftrace shows that most update_reg calls, when mask is 0xff, only
     cause a single i2c write

Change-Id: I14270ba5f3ef6d060401a7c6c69b6f493a9f6588
Reviewed-on: https://gerrit.chromium.org/gerrit/30551
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Reviewed-by: Olof Johansson <olofj@chromium.org>
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
drivers/mfd/max77686.c