Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751564AbdH1Xdd (ORCPT ); Mon, 28 Aug 2017 19:33:33 -0400 Received: from mail-cys01nam02on0125.outbound.protection.outlook.com ([104.47.37.125]:29802 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751272AbdH1Xbf (ORCPT ); Mon, 28 Aug 2017 19:31:35 -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: Mon, 28 Aug 2017 16:30:54 -0700 Message-Id: <1503963061-14763-2-git-send-email-ryans.lee@maximintegrated.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1503963061-14763-1-git-send-email-ryans.lee@maximintegrated.com> References: <1503963061-14763-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: BN6PR16CA0010.namprd16.prod.outlook.com (10.172.212.148) To SN1PR11MB0848.namprd11.prod.outlook.com (10.163.208.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57fbe6a6-3e2a-4658-dc72-08d4ee6ceaa5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SN1PR11MB0848; X-Microsoft-Exchange-Diagnost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SMlBSQVJxp8jX6gOZSeUi5iWRUMUGqFjC12ARcwIkr0zkBAXZ7raZma12ok+ESWuFyAYhKLAh2vJK8jBrpzx0mUwU3IizVAH24T3Z9Qx/BL4rDW1DnGIh7QLBtkvtU7QWklYhR8+xCIY+BscGY5zjLoWaNA6XdVjaigCXwKFtaCrSRP4rohZL8q2IvNsoUZfpPocSrK9d2FpNnR7jEcDtZ3Dh69zMYdj1NJkMqI/XnxTsb+gI8vCGnAp0Ei9rn88xJ0U8w41brYvGL8xSwQqhItSE8b8oQNaVFtPA7SbkQqh+A9mHGA+NDzTAMUw6Nmvtw8YsYJLlcDeyy/7stxRBXvA4hWkrhu/Z;4:YjWgKjH+N7uosFc27YO5WSRsm52Jn+nRnX7C5Pur4IaPu015FI4K7kD/DSiB1B7/GAZPjOtssnkaMxP6aBfVUSp7G1730rHrt1bDGJ8R6R4pvIaX8z+EZ/swm2K+yzv9ib09mUi8ASKo9H/M8Xn8IDmKsSMVvZfYAW9kt9zIrxN50RBlg5wq9Uamr6hX4tWCvOeP3BrrXT1gzpXzfU983zNAhzuF/F4Rxkwnj6fPJ/T6yL5ZlZpN3Amo5tO5zhAd6cbBpC/QrP+B1qR7gGP/Z/BMsBTlt7aWRZuOAehUx3M= 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)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR11MB0848;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR11MB0848; X-Forefront-PRVS: 0413C9F1ED X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(7370300001)(6009001)(39860400002)(199003)(189002)(105586002)(33646002)(106356001)(189998001)(2906002)(6512007)(76176999)(86362001)(50986999)(575784001)(53416004)(110136004)(42186005)(66066001)(7350300001)(6116002)(68736007)(4326008)(47776003)(3846002)(5003940100001)(8676002)(50466002)(48376002)(81156014)(25786009)(101416001)(2950100002)(81166006)(6486002)(6506006)(6666003)(478600001)(50226002)(53936002)(36756003)(72206003)(305945005)(97736004)(5660300001)(69596002)(7736002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR11MB0848;H:ryan-ThinkPad-T430.maxim-ic.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR11MB0848;23:fuTh32L64+nw5mFun9klMnFD1Ycck5BeGMO4Lc4+C?= =?us-ascii?Q?dtFJo3jb/sVcopKU/3V/AnVVsImWAt4dXmjgJxc8w0ORGwpTThiykaJTR361?= =?us-ascii?Q?cIsG0+4UZCpqUFNw8jAqyxpfxOzzij6cOM6L7pdhYLGcvg6XjRNOiyQcY4d7?= =?us-ascii?Q?28zwb9I+Kuc2xe/ds8ZqVGAOFNAYs6KQRZ0evFi8mjWhguOATJTXuRkHKDme?= =?us-ascii?Q?4T3vQPLBYZ7A+60IKaDSd1zKPNq/vIdSTiYXzWPYC9EK2xJNxYu5USC+eJiI?= =?us-ascii?Q?fyMtEX/sy3N1LZzFMsbRruv4pjHwS+NJB5X0vm2khlnl/NEQxGJwSpzsFhHS?= =?us-ascii?Q?9+XSsvg17FeBw8U7UQSD8uAtyE0a6CVx3MaXWW8eHrWEcmx/PMGL3Hi7v+mD?= =?us-ascii?Q?mYywIZjicPIuVAyv0CMeIpUAM+pksC/vtHYdV5eFL2WakyfSn3wt2VJtjNKh?= =?us-ascii?Q?Or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yXN/h/JqW8dOjgVAuGG6c2dopDtK0adqAiWXJGsoBrLH/+XNsjB4sS0dzcWsifRPl4sQkC6WAdxikp+4vixcff7jg0u6/Nv8cGC4qWtscnYFHN7ro4VJDcupCEjvlgPY68j/r/Y1ESuqyN6iwQeDYAx/hZE+mjotXqmTEuE50Pa6oVL6yMvTCYZt0W6/YS+CArzVafO5CQDYJQ==;5:/XuGI6rBnXi3fwUCKaufO0Bka0Aq6ek2pr/hTL1b1jgoh+Er3/+wTTmE+25iLpnOBa0CYS6swX9vxFcmUjFzl86CZT2LPGYnQof8ln02ANAK+OQL9hJOnTzuya/4+0irquZwECpukHc+JyiOn2qzuA==;24:YLSDw62aKWTOgGIPNSYas0HdOaPNTOM37jNJOR4ZyeDut7cWoZIcCK6W+Lsbgrx1xMwLUnJ6sQr9ynIcEB4FCuaWJiZ3vc+Q07lyAXNumtM=;7:+ZubmSKNbLiZ8QioZvQh86SAbmTTxyr9ODVvDbAiATXFimX1Byfi7HAX4P4/pB89fpI0OJXv5i1VdFrd29cyE98eJbRooCi+9BltY6564yh3RqHRgNSA2EhnP9Upk3RMAaGkaVRtqFF/pVQkebHACqoOteCntUAj6TPPyQsYmJPLSxSE6Ub/FZDQSIoqVwCWmv2aWZ7pN7FugSFt1SsrNMzG6alelMuSkJUelINNb1g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2017 23:31:31.5918 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR11MB0848 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2577 Lines: 71 Signed-off-by: Ryan Lee --- 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