From patchwork Mon Jun 11 05:15:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Katsuhiro Suzuki X-Patchwork-Id: 138197 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3616092lji; Sun, 10 Jun 2018 22:16:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIOQCft0LigEfNG6YoWb7AmoFgPLyfjyHQOCWuzW/dSsYMoxwRGvTrWHT6bFIJ60xlX1YrL X-Received: by 2002:a1c:ae94:: with SMTP id x142-v6mr2812476wme.22.1528694178929; Sun, 10 Jun 2018 22:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528694178; cv=none; d=google.com; s=arc-20160816; b=FkjzK/ChJF7+rOPYeB/Ekim9hVvqs823vyoHxnUQdzq+H612AtsTZJMsrOsOEWOgWc 93uEneUwbiqPddmnwBbniH3t05/pBwrzgWKe6tXBvh8bUjR05zui2riNgXHGIPXl5IyS yWQJCV6mJqmW2z8abvVPQJ4OFJQexQe6Q7ssGKf5EKzoRoGGTxAdDesgGm5IpyqutCYv DGpScIaIRZda+JfHOCoMXMaq26QjlDfgyqD9QCTqt/fCA3659HQ2lbH1H5gJahws47dh IT8L0n5ooCASF6DFVkUvkZn3v5PU9bWL/S5qxCuN+lLq4UXyVKn5WTRPjEWgUFpfEwk/ 7muw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:delivered-to:arc-authentication-results; bh=Lu1iTrZM44IJsaHBPe1ZAfMp2xFcMJsxZc2NROzb7vE=; b=AGC15XA+utPZylVrhqyiKc1MfqD5PWuPfBKNCqaWZJCDcMXgHusRCWXW986FVIRhjr cUlitlU6LOrhcDlbT1wartStcKKWnRbO/bIu2sjnGIZpHDVv91QxQ8V3vhoSo/ZPGuBW 5ju4PljgwIlB3+1pTjxlLVcZGz8YK+ELQwiaZcfRMzmMaERuZjVZNFjzu4lHjEpJxBzY px380oaR0xHCq3Hu0VymNOV5NbuaXMFKYxiylKklBm4ErbsSOYjxQLj2Pd1/J5HUe+7W tl/MbJFmraAqy6W0H9Aq6B3FjSAI3b2Yh3GWReb/YQ3qf25ahIJmE1k+QL3YQZRKvjoS EZOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id h66-v6si5143613wmg.128.2018.06.10.22.16.18; Sun, 10 Jun 2018 22:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2C0472676CA; Mon, 11 Jun 2018 07:16:12 +0200 (CEST) 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 6C2F52676C6; Mon, 11 Jun 2018 07:16:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by alsa0.perex.cz (Postfix) with ESMTP id B94DC2676C4 for ; Mon, 11 Jun 2018 07:16:04 +0200 (CEST) Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 11 Jun 2018 14:16:01 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 2FEE4180B83; Mon, 11 Jun 2018 14:16:02 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 11 Jun 2018 14:16:02 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id F147640389; Mon, 11 Jun 2018 14:16:01 +0900 (JST) Received: from aegis.e01.socionext.com (unknown [10.213.134.210]) by yuzu.css.socionext.com (Postfix) with ESMTP id C6354120139; Mon, 11 Jun 2018 14:16:01 +0900 (JST) From: Katsuhiro Suzuki To: Kuninori Morimoto , Mark Brown , alsa-devel@alsa-project.org Date: Mon, 11 Jun 2018 14:15:59 +0900 Message-Id: <20180611051559.18082-3-suzuki.katsuhiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180611051559.18082-1-suzuki.katsuhiro@socionext.com> References: <20180611051559.18082-1-suzuki.katsuhiro@socionext.com> Cc: Katsuhiro Suzuki , Jassi Brar , linux-arm-kernel@lists.infradead.org, Masami Hiramatsu , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v2 3/3] ASoC: audio-graph-card: add hp and mic detect gpios same as simple-card 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 This patch adds headphone and microphone jack detection gpios as same as simple-card driver. Signed-off-by: Katsuhiro Suzuki --- Changes from v1: - Move changes of audio-graph-card to other patch --- sound/soc/generic/audio-graph-card.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) -- 2.17.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1b6164249341..2baa60d3b3cc 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -21,7 +21,6 @@ #include #include #include -#include #include struct graph_card_data { @@ -32,6 +31,8 @@ struct graph_card_data { unsigned int mclk_fs; } *dai_props; unsigned int mclk_fs; + struct asoc_simple_jack hp_jack; + struct asoc_simple_jack mic_jack; struct snd_soc_dai_link *dai_link; struct gpio_desc *pa_gpio; }; @@ -278,6 +279,22 @@ static int asoc_graph_get_dais_count(struct device *dev) return count; } +static int asoc_graph_soc_card_probe(struct snd_soc_card *card) +{ + struct graph_card_data *priv = snd_soc_card_get_drvdata(card); + int ret; + + ret = asoc_simple_card_init_hp(card, &priv->hp_jack, NULL); + if (ret < 0) + return ret; + + ret = asoc_simple_card_init_mic(card, &priv->mic_jack, NULL); + if (ret < 0) + return ret; + + return 0; +} + static int asoc_graph_card_probe(struct platform_device *pdev) { struct graph_card_data *priv; @@ -319,6 +336,7 @@ static int asoc_graph_card_probe(struct platform_device *pdev) card->num_links = num; card->dapm_widgets = asoc_graph_card_dapm_widgets; card->num_dapm_widgets = ARRAY_SIZE(asoc_graph_card_dapm_widgets); + card->probe = asoc_graph_soc_card_probe; ret = asoc_graph_card_parse_of(priv); if (ret < 0) {