From patchwork Tue Dec 4 08:21:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10711485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F21C6417B for ; Tue, 4 Dec 2018 10:47:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E31D72AB15 for ; Tue, 4 Dec 2018 10:47:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D76A02AB8F; Tue, 4 Dec 2018 10:47:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 386AD2AB15 for ; Tue, 4 Dec 2018 10:47:48 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E67DE267B5F; Tue, 4 Dec 2018 09:21:07 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id F390A267B68; Tue, 4 Dec 2018 09:21:05 +0100 (CET) Received: from JPN01-OS2-obe.outbound.protection.outlook.com (mail-eopbgr1410113.outbound.protection.outlook.com [40.107.141.113]) by alsa0.perex.cz (Postfix) with ESMTP id 86353267B59 for ; Tue, 4 Dec 2018 09:21:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iAw0R6E1DQkokQ3ALTuIV4l/d2Bc4Ok8nEIoOJLl54Q=; b=KYimjdUf2kqmkklP+TXYM1eTtxRaQIxLmHTIMOvEUi7wmGgtbGEaCY5aBk+j9RACgGiYKK133LQXeWEjrFJFd5uKNcC6k/erFjiDrpl3CC0UCSIPW/ANDO2FqsXV5jAM1dSJbYg8IcPGnpVkkXhgM41zcq+xz3dmSwFl/wQLu/I= Received: from TYAPR01MB3661.jpnprd01.prod.outlook.com (20.178.137.210) by TYAPR01MB4255.jpnprd01.prod.outlook.com (20.178.140.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Tue, 4 Dec 2018 08:21:01 +0000 Received: from TYAPR01MB3661.jpnprd01.prod.outlook.com ([fe80::70b6:5ef2:3f71:77c7]) by TYAPR01MB3661.jpnprd01.prod.outlook.com ([fe80::70b6:5ef2:3f71:77c7%4]) with mapi id 15.20.1382.020; Tue, 4 Dec 2018 08:21:00 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 5/7] ASoC: simple-scu-card: tidyup "convert-rate/channels" parsing Thread-Index: AQHUi6pKchue/zNlXEG2Ncd6W2zTbw== Date: Tue, 4 Dec 2018 08:21:00 +0000 Message-ID: <877egp3e4z.wl-kuninori.morimoto.gx@renesas.com> References: <87efax3e85.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87efax3e85.wl-kuninori.morimoto.gx@renesas.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TY2PR04CA0021.apcprd04.prod.outlook.com (2603:1096:404:f6::33) To TYAPR01MB3661.jpnprd01.prod.outlook.com (2603:1096:404:c1::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [211.11.155.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TYAPR01MB4255; 20:24FTI2ltapcsA4jEje5ogfjJQ2sadzoEcf7iNz1NHDhs2ibwdClAC68rD6rVXerdM0dSVEByU3djXgj4VDQoWXd6fjN5SA3pyiN08n3DKFPUU5pbW9UDm9nq44QASMKj3Ho1I/W5bnMcB809Sh1RD6WCh14T5g898+cAzYkjvDs= x-ms-office365-filtering-correlation-id: 82aace04-b9fe-4094-89c6-08d659c16c8a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB4255; x-ms-traffictypediagnostic: TYAPR01MB4255: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231455)(999002)(944501493)(52105112)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB4255; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB4255; x-forefront-prvs: 0876988AF0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(39860400002)(376002)(346002)(396003)(366004)(189003)(199004)(81156014)(8676002)(486006)(8936002)(81166006)(99286004)(2906002)(3846002)(256004)(11346002)(6116002)(71200400001)(446003)(476003)(71190400001)(86362001)(25786009)(2616005)(68736007)(53936002)(36756003)(478600001)(4326008)(5660300001)(305945005)(14454004)(7736002)(97736004)(26005)(6506007)(102836004)(76176011)(186003)(386003)(6436002)(6512007)(105586002)(6486002)(52116002)(106356001)(6916009)(66066001)(316002); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB4255; H:TYAPR01MB3661.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 0OpsU+MMWREjC/9WLORMV71Yrdo3Mld1WuViJ1sWrTmrL7OSVkwu6w8rffAGl6IM2Vjg7XC8M3u4QvD4Ei32WW3Qa1QvV0NSYVi6qOJtbSvcf67Wzurk2qxtV6sdhTm5ioU6GmHz6/72cZYAQjFIVvT+Y4XX40eWXbJRAkGi3vBYtyz1JSksefFqT7gGE+QmHHH0wZTuySq9XKlUoBzceoW+43sT53P6OYC7E6n/dCXI894JW7ZncGw8gCCEIPkuVE2TS6DPwo40afwxzZhMotf+diHCF1VSQcLedf2vMugWp+lYtpraCKVALO7Tc5lrCpm/18Lq9sMrtOw9DAayaeafzeFhR7WEZ5J74sCDwQw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <669933256909A44685B3267FFE151C38@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82aace04-b9fe-4094-89c6-08d659c16c8a X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2018 08:21:00.7525 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB4255 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 5/7] ASoC: simple-scu-card: tidyup "convert-rate/channels" parsing X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto simple-scu-card.c is supporting "convert-rate/channels" which is used for DPCM. But, sound card might have multi codecs, and each codec might need each convert-rate/channels. This patch supports each codec's convert-rate/channles support. top node convert-rate/channels will overwrite settings if exist. It can't support each codec's convert-rate/channels if sound card had multi codecs without this patch. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-scu-card.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c index 1c6382f..3c4e289 100644 --- a/sound/soc/generic/simple-scu-card.c +++ b/sound/soc/generic/simple-scu-card.c @@ -26,6 +26,7 @@ struct simple_card_data { struct asoc_simple_dai dai; struct snd_soc_dai_link_component codecs; struct snd_soc_dai_link_component platform; + struct asoc_simple_card_data adata; } *dai_props; struct snd_soc_dai_link *dai_link; struct asoc_simple_card_data adata; @@ -86,7 +87,11 @@ static int asoc_simple_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card); + struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num); + asoc_simple_card_convert_fixup(&dai_props->adata, params); + + /* overwrite by top level adata if exist */ asoc_simple_card_convert_fixup(&priv->adata, params); return 0; @@ -177,6 +182,8 @@ static int asoc_simple_card_dai_link_of(struct device_node *link, "prefix"); } + asoc_simple_card_parse_convert(dev, link, prefix, &dai_props->adata); + ret = asoc_simple_card_of_parse_tdm(np, &dai_props->dai); if (ret) return ret;