Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751679AbdIOAaS (ORCPT ); Thu, 14 Sep 2017 20:30:18 -0400 Received: from mail-by2nam03on0124.outbound.protection.outlook.com ([104.47.42.124]:56592 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751516AbdIOAaQ (ORCPT ); Thu, 14 Sep 2017 20:30:16 -0400 From: Ryan Lee To: Mark Brown CC: "lgirdwood@gmail.com" , "perex@perex.cz" , "tiwai@suse.com" , "kuninori.morimoto.gx@renesas.com" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "ryan.lee.maxim@gmail.com" Subject: RE: [PATCH 1/3] ASoC: max98927: Added support for DSP_A and DSP_B format Thread-Topic: [PATCH 1/3] ASoC: max98927: Added support for DSP_A and DSP_B format Thread-Index: AQHTKxjU67KyBS/f6U2VnvD7xd71p6K0vkqAgABfGUA= Date: Fri, 15 Sep 2017 00:30:13 +0000 Message-ID: References: <1505146339-19380-1-git-send-email-ryans.lee@maximintegrated.com> <20170914184949.enuziddz27polfyf@sirena.org.uk> In-Reply-To: <20170914184949.enuziddz27polfyf@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;SN1PR11MB0813;6:hu6JYW905+kCqYnMiLpgbHEBKT3g9MytjvanGWR06I1VUCbRltIikjSaCLh2H76SPeII9u6/3hWuIj3UzNL0eL74whXF0E0Prx+i13ijVYBsl7ECKHe7f6FGI4jcFU6NWKVk2/k6X+LI96mL2+D/tQV79l/eLgBsUgLL8tq9hvfjI8u2HZ1EI63f6gVuAnkXPof8ue7g4Z4NJ/uwxmuqfawfjtJ8o98nE2MFJdAr7F6ldJAeMV2aG3Rns8JbxLCCxPpk9pMbHnSUArLwSXL1PvkHC0BfjT4dMpOuZH9cful+Q81+FB5v5XlmQ88UJwjm4AP17w5zcDyIZ3NiP1wlsw==;5:Qyjnomr/4UNWz/7OjkkrIqSxomr+AYnHVbq95WBGurTHoAGzF5xNuFUDk3zWV7+9cQ/2xYB6fjkBLdm00Ma2DvDAhnCWvVy9lrFSdIPxEAK8Gwh3xszWv5Vk7Febzofo6RwuF/EtAx9O2J4KDAheDN+khngbo2cXz3JAaBFSBK4=;24:N9lP4nnGrmZDwTkAG4bz0VH1ZU1LZK2VuGxpyiMgJYfkbJrL4hJQHGCXOELQ8+POlOf3wztXG1fbjnTSIOqOl0UrjKwwpr/CO8UiEGvgLec=;7:LnKUkto2Io0ZE38VxV90G/xEXXwR25MYryw9NsKfMIHo5Av/OmgPAKiHhL0eUzgjCeTEcHpUZlmA+zXBsbi+vcG/mp35RF6c3hIFY13AZfNcm0rUoHIySnlZnqiscpbE9mrLOVek5g33FmZgTO2N6yllIS3oUdTwMvHT9Lr08wlYvhS+A2WesY0nk79bEsMQl7geuMkm2B7PdBCwX1WFSVWQn7XQpLMDjpgO8sx/kJ8= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 761801ea-eb45-4dc9-3673-08d4fbd0ee23 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:SN1PR11MB0813; x-ms-traffictypediagnostic: SN1PR11MB0813: x-exchange-antispam-report-test: UriScan:(9452136761055)(108721460000369)(17755550239193); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR11MB0813;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR11MB0813; x-forefront-prvs: 0431F981D8 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(376002)(346002)(24454002)(189002)(199003)(377454003)(54534003)(13464003)(316002)(7696004)(25786009)(3280700002)(2900100001)(189998001)(6916009)(54356999)(33656002)(77096006)(50986999)(5660300001)(86362001)(229853002)(2906002)(2950100002)(68736007)(105586002)(106356001)(76176999)(8936002)(6506006)(6436002)(6246003)(101416001)(72206003)(478600001)(97736004)(7736002)(81156014)(3846002)(81166006)(53936002)(102836003)(8676002)(66066001)(110136004)(54906002)(4326008)(14454004)(9686003)(99286003)(74316002)(6116002)(55016002)(305945005)(39060400002)(3660700001);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR11MB0813;H:SN1PR11MB0847.namprd11.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: maximintegrated.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2017 00:30:13.1355 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fbd909df-ea69-4788-a554-f24b7854ad03 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR11MB0813 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v8F0UNqk015267 Content-Length: 2184 Lines: 46 >-----Original Message----- >From: Mark Brown [mailto:broonie@kernel.org] >Sent: Thursday, September 14, 2017 11:50 AM >To: Ryan Lee >Cc: lgirdwood@gmail.com; perex@perex.cz; tiwai@suse.com; >kuninori.morimoto.gx@renesas.com; alsa-devel@alsa-project.org; linux- >kernel@vger.kernel.org; ryan.lee.maxim@gmail.com >Subject: Re: [PATCH 1/3] ASoC: max98927: Added support for DSP_A and >DSP_B format > >On Mon, Sep 11, 2017 at 09:12:18AM -0700, Ryan Lee wrote: >> Signed-off-by: Ryan Lee >> --- > >Please make an effort to write changelogs that clearly describe the change >you're making. This is doing way more than just implementing DSP mode, it's >also adding a fairly complicated set_tdm_slot() implementation which isn't >mentioned at all. It probably needs splitting into multiple patches as well. I split this patch as two separated patches and sent again. One is about adding DSP_A, DSP_B support. Another is about TDM slot configuration. I added more changelog inside. > >> @@ -414,6 +504,9 @@ static int max98927_dac_event(struct >snd_soc_dapm_widget *w, >> struct max98927_priv *max98927 = >snd_soc_codec_get_drvdata(codec); >> >> switch (event) { >> + case SND_SOC_DAPM_PRE_PMU: >> + max98927->tdm_mode = 0; >> + break; >> case SND_SOC_DAPM_POST_PMU: >> regmap_update_bits(max98927->regmap, >> MAX98927_R003A_AMP_EN, > >Why is an event associated with the DAC changing something related to the DAI >format? These things should be unrelated. In TDM mode, BCLK is being configured inside 'max98927_dai_tdm_slot' because TDM slot information(number of slots, slot width) is available in there. In normal case, BCLK is being configured when 'hw_params' is called and TDM slot information is not available in this function. So I added 'tdm_mode' variable to avoid overwrite BCLK configuration when 'hw_params' function is called after TDM slot configuration is done. I wanted to clear this variable once playback is over so I added clear function when DAPM event is received. I referred some codec driver change TDM related things when DAC event is received after TDM slot configuration is done.