diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-02-22 15:04:41 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-02-24 18:49:56 -0500 |
commit | e611bd82441130991d7f4600dfd4632cebd417c5 (patch) | |
tree | a67ae0acad57d18caa025e1ffdb27d8792f4a75a /sound/soc/codecs/wm8753.c | |
parent | c2bac1606a937d4700f8fdd8e051a4c49593c41b (diff) |
ASoC: Only write back non-default registers when resuming WM8753
This will reduce the number of writes done on resume, allowing that to
complete faster (especially on systems with very slow I2C like the
current Samsung driver).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8753.c')
-rw-r--r-- | sound/soc/codecs/wm8753.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index bc29558149e9..2241204b5151 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -1526,6 +1526,11 @@ static int wm8753_resume(struct platform_device *pdev) | |||
1526 | for (i = 0; i < ARRAY_SIZE(wm8753_reg); i++) { | 1526 | for (i = 0; i < ARRAY_SIZE(wm8753_reg); i++) { |
1527 | if (i + 1 == WM8753_RESET) | 1527 | if (i + 1 == WM8753_RESET) |
1528 | continue; | 1528 | continue; |
1529 | |||
1530 | /* No point in writing hardware default values back */ | ||
1531 | if (cache[i] == wm8753_reg[i]) | ||
1532 | continue; | ||
1533 | |||
1529 | data[0] = ((i + 1) << 1) | ((cache[i] >> 8) & 0x0001); | 1534 | data[0] = ((i + 1) << 1) | ((cache[i] >> 8) & 0x0001); |
1530 | data[1] = cache[i] & 0x00ff; | 1535 | data[1] = cache[i] & 0x00ff; |
1531 | codec->hw_write(codec->control_data, data, 2); | 1536 | codec->hw_write(codec->control_data, data, 2); |