From patchwork Tue May 31 08:59:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9143825 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E13DB60757 for ; Tue, 31 May 2016 08:59:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5B5927BF1 for ; Tue, 31 May 2016 08:59:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA3DE28185; Tue, 31 May 2016 08:59:10 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B07A327BF1 for ; Tue, 31 May 2016 08:59:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756816AbcEaI7J (ORCPT ); Tue, 31 May 2016 04:59:09 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:42299 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755946AbcEaI7F (ORCPT ); Tue, 31 May 2016 04:59:05 -0400 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 31 May 2016 17:59:04 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 0C8983BC30; Tue, 31 May 2016 17:59:04 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id DDB928002E; Tue, 31 May 2016 17:59:03 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id CE5768002D; Tue, 31 May 2016 17:59:03 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAE31774; Tue, 31 May 2016 17:59:03 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211980129" Received: from mail-pu1apc01lp0015.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.15]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 31 May 2016 17:59:03 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8VRido+6Q7W1yYm7G9I+sQc85dTC11cx4MQcgrpSkcI=; b=bckxc4p+2sUH2vWDYZOT61B83diWEObwlzWPcN2ONlv/ME+DuSy63/R2euaOoJsWTb28u8mAjuVUosfsDIPjNHrVFXtjzGIZBrA8cTncFg566YKc2rqkiG2ADM7eDL3YGzJq5GFDkvjejsP5IQTrFih0RUwzyZc8s8IEqAY2qy8= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 08:59:01 +0000 Message-ID: <87d1o2sj6z.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 02/39 v2] ASoC: simple-card: use common PREFIX for each DT property User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> References: <87fusysjam.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 31 May 2016 08:59:01 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0004.jpnprd01.prod.outlook.com (10.161.131.142) To PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) X-MS-Office365-Filtering-Correlation-Id: 4faecc68-c34f-4568-4e22-08d38931cf8a X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 2:t0ObDGv4eF0Drs18mBBNZaAMlT01Yhzu37ItaN3o6NGs8JYZ58SinjeykIVpWNNRV4MrPKCPL6trWdVlqdGUKZuV4zzUtiXB2zymBd0aOhRXtijvNxeTm34Sdn/EGS6t0PsoCPNzFyDpf95Cr8z97bQmzAtOk9ob9yHeG/E7BTyXS4fqNWsqTVU1LKErnmZ8; 3:svjghMqze+A9rrxz4lIN/J2CRq12LVECXdldMdlxEe1bpYSW8YaF1SNRFU82e3/AIC/ransiDLq/6zy8xpMuRB4mIO/RP0ExE3ouTRCHUzpHAd4dM67zRPeOZ6FA00qj X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR06MB1705; X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 25:n3zROzkUEY+IhFLyGRhjyN/BVVULZd6kPi0MS0vtXXPf6/gaquC9PnpzHBxKmSSIaTVpfEqvxeoQuhLmX7Za0ooHIX6RC0Yz+BtMKjsYPoLBXFItQ94IrXalCU12eTq/e4a6IhCJYLdFe1tr2kDhcgpWLEaI8Av7PDPsWJ/nvIeMuqdyz0pGzYhbw5WqaVLBWaZGuBX0K8ykVOo8LCOfj/8mZ4l6iOHmVID5foK4fNETfKiQhePlJbXNFSKTLv8bH8Iwz0g3RhRVUGg9+QmtiuW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RkCIFcWZvUdpzCl5/KEgqIU9ic6595HFDqn9nmWsL1qyUdNTZ5C4Y8wUGzYk5Sf4Nfo0WMrScOKjpldZjPd5D84rwufOgGgflAAESo9EHDK6zcN4w7L5ivX+ukK/mVaDRCDSxm8B1GiuHewxpMrpev5le0fHmSYIXoEs0d203XX7e8LlzrG5nRN5aFhSphTZvRPpzt/hXOr404mxNMBSgJtcg9cE2FmSl6ETjeMnzcAwXpV9VsyTa+fhCfkrHLgdguVWF+syCYonGEwJvVsvphySVxJCH+O6B8eDYb8GTLjtOezV14TazyXnkSN8fkzPreiOE8ZKVALKvT9SeqA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:PS1PR06MB1705; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1705; X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(979002)(6009001)(575784001)(86362001)(2950100001)(4001350100001)(189998001)(110136002)(33646002)(66066001)(229853001)(47776003)(92566002)(53416004)(42186005)(8676002)(2906002)(19580395003)(19580405001)(4326007)(46406003)(81166006)(5008740100001)(3846002)(54356999)(76176999)(83506001)(5004730100002)(6116002)(23726003)(50986999)(77096005)(50466002)(36756003)(586003)(16060500001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1705; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1705; 23:W4diUc2OuHJy2trmxEb+pRNHlA+1ArSgvwpKKi7lr?= =?us-ascii?Q?pQ1Dy5nnFIbyJdpy0VCl5JRcsOFkfb8ZO5JmrXZAfHUnNdvl8U+GPJmXdOqj?= =?us-ascii?Q?3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ddyWxLYNkSLI?= =?us-ascii?Q?Dzb0fJYz5wFKVb0doiYMcejhtkb/nnfEQUaXWNMk6KZsMQvqXevQ1iBTZYq/?= =?us-ascii?Q?Ciwb5WFNcnVYMYXci+pnRGasIjc?= X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 5:eQMlIymGAslBaiofm8ZjR0Dz9tHELk3lRe+6XaTIFo2CeqlY8k7v2vLOyXt8rhZUVSKi6uku2LeFWJqktbsMyW08+bq8YuI5x+zNQlXRMveqy80pNctRkyDgr8lidi+GNRQ2uhsnKFEEmNfH/DpzNg==; 24:/KoQ/f0uo8bIdScSzbtSTrPHV1eTr7prxlaQ2fPQmKa3z0HavvUdHDtfaGNxR/acV9em+xsUv2Klpw43aMiKDodgUyYyzwaBvie/yoirVGM=; 7:CCxYFFJXXxzFGIN2dEz+9mXJmb7IDMOyveSGN7Sl4x5bqSubCndqO/48RW/nKF9Ol415sRN27EMDC+RCCC5wRWE4x3QADnQd4HMrIYoTnwwo7qeAurebKGkNDkTQCl3YYHfaUDaJx54N0VotffiOmtBUhiSxJhrQwuB3u52Lgtyl3kAm7D8j05Wh1+uMuDXt; 20:NFP6GPCkC+aV3StlHGj+playFui4I6kRP53258RRaCv2VXLAuLFJWeD1Ia9nsrjJHobaDfVfiOnY6Kr977rnrHBT/C9VNOZcyfueTHOKYp+TetjzGQB5MOMF4+wP9FPAxwRThtq6i7WAOhg6Z3NTBi93YLubDSM7km7LfWy3DmY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 08:59:01.3972 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1705 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 4e39c0f..b6e6d9a 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -40,6 +40,8 @@ struct simple_card_data { #define simple_priv_to_link(priv, i) ((priv)->snd_card.dai_link + i) #define simple_priv_to_props(priv, i) ((priv)->dai_props + i) +#define PREFIX "simple-audio-card," + static int asoc_simple_card_startup(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; @@ -344,7 +346,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, /* For single DAI link & old style of DT node */ if (is_top_level_node) - prefix = "simple-audio-card,"; + prefix = PREFIX; snprintf(prop, sizeof(prop), "%scpu", prefix); cpu = of_get_child_by_name(node, prop); @@ -453,26 +455,26 @@ static int asoc_simple_card_parse_of(struct device_node *node, return -EINVAL; /* Parse the card name from DT */ - snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name"); + snd_soc_of_parse_card_name(&priv->snd_card, PREFIX "name"); /* The off-codec widgets */ - if (of_property_read_bool(node, "simple-audio-card,widgets")) { + if (of_property_read_bool(node, PREFIX "widgets")) { ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card, - "simple-audio-card,widgets"); + PREFIX "widgets"); if (ret) return ret; } /* DAPM routes */ - if (of_property_read_bool(node, "simple-audio-card,routing")) { + if (of_property_read_bool(node, PREFIX "routing")) { ret = snd_soc_of_parse_audio_routing(&priv->snd_card, - "simple-audio-card,routing"); + PREFIX "routing"); if (ret) return ret; } /* Factor to mclk, used in hw_params() */ - ret = of_property_read_u32(node, "simple-audio-card,mclk-fs", &val); + ret = of_property_read_u32(node, PREFIX "mclk-fs", &val); if (ret == 0) priv->mclk_fs = val; @@ -480,7 +482,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, priv->snd_card.name : ""); /* Single/Muti DAI link(s) & New style of DT node */ - if (of_get_child_by_name(node, "simple-audio-card,dai-link")) { + if (of_get_child_by_name(node, PREFIX "dai-link")) { struct device_node *np = NULL; int i = 0; @@ -502,13 +504,13 @@ static int asoc_simple_card_parse_of(struct device_node *node, } priv->gpio_hp_det = of_get_named_gpio_flags(node, - "simple-audio-card,hp-det-gpio", 0, &flags); + PREFIX "hp-det-gpio", 0, &flags); priv->gpio_hp_det_invert = !!(flags & OF_GPIO_ACTIVE_LOW); if (priv->gpio_hp_det == -EPROBE_DEFER) return -EPROBE_DEFER; priv->gpio_mic_det = of_get_named_gpio_flags(node, - "simple-audio-card,mic-det-gpio", 0, &flags); + PREFIX "mic-det-gpio", 0, &flags); priv->gpio_mic_det_invert = !!(flags & OF_GPIO_ACTIVE_LOW); if (priv->gpio_mic_det == -EPROBE_DEFER) return -EPROBE_DEFER; @@ -543,7 +545,7 @@ static int asoc_simple_card_probe(struct platform_device *pdev) int num_links, ret; /* Get the number of DAI links */ - if (np && of_get_child_by_name(np, "simple-audio-card,dai-link")) + if (np && of_get_child_by_name(np, PREFIX "dai-link")) num_links = of_get_child_count(np); else num_links = 1;