From patchwork Wed Nov 8 17:24:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 10048879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BDB4760247 for ; Wed, 8 Nov 2017 17:24:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A11CF2A6B0 for ; Wed, 8 Nov 2017 17:24:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95EA52A7C0; Wed, 8 Nov 2017 17:24:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D9AE2A6B0 for ; Wed, 8 Nov 2017 17:24:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 60BC76E72C; Wed, 8 Nov 2017 17:24:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 516456E729; Wed, 8 Nov 2017 17:24:17 +0000 (UTC) Received: by mail-qt0-x241.google.com with SMTP id d9so4282211qtd.7; Wed, 08 Nov 2017 09:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/noFftZqW9HTq9amfAb9S7eeWIe0jy6D1nVvydMNPZc=; b=JYAjbEJx87PeTzoC6MMymmgM2grkeqh3Nc9sxg8tiTpjus3MgrDs7V58o+p0f8T0S0 aZM4Qzkm3KcDbQBOBVZQpO0qZqR050kV/TsFkrdGq3rtaFpJtz38cCL+sOTGWkTCzAms pbz8Xy5HyGEIuyi639gx0Vx8IbrzTR8wdgwj92zfB1Lq6CwC7ErAePef6TBWtfZ11GKB EIMX2h/KPQwpeGH5FbgLPSjB3ppUtAQUKG8jqsWkJEOJIpcuZpYRiGebbbGGAnP/lq2g axUz9Hyhp508YTf4zzltnVmQfrKO2m3V0N00o17khQfLqyn3tdgdouEL+GDsgeoler/Z i8SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/noFftZqW9HTq9amfAb9S7eeWIe0jy6D1nVvydMNPZc=; b=ngyKa/SUWju0yZlkanL79xhTo+7u95rveBoJqXC0rIn2/TmgVhlTsCN6LKSNHAwCSm y0TDfrfsjw2N2sekzhAyZcpPnCj7yai4tGz/dG65JMcvt0m/3GvFqOdnbJoDnMjMDrmo 9i+eb92nB53tcZNAh6gOrgruldEqOnADrkgnKUTIQaP0ZrNZEjqflQphSgUF9/ckKdIs z4p6IvbN+1Vt+zGkjEWvytX1Eho6eRZIH13FolLymZbGVz+p/3SGkdj+E+LHCAtc9sZI y8Y6bwffOk6JizTnda78nvddZxqJGYlOiphgnwcviv74ooX5AAA7BzbmAukg7JyuZowl 1XPA== X-Gm-Message-State: AJaThX7agm4ayG6HMy35Rl74LDpiP/m2GLgXfOPGt7m4v86Yk26oByc4 Fxi+BzJlgod8Sns3hISXL+535Q== X-Google-Smtp-Source: ABhQp+TmhOaWtBrmV6nCWwtRtnden9NDF+e8TlRDHi111dEJBpLTGxXy4q5A2stL3Cls2XM2ualNUA== X-Received: by 10.237.42.43 with SMTP id c40mr1955186qtd.322.1510161856267; Wed, 08 Nov 2017 09:24:16 -0800 (PST) Received: from localhost.localdomain (va-67-233-122-109.dhcp.embarqhsd.net. [67.233.122.109]) by smtp.gmail.com with ESMTPSA id k43sm3151324qtc.75.2017.11.08.09.24.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Nov 2017 09:24:15 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org, broonie@kernel.org, Vijendar.Mukunda@amd.com Subject: [PATCH v2 2/3] ASoC: rt5645: Wait for 400msec before concluding on value of RT5645_VENDOR_ID2 Date: Wed, 8 Nov 2017 12:24:03 -0500 Message-Id: <20171108172404.19118-3-alexander.deucher@amd.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171108172404.19118-1-alexander.deucher@amd.com> References: <20171108172404.19118-1-alexander.deucher@amd.com> Cc: Bard Liao , Alex Deucher , lgirdwood@gmail.com, Akshu Agrawal X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Akshu Agrawal Minimum time required between power On of codec and read of RT5645_VENDOR_ID2 is 400msec. We should wait that long before reading the value. TEST=Cold boot the device and check for sound device. Signed-off-by: Akshu Agrawal Signed-off-by: Bard Liao Signed-off-by: Alex Deucher --- v2: rework the patch based on mailing list discussion. Just wait before reading the register. sound/soc/codecs/rt5645.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 23cc2cb8393f..ce5d2c3c6976 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -55,6 +55,8 @@ MODULE_PARM_DESC(quirk, "RT5645 pdata quirk override"); #define RT5645_HWEQ_NUM 57 +#define TIME_TO_POWER_MS 400 + static const struct regmap_range_cfg rt5645_ranges[] = { { .name = "PR", @@ -3786,6 +3788,13 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, } regmap_read(regmap, RT5645_VENDOR_ID2, &val); + /* + * Read after 400msec, as it is the interval required between + * read and power On. + */ + msleep(TIME_TO_POWER_MS); + regmap_read(regmap, RT5645_VENDOR_ID2, &val); + switch (val) { case RT5645_DEVICE_ID: rt5645->regmap = devm_regmap_init_i2c(i2c, &rt5645_regmap);