From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: [PATCH 7/7] ASoC: Only write back non-default registers when resuming WM8753 Date: Wed, 25 Feb 2009 10:48:22 +0000 Message-ID: <1235558902-20314-7-git-send-email-broonie@opensource.wolfsonmicro.com> References: <20090225104701.GA20221@rakim.wolfsonmicro.main> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from opensource2.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 8D28F2443D for ; Wed, 25 Feb 2009 11:48:24 +0100 (CET) In-Reply-To: <20090225104701.GA20221@rakim.wolfsonmicro.main> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Takashi Iwai Cc: alsa-devel@alsa-project.org, Mark Brown List-Id: alsa-devel@alsa-project.org 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 --- 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 bc29558..2241204 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) 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.6.1.3