Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3643796imm; Sun, 10 Jun 2018 22:17:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJtzG3JOQUoi3+kX5WBIEoQXIMzY/6XMLUhIu0UIBpAbz3TYWbne8cxfshzUlIIoUc9rDmG X-Received: by 2002:a65:5006:: with SMTP id f6-v6mr13458838pgo.116.1528694261396; Sun, 10 Jun 2018 22:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528694261; cv=none; d=google.com; s=arc-20160816; b=XZ3Pe7P2BhRK8e+EuWfegFxvt7aYCCjcIj1diovg3eVdURNJpzR5uNOlLj0RWsCXi4 73htGPpoi7nFJAu8717GW4StE9wQLUuqc4OQr8Bv37uAfViTEVPQ0k5Tl1BPbewb8qEE P7l3d7joloD9fDpAq+r8tq/5ZS4o6+YszCZnfeYVLZp0wwXNUNHYLENgAky4lUaXLAWM Bo8JCfNG/ADT+pNN8iQUHzjQZtPrDqzL3LFTnuxZr0Zg4SCCG+tVgM1vxIRhblIPd24D tUuZZ1F891Hp76NItsP5MjzCyL8roFi8I15tlyC9nxSnYl1P0Wcvh1KjDz8emTXvc2sN Lw5w== 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=xvjSvlHrxuLw9dIs0VhqKNIPiXwUcWuqzCl5AGC0Qk0=; b=UaHd6ZgwTk3nOnb0CfMGLsMmCyyQ8innLazGuIaDLE6pyReFAzVX1HMKBrZOAsSrEI CuuQAre+x2oB96LAwSqMmp0iCnHVx0SVCPSWHrJyJ3Nhcz6VgXZHlCXDhi+uonGKiJl9 3gHx/hHtqEpEH2OunuClhvXoke4WY3aGGryiD0t/a1C3OsCeJyND2mmlhwNzZzCQxw8w XTF92IvQwJzOzgOGVi1hsP0U7N+DA64Al49ZBDaQ6l9V+hyHIRuqKeM3GZK+5gLS8LZO 5XNBTD0q1+xHQ0S/v1lTd9v6pxMbPVMxgqCCoSAeRSHE7GpUWA0Lp8kM+4bwXQ+kM0mU 2X/A== 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 v14-v6si12223621pgq.146.2018.06.10.22.17.27; Sun, 10 Jun 2018 22:17:41 -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 S1753968AbeFKFQE (ORCPT + 99 others); Mon, 11 Jun 2018 01:16:04 -0400 Received: from mx.socionext.com ([202.248.49.38]:19719 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753902AbeFKFQD (ORCPT ); Mon, 11 Jun 2018 01:16:03 -0400 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 Cc: Masami Hiramatsu , Jassi Brar , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Katsuhiro Suzuki Subject: [PATCH v2 3/3] ASoC: audio-graph-card: add hp and mic detect gpios same as simple-card 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> 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 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