Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3787031imm; Mon, 11 Jun 2018 01:34:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLmMTe96KcXUwMvaUTolQNNLwUE4BCTc0lGNLA0eEKNnauudr6S2s6IoeDFylH0LYwH20M9 X-Received: by 2002:a62:8f8c:: with SMTP id n134-v6mr16698713pfd.66.1528706090467; Mon, 11 Jun 2018 01:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528706090; cv=none; d=google.com; s=arc-20160816; b=ikDHClgCpyGYvl2Bj+DWaFSeaHsqXx/b8L1kReySCWjYrs6IF9+r3hkP9K8KsK95AW xrfG4q1fqVoXLjKxPFUW2aB2sOWf+bL7lDgWz3vxXaBL7BXG7TLknvcJ/MgTPC2Ps64U 998hzWMsa0Gq9gzdDEXkH8a3WAhw6uHZplKKCEdi3Ek8XA9WGSu0gMwGBv++oUo+31wI GRlowmvA65DTCiYc/yjsMjYZnw38UzpKttyKS/jnNm1UHvnlLW2i35D7DjylIq6+yenE ahJ6U4cdQYmcFP8sxmoo178Lb3Wcdrm9pZAonirQ4zrbQaVrLwa3fmhlX/0swQ1ZgMNH stsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=8kCuGiVcyQ3C+btUM8g0Nj14qK+ikY2luLidBGdY1fQ=; b=pKn/ANjwo+NQlLCWZCXbuWUxRspvQNN903H+OSg3BDfUnjPGcMP/MZjzW9DBq32EOa PPICfGukXou/Pgn/lSjCpfIxQtDFFXcFqCo7l7ec/DyTHvTx/+u3D45xS1jfXXPXzOs+ /QWvPXmI3FUbedla5MpwkPAzLgh5Y5b8Ry1tiGtogrRUL1FFIm2rhyzQyC81c1CbI8AT YZV68zxuV95Hl3nhXRG5eoTdxsplLjWVwRGPaHkPcf093fP/iLJ3HoAWZ8UPplL1HXGj Dxg5DfcRNPbAqKGBjTI5+XbY8Ziwm5bM2xVE4Yb1BnK4JIG5vD4cs7n2hCl39dCN2GlX 2TGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17-v6si17704231plq.221.2018.06.11.01.34.36; Mon, 11 Jun 2018 01:34:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754223AbeFKIct (ORCPT + 99 others); Mon, 11 Jun 2018 04:32:49 -0400 Received: from mx.socionext.com ([202.248.49.38]:23019 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754116AbeFKIcT (ORCPT ); Mon, 11 Jun 2018 04:32:19 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 11 Jun 2018 17:32:17 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 9C0DC1800E5; Mon, 11 Jun 2018 17:32:17 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Mon, 11 Jun 2018 17:32:17 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 07F14403FD; Mon, 11 Jun 2018 17:32:17 +0900 (JST) Received: from aegis.e01.socionext.com (unknown [10.213.134.210]) by yuzu.css.socionext.com (Postfix) with ESMTP id D0B5D12013B; Mon, 11 Jun 2018 17:32:16 +0900 (JST) From: Katsuhiro Suzuki To: Kuninori Morimoto , Mark Brown , alsa-devel@alsa-project.org Cc: Masami Hiramatsu , Jassi Brar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Katsuhiro Suzuki Subject: [PATCH v3 3/3] ASoC: audio-graph-card: add hp and mic detect gpios same as simple-card Date: Mon, 11 Jun 2018 17:32:14 +0900 Message-Id: <20180611083214.16858-3-suzuki.katsuhiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180611083214.16858-1-suzuki.katsuhiro@socionext.com> References: <20180611083214.16858-1-suzuki.katsuhiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds headphone and microphone jack detection gpios as same as simple-card driver. Signed-off-by: Katsuhiro Suzuki --- Changes from v2: - Nothing 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(-) 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) { -- 2.17.1