From patchwork Thu Nov 9 17:35:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 10051519 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 D1FF8603FA for ; Thu, 9 Nov 2017 17:36:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B85782B00E for ; Thu, 9 Nov 2017 17:36:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA3532B047; Thu, 9 Nov 2017 17:36:15 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 ADFEA2B00E for ; Thu, 9 Nov 2017 17:36:14 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 49E6326783F; Thu, 9 Nov 2017 18:36:09 +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 CB627267841; Thu, 9 Nov 2017 18:36:06 +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 00166267826 for ; Thu, 9 Nov 2017 18:36:02 +0100 (CET) Received: by mail-qt0-f193.google.com with SMTP id n61so8612413qte.10 for ; Thu, 09 Nov 2017 09:36:02 -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; bh=v8R99slVmkZLsjPSs0PZ1iv79B7k/lCVfgtAp3IqVRU=; b=ewlUID/BtNi8puWhQ4kCJwJZjtgSLClj2XrWQYQKkcd/cjfcR/7Z82U2tJNZDJWwcD etEMx/l6dDPC7kKp+i1Yoh8UPC7/qmps+UWTFdccxo1T9F9fvKfbmZxPLWLm+Ba2I0zV 5DDYZCESXNuJEa4FRvCvQIlRlw2QhpYRoBvZvn3h7ze0ahUDc2T4i1+XzvXGY93IZni5 KL516KqFnx/OGrJm46+ZdDEmsqqdyKbukNn5sI0UGaHwgtOTbX31neyBlboIURuaoN3i ai9iFfFPVo4/2LDESD+PyeBF6RaMV9aROUheZjYRqyJN+kxfky6P/eYft2TfAa5F/ZZY 4Etg== 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; bh=v8R99slVmkZLsjPSs0PZ1iv79B7k/lCVfgtAp3IqVRU=; b=TNCRI5P/AZMkmJ2+LDOzogPH2DJKnVfJxr02SyaClQYsNglgoCKAUmbVvef3QiRzId yT9S8On0EsR7VSHdU6v2y4q3+tsUhp2cCXoYjKGLWGbrc1zdwuHtOoXlNaZ4kWoNzALB 1sNZFmWiJJQ0d+HtATYDIzPBYDTUJiER2eQ+wOItPhOVPx7bEUswQstjy0dxV6KCM8QX oM4TtIqNKDZNYBJHWJ88XqjXlV7TUz7wKrV9sr1p4VfcZnUbkpMHizHrrrXv05pX9qS0 PdWbMjSj7jLFZ4rd5e03JNZACiMWOyj6NzRMkNDilkmiyX7hY5dfBNxy+dbjsnnrQSrb ZcLw== X-Gm-Message-State: AJaThX5G62kQgKl8mRYHPzbY19cJdYY8G/1MbalBBYF0hnJFb+guxoWg XkNEBV8vVkzXqAkxCeGTpZq5KA== X-Google-Smtp-Source: AGs4zMYqtc0ivN9/Ulwh8tdCRqzGj6lRosEF1f2TRtG4UA030bCHI8hfMUBEkVtmfTUDAUrUwiHoKQ== X-Received: by 10.200.43.120 with SMTP id 53mr2148559qtv.127.1510248961196; Thu, 09 Nov 2017 09:36:01 -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 t49sm5017532qta.54.2017.11.09.09.36.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Nov 2017 09:36:00 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: alsa-devel@alsa-project.org, broonie@kernel.org, Vijendar.Mukunda@amd.com Date: Thu, 9 Nov 2017 12:35:51 -0500 Message-Id: <20171109173552.21438-1-alexander.deucher@amd.com> X-Mailer: git-send-email 2.13.6 Cc: tiwai@suse.de, Bard Liao , Alex Deucher , lgirdwood@gmail.com, Akshu Agrawal Subject: [alsa-devel] [PATCH v3] 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. v3: Drop the extra read sound/soc/codecs/rt5645.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 23cc2cb8393f..5f24df4fae8e 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", @@ -3784,6 +3786,12 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, ret); return ret; } + + /* + * 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) {