From patchwork Tue Oct 31 11:21:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 10034215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1DF0760291 for ; Tue, 31 Oct 2017 11:23:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0911828A51 for ; Tue, 31 Oct 2017 11:23:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1FD228A57; Tue, 31 Oct 2017 11:23:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4F2728A59 for ; Tue, 31 Oct 2017 11:23:32 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 00332267344; Tue, 31 Oct 2017 12:22:13 +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 AC445267338; Tue, 31 Oct 2017 12:22:11 +0100 (CET) Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id B5F6C26727C for ; Tue, 31 Oct 2017 12:22:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=i439YjmgEG2UBZpJNGv5XVxqCGgdSAXioX/WQh3Lk60=; b=bWe3a+WKv4dp R9ninBnrZZc0vz5VdTCcX4IKEkHM3U2p7EoXoK3eMmQSnLiRyVS97XVTXInRYu0UXSmZQxhYVRGOh Q4+QlMs43u9OkSzF9D/S5S61cay17fXq+k4ClDfK37+gnG/5r1JD0/5AUHjSCJWU7XkWtZEWGOH91 xTUuU=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1e9UcB-00015s-Nk; Tue, 31 Oct 2017 11:21:51 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1e9UcB-0002sT-AV; Tue, 31 Oct 2017 11:21:51 +0000 From: Mark Brown To: Bard Liao In-Reply-To: <1509348365-16840-1-git-send-email-bardliao@realtek.com> Message-Id: Date: Tue, 31 Oct 2017 11:21:51 +0000 Cc: oder_chiou@realtek.com, jack.yu@realtek.com, alsa-devel@alsa-project.org, lars@metafoo.de, lgirdwood@gmail.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, broonie@kernel.org, shumingf@realtek.com, flove@realtek.com Subject: [alsa-devel] Applied "ASoC: rt5645: remove unexisting route on new rt5645" to the asoc tree 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 X-Virus-Scanned: ClamAV using ClamSMTP The patch ASoC: rt5645: remove unexisting route on new rt5645 has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 50f510a33c7c906f8f75b02e3d1104984ebf6f78 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Mon, 30 Oct 2017 15:26:05 +0800 Subject: [PATCH] ASoC: rt5645: remove unexisting route on new rt5645 "SPOL MIX DAC R1 Switch" and "SPOL MIX SPKVOL R Switch" are only exist in the early version of rt5645. Signed-off-by: Bard Liao Signed-off-by: Mark Brown --- sound/soc/codecs/rt5645.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 4b2dbf0c3409..23cc2cb8393f 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -432,6 +432,7 @@ struct rt5645_priv { int jack_type; bool en_button_func; bool hp_on; + int v_id; }; static int rt5645_reset(struct snd_soc_codec *codec) @@ -2516,9 +2517,7 @@ static const struct snd_soc_dapm_route rt5645_dapm_routes[] = { { "SPKVOL L", "Switch", "SPK MIXL" }, { "SPKVOL R", "Switch", "SPK MIXR" }, - { "SPOL MIX", "DAC R1 Switch", "DAC R1" }, { "SPOL MIX", "DAC L1 Switch", "DAC L1" }, - { "SPOL MIX", "SPKVOL R Switch", "SPKVOL R" }, { "SPOL MIX", "SPKVOL L Switch", "SPKVOL L" }, { "SPOR MIX", "DAC R1 Switch", "DAC R1" }, { "SPOR MIX", "SPKVOL R Switch", "SPKVOL R" }, @@ -2707,6 +2706,11 @@ static const struct snd_soc_dapm_route rt5645_specific_dapm_routes[] = { { "DAC R2 Mux", "IF1 DAC", "RT5645 IF1 DAC2 R Mux" }, }; +static const struct snd_soc_dapm_route rt5645_old_dapm_routes[] = { + { "SPOL MIX", "DAC R1 Switch", "DAC R1" }, + { "SPOL MIX", "SPKVOL R Switch", "SPKVOL R" }, +}; + static int rt5645_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { @@ -3363,6 +3367,11 @@ static int rt5645_probe(struct snd_soc_codec *codec) snd_soc_dapm_add_routes(dapm, rt5645_specific_dapm_routes, ARRAY_SIZE(rt5645_specific_dapm_routes)); + if (rt5645->v_id < 3) { + snd_soc_dapm_add_routes(dapm, + rt5645_old_dapm_routes, + ARRAY_SIZE(rt5645_old_dapm_routes)); + } break; case CODEC_TYPE_RT5650: snd_soc_dapm_new_controls(dapm, @@ -3803,6 +3812,9 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, regmap_write(rt5645->regmap, RT5645_RESET, 0); + regmap_read(regmap, RT5645_VENDOR_ID, &val); + rt5645->v_id = val & 0xff; + ret = regmap_register_patch(rt5645->regmap, init_list, ARRAY_SIZE(init_list)); if (ret != 0)