From patchwork Wed Aug 8 09:11:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1293531 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 15D0EDF223 for ; Wed, 8 Aug 2012 09:12:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964909Ab2HHJMc (ORCPT ); Wed, 8 Aug 2012 05:12:32 -0400 Received: from na3sys009aog131.obsmtp.com ([74.125.149.247]:56362 "EHLO na3sys009aog131.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757914Ab2HHJMb (ORCPT ); Wed, 8 Aug 2012 05:12:31 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]) (using TLSv1) by na3sys009aob131.postini.com ([74.125.148.12]) with SMTP ID DSNKUCItfpYl47YSFFJ5eZ7i6bih378KV0gT@postini.com; Wed, 08 Aug 2012 02:12:30 PDT Received: by obbta14 with SMTP id ta14so1187441obb.18 for ; Wed, 08 Aug 2012 02:12:29 -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=Ud33pC5XQxx6oL8nothzVCw88x1GHo+8sPI60HqqqVg=; b=d+YAh3wwR7vmS2iGRS/g+hSRq3KQyoaWPO4oG18jBdWdD6YN2L4Asaj+t1MBELLdU/ iRLc/PPDLF3SaHRyrjNNZqrkU+hiTHA5H6EaRiYrX9YDLERPeIctPhm+kci6uLVHAkqI 0Xd9M01R8mICOyRTf+9b4Ajnhi8nEdHtGeuKCMU0iQdZm6BHgRNKVRx7SoLdTfJzz5ST f0/Qpw1msTLYHuPIjHeX9Z3A2om7rZAkV/q2aHP0hx/5q9CAbq2U4QdjmCvps3wepz+6 R7tioHuryOcADIXF6+9CIEOVo7dIwL4a3GEexEIvQ6Rg6EvaIdKoNwkx1uum3p26yvRT VOIA== Received: by 10.182.212.70 with SMTP id ni6mr28885064obc.44.1344417149554; Wed, 08 Aug 2012 02:12:29 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id cp8sm22099007obc.23.2012.08.08.02.12.26 (version=SSLv3 cipher=OTHER); Wed, 08 Aug 2012 02:12:29 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren Cc: Jarkko Nikula , alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, Benoit Cousson Subject: [PATCH 10/11] ASoC: omap-mcbsp: Remove cpu_is_omap* checks from the code Date: Wed, 8 Aug 2012 12:11:40 +0300 Message-Id: <1344417101-5015-11-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1344417101-5015-1-git-send-email-peter.ujfalusi@ti.com> References: <1344417101-5015-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQkl0bZZKzbYXAhSfgOECLq1xNsgxmG3leAIM4XPyM1KQRVb0hPni7Hn8aZrJT5jd7FU5euy Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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 --- 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; }