From patchwork Mon Aug 13 14:22:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1313221 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8236ADF223 for ; Mon, 13 Aug 2012 14:27:35 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T0vZ9-0004OG-Au; Mon, 13 Aug 2012 14:24:23 +0000 Received: from na3sys009aog104.obsmtp.com ([74.125.149.73]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T0vXl-0003oQ-2B for linux-arm-kernel@lists.infradead.org; Mon, 13 Aug 2012 14:22:58 +0000 Received: from mail-qa0-f43.google.com ([209.85.216.43]) (using TLSv1) by na3sys009aob104.postini.com ([74.125.148.12]) with SMTP ID DSNKUCkNvy21ebcdHgIFPoGc14IDf1TmjyDn@postini.com; Mon, 13 Aug 2012 07:22:56 PDT Received: by qatk31 with SMTP id k31so3070941qat.16 for ; Mon, 13 Aug 2012 07:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=mKE/g9jK3UuseJRwq+fbGbjOE4k0z/pbI4Bi+EFWOFw=; b=eXay63d/ux1JiYos6+YDxHrrpt3TLYuJj06axqpm6bIACO9WJNqOzPEJQX/NZzGSlX NSS7Ii2h8gp/z8gSVgBOZ3/QMLC/W/fJyjjvNwbuOKl6+1E6vQ3KtWbhzSbJxwJkhf2G EwXRrw+n/jXtBmT+3w2In53odKo1d8IprOv4XVaU1eNVYDwdSZw+OY09BGi8kvyJv7zR PGuuzhsTDOPZhL0JdRjPjFVYHXjoJj9uN+545XgiTMAur73NZN1xrN+jacpcCsw3TmeE GZaX5MnT23R560Q9FGvcygts9lIuRGji6Cd3LblNypWALL4ZBqAqgSIrftF/RsO6nmz1 K5cQ== Received: by 10.60.8.8 with SMTP id n8mr14123193oea.38.1344867774563; Mon, 13 Aug 2012 07:22:54 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id th3sm6355591obb.6.2012.08.13.07.22.51 (version=SSLv3 cipher=OTHER); Mon, 13 Aug 2012 07:22:54 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren Subject: [PATCH v2 7/9] ASoC: omap-mcbsp: Remove cpu_is_omap* checks from the code Date: Mon, 13 Aug 2012 17:22:46 +0300 Message-Id: <1344867768-26335-8-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1344867768-26335-1-git-send-email-peter.ujfalusi@ti.com> References: <1344867768-26335-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQlcTljOjRVGGdPhQMBsRlR7BqPFQs8jl22RDrbz3UvMWzkoTU4l4ZoOmtHSDW13HunT801j X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.73 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: alsa-devel@alsa-project.org, Benoit Cousson , devicetree-discuss@lists.ozlabs.org, Jarkko Nikula , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We can use the has_ccr flag to replace the cpu_is_omap* checks. This provides future proof implementation and we do not need to update the code if new OMAP revision starts to use the McBSP driver. Signed-off-by: Peter Ujfalusi Acked-by: Jarkko Nikula --- sound/soc/omap/omap-mcbsp.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 5061594..b9770ee 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -398,12 +398,14 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai, /* Generic McBSP register settings */ regs->spcr2 |= XINTM(3) | FREE; regs->spcr1 |= RINTM(3); - /* RFIG and XFIG are not defined in 34xx */ - if (!cpu_is_omap34xx() && !cpu_is_omap44xx()) { + /* RFIG and XFIG are not defined in 2430 and on OMAP3+ */ + if (!mcbsp->pdata->has_ccr) { regs->rcr2 |= RFIG; regs->xcr2 |= XFIG; } - if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) { + + /* Configure XCCR/RCCR only for revisions which have ccr registers */ + if (mcbsp->pdata->has_ccr) { regs->xccr = DXENDLY(1) | XDMAEN | XDISABLE; regs->rccr = RFULL_CYCLE | RDMAEN | RDISABLE; }