Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754527AbdHZAle (ORCPT ); Fri, 25 Aug 2017 20:41:34 -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 S1754305AbdHZAlc (ORCPT ); Fri, 25 Aug 2017 20:41:32 -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 2/9] ASoC: max98927: Added controls for Envelope tracking Date: Fri, 25 Aug 2017 17:41:03 -0700 Message-Id: <1503708070-7906-2-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: ef6ba0b3-048b-4b6a-cbc7-08d4ec1b305d 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-Diagnostics: 1;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hDgTm8Sv7tjBLMPSh72+bsiEi+LgVFavu5Eo1sWQFsA7+642lxSAihKsPGVvyhNRV1WGjLuazL//VeUKFVHS2tF9tsIMdOsJteYmxMYiglAqiRgfn2ZLh7Y8Egg/LLdSN48HmcImIXn+ceOAqx64oQzXoP1DrmrUVo2wBpmXjWpXlrxDEZbwlWIfl9EQgobBeJBCNr5EyF+k58WHJMJtmjVXkyFr79kOZyi/QEvPtPjSd4esNpTkV+DR1PCFkSiVOg8PsfZySro5YV4BsDUSqH+IFluv95OPKHbeHdCgraD8cWJR4Z+fW+mTEGGqQA7Ni1lFSKWtiGMMLJJstyXQ9rsN2DZwk8GVfLuKQwYELJ;4:ORFSAYVABWeZ6hHavtrEES+t2jkjBpFKN1z5XMYDTjaYZdVtIAtr+mqaurbGXplHMh2Q/JpR2eOiOeUlslpYLx7ZddKmbDP/Yv3bHhV41h1IuAOmqqjFFFSh2cP1uYPaukpLdfFBD+4YvR7aA8nOqDEHjU1skRZ98dONsREECEmXnRPiuIYLYRivBScvv6Kv1tMVjJBiLw3gq4t14EF+TNvQU1B4c5fldif2NqMZ0+0PoZ4sy1AONQjNpuKHlpbYXOODAEDVL9U8/VKnAKV3jvlca0CNX/dyoOTrOkcyeUY= 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)(575784001)(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:Lqq84FlYSI0/lNlZbS4DdshfAJzGNDx/37l7hcA/c?= =?us-ascii?Q?ZPLjtyEo+pgJ/ZtpAA/kDAs/ZsP9WAGbQpffg7DPjpj2BAGHqDWSaHEMNziO?= =?us-ascii?Q?ae5zwlmDR1CxJnk4VUQP3nusQ5RyS1N6v+MECpuumc3cJCocxL2sXX9wH9Ue?= =?us-ascii?Q?0IFyYnX+Zo/LLySFnNxAyBcPgO1S1TfW3aQZcoboTbX1FUA7EZa7E3prjRxa?= =?us-ascii?Q?JbD6ZXeKezhaZ6v7Vf2PxyAiKN1mBBrHq7/z8IicerACdQqgJF/dvXVapYQi?= =?us-ascii?Q?ymmkZSh/doZIzmHwEWWaToL6ajAeYgDGsKYYvR2MGedrY0r3fU6av0UGPx6r?= =?us-ascii?Q?go15NEcBZASbL+xGSaPetzlW/tGXRFqDyQ7VSm874GG7avys75Afab0P6oWh?= =?us-ascii?Q?mXzQ00BfhP9j/M7tkACyotUdb3luQ3HEt0KInDdSZHulLLoBdmcgZqAX+9+G?= =?us-ascii?Q?yX9EIrNBQJpukh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Dr2ykTUtJVbv9GTvfObSAzoeqFkfSogDo1Yx4T/Lt0FekqgOFLp5cxvIWcJS7fIkDoWtr3THf+4+MU7SnQZT3e5hkOCElOcKuYeTP02TdlD76NHwEN6oQgMXGUbrpSr1UlZJ4u+KoW7a400ppek+yUtYFiojGKmsMJrCab3phNTSfcMunCRNYk4csSSfZYQ==;5:D7FVQL15k2Dvu6WQhvi+Eye0i6RrxCpQ5h+mWBxsqE9Hhis80z/oPX86COtP8OHLSVPtQEVI8tunw88esqBVcraeGuJ8Gw2q4D4sSrdBVdSnomSCO5fpp0MO4fQM6sKo0lUzx2JEpWihaZ12jdx/yg==;24:pqK+2GqFbVwnxN2Wfvq2qYUlag27yjZWhYRGv1SVjrX115nXGjTx5Rurk2IjmHeTNQ//f4t02fWU5hiyx6dKLrf0hWjcpo8IG99UtpYjtnA=;7:/7woIhEttokY6aPrzef4ynUqgbpeImEAu+Wv/Zlqw8pyFIUkYk1A8F90A5ge/6dXy8lKmJ/LDCAouyquiKeE97V8IEuk8g/U/7qRXuE+88N59UZ+j6RuceWRuO5GdvfkWK773qxLJzk60FvZIUhZAmN6e/Ni2ozpIpC42TeVbGpq9xvZSnYqGfjI66tn08GJDzhsPOMroUbW+oxw/Fr6aYMAd+/z4zKZwyZbuNKvTTE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2017 00:41:27.7213 (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: 2641 Lines: 73 Signed-off-by: Ryan Lee --- Changes : Added controls to support envelope tracking function sound/soc/codecs/max98927.c | 20 ++++++++++++++++---- sound/soc/codecs/max98927.h | 4 ++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c index 951cc05..1dfcb7b 100644 --- a/sound/soc/codecs/max98927.c +++ b/sound/soc/codecs/max98927.c @@ -614,6 +614,18 @@ static SOC_ENUM_SINGLE_DECL(max98927_current_limit, MAX98927_R0042_BOOST_CTRL1, 1, max98927_current_limit_text); +static const char * const max98927_env_track_headroom_text[] = { + "0.000V", "0.125V", "0.250V", "0.375V", "0.500V", "0.625V", + "0.750V", "0.875V", "1.000V", "1.125V", "1.250V", "1.375V", + "1.500V", "1.625V", "1.750V", "1.875V", "2.000V", "2.125V", + "2.250V", "2.375V", "2.500V", "2.625V", "2.750V", "2.875V", + "3.000V", "3.125V", "3.250V", "3.375V", "3.500V" +}; + +static SOC_ENUM_SINGLE_DECL(max98927_env_track_headroom, + MAX98927_R0082_ENV_TRACK_VOUT_HEADROOM, 0, + max98927_env_track_headroom_text); + static const struct snd_kcontrol_new max98927_snd_controls[] = { SOC_SINGLE_TLV("Speaker Volume", MAX98927_R003C_SPK_GAIN, 0, 6, 0, @@ -631,6 +643,9 @@ static SOC_ENUM_SINGLE_DECL(max98927_current_limit, MAX98927_AMP_VOL_SEL_SHIFT, 1, 0), SOC_ENUM("Boost Output Voltage", max98927_boost_voltage), SOC_ENUM("Current Limit", max98927_current_limit), + SOC_SINGLE("EnvTrack Switch", MAX98927_R0086_ENV_TRACK_CTRL, + MAX98927_ENV_TRACKER_EN_SHIFT, 1, 0), + SOC_ENUM("EnvTrack Headroom", max98927_env_track_headroom), }; static const struct snd_soc_dapm_route max98927_audio_map[] = { @@ -725,13 +740,10 @@ static int max98927_probe(struct snd_soc_codec *codec) /* Envelope Tracking configuration */ regmap_write(max98927->regmap, MAX98927_R0082_ENV_TRACK_VOUT_HEADROOM, - 0x08); + 0x0A); regmap_write(max98927->regmap, MAX98927_R0086_ENV_TRACK_CTRL, 0x01); - regmap_write(max98927->regmap, - MAX98927_R0087_ENV_TRACK_BOOST_VOUT_READ, - 0x10); /* voltage, current slot configuration */ regmap_write(max98927->regmap, diff --git a/sound/soc/codecs/max98927.h b/sound/soc/codecs/max98927.h index bf7a6f92..3069a09 100644 --- a/sound/soc/codecs/max98927.h +++ b/sound/soc/codecs/max98927.h @@ -250,6 +250,10 @@ #define MAX98927_BROWNOUT_DSP_EN (0x1 << 2) #define MAX98927_BROWNOUT_DSP_SHIFT (2) +/* MAX98927_R0086_ENV_TRACK_CTRL */ +#define MAX98927_ENV_TRACKER_EN (0x1 << 0) +#define MAX98927_ENV_TRACKER_EN_SHIFT (0) + /* MAX98927_R0100_SOFT_RESET */ #define MAX98927_SOFT_RESET (0x1 << 0) -- 1.9.1