Received: by 10.192.165.148 with SMTP id m20csp4041869imm; Tue, 8 May 2018 01:46:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo3iDT4W7LDjoO2XR22l/XJE84lklUJXh4s5MCq84EOOw5urKakJbDCNN7mcse+djFLcITy X-Received: by 2002:a63:be42:: with SMTP id g2-v6mr17027810pgo.44.1525769168832; Tue, 08 May 2018 01:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525769168; cv=none; d=google.com; s=arc-20160816; b=TJ80EYSg8CVjW3Mav0wrldfCW/B0waC15ZXEQyN3eiKPNY9Cafcz8rQb3fWDHNnXss bP/F5qZ0LsQfiyJrpocs56SKzCmbJOJAUUpLZZVzNa82lphteYyJAsmNCHyWSnLMuh6O ZaBmB5ZsC7AZMgB+NCzRjkrZHDRQTBaaaSFmiy9lBEU4ii+cWY8wCYTLmeXZv5jX+zZp 0LgrTfOD1nF8kwYdaBWVCKBQXxap8nZ5SWZizGb7t+9VEROt+pTZu9vVMKkkf/e6nP27 7Q4CrpPUlBw3Zj5MtLsrHl9X9qG+4W6YmTo1/fetyH4KgACH4bTzodFOBbH6qHYJfDIk GwYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PptCVJkrNJBqAETMz5lYbM3uRzVcI3RKpmpU82wBKnU=; b=WTRRWlNKbjQn6SoJVe1UPlxSs4STVJAgyfvLD90IpF0vvf0d5bU4To7Xu3HiWSu2LA r+HhPIzJPTsWic3Tjdy9Y0EUNMPDXme7R3TqUDPSIE+DlAWBYcm9ckWh6S6w1M7jvkTT ljwn5TiOC2+JoOLGhrwBk/TxpncIBX1xhu2YhQbZV2D1n+0RJ3jlu1sNH2BjT4NLvR+I fYDtx13WWK5H/kTD6bIz5S4dSCg8QX+2IHol8CQzqNBhG8BWccUFpmrBFdro+hlMS1vV pSRyhPj1u/6ZpUCBpfwEnqQaUZTTz7YzUEPDqz7W8XybtjlY0AdtB3YbgV87sI/821yP rsNA== 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 132-v6si7483046pgb.674.2018.05.08.01.45.54; Tue, 08 May 2018 01:46:08 -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 S932632AbeEHIpQ (ORCPT + 99 others); Tue, 8 May 2018 04:45:16 -0400 Received: from mx.socionext.com ([202.248.49.38]:12383 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932358AbeEHIpL (ORCPT ); Tue, 8 May 2018 04:45:11 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 08 May 2018 17:45:10 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id 61984180B83; Tue, 8 May 2018 17:45:10 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Tue, 8 May 2018 17:45:10 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id D26D240390; Tue, 8 May 2018 17:45:09 +0900 (JST) Received: from aegis.e01.socionext.com (unknown [10.213.134.210]) by yuzu.css.socionext.com (Postfix) with ESMTP id AA6F7120423; Tue, 8 May 2018 17:45:09 +0900 (JST) From: Katsuhiro Suzuki To: 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] ASoC: uniphier: evea: use DAPM to change source of line-in Date: Tue, 8 May 2018 17:45:09 +0900 Message-Id: <20180508084509.21616-1-suzuki.katsuhiro@socionext.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch replaces mixer switch to DAPM one for changing audio source of line-in. Signed-off-by: Katsuhiro Suzuki --- sound/soc/uniphier/evea.c | 55 +++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/sound/soc/uniphier/evea.c b/sound/soc/uniphier/evea.c index 73fd6730095c..f9c10165fbc1 100644 --- a/sound/soc/uniphier/evea.c +++ b/sound/soc/uniphier/evea.c @@ -54,8 +54,21 @@ struct evea_priv { int switch_hp; }; +static const char * const linsw1_sel1_text[] = { + "LIN1", "LIN2", "LIN3" +}; + +static SOC_ENUM_SINGLE_DECL(linsw1_sel1_enum, + ALINSW1, ALINSW1_SEL1_SHIFT, + linsw1_sel1_text); + +static const struct snd_kcontrol_new linesw1_mux[] = { + SOC_DAPM_ENUM("Line In 1 Source", linsw1_sel1_enum), +}; + static const struct snd_soc_dapm_widget evea_widgets[] = { - SND_SOC_DAPM_ADC("ADC", "Capture", SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_ADC("ADC", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_MUX("Line In 1 Mux", SND_SOC_NOPM, 0, 0, linesw1_mux), SND_SOC_DAPM_INPUT("LIN1_LP"), SND_SOC_DAPM_INPUT("LIN1_RP"), SND_SOC_DAPM_INPUT("LIN2_LP"), @@ -63,7 +76,9 @@ static const struct snd_soc_dapm_widget evea_widgets[] = { SND_SOC_DAPM_INPUT("LIN3_LP"), SND_SOC_DAPM_INPUT("LIN3_RP"), - SND_SOC_DAPM_DAC("DAC", "Playback", SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_DAC("DAC HP", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_DAC("DAC LO1", NULL, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_DAC("DAC LO2", NULL, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_OUTPUT("HP1_L"), SND_SOC_DAPM_OUTPUT("HP1_R"), SND_SOC_DAPM_OUTPUT("LO2_L"), @@ -71,17 +86,22 @@ static const struct snd_soc_dapm_widget evea_widgets[] = { }; static const struct snd_soc_dapm_route evea_routes[] = { - { "ADC", NULL, "LIN1_LP" }, - { "ADC", NULL, "LIN1_RP" }, - { "ADC", NULL, "LIN2_LP" }, - { "ADC", NULL, "LIN2_RP" }, - { "ADC", NULL, "LIN3_LP" }, - { "ADC", NULL, "LIN3_RP" }, - - { "HP1_L", NULL, "DAC" }, - { "HP1_R", NULL, "DAC" }, - { "LO2_L", NULL, "DAC" }, - { "LO2_R", NULL, "DAC" }, + { "Line In 1", NULL, "ADC" }, + { "ADC", NULL, "Line In 1 Mux" }, + { "Line In 1 Mux", "LIN1", "LIN1_LP" }, + { "Line In 1 Mux", "LIN1", "LIN1_RP" }, + { "Line In 1 Mux", "LIN2", "LIN2_LP" }, + { "Line In 1 Mux", "LIN2", "LIN2_RP" }, + { "Line In 1 Mux", "LIN3", "LIN3_LP" }, + { "Line In 1 Mux", "LIN3", "LIN3_RP" }, + + { "DAC HP", NULL, "Headphone 1" }, + { "DAC LO1", NULL, "Line Out 1" }, + { "DAC LO2", NULL, "Line Out 2" }, + { "HP1_L", NULL, "DAC HP" }, + { "HP1_R", NULL, "DAC HP" }, + { "LO2_L", NULL, "DAC LO2" }, + { "LO2_R", NULL, "DAC LO2" }, }; static void evea_set_power_state_on(struct evea_priv *evea) @@ -280,16 +300,7 @@ static int evea_set_switch_hp(struct snd_kcontrol *kcontrol, return evea_update_switch_hp(evea); } -static const char * const linsw1_sel1_text[] = { - "LIN1", "LIN2", "LIN3" -}; - -static SOC_ENUM_SINGLE_DECL(linsw1_sel1_enum, - ALINSW1, ALINSW1_SEL1_SHIFT, - linsw1_sel1_text); - static const struct snd_kcontrol_new evea_controls[] = { - SOC_ENUM("Line Capture Source", linsw1_sel1_enum), SOC_SINGLE_BOOL_EXT("Line Capture Switch", 0, evea_get_switch_lin, evea_set_switch_lin), SOC_SINGLE_BOOL_EXT("Line Playback Switch", 0, -- 2.17.0