Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp196093pxb; Thu, 12 Nov 2020 01:03:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPueC2kku1EOlTq6/Zne4ovxrD3DpUfPYI59yTc+fV1KzI46RjtMq5C2OIToKbUm44icoP X-Received: by 2002:aa7:ce8d:: with SMTP id y13mr4203580edv.65.1605171783480; Thu, 12 Nov 2020 01:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605171783; cv=none; d=google.com; s=arc-20160816; b=MSJiMsWK0WlI3ewp9ug4wAPjAi8/tcnHl2uUK+OKwWplYsGugKIqFJORwldRX0xWfM IcJuVY6zy34oP+NA7sJDtc9Gi609J0pYbWSgA5MQrvTgM78YxvE72vpmS5pPuZ9S8DSX DAVkUHuraiLJRETWzYCfTCWwIFUnvU8Q2Jy1sEp3cws5zvrchkumc9adR/GqpbWoDpQS agLWOexjSoqRRKhXe1eZPDrKoJyfFo9hNsk9YyzULMy6EqGOw6qHKAtSrJ5L1Uazya6q pEVCjNF1GvZlvjKpDKcGPvjZvZfDqwHGHVaanSCijd/UmUkBkdeO5CBnf76/Epr0Cjt6 Q2gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=UmSY0edIf57Yap12ihdDOUqAqI05HX2cAZc82RxQrXk=; b=d+JsVS9yzzli77sQ3OSL2UolvZO8iM1J1g13GIdxHK009QfdiRUnKknfPBweepPiUJ zcKMJ3jDJ/wCMmxxOXUWf2mFJd6edSSlLGdrLbhfo9LguQSPDTM4ow2Mroaf8RUPXUUD kknyBXu6kByQhVUwatpDy6F/U35IXok5zfio2LFGwLQqyNRu4aMcY48plKr9dNbfWW/T AueAqFT/Jpb70Wm3IpyVJEumM+Ne3sNuuoD5/zLcuezCDC7i6kCL+aM645hTNr+u+LH3 9yzTDLR1Wtf7tK//QgynHx4IzBku4RG2sVzTvvdS3JMT31ZxR5cak621DBroLUe46AKu Y6dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=msUEzors; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gh13si3231739ejb.108.2020.11.12.01.02.36; Thu, 12 Nov 2020 01:03:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=msUEzors; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727274AbgKLI7g (ORCPT + 99 others); Thu, 12 Nov 2020 03:59:36 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:51572 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbgKLI7g (ORCPT ); Thu, 12 Nov 2020 03:59:36 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0AC8wLtO120801; Thu, 12 Nov 2020 02:58:21 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1605171501; bh=UmSY0edIf57Yap12ihdDOUqAqI05HX2cAZc82RxQrXk=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=msUEzorsyk84ZK/LOeX29FtcG5Xk9UIHfWWUpKlVqM8GumH10EMxUNv/E1TYh70Dr aOll4/ApPVGZiVIlCu6kBuVm139LOesTK/z+zWom/zuyY6eJNPuz0/5IeaAx14cDo3 UJeg2SjBSg/vn2F1jryUC6OeV/RX0us8fdx/hFXw= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0AC8wL1U090221 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Nov 2020 02:58:21 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 12 Nov 2020 02:58:21 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 12 Nov 2020 02:58:20 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0AC8wIj8011893; Thu, 12 Nov 2020 02:58:19 -0600 Subject: Re: [PATCH] ASoC: pcm512x: Add support for data formats RJ and LJ To: Kirill Marinushkin CC: Mark Brown , Takashi Iwai , Liam Girdwood , Matthias Reichl , Kuninori Morimoto , , References: <20201109212133.25869-1-kmarinushkin@birdec.com> <690508c7-7029-6781-a1a2-0609e37cb9e6@ti.com> <6e14cdc3-2d45-d7bc-14eb-30c6ea568078@birdec.com> From: Peter Ujfalusi Message-ID: <43973577-f719-b414-395c-91a4e1a3b460@ti.com> Date: Thu, 12 Nov 2020 10:59:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.2 MIME-Version: 1.0 In-Reply-To: <6e14cdc3-2d45-d7bc-14eb-30c6ea568078@birdec.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kirill, On 12/11/2020 9.57, Kirill Marinushkin wrote: >> The set_fmt callback is there to set the bus format, it has nothing to >> do (in most cases) with the sample format (hw_params). Bus coding, clock >> source has nothing to do with hw_params. >> >> When you bind a link you will use set_fmt for the two sides to see if >> they can agree, that both can support what has been asked. >> >> The pcm512x driver just saves the fmt and say back to that card: >> whatever, I'm fine with it. But runtime during hw_params it can fail due >> to unsupported bus format, which it actually acked to be ok. >> >> This is the difference. >> >> Sure, some device have constraint based on the fmt towards the hw_params >> and it is perfectly OK to do such a checks and rejections or build >> rules/constraints based on fmt, but failing hw_params just because >> set_fmt did not checked that the bus format is not even supported is not >> a nice thing to do. > > Those are good arguments > >>> Would you agree? >> >> I don't have a device to test, I'm just trying to point out what is the >> right thing to do. > > I have a device to test. I will move format checks into `pcm512x_set_fmt()`, > ensure that it works properly, and submit as patch v3. Thank you. I know it is slightly more work. When you send v3 please do not use --in-reply-to, let it be itself. Regards, - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki