From patchwork Wed Jul 15 07:13: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: 6793761 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 01853C05AC for ; Wed, 15 Jul 2015 07:21:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29067205E2 for ; Wed, 15 Jul 2015 07:21:44 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E6B00205D8 for ; Wed, 15 Jul 2015 07:21:41 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E458E265D33; Wed, 15 Jul 2015 09:21:40 +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 04E2D26585D; Wed, 15 Jul 2015 09:16:44 +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 32E1626585D; Wed, 15 Jul 2015 09:16:43 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id E3EE92659A4 for ; Wed, 15 Jul 2015 09:13:33 +0200 (CEST) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 15 Jul 2015 16:13:32 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 5BCEA425CB; Wed, 15 Jul 2015 16:13:32 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 4E1F01800A; Wed, 15 Jul 2015 16:13:31 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id CDA0618070; Wed, 15 Jul 2015 16:13:31 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id SAD32742; Wed, 15 Jul 2015 16:13:31 +0900 X-IronPort-AV: E=Sophos;i="5.15,477,1432566000"; d="scan'";a="191576057" Received: from mail-hk1lp0123.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.123]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jul 2015 16:13:31 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.144) by HKXPR06MB0599.apcprd06.prod.outlook.com (10.161.181.148) with Microsoft SMTP Server (TLS) id 15.1.219.17; Wed, 15 Jul 2015 07:13:29 +0000 Message-ID: <87mvyxvqtz.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:13:29 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0013.jpnprd01.prod.outlook.com (25.161.74.151) To HKXPR06MB0599.apcprd06.prod.outlook.com (25.161.181.148) X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0599; 2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QuUeE3ieI1; 4:sWS+tD6X+0tjAiVsnOjninfCngkLB3eC2mS8vkcMa5sBXLn/RuoYwrCKFV09KLGDFx1h/tlezxiFBJHCcwx3TcNnoXQX6I0a0LwpaEhdkuDwiiz4xaz9J/vnAIcdKf1JAYDkmzFsrNdRA5la14pqX5HCvzg+Mb8CW/DyyWulZfId4mBKgVx+z8/sBVUDAhtJ5neh0VXrKNZh5684ECc3nnetOFNy+EMuxiPQXlPbWBj5j2MS465cn9y6F1DSk+cz5BSkliPRFV+GqkOGDjNvo3t5oFwqEfVT7muoMZHdUIw= HKXPR06MB0599: 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:HKXPR06MB0599; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB0599; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(92566002)(40100003)(23726002)(19580395003)(36756003)(87976001)(19580405001)(4001350100001)(77096005)(46102003)(33646002)(2950100001)(76176999)(54356999)(122386002)(229853001)(50986999)(83506001)(66066001)(62966003)(77156002)(189998001)(50466002)(46406003)(53416004)(86362001)(110136002)(47776003)(5001960100002)(107886002)(42186005)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB0599; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; HKXPR06MB0599; 23:jZDCeubaF1TE0w8Kx4aRVMcsHg4Gp0EPeRJNv027q8hsnjcSJ/D3YJiHWL7GQwKWtjTcMSrhQ8zeFNqX+QFR+7qM9swg7TRAHiQW8V2nEVFWa/UjMSXo2Ttq7tXsLNJBukfa/OQI1GMOeuk6L40DOjMljFaBJxgDwA6CPCCYDfIitWkfYwXhHQtiD8B65xnPtmOPTXvB6NHY6RYMgI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2w+57J2vUCMYw6vRXYQRia+K7/qDyzE0Tp/P0U031B7Rahc19eqdWUxGuncj0CQddwX7RgOOR26UM+xNsOf092g9bUxy/ra4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2015 07:13:29.5635 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB0599 Cc: Linux-ALSA , shiiba , Liam Girdwood , komatsu , kobayashi , Simon Subject: [alsa-devel] [PATCH 18/35] ASoC: rsnd: add rsnd_dvc_initialize_lock/unlock() 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 Renesas SCU (Sampling Rate Convert Unit) includes SRC/CTU/MIX/DVC, and these have similar register. xxxIR (Initialization Register) is one of them. These xxxIR need be set to 1 during initialization. Current rsnd driver has src.c / dvc.c, and we will have mix.c. It is readable if these have same named function. This patch adds rsnd_dvc_initialize_lock/unlock() and make sure it Signed-off-by: Kuninori Morimoto Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/dvc.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index 9392507..343d446 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c @@ -70,6 +70,13 @@ static void rsnd_dvc_soft_reset(struct rsnd_mod *mod) rsnd_mod_write(mod, DVC_SWRSR, 1); } +#define rsnd_dvc_initialize_lock(mod) __rsnd_dvc_initialize_lock(mod, 1) +#define rsnd_dvc_initialize_unlock(mod) __rsnd_dvc_initialize_lock(mod, 0) +static void __rsnd_dvc_initialize_lock(struct rsnd_mod *mod, u32 enable) +{ + rsnd_mod_write(mod, DVC_DVUIR, enable); +} + static void rsnd_dvc_volume_update(struct rsnd_dai_stream *io, struct rsnd_mod *mod) { @@ -150,17 +157,15 @@ static int rsnd_dvc_init(struct rsnd_mod *mod, rsnd_dvc_soft_reset(mod); - rsnd_path_parse(priv, io); + rsnd_dvc_initialize_lock(mod); - rsnd_mod_write(mod, DVC_DVUIR, 1); + rsnd_path_parse(priv, io); rsnd_mod_write(mod, DVC_ADINR, rsnd_get_adinr(mod, io)); /* ch0/ch1 Volume */ rsnd_dvc_volume_update(io, mod); - rsnd_mod_write(mod, DVC_DVUIR, 0); - rsnd_adg_set_cmd_timsel_gen2(mod, io); return 0; @@ -179,6 +184,8 @@ static int rsnd_dvc_start(struct rsnd_mod *mod, struct rsnd_dai_stream *io, struct rsnd_priv *priv) { + rsnd_dvc_initialize_unlock(mod); + rsnd_mod_write(mod, CMD_CTRL, 0x10); return 0;