Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751919AbdIKQNA (ORCPT ); Mon, 11 Sep 2017 12:13:00 -0400 Received: from mail-by2nam01on0108.outbound.protection.outlook.com ([104.47.34.108]:62496 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751852AbdIKQM6 (ORCPT ); Mon, 11 Sep 2017 12:12:58 -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/3] ASoC: max98927: Added controls for Envelope tracking Date: Mon, 11 Sep 2017 09:12:19 -0700 Message-Id: <1505146339-19380-2-git-send-email-ryans.lee@maximintegrated.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505146339-19380-1-git-send-email-ryans.lee@maximintegrated.com> References: <1505146339-19380-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: MWHPR2001CA0014.namprd20.prod.outlook.com (10.172.58.152) To CY1PR11MB0841.namprd11.prod.outlook.com (10.163.237.19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b4f760c-5c80-480d-f902-08d4f92ff658 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)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR11MB0841; X-Microsoft-Exchange-Diagnost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QVesqsjZ+H+K0+QmcI7UFr14Zh87CLNWBSrU+p0rmaKMJSw6ZJJp0Lj8Bu6llzzlIhH6cnFuDEfXSCtBsj7TJdhcEHdCyVqXHR3GAy0UbX0bDGGyZKFf20IM+YsLvOFf9sPa0MoJ8Hqke15qF2POXA3LxTYfiLhA2R3bAtEwEuHkVE5HlbLcWL6IxlPbxciAUkIswqFtkHuD5uM04BqtVikqSazRrALMCov+JOEClmjcKFfRK51j+FW7u2ktBiOxtdz1OBiG4NHbP1lignEU2+go/D3dwCaqUPVFJ6SzXIsOmS1z2SizLh94/XRoRS8/xzJydAlE5xj1V4P/d5rDIpbqk610w8ACscjemSlEJ+QO9orjcNgRByoiRu;4:iXeunWRhpONpFJeawyMgzWv6c7yk83sVlihU7sWIxm4LhpbrQFpuJasoL6UgQe/B1nH4miialxqsDKgv2PKq2kUQkyhLqcBtZ6622Eljv8ukZtHORnp8gvm6QBx1WtbklFmbG/TPJDn1t/mh5+lmkzDrz9fo4wzyH/ubj2cUu1AroZFMCFr7msgDsZsms/dVNYMMkmSZxJZr37gHeAqpsgaRVFgZIlwIGxwshTY7nWg9xafwjTlz39gJFn2JKyj5TdRttPfcVox4uBm5YMbiXYEYg2Zv02li5mkRF3igCbg= 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)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR11MB0841;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR11MB0841; X-Forefront-PRVS: 04270EF89C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(54534003)(189002)(48376002)(5003940100001)(50466002)(68736007)(106356001)(105586002)(6666003)(33646002)(2950100002)(25786009)(39060400002)(110136004)(189998001)(4326008)(72206003)(478600001)(53936002)(3846002)(6116002)(2906002)(97736004)(66066001)(81156014)(5660300001)(47776003)(8936002)(50226002)(305945005)(86362001)(6512007)(7736002)(81166006)(8676002)(53416004)(6486002)(69596002)(6506006)(42186005)(50986999)(76176999)(101416001)(36756003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR11MB0841;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;CY1PR11MB0841;23:EIpcmMDY/6AoVXZ6vF0DxrwdRUUuF0dVGWqhaACZl?= =?us-ascii?Q?H71+k+q6lJ+LGwSMQxupYywHMsNmjmhxFc8MrOP7nDJQM+JgkfhXCHYkeOuI?= =?us-ascii?Q?opYQcaPdqpaU2O3Ks5sJJgN5hAqVLfpWh91zommbeI2ZnCdiQkrpvK6d9a9O?= =?us-ascii?Q?MJdAAlYXDpHFnna/bSIAEkeGHJP2DSOlEdGSSmC48+/Gnjtp3LH7KNpP2hQa?= =?us-ascii?Q?mVdbZfbs6clrFO+2fDGmNWOUf5CwU0ymHV1aM7t0R8uifcddlaWwdATjFI7j?= =?us-ascii?Q?hj3uVLcvMm+YBwga8U+D1HMPcerk+mx1UE64d2d1sAXmTo8Pm1SjdKeFRi09?= =?us-ascii?Q?PPpfb0Iew2WUqCUPlhADv95hjKq1SfuhNyNPNGt93GyR0R2gbdd8Q6Cx936e?= =?us-ascii?Q?0/lJedVjKfJI1WO9DDl8FqsQLNSTRYF/8hYUmJtZtFdoL5JzhAgfiSBAm86H?= =?us-ascii?Q?XkalJ1OymP7uqgLoyVjwosV5v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ojiJoH3Ydg/8IkRbv3sFb3mZrRRk/Id5BPNBZcVfIoqTlXZUmnLNwvYWrPYVczW06iLd0fzWGMaE+M9D63coKn+3Wh3IMPmsbTDQY0M5PHUw8Q==;5:BXsR4kkgxDkmu/eRVYFHcdcxSlFLJUlLKj1I1FD4AewwJmGhBQfVkUY/re3SGJEezIKlQ5bX4hGotrcYyfLipfjU/sdGEQzMEIvNAc9QjInTMj9CnvzkwhwPv3klP2h3of8WSydfCu+VpQceA7zetg==;24:sghi4FD6S8z081lVV08V9QLz77+gDVAIcEbhxnM5vlTJ0kr6CA+KDE43rKfnWwoh0lB1rwpA2XmZ4u94kvNPSn+PCbNSzQAjgRk9qYdyC6A=;7:2xQvo7l7KYAnCB2NMy7m6qNjd+uTvVWVqGPXFSm/+QQciftV0dmFzKIOwHa4k5XHmsc5BEqJrXrXznFp8EDNSVbMyDii0tVeHyNBrNQVNK3yoffZOvCbvHVTJ5lh599waEgnMC98t3+u+RMj7Z6U10eKdck61RJ2GruObZkfMptqdWnM3Wl0M/FdgWi8Z2lYusofVZDA7OA7417c2uj19EiRnvEIfp86F+A/h9zboxc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2017 16:12:55.0231 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fbd909df-ea69-4788-a554-f24b7854ad03 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR11MB0841 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2750 Lines: 72 Signed-off-by: Ryan Lee --- Changelog: Added a control("EnvTrack Headroom") to set different headroom value for envelop tracking function. Added one more control for envelop tracking function enable/disable("EnvTrack Switch"). Removed writing process to register 0x0087 because it is read only register. sound/soc/codecs/max98927.c | 19 +++++++++++++++---- sound/soc/codecs/max98927.h | 4 ++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/max98927.c b/sound/soc/codecs/max98927.c index a1d3935..73c7a33 100644 --- a/sound/soc/codecs/max98927.c +++ b/sound/soc/codecs/max98927.c @@ -624,6 +624,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, @@ -641,6 +653,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[] = { @@ -744,10 +759,6 @@ static int max98927_probe(struct snd_soc_codec *codec) 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, MAX98927_R001E_PCM_TX_CH_SRC_A, diff --git a/sound/soc/codecs/max98927.h b/sound/soc/codecs/max98927.h index 9ea8397..98b5f17 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