From patchwork Tue Dec 11 03:25:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10723029 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 85A6E18A7 for ; Tue, 11 Dec 2018 04:42:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7622F2A81E for ; Tue, 11 Dec 2018 04:42:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AF932A835; Tue, 11 Dec 2018 04:42:53 +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 F3F422A827 for ; Tue, 11 Dec 2018 04:42:50 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9B97B267B4D; Tue, 11 Dec 2018 04:25:26 +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 BE9C7267B6A; Tue, 11 Dec 2018 04:25:24 +0100 (CET) Received: from JPN01-TY1-obe.outbound.protection.outlook.com (mail-eopbgr1400105.outbound.protection.outlook.com [40.107.140.105]) by alsa0.perex.cz (Postfix) with ESMTP id DB548267B4D for ; Tue, 11 Dec 2018 04:25:21 +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=WTfbCEBgFf7k8lhQYj8rOWWbc/AHwVdoX8MR6RPmLeXM+qYg4QbSGB54O+ObXvswxQ1fpl/1Brj84WDON8BrRoMuYgdefLCI1CwnvgSddMypDyb7Wf34kyzAueJjlTLXOnJ1hYzyJQBzSng0B66w45hXW8lOO5cb8Pi7NvZ+WyQ= Received: from TYAPR01MB3661.jpnprd01.prod.outlook.com (20.178.137.210) by TYAPR01MB2592.jpnprd01.prod.outlook.com (20.177.102.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Tue, 11 Dec 2018 03:25:18 +0000 Received: from TYAPR01MB3661.jpnprd01.prod.outlook.com ([fe80::939:87f0:3329:af2f]) by TYAPR01MB3661.jpnprd01.prod.outlook.com ([fe80::939:87f0:3329:af2f%4]) with mapi id 15.20.1404.026; Tue, 11 Dec 2018 03:25:18 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 3/5] ASoC: simple-scu-card: tidyup "convert-rate/channels" parsing Thread-Index: AQHUkQEjaPIDA/ea00OcFxV/ghZIlg== Date: Tue, 11 Dec 2018 03:25:18 +0000 Message-ID: <877eggbvov.wl-kuninori.morimoto.gx@renesas.com> References: <87bm5sbvq6.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87bm5sbvq6.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: TY2PR06CA0024.apcprd06.prod.outlook.com (2603:1096:404:42::36) 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; TYAPR01MB2592; 20:ruv1165vsIl0q9AQs9MoaLoBYkOQNJdQf9tH4IM+P5UM9oQDzrzOBp7VbYQtYGzVmLBLGaR3v36rAQDAJp+q3p8/1KSZ2+HoM6F6lAZS8yFZ1Ai/vAUkrgHox5lAV3mc42si9SQAhSM5lP7E294r6Mkj6D3s2pAmNh3UksF8Rf0= x-ms-office365-filtering-correlation-id: 00c76282-9756-45be-f941-08d65f184661 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:TYAPR01MB2592; x-ms-traffictypediagnostic: TYAPR01MB2592: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230017)(999002)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231472)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB2592; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB2592; x-forefront-prvs: 08831F51DC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(136003)(346002)(39860400002)(396003)(376002)(189003)(199004)(68736007)(81166006)(6116002)(3846002)(105586002)(25786009)(81156014)(4326008)(8676002)(106356001)(2616005)(486006)(476003)(8936002)(256004)(6512007)(102836004)(76176011)(53936002)(6506007)(36756003)(71190400001)(71200400001)(6916009)(386003)(26005)(86362001)(52116002)(478600001)(99286004)(66066001)(2906002)(316002)(14454004)(7736002)(305945005)(97736004)(446003)(6436002)(186003)(11346002)(5660300001)(6486002); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB2592; 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: macLCF6SlpBTHYMr1H8HMkFocwIiuUhg0FbB+YzmtJO/ySCRhUH4zzLV1GZ0I1fQzCyM40oJSfCkROZDhFHg2NAZE9BWr63d/iEkKhVjVoYpcb2a10hihDKw8erBrJwmDtErarVm2kMrLUWLMuNeItn3PgmLxnZbTlBTMqjP6LdANuWONqvD+AqT2KdvRvWwwPxTsQpRw5BqdoEZzbqjqkmQ0kGPhe35vJe60NQC0sPtHcxtuJHWoJXOjfcypdj8F1a/CbhTxtqim6ATAOL8ebtd1OqeFyf4auPTtsCjI0uNLN0tY/GukOgN7nZmdEp3 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <22EA344CACF63242B43D08E42F182B0F@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00c76282-9756-45be-f941-08d65f184661 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2018 03:25:18.5433 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB2592 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 3/5] 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;