From: Pierre-Louis Bossart Subject: Re: [RFC PATCH] ASoC: pcm512x: Implement the set_bclk_ratio interface Date: Mon, 14 Jan 2019 11:36:19 -0600 Message-ID: <7486f4cb-10c9-26ce-83d8-cb346e33e379@linux.intel.com> References: <900a4f74-9312-58d8-a5b3-035305fe184e@gmail.com> <4b8ce92c-9239-3a8a-f061-eb114050bd3a@axentia.se> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 270EF2667E7 for ; Mon, 14 Jan 2019 18:36:21 +0100 (CET) In-Reply-To: <4b8ce92c-9239-3a8a-f061-eb114050bd3a@axentia.se> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Peter Rosin , Dimitris Papavasiliou , "alsa-devel@alsa-project.org" Cc: Mark Brown , Takashi Iwai , Kuninori Morimoto , Liam Girdwood List-Id: alsa-devel@alsa-project.org >> >> mck_rate = sck_rate; >> } else { >> @@ -1383,6 +1389,16 @@ static int pcm512x_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) >> return 0; >> } >> >> +static int pcm512x_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) >> +{ >> + struct snd_soc_component *component = dai->component; >> + struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component); >> + >> + pcm512x->bclk_ratio = ratio; > You should perhaps check if (ratio >= 1 && ratio <= 256) prior to > accepting a divider that can't be programmed? But maybe that's enforced > somewhere else? And perhaps the sanity check should be even stricter? Yes it should be stricter with a power of two only. I tried really hard to make this codec work with ratios of 50 (and a 19.2 MHz mclk) on an Up board and it's just not possible, probably not supported by hardware.