From patchwork Thu Apr 22 01:52:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 12217311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEBB3C433ED for ; Thu, 22 Apr 2021 01:54:05 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06D3A61405 for ; Thu, 22 Apr 2021 01:54:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06D3A61405 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5C435950; Thu, 22 Apr 2021 03:53:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5C435950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1619056441; bh=RtzEtfafKe52gQbujk0Kro6/2baKjJgsg9a3s6jIMvw=; h=Date:From:Subject:To:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=qJd/0Y2IxhegZzBqcPWoQaJSQSoWXfq7a1C1ElS9bzCYeOWyAMvzS8F9xm+obdtGv OMS40htgA9IJJrjNRzbcu5H/R2QFxqPTBSw72CDG1eift2jcav0NWiyKsZMbKtK63+ yJ/5lTderJr32QFKCcv2TmLbKWiTmK6769IvgjUo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BB467F80168; Thu, 22 Apr 2021 03:53:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D9ECEF80253; Thu, 22 Apr 2021 03:53:08 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 1B903F800AE for ; Thu, 22 Apr 2021 03:53:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1B903F800AE Date: 22 Apr 2021 10:52:57 +0900 X-IronPort-AV: E=Sophos;i="5.82,241,1613401200"; d="scan'208";a="78840139" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 22 Apr 2021 10:52:57 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 621A241728D6; Thu, 22 Apr 2021 10:52:57 +0900 (JST) Message-ID: <871rb3hypy.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 0/7] ASoC: adds new .get_fmt support User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Hi Mark These are a little bit challenging patch-set. We need to set dai_link->dai_fmt to select CPU/Codec settings, and it is selected by Sound Card Driver, today. Because of it, Sound Card user need to know both CPU / Codec available dai_fmt, and needs to select it. For example simple-card / audio-graph case, it is selected by "format" and "bitclock/frame-master/inversion" on DT. But, it can be automatically selected if both CPU and Codec drivers indicate it to ALSA SoC Framework, somehow. If we can use it, Sound Card Driver user no longer need to select it, and I want to use this style on new audio-graph-card2. This patch-set adds new .get_fmt callback which indicate available dai_fmt to ALSA SoC Framework. Of course Sound Card Driver can still select dai_link->dai_fmt, same as before. If Sound Card Driver didn't set it, and if both CPU / Codec had .get_fmt callback, dai_link->dai_fmt will be automatically selected. Kuninori Morimoto (7): ASoC: soc-core: move snd_soc_runtime_set_dai_fmt() to upside ASoC: soc-core: add snd_soc_runtime_get_dai_fmt() ASoC: ak4613: add .get_fmt support ASoC: pcm3168a: add .get_fmt support ASoC: rsnd: add .get_fmt support ASoC: fsi: add .get_fmt support ASoC: hdmi-codec: add .get_fmt support include/sound/soc-dai.h | 35 ++++++ sound/soc/codecs/ak4613.c | 10 ++ sound/soc/codecs/hdmi-codec.c | 19 ++++ sound/soc/codecs/pcm3168a.c | 13 +++ sound/soc/sh/fsi.c | 13 +++ sound/soc/sh/rcar/core.c | 16 +++ sound/soc/soc-core.c | 195 +++++++++++++++++++++++----------- sound/soc/soc-dai.c | 19 ++++ sound/soc/soc-utils.c | 26 +++++ 9 files changed, 284 insertions(+), 62 deletions(-)