Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754799AbdHZAls (ORCPT ); Fri, 25 Aug 2017 20:41:48 -0400 Received: from mail-cys01nam02on0131.outbound.protection.outlook.com ([104.47.37.131]:30527 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754673AbdHZAlm (ORCPT ); Fri, 25 Aug 2017 20:41:42 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=RyanS.Lee@maximintegrated.com; From: Ryan Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ryans.lee@maximintegrated.com, kuninori.morimoto.gx@renesas.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: ryan.lee.maxim@gmail.com Subject: [PATCH 8/9] ASoC: max98927: Modified DAPM widget and map to enable/disable VI sense path Date: Fri, 25 Aug 2017 17:41:09 -0700 Message-Id: <1503708070-7906-8-git-send-email-ryans.lee@maximintegrated.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503708070-7906-1-git-send-email-ryans.lee@maximintegrated.com> References: <1503708070-7906-1-git-send-email-ryans.lee@maximintegrated.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [204.17.143.20] X-ClientProxiedBy: CY4PR15CA0022.namprd15.prod.outlook.com (10.172.74.32) To BLUPR11MB0835.namprd11.prod.outlook.com (10.163.217.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: edbe7af9-f295-4f3e-c61d-08d4ec1b353c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BLUPR11MB0835; X-Microsoft-Exchange-Diag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XUx29Eom/ocKeumWdz4JA2WfCV4GlxuHZmmmV/3+fZ1AzK3w6KOem10yY8Npt5UpvKLIOqqs0DYTzvprWQjTvwO0yFtaRxr9aTdokt5WjbeLteHt3l+RCzIKmmS5uYbUk0h6rqNAoDHcLp9c+EPs232z79bVSqC6IUEJS+q6rZSusN8fxE63VGpTlucsbsu6IsOICtESjfaIBo6jl4PJDD0nKKHIuMNpY6lPH4An9Q9txfyOtdMxmNbl06YCD+xVuk9PJN+eYI1+uOjbEBtPnTi1C4D9NqwEiSKHGCi6i9jacVeqTd3niIm8bx8OEkcLMrJ4zCCcQD4v1PQ4Pn83xbit85UemSVauGf7+pZ26DZfhGYYD;4:I4ZdMADmKqEUXcWhXb5LRmiUlv0bebTVIGGFq8+ZokbMuKbPVaRHVqng0FsYCjTMjk3KkHvks6Wup5P1VwnA2lM3L4KSME6IHHScX2b2i0mTCBuFNb+98FygljtRmTVh6uW0LnzXcAZqDi8NkTSIPOCqylXHGvFLtNtAR7B38QOWwLLCF3mxvmEhfSC0RgLBX2arvdUbO1s+TnNfjJS4+7nAPHkrwD5LWPgLyowyzgpR0R9ITdesI6mJxbcTR4O/Skg6CA2mD9ja7KBlrdcwclhLzkqkdy+pMRfcsPZjI6U= X-Exchange-Antispam-Report-Test: UriScan:(108721460000369); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123564025)(20161123562025)(20161123558100)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BLUPR11MB0835;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BLUPR11MB0835; X-Forefront-PRVS: 04111BAC64 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6009001)(39860400002)(189002)(199003)(4326008)(72206003)(97736004)(81166006)(110136004)(81156014)(8676002)(53936002)(189998001)(66066001)(25786009)(478600001)(86362001)(47776003)(305945005)(48376002)(7736002)(50466002)(3846002)(50986999)(2906002)(6486002)(6506006)(6666003)(6512007)(68736007)(76176999)(101416001)(53416004)(50226002)(5660300001)(6116002)(2950100002)(42186005)(69596002)(7350300001)(5003940100001)(106356001)(105586002)(33646002)(36756003);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR11MB0835;H:ryan-ThinkPad-T430.maxim-ic.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR11MB0835;23:ZJmaEGriXXZTrwnWeHw91maNOpLUmvVbDsC464VBG?= =?us-ascii?Q?G1IyhRgK+UzfCC24N2Wm34B9u9QTPUcbTHdTHSO7HJHW8vOuPAvKLxW5equo?= =?us-ascii?Q?fRdG7kiVaFI+df3GaLLNLViw0LCYVUGvKPgEb74SLQWbiWQ6Nx6mQMojVOnZ?= =?us-ascii?Q?CapaZc2d+xnZ0QLa2oUrG/hG6YuVimY0oTkYwcCwiiVYxI1HNtM5tWd7uJhC?= =?us-ascii?Q?Q3X3qnDs5/hc6nI4DUBsvolOksiu2SyVn3ZDkXZQ2DNyKc/BvCPkByqrHCvs?= =?us-ascii?Q?+Nt1U+g+IeeNl8nO+dOXP3vFvA571908aOCb3seSUJkRLRiWpBcoTzax/hdL?= =?us-ascii?Q?jmAjnLQ0p4UpMCTIDX8ZYXy2By/RM+c0m2alKmX0Jd33RS0U4kUjGksnvcHc?= =?us-ascii?Q?qIDy9GegAjEYTQTq31rFsu+oGeuXc7fcQMmxDmszAv9b1NtYIAVGghHpdknT?= =?us-ascii?Q?LCQ0bMPoX4Ha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XtJVi/FNp6keUKNunu86SyOvFdxPIX1XBYZTeRTPHCsq+y2nTT88bsFpbLkrwLH21dmc0pUnIoLTLtluA74KlX5gf91nipjSte44MzwwDQWsy6gFrrrOGOv3bIV+iXsX9yZdgLpV1WsKcHqmJeScoCJUj20rQA==;5:JLp7ZKLJPUaPvty0xdedLiZqHpMj55+XepSqN/sQOcy8BvAj2pDFxxJNS94GCM6lEehExqfmJNx1Umgu/cQUIUcGML7tzjyLf+kHy3LnSBuePeqVPxi9K2595UJcBEPLfGsK5uWYvjuPXcLd7aj/kw==;24:VJH0j9Obp3rTCxmPvQgDD7Kxtn715EhHNE4DC1l/OiDxxsD4K96ZNWrQnAV5kMfMeIfu5lLb3BIRNZUrEcpgSNY9oZcZc7qONB95uvlm6bE=;7:1HoQyn/25kg0T+X51Q3Xd19UKYY60SO9tBbINq4EsZ6hYZMVc9326sIRh0NF7IQhY7c816YEGEfK7lyaYmL1R6S2kXJgE2MlL54fgZ0y29s+cd0wF9uDMhUyTatZO5QcUWT9NyuLUt36xAFplYXJ0WCo9YMY84x2f0Q7wytarHLK6jdqPVVMR9OmIqZLZ47ByuH6LTMCikBOMhFbQQQ9XM03rlQD9ow0AzJl2lTLpdo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2017 00:41:35.8935 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR11MB0835 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2991 Lines: 80 Signed-off-by: Ryan Lee --- Changes : Modified DAPM widget and audio map to enable/disable IV sensing path sound/soc/codecs/max98927.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c index 5517251..f944659 100644 --- a/sound/soc/codecs/max98927.c +++ b/sound/soc/codecs/max98927.c @@ -509,11 +509,6 @@ static int max98927_dac_event(struct snd_soc_dapm_widget *w, regmap_update_bits(max98927->regmap, MAX98927_R003A_AMP_EN, MAX98927_AMP_EN_MASK, 1); - /* enable VMON and IMON */ - regmap_update_bits(max98927->regmap, - MAX98927_R003E_MEAS_EN, - MAX98927_MEAS_V_EN | MAX98927_MEAS_I_EN, - MAX98927_MEAS_V_EN | MAX98927_MEAS_I_EN); regmap_update_bits(max98927->regmap, MAX98927_R00FF_GLOBAL_SHDN, MAX98927_GLOBAL_EN_MASK, 1); @@ -525,10 +520,6 @@ static int max98927_dac_event(struct snd_soc_dapm_widget *w, regmap_update_bits(max98927->regmap, MAX98927_R003A_AMP_EN, MAX98927_AMP_EN_MASK, 0); - /* disable VMON and IMON */ - regmap_update_bits(max98927->regmap, - MAX98927_R003E_MEAS_EN, - MAX98927_MEAS_V_EN | MAX98927_MEAS_I_EN, 0); break; default: return 0; @@ -547,14 +538,24 @@ static int max98927_dac_event(struct snd_soc_dapm_widget *w, static const struct snd_kcontrol_new max98927_dai_controls = SOC_DAPM_ENUM("DAI Sel", dai_sel_enum); +static const struct snd_kcontrol_new max98927_vi_control = + SOC_DAPM_SINGLE("Switch", MAX98927_R003F_MEAS_DSP_CFG, 2, 1, 0); + static const struct snd_soc_dapm_widget max98927_dapm_widgets[] = { - SND_SOC_DAPM_AIF_IN("DAI_OUT", "HiFi Playback", 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_DAC_E("Amp Enable", "HiFi Playback", MAX98927_R003A_AMP_EN, 0, 0, max98927_dac_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_MUX("DAI Sel Mux", SND_SOC_NOPM, 0, 0, &max98927_dai_controls), SND_SOC_DAPM_OUTPUT("BE_OUT"), + SND_SOC_DAPM_AIF_OUT("Voltage Sense", "HiFi Capture", 0, + MAX98927_R003E_MEAS_EN, 0, 0), + SND_SOC_DAPM_AIF_OUT("Current Sense", "HiFi Capture", 0, + MAX98927_R003E_MEAS_EN, 1, 0), + SND_SOC_DAPM_SWITCH("VI Sense", SND_SOC_NOPM, 0, 0, + &max98927_vi_control), + SND_SOC_DAPM_SIGGEN("VMON"), + SND_SOC_DAPM_SIGGEN("IMON"), }; static DECLARE_TLV_DB_SCALE(max98927_spk_tlv, 300, 300, 0); @@ -656,11 +657,16 @@ static SOC_ENUM_SINGLE_DECL(max98927_env_track_headroom, }; static const struct snd_soc_dapm_route max98927_audio_map[] = { - {"Amp Enable", NULL, "DAI_OUT"}, + /* Plabyack */ {"DAI Sel Mux", "Left", "Amp Enable"}, {"DAI Sel Mux", "Right", "Amp Enable"}, {"DAI Sel Mux", "LeftRight", "Amp Enable"}, {"BE_OUT", NULL, "DAI Sel Mux"}, + /* Capture */ + { "VI Sense", "Switch", "VMON" }, + { "VI Sense", "Switch", "IMON" }, + { "Voltage Sense", NULL, "VI Sense" }, + { "Current Sense", NULL, "VI Sense" }, }; static struct snd_soc_dai_driver max98927_dai[] = { -- 1.9.1