From patchwork Wed Jul 15 07:07:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6793551 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BF3DFC05AC for ; Wed, 15 Jul 2015 07:08:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DC49520576 for ; Wed, 15 Jul 2015 07:08:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8A82F20519 for ; Wed, 15 Jul 2015 07:08:28 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 981672657E0; Wed, 15 Jul 2015 09:08:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 74048265826; Wed, 15 Jul 2015 09:08:10 +0200 (CEST) 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 C2F00265826; Wed, 15 Jul 2015 09:08:08 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id AD2202657DF for ; Wed, 15 Jul 2015 09:07:48 +0200 (CEST) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 15 Jul 2015 16:07:45 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id C20744488C; Wed, 15 Jul 2015 16:07:45 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id C0F951806F; Wed, 15 Jul 2015 16:07:45 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id BC06F1800A; Wed, 15 Jul 2015 16:07:45 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id SAL29800; Wed, 15 Jul 2015 16:07:45 +0900 X-IronPort-AV: E=Sophos;i="5.15,477,1432566000"; d="scan'";a="190393987" Received: from mail-pu1apc01lp0024.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.24]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jul 2015 16:07:44 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.144) by SG2PR06MB0601.apcprd06.prod.outlook.com (10.161.10.151) with Microsoft SMTP Server (TLS) id 15.1.213.14; Wed, 15 Jul 2015 07:07:42 +0000 Message-ID: <87bnfdx5o2.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <87d1ztx5pb.wl%kuninori.morimoto.gx@renesas.com> References: <87d1ztx5pb.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 15 Jul 2015 07:07:42 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0002.jpnprd01.prod.outlook.com (25.161.24.12) To SG2PR06MB0601.apcprd06.prod.outlook.com (25.161.10.151) X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0601; 2:GBCBsB+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aIY1vm1pY2YUvnwkcvptpV3Aps3gcT3g+whjDqYVogV3xLl; 4:IfwYVzuriX027acO+GUEG5ZSncp8sLtxXqgsNvwO8wALOKKlwSJh9k8Ugbq8EJZ/XEH8d+PP8376HcYovArUFMXkZNTGaAKOUd9bfh5CBCdT/lYLUTP6hTEgDSQ9Eb2NedRlRs3HzSZzT2sTGzOld4u4X80mOtI3WS5jACKpvqcxUTd9DFbHUG/cvUBchSCM4cKL5saYHBOou5YUi+bAHUSnRrtnkOVIRbjjdnYmnblcMv2WUEl72NVp+z00vC26MbAtA9O89YbTArBKIX1hy1lHJmvP4DuQRmDwGvKqHuY= SG2PR06MB0601: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:SG2PR06MB0601; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0601; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(87976001)(92566002)(110136002)(42186005)(40100003)(62966003)(107886002)(86362001)(36756003)(77156002)(4001350100001)(5001960100002)(77096005)(2950100001)(23726002)(83506001)(33646002)(19580405001)(50466002)(229853001)(189998001)(66066001)(122386002)(46406003)(19580395003)(47776003)(50986999)(46102003)(54356999)(76176999)(53416004)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0601; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0601; 23:hh4wyq0Cne46GwBU532j6l0Ct5SnO6jSFwyMcPdV4Ej1bUwJ+2wRhSTI8F8EuDq1pth+YizdBXJlKe9WDiDC31pSZP64eR+tMdHzd821QI/vh5+WuaftLm3uKcZ2TSfwzZsFRxwv4WUF57RPH1SKHDMjlkCDtATJF4ExYAOF2wb+7GKZMKruBojaF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hBU0SyZPPLjVUNlljc9l+pq5hBr8kOzxgSzCz6hyLTbLqkn8qxv0ewBCsg+cJhepJfx+Hn7+UZPZdagf6KvZLtE1rKm6u/YfhVLrp1FtQi80BPXH0rj3HBhbj8z4Bv4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2015 07:07:42.4433 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0601 Cc: Linux-ALSA , shiiba , Liam Girdwood , komatsu , kobayashi , Simon Subject: [alsa-devel] [PATCH 01/35] ASoC: core: add snd_soc_of_parse_audio_prefix() 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 ASoC can add name_prefix for DAPM, and it is necessary for route settings. This patch adds snd_soc_of_parse_audio_prefix() for this purpose. It will be used with snd_soc_of_parse_audio_routing(). Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- include/sound/soc.h | 4 ++++ sound/soc/soc-core.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/sound/soc.h b/include/sound/soc.h index 93df8bf..75cd19c 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1604,6 +1604,10 @@ int snd_soc_of_parse_audio_simple_widgets(struct snd_soc_card *card, int snd_soc_of_parse_tdm_slot(struct device_node *np, unsigned int *slots, unsigned int *slot_width); +void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, + struct snd_soc_codec_conf *codec_conf, + struct device_node *of_node, + const char *propname); int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, const char *propname); unsigned int snd_soc_of_parse_daifmt(struct device_node *np, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 3a4a5c0..fd15d54 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3303,6 +3303,26 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np, } EXPORT_SYMBOL_GPL(snd_soc_of_parse_tdm_slot); +void snd_soc_of_parse_audio_prefix(struct snd_soc_card *card, + struct snd_soc_codec_conf *codec_conf, + struct device_node *of_node, + const char *propname) +{ + struct device_node *np = card->dev->of_node; + const char *str; + int ret; + + ret = of_property_read_string(np, propname, &str); + if (ret < 0) { + /* no prefix is not error */ + return; + } + + codec_conf->of_node = of_node; + codec_conf->name_prefix = str; +} +EXPORT_SYMBOL_GPL(snd_soc_of_parse_audio_prefix); + int snd_soc_of_parse_audio_routing(struct snd_soc_card *card, const char *propname) {