From patchwork Sun Feb 23 06:40:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang Xiao X-Patchwork-Id: 3703261 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 0012C9F2ED for ; Sun, 23 Feb 2014 06:41:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25D85201E4 for ; Sun, 23 Feb 2014 06:41:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 36E362012E for ; Sun, 23 Feb 2014 06:41:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1E97E265091; Sun, 23 Feb 2014 07:41:15 +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 E5B63264EFF; Sun, 23 Feb 2014 07:41:04 +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 08C41264F03; Sun, 23 Feb 2014 07:41:04 +0100 (CET) Received: from mx1.mxmail.xiaomi.com (mx1.mxmail.xiaomi.com [58.68.235.87]) by alsa0.perex.cz (Postfix) with ESMTP id B79AE261A18 for ; Sun, 23 Feb 2014 07:40:56 +0100 (CET) Received: from mail.xiaomi.com (unknown [114.255.3.134]) by mx1.mxmail.xiaomi.com (Postfix) with ESMTP id 188D481698; Sun, 23 Feb 2014 14:40:52 +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:40:52 +0800 From: xiangxiao To: , Date: Sun, 23 Feb 2014 14:40:44 +0800 Message-ID: <1393137644-20955-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: add data field into snd_soc_jack_gpio 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 callback could get the context data as needed Change-Id: I5542613ccf9881deb672e71d0f0c4f603ad761fd Signed-off-by: xiangxiao --- include/sound/soc.h | 3 ++- sound/soc/soc-jack.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 21038e0..a789a29 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -613,7 +613,8 @@ struct snd_soc_jack_gpio { struct snd_soc_jack *jack; struct delayed_work work; - int (*jack_status_check)(void); + void *data; + int (*jack_status_check)(void *data); }; struct snd_soc_jack { diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c index b12fce6..b903f82 100644 --- a/sound/soc/soc-jack.c +++ b/sound/soc/soc-jack.c @@ -250,7 +250,7 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio) report = 0; if (gpio->jack_status_check) - report = gpio->jack_status_check(); + report = gpio->jack_status_check(gpio->data); snd_soc_jack_report(jack, report, gpio->report); }