Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581AbeAERKl (ORCPT + 1 other); Fri, 5 Jan 2018 12:10:41 -0500 Received: from mail-sn1nam02on0097.outbound.protection.outlook.com ([104.47.36.97]:55802 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752410AbeAERKj (ORCPT ); Fri, 5 Jan 2018 12:10:39 -0500 From: Ryan Lee To: Mark Brown CC: "lgirdwood@gmail.com" , "perex@perex.cz" , "tiwai@suse.com" , "arnd@arndb.de" , "afd@ti.com" , "robert.jarzmik@free.fr" , "supercraig0719@gmail.com" , "jbrunet@baylibre.com" , "dannenberg@ti.com" , "romain.perier@collabora.com" , "bryce.ferguson@rockwellcollins.com" , "kuninori.morimoto.gx@renesas.com" , "m-stecklein@ti.com" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "ryan.lee.maxim@gmail.com" Subject: RE: [V3 2/2] ASoC: max98373: Added Amplifier Driver Thread-Topic: [V3 2/2] ASoC: max98373: Added Amplifier Driver Thread-Index: AQHThMIwGuDhyppEZ0aZeZ+lJxx/U6Nj9TyAgAGRcaA= Date: Fri, 5 Jan 2018 17:10:35 +0000 Message-ID: References: <1515004757-22267-1-git-send-email-ryans.lee@maximintegrated.com> <20180104171345.GI10774@sirena.org.uk> In-Reply-To: <20180104171345.GI10774@sirena.org.uk> Accept-Language: en-US, ko-KR Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=RyanS.Lee@maximintegrated.com; x-originating-ip: [204.17.143.20] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR11MB0841;7:BxEcfSrUE4Q3TFbcRT3XY/CeFvzAJyQmmjLPHUosWkCANOWnnA7lIxWNRu4829vtpEzMuLHkc8TkoNrhUmcNnBWU3+0wpsaq9DbwjinAhyRlMXprNV1jhgVfRyqE6Qec+6nS/vVvdL+rQwE3b0glGaGyuO7hMdjiWncYijuG0SPeByJE5dfMsqiBG3eoc/rx+lWk4Ks4iCh9nU9/yKqpSr4U2sYaqzCBVDtDvdgiPRhpV7f8iCv8o+sdhjjfndQe x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 03e8040b-a1d7-46de-7e72-08d5545f3c4a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060);SRVR:CY1PR11MB0841; x-ms-traffictypediagnostic: CY1PR11MB0841: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(191636701735510)(31051911155226)(9452136761055)(108721460000369); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:CY1PR11MB0841;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:CY1PR11MB0841; x-forefront-prvs: 05437568AA x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(39380400002)(376002)(366004)(346002)(189003)(24454002)(13464003)(199004)(6116002)(3846002)(53936002)(305945005)(33656002)(7696005)(8676002)(14454004)(66066001)(9686003)(7416002)(74316002)(7736002)(72206003)(6916009)(97736004)(2900100001)(55016002)(8936002)(25786009)(2950100002)(68736007)(99286004)(76176011)(3280700002)(478600001)(39060400002)(54906003)(5660300001)(3660700001)(105586002)(106356001)(6436002)(6246003)(316002)(86362001)(81156014)(102836004)(2906002)(4326008)(81166006)(77096006)(229853002)(6506007)(15866825006);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR11MB0841;H:CY1PR11MB0841.namprd11.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; x-microsoft-antispam-message-info: N08I9QjvURJt4DgkUG0vcme/QV33wqMX+Q91JkP9Jm4wWXOpp+nXJBQDcv9E2VGtX+zGRa+Qu2WMfnuoDNlQWQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-Network-Message-Id: 03e8040b-a1d7-46de-7e72-08d5545f3c4a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2018 17:10:35.1996 (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 Return-Path: >-----Original Message----- >From: Mark Brown [mailto:broonie@kernel.org] >Sent: Thursday, January 4, 2018 9:14 AM >To: Ryan Lee >Cc: lgirdwood@gmail.com; perex@perex.cz; tiwai@suse.com; arnd@arndb.de; >afd@ti.com; robert.jarzmik@free.fr; supercraig0719@gmail.com; >jbrunet@baylibre.com; dannenberg@ti.com; romain.perier@collabora.com; >bryce.ferguson@rockwellcollins.com; kuninori.morimoto.gx@renesas.com; m- >stecklein@ti.com; alsa-devel@alsa-project.org; linux-kernel@vger.kernel.org; >ryan.lee.maxim@gmail.com >Subject: Re: [V3 2/2] ASoC: max98373: Added Amplifier Driver > >On Wed, Jan 03, 2018 at 10:39:17AM -0800, Ryan Lee wrote: > >This looks mostly good. There are a few smaller issues but I think at this point >it's most sensible to apply and fix those incrementally so I'll do that, please >follow up with patches fixing the remaining issues. Thank you. Let me follow up with patches fixing the remaining issues. > >> --- /dev/null >> +++ b/sound/soc/codecs/max98373.c >> @@ -0,0 +1,971 @@ >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +/* Copyright (c) 2017, Maxim Integrated */ > >SPDX headers are supposed to be C++ comments, please send a followup patch >fixing this. > >> +static int max98373_get_bclk_sel(int bclk) { >> + int i; >> + /* match BCLKs per LRCLK */ >> + for (i = 0; i < ARRAY_SIZE(bclk_sel_table); i++) { >> + if (bclk_sel_table[i] == bclk) >> + return i + 2; >> + } >> + return 0; >> +} >> +static int max98373_set_clock(struct snd_soc_codec *codec, > >Missing blank line between the functions. OK. Thanks. > >> + } >> + /* set DAI_SR to correct LRCLK frequency */ > >Another missing blank line. OK. Let me fix. > >> +static int max98373_dai_tdm_slot(struct snd_soc_dai *dai, >> + unsigned int tx_mask, unsigned int rx_mask, >> + int slots, int slot_width) >> +{ >> + struct snd_soc_codec *codec = dai->codec; >> + struct max98373_priv *max98373 = >snd_soc_codec_get_drvdata(codec); >> + int bsel = 0; >> + unsigned int chan_sz = 0; >> + unsigned int mask; >> + int x, slot_found; >> + >> + max98373->tdm_mode = true; > >This should really also support disabling TDM mode - if the parameters are all 0 >just turn TDM off. Again can be fixed in a followup. OK. Let me apply it. > >> +SOC_SINGLE_TLV("DHT Gain Min", MAX98373_R20D1_DHT_CFG, >> + MAX98373_DHT_SPK_GAIN_MIN_SHIFT, 9, 0, >> +max98373_dht_spkgain_min_tlv), SOC_SINGLE_TLV("DHT Rot Pnt", >MAX98373_R20D1_DHT_CFG, >> + MAX98373_DHT_ROT_PNT_SHIFT, 15, 0, >max98373_dht_rotation_point_tlv), >> +SOC_SINGLE_TLV("DHT Attack Step", MAX98373_R20D2_DHT_ATTACK_CFG, >> + MAX98373_DHT_ATTACK_STEP_SHIFT, 4, 0, >max98373_dht_step_size_tlv), >> +SOC_SINGLE_TLV("DHT Release Step", >MAX98373_R20D3_DHT_RELEASE_CFG, >> + MAX98373_DHT_RELEASE_STEP_SHIFT, 4, 0, >max98373_dht_step_size_tlv), > >You should add a Volume on the end of these control names so that userspace >knows how to display them properly; it's a little confusing as they're not >actually gains but it tends to work out better. Same for most of the other TLV >controls. OK. Thanks for your feedback.