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 <[email protected]>
---
 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 27efcb8..213e3f0 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1542,6 +1542,11 @@ static int wm8753_resume(struct platform_device *pdev)
        for (i = 0; i < ARRAY_SIZE(wm8753_reg); i++) {
                if (i + 1 == WM8753_RESET)
                        continue;
+
+               /* No point in writing hardware default values back */
+               if (cache[i] == wm8753_reg[i])
+                       continue;
+
                data[0] = ((i + 1) << 1) | ((cache[i] >> 8) & 0x0001);
                data[1] = cache[i] & 0x00ff;
                codec->hw_write(codec->control_data, data, 2);
-- 
1.5.6.3


Reply via email to