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: 10048883 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 4C53E60247 for ; Wed, 8 Nov 2017 17:24:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DEBC2A7B8 for ; Wed, 8 Nov 2017 17:24:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2230B2A7BC; Wed, 8 Nov 2017 17:24:43 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 698FF2A7B8 for ; Wed, 8 Nov 2017 17:24:42 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 34A972674F7; Wed, 8 Nov 2017 18:24:24 +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 84F4C267505; Wed, 8 Nov 2017 18:24:21 +0100 (CET) Received: from mail-qt0-f193.google.com (mail-qt0-f193.google.com [209.85.216.193]) by alsa0.perex.cz (Postfix) with ESMTP id 81CD62674F6 for ; Wed, 8 Nov 2017 18:24:17 +0100 (CET) Received: by mail-qt0-f193.google.com with SMTP id j58so4302127qtj.0 for ; Wed, 08 Nov 2017 09:24:16 -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=Cjq6fjYT3xZWkmMB3Sh2prDtQlkwKe5MKf16Mgo9aAU1j081FDIT9GZzOD1+uLh4Pd ntUrmHY3nwIyVFUtWEbWFtVOEape5nSFv8Aym46ne8VpoICMKUBsDxTZ5yRqDLpTUgp5 8pR7isMXB1p5OzmWCmJkIxaN1h+6Qcdm/ZZsELRZgwESchyJA/WtTBOLiFj8hr1ftd2G A7GDkcjjarVwmTCQyH8m9DKCWYwiJB8AQoyQp7xcbvmdCYnbNjQ4zXFkf/KBIZAsxF80 JP3d3ddGWAKCQpCdPD7YF6y0QzqWhpGfftW8sVb7qSTlKl+0KgglRkZ+OhOL8hEzB8P/ UWLA== X-Gm-Message-State: AJaThX5WO9YfHr1qEj22VVGxBhg4ONDCHlXClyiVzeFVUafXCZeop4ja EbDwyvxWSZgMmlIK1vHuCHvWLA== 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 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: tiwai@suse.de, Bard Liao , Alex Deucher , lgirdwood@gmail.com, Akshu Agrawal Subject: [alsa-devel] [PATCH v2 2/3] ASoC: rt5645: Wait for 400msec before concluding on value of RT5645_VENDOR_ID2 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org 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);