From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935386AbeAOOuu (ORCPT + 1 other); Mon, 15 Jan 2018 09:50:50 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:11485 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934569AbeAOOur (ORCPT ); Mon, 15 Jan 2018 09:50:47 -0500 Subject: Re: [PATCH 4/4] ASoC: codecs: tas5720: add TAS5722 TDM slot width setting support To: Mark Brown CC: Liam Girdwood , Rob Herring , Mark Rutland , , , References: <20171211190157.12371-1-afd@ti.com> <20171211190157.12371-4-afd@ti.com> <20171212120232.GI16323@sirena.org.uk> From: "Andrew F. Davis" Message-ID: <5111739c-df33-6a75-5ccf-2a2dc79f015d@ti.com> Date: Mon, 15 Jan 2018 08:50:38 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171212120232.GI16323@sirena.org.uk> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 12/12/2017 06:02 AM, Mark Brown wrote: > On Mon, Dec 11, 2017 at 01:01:57PM -0600, Andrew F. Davis wrote: > >> + /* Configure TDM slot width. This is only applicable to TAS5722. */ >> + if (tas5720->devtype == TAS5722) { >> + ret = snd_soc_update_bits(codec, TAS5722_DIGITAL_CTRL2_REG, >> + TAS5722_TDM_SLOT_16B, >> + slot_width == 16 ? >> + TAS5722_TDM_SLOT_16B : 0); >> + if (ret < 0) >> + goto error_snd_soc_update_bits; >> + } > > Use a switch statement, that way additional variants can be handled more > sensibly. > Will fix.