From patchwork Fri Jan 30 20:52:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 5752761 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6E5DEBF440 for ; Fri, 30 Jan 2015 20:52:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82CD220270 for ; Fri, 30 Jan 2015 20:52:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5C63920219 for ; Fri, 30 Jan 2015 20:52:35 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BC9752605D6; Fri, 30 Jan 2015 21:52:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 96C30260506; Fri, 30 Jan 2015 21:52:26 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4013E26051D; Fri, 30 Jan 2015 21:52:25 +0100 (CET) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by alsa0.perex.cz (Postfix) with ESMTP id 0C1772604C3 for ; Fri, 30 Jan 2015 21:52:18 +0100 (CET) Received: by mail-pa0-f41.google.com with SMTP id kq14so56668366pab.0 for ; Fri, 30 Jan 2015 12:52:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=Og2THZniXKkMKn7dWUcojmF2kZkabbxDoNcM7LdUmg8=; b=kC3148k6pnx8tFjMGVoU5+tNn7rgNj69CmEEMXtC3Z+rK5/GwhXghR6YKlirF0DWly CG7pPPzYzoxiSe7DXZt6vOQVuozpJBstEYmYpqMwAUDgI0i6f6V+FpvKizUABanMXPjr qL1rt57/VlwTh/MOrbvdqaW+2oF+NG1W4p3TLJtOZEzA83tUf6YmZi63ksnULTIqdylR i+Ztf7TS8K4/PeUm91Uj249OGyo3UtqSXbNBBjwclfKZiW8q1e5nH2wgOUIE75+bWSn3 Z8Xzpzdc9KwCLGJyGz9LmjLutS2PRSSZNKm88oFeJvzEfoIQBALZy9Qh3jWZMqA4j771 aBXQ== X-Gm-Message-State: ALoCoQlYyFqJab03HFTAKAkF3RGZ8xrl/jcOl2p+Gm+m2BFv2AbrQvZcKGB4NgHqVqjvC2mZ1Qzf X-Received: by 10.70.90.100 with SMTP id bv4mr11424355pdb.29.1422651136408; Fri, 30 Jan 2015 12:52:16 -0800 (PST) Received: from ericsam.boundarydevices.com (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by mx.google.com with ESMTPSA id bc1sm11800384pad.12.2015.01.30.12.52.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Jan 2015 12:52:15 -0800 (PST) From: Eric Nelson To: alsa-devel@alsa-project.org, tiwai@suse.de, perex@perex.cz Date: Fri, 30 Jan 2015 13:52:11 -0700 Message-Id: <1422651131-13261-1-git-send-email-eric.nelson@boundarydevices.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Cc: fabio.estevam@freescale.com, broonie@kernel.org, Eric Nelson Subject: [alsa-devel] [PATCH] ASoC: sgtl5000: add delay before first I2C access X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP To quote from section 1.3.1 of the data sheet: The SGTL5000 has an internal reset that is deasserted 8 SYS_MCLK cycles after all power rails have been brought up. After this time, communication can start ... 1.0?s represents 8 SYS_MCLK cycles at the minimum 8.0 MHz SYS_MCLK. Signed-off-by: Eric Nelson --- sound/soc/codecs/sgtl5000.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 29cf7ce..7d65a5b 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1462,6 +1462,9 @@ static int sgtl5000_i2c_probe(struct i2c_client *client, if (ret) return ret; + /* Need 8 clocks before I2C accesses */ + usleep_range(1, 2); + /* read chip information */ ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, ®); if (ret)