From patchwork Thu Aug 28 07:01:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 4796831 Return-Path: X-Original-To: patchwork-ltsi-dev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 093479F375 for ; Thu, 28 Aug 2014 08:02:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD9AC20145 for ; Thu, 28 Aug 2014 08:02:57 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C26982012E for ; Thu, 28 Aug 2014 08:02:52 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1C7EF11B5; Thu, 28 Aug 2014 07:30:10 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp2.linuxfoundation.org (smtp2.linux-foundation.org [172.17.192.36]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 1B6EDC1F for ; Thu, 28 Aug 2014 07:30:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kirsty.vergenet.net (kirsty.vergenet.net [202.4.237.240]) by smtp2.linuxfoundation.org (Postfix) with ESMTP id 405651DCB3 for ; Thu, 28 Aug 2014 07:30:08 +0000 (UTC) Received: from ayumi.isobedori.kobe.vergenet.net (p4222-ipbfp1605kobeminato.hyogo.ocn.ne.jp [114.154.95.222]) by kirsty.vergenet.net (Postfix) with ESMTP id 76E7F267379; Thu, 28 Aug 2014 17:08:43 +1000 (EST) Received: by ayumi.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id F3B64EDE5F6; Thu, 28 Aug 2014 16:08:41 +0900 (JST) From: Simon Horman To: ltsi-dev@lists.linuxfoundation.org Date: Thu, 28 Aug 2014 16:01:29 +0900 Message-Id: <1409209620-24487-564-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1409209620-24487-1-git-send-email-horms+renesas@verge.net.au> References: <1409209620-24487-1-git-send-email-horms+renesas@verge.net.au> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org Cc: Magnus Damm Subject: [LTSI-dev] [PATCH LTSI-3.14 563/894] ASoC: rsnd: module name is unified X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Renesas sound driver uses many modules (= SSI/SRC/DVC), and each module had own name. But, each module name can be used as several purpose, like clock name, DMA name etc... This patch uses common name for each module. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown (cherry picked from commit 8aefda5046f417c551e3acdeb2cf37949a4b75e9) Signed-off-by: Simon Horman --- sound/soc/sh/rcar/dvc.c | 20 ++++++++++++++++++-- sound/soc/sh/rcar/src.c | 23 ++++++++++++++++++++--- sound/soc/sh/rcar/ssi.c | 15 +++++++++++---- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 74769b1..ed0007006 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -13,6 +13,9 @@ #define RSND_DVC_NAME_SIZE 16 #define RSND_DVC_VOLUME_MAX 100 #define RSND_DVC_VOLUME_NUM 2 + +#define DVC_NAME "dvc" + struct rsnd_dvc { struct rsnd_dvc_platform_info *info; /* rcar_snd.h */ struct rsnd_mod mod; @@ -43,6 +46,17 @@ static void rsnd_dvc_volume_update(struct rsnd_mod *mod) rsnd_mod_write(mod, DVC_VOL1R, vol[1]); } +static int rsnd_dvc_probe_gen2(struct rsnd_mod *mod, + struct rsnd_dai *rdai) +{ + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct device *dev = rsnd_priv_to_dev(priv); + + dev_dbg(dev, "%s (Gen2) is probed\n", rsnd_mod_name(mod)); + + return 0; +} + static int rsnd_dvc_init(struct rsnd_mod *dvc_mod, struct rsnd_dai *rdai) { @@ -208,7 +222,8 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod, } static struct rsnd_mod_ops rsnd_dvc_ops = { - .name = "dvc (gen2)", + .name = DVC_NAME, + .probe = rsnd_dvc_probe_gen2, .init = rsnd_dvc_init, .quit = rsnd_dvc_quit, .start = rsnd_dvc_start, @@ -255,7 +270,8 @@ int rsnd_dvc_probe(struct platform_device *pdev, priv->dvc = dvc; for_each_rsnd_dvc(dvc, priv, i) { - snprintf(name, RSND_DVC_NAME_SIZE, "dvc.%d", i); + snprintf(name, RSND_DVC_NAME_SIZE, "%s.%d", + DVC_NAME, i); clk = devm_clk_get(dev, name); if (IS_ERR(clk)) diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 89d24ee..200eda0 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -10,6 +10,8 @@ */ #include "rsnd.h" +#define SRC_NAME "src" + struct rsnd_src { struct rsnd_src_platform_info *info; /* rcar_snd.h */ struct rsnd_mod mod; @@ -389,6 +391,17 @@ static int rsnd_src_set_convert_rate_gen1(struct rsnd_mod *mod, return 0; } +static int rsnd_src_probe_gen1(struct rsnd_mod *mod, + struct rsnd_dai *rdai) +{ + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct device *dev = rsnd_priv_to_dev(priv); + + dev_dbg(dev, "%s (Gen1) is probed\n", rsnd_mod_name(mod)); + + return 0; +} + static int rsnd_src_init_gen1(struct rsnd_mod *mod, struct rsnd_dai *rdai) { @@ -434,7 +447,8 @@ static int rsnd_src_stop_gen1(struct rsnd_mod *mod, } static struct rsnd_mod_ops rsnd_src_gen1_ops = { - .name = "sru (gen1)", + .name = SRC_NAME, + .probe = rsnd_src_probe_gen1, .init = rsnd_src_init_gen1, .quit = rsnd_src_quit, .start = rsnd_src_start_gen1, @@ -498,6 +512,8 @@ static int rsnd_src_probe_gen2(struct rsnd_mod *mod, if (ret < 0) dev_err(dev, "SRC DMA failed\n"); + dev_dbg(dev, "%s (Gen2) is probed\n", rsnd_mod_name(mod)); + return ret; } @@ -558,7 +574,7 @@ static int rsnd_src_stop_gen2(struct rsnd_mod *mod, } static struct rsnd_mod_ops rsnd_src_gen2_ops = { - .name = "src (gen2)", + .name = SRC_NAME, .probe = rsnd_src_probe_gen2, .remove = rsnd_src_remove_gen2, .init = rsnd_src_init_gen2, @@ -652,7 +668,8 @@ int rsnd_src_probe(struct platform_device *pdev, priv->src = src; for_each_rsnd_src(src, priv, i) { - snprintf(name, RSND_SRC_NAME_SIZE, "src.%d", i); + snprintf(name, RSND_SRC_NAME_SIZE, "%s.%d", + SRC_NAME, i); clk = devm_clk_get(dev, name); if (IS_ERR(clk)) diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 97bc470..b821ec6 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -57,6 +57,8 @@ */ #define CONT (1 << 8) /* WS Continue Function */ +#define SSI_NAME "ssi" + struct rsnd_ssi { struct clk *clk; struct rsnd_ssi_platform_info *info; /* rcar_snd.h */ @@ -373,6 +375,8 @@ static int rsnd_ssi_pio_probe(struct rsnd_mod *mod, if (ret) dev_err(dev, "SSI request interrupt failed\n"); + dev_dbg(dev, "%s (PIO) is probed\n", rsnd_mod_name(mod)); + return ret; } @@ -405,7 +409,7 @@ static int rsnd_ssi_pio_stop(struct rsnd_mod *mod, } static struct rsnd_mod_ops rsnd_ssi_pio_ops = { - .name = "ssi (pio)", + .name = SSI_NAME, .probe = rsnd_ssi_pio_probe, .init = rsnd_ssi_init, .quit = rsnd_ssi_quit, @@ -430,6 +434,8 @@ static int rsnd_ssi_dma_probe(struct rsnd_mod *mod, if (ret < 0) dev_err(dev, "SSI DMA failed\n"); + dev_dbg(dev, "%s (DMA) is probed\n", rsnd_mod_name(mod)); + return ret; } @@ -480,7 +486,7 @@ static int rsnd_ssi_dma_stop(struct rsnd_mod *mod, } static struct rsnd_mod_ops rsnd_ssi_dma_ops = { - .name = "ssi (dma)", + .name = SSI_NAME, .probe = rsnd_ssi_dma_probe, .remove = rsnd_ssi_dma_remove, .init = rsnd_ssi_init, @@ -493,7 +499,7 @@ static struct rsnd_mod_ops rsnd_ssi_dma_ops = { * Non SSI */ static struct rsnd_mod_ops rsnd_ssi_non_ops = { - .name = "ssi (non)", + .name = SSI_NAME, }; /* @@ -620,7 +626,8 @@ int rsnd_ssi_probe(struct platform_device *pdev, for_each_rsnd_ssi(ssi, priv, i) { pinfo = &info->ssi_info[i]; - snprintf(name, RSND_SSI_NAME_SIZE, "ssi.%d", i); + snprintf(name, RSND_SSI_NAME_SIZE, "%s.%d", + SSI_NAME, i); clk = devm_clk_get(dev, name); if (IS_ERR(clk))