From patchwork Wed Nov 21 02:10:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10691549 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 4500213AD for ; Wed, 21 Nov 2018 02:11:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA2D2B1E3 for ; Wed, 21 Nov 2018 02:11:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23F452B1E5; Wed, 21 Nov 2018 02:11:02 +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 7533F2B1E3 for ; Wed, 21 Nov 2018 02:11:01 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 423EF267947; Wed, 21 Nov 2018 03:11:00 +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 44B3526796A; Wed, 21 Nov 2018 03:10:58 +0100 (CET) Received: from JPN01-TY1-obe.outbound.protection.outlook.com (mail-eopbgr1400109.outbound.protection.outlook.com [40.107.140.109]) by alsa0.perex.cz (Postfix) with ESMTP id D6CED267936 for ; Wed, 21 Nov 2018 03:10:55 +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=Mtgug2WzRaT8k7jXReh/z55yH/Ahi84AyRAi1nXNuCY=; b=M0Qof4nGVQQ/0qoOAEyjonVAzEdknS3sOXEIVV//KKmKVg7lRo5x0rOesJi5/WxorMASFWdoVih7W+hTCxx2IXJvJFFpBZ0FTcF60YWYP64n2Vt4e6PI8mehXHit65MTJwWJm9eb3nxWAoywiEPZlu7PP1PBM1pDV8pKl+O8leo= Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com (20.178.136.81) by TYAPR01MB3936.jpnprd01.prod.outlook.com (20.178.139.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.24; Wed, 21 Nov 2018 02:10:52 +0000 Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67]) by TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 02:10:52 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert() Thread-Index: AQHUgT9tyefJqCZntEWvHm+PkImSTg== Date: Wed, 21 Nov 2018 02:10:51 +0000 Message-ID: <87sgzvp4se.wl-kuninori.morimoto.gx@renesas.com> References: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87wop7p4wk.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: TYAPR01CA0111.jpnprd01.prod.outlook.com (2603:1096:404:2a::27) To TYAPR01MB3328.jpnprd01.prod.outlook.com (2603:1096:404:bb::17) 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; TYAPR01MB3936; 20:4bMPcstquJSMUrLM758KwGgVoCay5nViU59fhvjWikQJFFifL7cVUMvzX7Y9HIoR8SCsvWduQvZOJGikzcHaNG0fk/ZZ98Zka98d9OsOY1elIBkZpHZkrjmfSSiEDyQlElqFeGWOCXfLtR39oNFtZBDL83gYemU+qNYN05L3qeM= x-ms-office365-filtering-correlation-id: 13a6208d-0a36-4ece-d77f-08d64f568fc0 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:TYAPR01MB3936; x-ms-traffictypediagnostic: TYAPR01MB3936: 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)(3231442)(944501410)(52105112)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB3936; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB3936; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39840400004)(366004)(136003)(376002)(346002)(396003)(189003)(199004)(5660300001)(25786009)(2906002)(6116002)(6512007)(3846002)(7736002)(386003)(53936002)(6506007)(305945005)(81166006)(8936002)(8676002)(81156014)(4326008)(14454004)(97736004)(36756003)(2900100001)(71200400001)(478600001)(71190400001)(316002)(256004)(486006)(11346002)(446003)(6916009)(99286004)(52116002)(76176011)(106356001)(86362001)(6436002)(26005)(186003)(2616005)(476003)(6486002)(68736007)(66066001)(105586002)(102836004); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB3936; H:TYAPR01MB3328.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: +vcRuQyw0NgAkp9uFBHlLjFE9n8y6ov2Cfty5Nh3dlns9J3uohEQZL2Akhrp15uuzMI9HvZj+Ah2jtiE1PiQmr1hSfZOsXzAej2tgrYPGgCjTMx3l5V52E26e2RJ0553j8qodJld89BfL6J6QYB3OoFhG2tTMuI1PpPjd7iq6H5kTt1K95l0i1ZtNu1xUn+WHUmG2KZX9VkG0LCGlrCUt8I4j92qFhKH4ehxXzlP2/AceRGlcX/dbGE92ml87nRgb5abCm2+xdeVgpi3UoMqQVnrL/S0BCOXk6iQQZCP/bsmqDo67OvsLPF6i/h3LnkgJzChYEP4pcBDDfssRDyJLMNFUrVX0HrXGnPcEPEJzSY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <52ED6C9C63D07B439D52A11D7FE1470B@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13a6208d-0a36-4ece-d77f-08d64f568fc0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 02:10:51.9107 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB3936 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert() 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 simple-card-utils has asoc_simple_card_parse_convert() to parse convert channel/rate for be_hw_params_fixup. But, it is parsing from top of node. If sound card had multi subnode, we need to parse it from each sub node. This patch tidyup asoc_simple_card_parse_convert() to allow parsing settings from each node. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_utils.h | 3 ++- sound/soc/generic/audio-graph-scu-card.c | 2 +- sound/soc/generic/simple-card-utils.c | 5 +++-- sound/soc/generic/simple-scu-card.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index fb0318f..d1f1717 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -116,7 +116,8 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card); void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data, struct snd_pcm_hw_params *params); -void asoc_simple_card_parse_convert(struct device *dev, char *prefix, +void asoc_simple_card_parse_convert(struct device *dev, + struct device_node *np, char *prefix, struct asoc_simple_card_data *data); int asoc_simple_card_of_parse_routing(struct snd_soc_card *card, diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c index 2ba35bd..1f75493 100644 --- a/sound/soc/generic/audio-graph-scu-card.c +++ b/sound/soc/generic/audio-graph-scu-card.c @@ -204,7 +204,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) if (ret < 0) return ret; - asoc_simple_card_parse_convert(dev, NULL, &priv->adata); + asoc_simple_card_parse_convert(dev, node, NULL, &priv->adata); /* * it supports multi CPU, single CODEC only here diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 2fe7ea2..f588c93 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -32,10 +32,11 @@ void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data, } EXPORT_SYMBOL_GPL(asoc_simple_card_convert_fixup); -void asoc_simple_card_parse_convert(struct device *dev, char *prefix, +void asoc_simple_card_parse_convert(struct device *dev, + struct device_node *np, + char *prefix, struct asoc_simple_card_data *data) { - struct device_node *np = dev->of_node; char prop[128]; if (!prefix) diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c index 85b46f0..2d3ef6e 100644 --- a/sound/soc/generic/simple-scu-card.c +++ b/sound/soc/generic/simple-scu-card.c @@ -202,7 +202,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv) if (ret < 0) return ret; - asoc_simple_card_parse_convert(dev, PREFIX, &priv->adata); + asoc_simple_card_parse_convert(dev, node, PREFIX, &priv->adata); /* find 1st codec */ np = of_get_child_by_name(node, PREFIX "codec");