From patchwork Wed Jul 15 07:14:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6793801 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 D7F50C05AC for ; Wed, 15 Jul 2015 07:24:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1AE3205FA for ; Wed, 15 Jul 2015 07:24:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id B05BC2056D for ; Wed, 15 Jul 2015 07:24:00 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AC9E5265A01; Wed, 15 Jul 2015 09:23:59 +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 D86402658D5; Wed, 15 Jul 2015 09:18:17 +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 982AC265A9D; Wed, 15 Jul 2015 09:18:16 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 5270C2658D5 for ; Wed, 15 Jul 2015 09:14:33 +0200 (CEST) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 15 Jul 2015 16:14:31 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id E03DC46566; Wed, 15 Jul 2015 16:14:31 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id DCA8B480A4; Wed, 15 Jul 2015 16:14:31 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id CFF95480A5; Wed, 15 Jul 2015 16:14:31 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id SAB13597; Wed, 15 Jul 2015 16:14:31 +0900 X-IronPort-AV: E=Sophos;i="5.15,477,1432566000"; d="scan'";a="190395015" Received: from mail-sg2apc01lp0241.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.241]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jul 2015 16:14:30 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.144) by HK2PR06MB0594.apcprd06.prod.outlook.com (10.161.187.145) with Microsoft SMTP Server (TLS) id 15.1.213.14; Wed, 15 Jul 2015 07:14:29 +0000 Message-ID: <87io9lvqsg.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:14:29 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0031.jpnprd01.prod.outlook.com (25.165.48.141) To HK2PR06MB0594.apcprd06.prod.outlook.com (25.161.187.145) X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0594; 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LmOGPMCkI1Hf; 4:ZkjmBakp+tjf80hjBDw5zmCedjmvXq4LbJ5KWgBm/YKsMkCbZD+7bOnPZ5iBpENgLMqMln8NXHWO73MZqhMIu7MXr9cLXbgtaP+wrwefqQNbcKTNbBAk2FdMKfUdmBdm1L0ezmARbywbQPTGPFfvM8dpbnnGhWO8+brsGIi1e1k25iC/zXZiE5BusOie2xVSgzAr5vmYeaHTqaR0LTvkh/HMOTj17aos65Um/EsHIKnl5L9DvPenQvtnefqzAYPFYo4tReASmTs2xm1UxAZpZiyfRgaIEB91hRXhWjP+khE= HK2PR06MB0594: 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:HK2PR06MB0594; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0594; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(76176999)(46406003)(23726002)(54356999)(77096005)(46102003)(86362001)(50986999)(107886002)(110136002)(83506001)(189998001)(66066001)(122386002)(33646002)(36756003)(62966003)(77156002)(229853001)(47776003)(40100003)(19580395003)(92566002)(19580405001)(5001960100002)(4001350100001)(87976001)(50466002)(42186005)(53416004)(2950100001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0594; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0594; 23:qDdz922QyUFC7J11zC1MQUxkTyORj9j6gfpn75kNqNQ4/e5BLSb76BmbcFU1RVbPOir/+SwZC51D7skhtkJUuZZDrZl75gVq4HWLspKb5fWyV3dxe8uKt0NaxOd5FPKd9c3D8RTvObOgPibeSUcbYyFxDXmfYv9tVNol0MGmtgDvJSP2rS5DFJBa6o65zf4nJDl1/+1eHm2odloyIkxUg2n2Sokt+a59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kZsuURLunNKjpkogXaOg/VSvh4tDKIg/kbK5bmvCHfHfWslr+lCeUXSKQh2Ub6+zL5vDGGSgjpKbDdA21D5Es6bK/nehd7qtg= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2015 07:14:29.3256 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0594 Cc: Linux-ALSA , shiiba , Liam Girdwood , komatsu , kobayashi , Simon Subject: [alsa-devel] [PATCH 21/35] ASoC: rsnd: add rsnd_get_adinr_chan() 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 rsnd driver has rsnd_get_adinr_bit() to get bit settings for ADINR (= Audio Information Register) of SSIU/SRC/DVC. This patch adds rsnd_get_adinr_chan() to get channel settings for ADINR (= Audio Information Register) of CTU/MIX. Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/core.c | 22 ++++++++++++++++++++++ sound/soc/sh/rcar/rsnd.h | 1 + 2 files changed, 23 insertions(+) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 0ca6d02..a3637b9 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -227,6 +227,28 @@ u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io) return adinr; } +u32 rsnd_get_adinr_chan(struct rsnd_mod *mod, struct rsnd_dai_stream *io) +{ + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io); + struct device *dev = rsnd_priv_to_dev(priv); + u32 chan = runtime->channels; + + switch (chan) { + case 1: + case 2: + case 4: + case 6: + case 8: + break; + default: + dev_warn(dev, "not supported channel\n"); + chan = 0; + break; + } + + return chan; +} /* * rsnd_dai functions */ diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 224a4a9..1296b35 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -170,6 +170,7 @@ void rsnd_force_write(struct rsnd_priv *priv, struct rsnd_mod *mod, void rsnd_bset(struct rsnd_priv *priv, struct rsnd_mod *mod, enum rsnd_reg reg, u32 mask, u32 data); u32 rsnd_get_adinr_bit(struct rsnd_mod *mod, struct rsnd_dai_stream *io); +u32 rsnd_get_adinr_chan(struct rsnd_mod *mod, struct rsnd_dai_stream *io); void rsnd_path_parse(struct rsnd_priv *priv, struct rsnd_dai_stream *io);