From patchwork Sun Feb 23 06:44:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang Xiao X-Patchwork-Id: 3703271 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 09ACE9F2ED for ; Sun, 23 Feb 2014 06:45:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 268C5201E7 for ; Sun, 23 Feb 2014 06:45:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3098A2012E for ; Sun, 23 Feb 2014 06:45:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 881B2265131; Sun, 23 Feb 2014 07:45:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: 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 409A7264EFF; Sun, 23 Feb 2014 07:45: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 CC98B264F03; Sun, 23 Feb 2014 07:45:07 +0100 (CET) Received: from mx1.mxmail.xiaomi.com (mx1.mxmail.xiaomi.com [58.68.235.87]) by alsa0.perex.cz (Postfix) with ESMTP id 80532261A18 for ; Sun, 23 Feb 2014 07:45:00 +0100 (CET) Received: from mail.xiaomi.com (unknown [114.255.3.134]) by mx1.mxmail.xiaomi.com (Postfix) with ESMTP id 6D80C817FE; Sun, 23 Feb 2014 14:44:58 +0800 (CST) Received: from xiaoxiang-desktop.mioffice.cn (10.237.130.10) by EX-CAS2.xiaomi.net (10.237.8.100) with Microsoft SMTP Server (TLS) id 14.3.174.1; Sun, 23 Feb 2014 14:44:58 +0800 From: xiangxiao To: , Date: Sun, 23 Feb 2014 14:44:52 +0800 Message-ID: <1393137892-21007-1-git-send-email-xiaoxiang@xiaomi.com> X-Mailer: git-send-email 1.8.1.2 MIME-Version: 1.0 X-Originating-IP: [10.237.130.10] X-EsetResult: clean, is OK X-EsetId: E374883E57221E38B039D5 Cc: alsa-devel@alsa-project.org, xiaoxiang@xiaomi.com Subject: [alsa-devel] [PATCH] ASoC: delay the initial jack detect by debounce_time 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 so the hardware could get time to initialize and debounce Change-Id: Iebeffa9bac6c4012ee8f9645771c13b28fe5ae80 Signed-off-by: xiangxiao --- sound/soc/soc-jack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index 23d43da..b12fce6 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -342,7 +342,8 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, gpio_export(gpios[i].gpio, false); /* Update initial jack status */ - snd_soc_jack_gpio_detect(&gpios[i]); + schedule_delayed_work(&gpios[i].work, + msecs_to_jiffies(gpios[i].debounce_time)); } return 0;