From patchwork Fri Jan 30 21:07:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 5752771 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C8BE9F358 for ; Fri, 30 Jan 2015 21:08:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F2C020270 for ; Fri, 30 Jan 2015 21:08:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CBD7A20225 for ; Fri, 30 Jan 2015 21:08:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 42B8C2606BA; Fri, 30 Jan 2015 22:08:17 +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, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 8103826051D; Fri, 30 Jan 2015 22:08:08 +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 A11A8260537; Fri, 30 Jan 2015 22:08:07 +0100 (CET) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id C6549260506 for ; Fri, 30 Jan 2015 22:08:01 +0100 (CET) Received: by mail-pa0-f54.google.com with SMTP id eu11so56759045pac.13 for ; Fri, 30 Jan 2015 13:08:00 -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:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=OG5OC/EVsx0Phrl2w5GiXTZ0BTmm5B9+06TnU96IMdo=; b=Jkt0RTSvdMZdTk/CrbD5GFGKzkkLb1zP/oLZihhvra6+gSjhykQEFFvr4C/CweNiq3 OlIVpaEEEOwCbRwEkodyhbWn+orWAW7UHmAn/l5jSwYpSjJc7hbPfXg81d35VNG9mJk0 kdXKNaAqrVPYMp/pb5KFC/VQwwg74ZyyRZ8NsQuv3UcOXKw05SoznJ6g2B8bb+KNqU+l /MruXGVOdORqF+shzCc0YWBsj0Y0RM/Bb1BksxDDycuCeizr5bxF7Yh7BpPYnK3ze3XX pXjonHriQ+6AhS3OcKOXmOuX0kz6j7X880RvtKm4lfuiNh6RH03qUBLiG5cuH11bazIr LDRg== X-Gm-Message-State: ALoCoQlYl928t4lQ64w+9Re5zmJzm7CHli64I4zMcmz0QnAtbXnqiyKE4l7V1flDeI0pRs56kiSp X-Received: by 10.70.127.209 with SMTP id ni17mr11615708pdb.100.1422652080654; Fri, 30 Jan 2015 13:08:00 -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 y10sm11656296pbt.55.2015.01.30.13.07.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Jan 2015 13:07:59 -0800 (PST) From: Eric Nelson To: alsa-devel@alsa-project.org, tiwai@suse.de, perex@perex.cz Date: Fri, 30 Jan 2015 14:07:55 -0700 Message-Id: <1422652075-13604-1-git-send-email-eric.nelson@boundarydevices.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422651131-13261-1-git-send-email-eric.nelson@boundarydevices.com> References: <1422651131-13261-1-git-send-email-eric.nelson@boundarydevices.com> MIME-Version: 1.0 Cc: fabio.estevam@freescale.com, broonie@kernel.org, Eric Nelson Subject: [alsa-devel] [PATCH V2] 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.0uS represents 8 SYS_MCLK cycles at the minimum 8.0 MHz SYS_MCLK. Signed-off-by: Eric Nelson Reviewed-by: Fabio Estevam --- V2 replaces usleep_range with udelay and fixes microseconds in comment. 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 */ + udelay(1); + /* read chip information */ ret = regmap_read(sgtl5000->regmap, SGTL5000_CHIP_ID, ®); if (ret)