From patchwork Mon Jul 1 08:16:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2806211 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DBB429F3C3 for ; Mon, 1 Jul 2013 08:20:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC0632013D for ; Mon, 1 Jul 2013 08:20:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 15CB5200ED for ; Mon, 1 Jul 2013 08:20:51 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZIf-0004Ix-Mn; Mon, 01 Jul 2013 08:17:30 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZIE-0002ei-DB; Mon, 01 Jul 2013 08:17:02 +0000 Received: from co9ehsobe001.messaging.microsoft.com ([207.46.163.24] helo=co9outboundpool.messaging.microsoft.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UtZI5-0002bM-Vb for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2013 08:16:55 +0000 Received: from mail109-co9-R.bigfish.com (10.236.132.228) by CO9EHSOBE019.bigfish.com (10.236.130.82) with Microsoft SMTP Server id 14.1.225.23; Mon, 1 Jul 2013 08:16:32 +0000 Received: from mail109-co9 (localhost [127.0.0.1]) by mail109-co9-R.bigfish.com (Postfix) with ESMTP id 0EE8D4E034D; Mon, 1 Jul 2013 08:16:32 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz8275dhz2dh87h2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e23h1151h1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail109-co9 (localhost.localdomain [127.0.0.1]) by mail109-co9 (MessageSwitch) id 1372666590907591_18832; Mon, 1 Jul 2013 08:16:30 +0000 (UTC) Received: from CO9EHSMHS002.bigfish.com (unknown [10.236.132.228]) by mail109-co9.bigfish.com (Postfix) with ESMTP id D36988005E; Mon, 1 Jul 2013 08:16:30 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS002.bigfish.com (10.236.130.12) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 1 Jul 2013 08:16:26 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.2.328.11; Mon, 1 Jul 2013 08:16:03 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.66]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r618Fs4p002487; Mon, 1 Jul 2013 01:16:01 -0700 From: Shawn Guo To: Subject: [PATCH 1/4] ASoC: sgtl5000: give it a ramping time before writting Date: Mon, 1 Jul 2013 16:16:08 +0800 Message-ID: <1372666571-17276-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372666571-17276-1-git-send-email-shawn.guo@linaro.org> References: <1372666571-17276-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130701_041654_232316_74352E91 X-CRM114-Status: GOOD ( 11.34 ) X-Spam-Score: -4.2 (----) Cc: Fabio Estevam , marex@denx.de, Mark Brown , linux-arm-kernel@lists.infradead.org, Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since commit af8ee11 (ASoC: sgtl5000: Fix driver probe after reset), it's very ofen to run into the following probe error on imx28. It is caused by the regmap_write() failure in sgtl5000_fill_defaults(). However, the regmap_read() before this has already been working. It seems that sgtl5000 takes a longer ramping time to get the registers ready for write than read. [ 1.991579] sgtl5000 0-000a: sgtl5000 revision 0x11 [ 2.021655] mxs-sgtl5000 sound.12: ASoC: CODEC (null) not registered [ 2.039087] mxs-sgtl5000 sound.12: snd_soc_register_card failed (-517) [ 2.046299] platform sound.12: Driver mxs-sgtl5000 requests probe deferral Fix the regression by giving it a ramping time before the first write. Signed-off-by: Shawn Guo --- sound/soc/codecs/sgtl5000.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index d441559..20bca03 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1552,6 +1552,13 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, i2c_set_clientdata(client, sgtl5000); + /* + * It seems that sgtl5000 takes a longer time to get the registers + * ready for write than bread. Let's give it a ramping time before + * the first write goes. + */ + msleep(50); + /* Ensure sgtl5000 will start with sane register values */ ret = sgtl5000_fill_defaults(sgtl5000); if (ret)