From patchwork Wed Dec 5 01:32:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10712883 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 5F7411057 for ; Wed, 5 Dec 2018 01:32:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ABD42C497 for ; Wed, 5 Dec 2018 01:32:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DE912C4CC; Wed, 5 Dec 2018 01:32:30 +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 86E282C497 for ; Wed, 5 Dec 2018 01:32:29 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 38131267BD2; Wed, 5 Dec 2018 02:32:28 +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 C41A3267BD4; Wed, 5 Dec 2018 02:32:17 +0100 (CET) Received: from JPN01-OS2-obe.outbound.protection.outlook.com (mail-eopbgr1410139.outbound.protection.outlook.com [40.107.141.139]) by alsa0.perex.cz (Postfix) with ESMTP id E78B6267BDB for ; Wed, 5 Dec 2018 02:32:12 +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=Wynd3k4OUgqnWoVJ5NtlfD0Ybkk8E435xBAxGP2EEpQ=; b=VoQ5+3Mvvs9dFnXFgDOIe3wh9bOTdL5i+WpJS26mPlhjw8yNroixU5SdIxMse+wvc4xuKpWOoJNTlVTFtOXZdsawI4NKIfksie25buzD2XYSyFEQGE57Xy2yR68zqTYbvFA+6MJA5Qzq84SMVhmkNjn05Sp2k3Y5LAdVOtJ8yYc= Received: from TYAPR01MB3661.jpnprd01.prod.outlook.com (20.178.137.210) by TYAPR01MB4318.jpnprd01.prod.outlook.com (20.179.173.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.18; Wed, 5 Dec 2018 01:32:10 +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.023; Wed, 5 Dec 2018 01:32:10 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 4/6] ASoC: audio-graph-card: tidyup convert_rate/channel method Thread-Index: AQHUjDpXgcCCjwAX50SHJH5JCcJfSQ== Date: Wed, 5 Dec 2018 01:32:10 +0000 Message-ID: <87va48daxz.wl-kuninori.morimoto.gx@renesas.com> References: <871s6wepmp.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <871s6wepmp.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: TYAPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:404:28::34) 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; TYAPR01MB4318; 20:cfdrJzsVm8LEVkvC6e3/5ZnKZ/d95tMjcca/5rhH03rA80b9njmpOIz8NkVv6TYYETXmpzrbYswMW4z+yi/DjRTuetaQ/EUxfphxWNcFSGxcf/N4xVnW5b2/WYdwZ0ow7+YA5LmhDr/KEhFcgu5oxz0n/dqfSdYDbfVXclbIK2E= x-ms-office365-filtering-correlation-id: 6bdad725-fd15-433c-33c9-08d65a5179df x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB4318; x-ms-traffictypediagnostic: TYAPR01MB4318: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231455)(999002)(944501519)(52105112)(93006095)(93001095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB4318; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB4318; x-forefront-prvs: 08770259B4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(396003)(39860400002)(366004)(136003)(346002)(189003)(199004)(7736002)(6916009)(36756003)(102836004)(6506007)(386003)(86362001)(186003)(305945005)(5660300001)(26005)(97736004)(316002)(14454004)(478600001)(4326008)(66066001)(68736007)(476003)(2616005)(11346002)(446003)(486006)(256004)(25786009)(99286004)(106356001)(105586002)(76176011)(52116002)(53936002)(8936002)(6512007)(71200400001)(71190400001)(81166006)(81156014)(8676002)(2906002)(6486002)(6436002)(6116002)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB4318; 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: OdvWlCHJs4qBLtXxKHoK9u7uFBnf0hw8ZWZeay5McY8q2gG2ae1sf2c8qcTIAbbtjDNZtk9fv0NUCx5aZGEGp0gvEHsfUZf37Yo8U/FD40ypa8ytlpT1HbMFQoLr11bOP+y+KyFav9VtSzA8IvHfdOfmZeh1MMg5j6GGDtq8mhGOpGssYv0atEFi+HS9b/2xYlpD1Lzox1YJxAwuZ86sMCZmrm7TOQ1La743wrWRErWt+4DmV6muAV/5Uk/Pm4IZZGMj+4xKwIy7oCtNWDv5bqkTEu7aor19uM6gBJYwbYM4YuvW11QOSmzCiB37rCjNq5PgQRe6a6yF3WueL8Gk9hVH1FsIyKl4f2+iRMka8Zo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <03CAF1A9BCB16F448A22B1F34D1241A9@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bdad725-fd15-433c-33c9-08d65a5179df X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2018 01:32:10.5747 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB4318 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 4/6] ASoC: audio-graph-card: tidyup convert_rate/channel method 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 Current audio-graph-card is handling "convert_rate/channel" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch support it. It will be overwrote if lower node has it. sound { convert-channels = ; // initial }; codec { audio-graph-card,convert-channels = ; // overwrite ports { convert_channels = ; // overwrite port { convert_channels = ; // overwrite endpoint { convert_channels = ; // overwrite }; }; }; }; Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index efa6be6..24f1a72 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -35,7 +35,6 @@ struct graph_card_data { struct asoc_simple_jack mic_jack; struct snd_soc_dai_link *dai_link; struct asoc_simple_dai *dais; - struct asoc_simple_card_data adata; struct snd_soc_codec_conf *codec_conf; struct gpio_desc *pa_gpio; }; @@ -167,9 +166,6 @@ static int asoc_graph_card_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, 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; } @@ -197,6 +193,13 @@ static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top, of_property_read_u32(ports, "mclk-fs", &dai_props->mclk_fs); of_property_read_u32(port, "mclk-fs", &dai_props->mclk_fs); of_property_read_u32(ep, "mclk-fs", &dai_props->mclk_fs); + + asoc_simple_card_parse_convert(dev, top, NULL, &dai_props->adata); + asoc_simple_card_parse_convert(dev, node, PREFIX, &dai_props->adata); + asoc_simple_card_parse_convert(dev, ports, NULL, &dai_props->adata); + asoc_simple_card_parse_convert(dev, port, NULL, &dai_props->adata); + asoc_simple_card_parse_convert(dev, ep, NULL, &dai_props->adata); + of_node_put(ports); of_node_put(port); @@ -276,8 +279,6 @@ static int asoc_graph_card_dai_link_of_dpcm(struct device_node *top, PREFIX "prefix"); } - asoc_simple_card_parse_convert(dev, node, PREFIX, &dai_props->adata); - ret = asoc_simple_card_of_parse_tdm(ep, dai); if (ret) return ret; @@ -409,8 +410,6 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) if (ret < 0) return ret; - asoc_simple_card_parse_convert(dev, node, NULL, &priv->adata); - link_idx = 0; dai_idx = 0; conf_idx = 0;