From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre-Louis Bossart Subject: Re: [RFC PATCH] ASoC: pcm512x: Implement the set_bclk_ratio interface Date: Tue, 15 Jan 2019 08:56:01 -0600 Message-ID: <5236394a-2d46-e4e2-5c1b-14ed396a8b67@linux.intel.com> References: <900a4f74-9312-58d8-a5b3-035305fe184e@gmail.com> <4b8ce92c-9239-3a8a-f061-eb114050bd3a@axentia.se> <7486f4cb-10c9-26ce-83d8-cb346e33e379@linux.intel.com> <0a5918e1-aaf1-2b22-0f2a-4aaa62d1cd3e@axentia.se> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id D5B242667E7 for ; Tue, 15 Jan 2019 15:56:05 +0100 (CET) In-Reply-To: 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: Dimitris Papavasiliou , Peter Rosin Cc: "alsa-devel@alsa-project.org" , Mark Brown , Takashi Iwai , Kuninori Morimoto , Liam Girdwood List-Id: alsa-devel@alsa-project.org On 1/15/19 6:19 AM, Dimitris Papavasiliou wrote: > On Tue, Jan 15, 2019 at 10:08 AM Peter Rosin wrote: >> On 2019-01-14 18:36, Pierre-Louis Bossart wrote: >>>> 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. >> Disallowing anything but powers of two just because 50 doesn't work seems >> pretty wild. According to docs I think 48 should work just fine. >> >> Section 8.3.2 Audio Data Interface page 16. >> http://www.ti.com/lit/ds/symlink/pcm5142.pdf >> >> Or? > According to the datasheet[1], you can program any divider between 1 > and 256, via register 33 (page 80), but, as Peter points out, in the > description of the audio data interface (page 15), only the values 32, > 48, 64, 128, 256 are mentioned as permissible. So one approach would > be to restrict the values accepted by the callback to this set. Since > the datasheet is not terribly clear on whether only these are allowed, > and since the ratio is set explicitly in the machine driver, it could > be argued that it would be preferable to allow all values that can be > set in the register, to minimize the risk of needlessly rejecting > valid configurations. > > [1] http://www.ti.com/lit/ds/symlink/pcm5121.pdf I meant multiple of 16, sorry. multiples of 25/50 commonly used with other codecs will not work.