From patchwork Thu Aug 16 13:41:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 1332081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id ACDEA40210 for ; Thu, 16 Aug 2012 13:47:00 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T20LG-0005eM-NR; Thu, 16 Aug 2012 13:42:30 +0000 Received: from na3sys009aog119.obsmtp.com ([74.125.149.246]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T20K9-0005GD-7d for linux-arm-kernel@lists.infradead.org; Thu, 16 Aug 2012 13:41:22 +0000 Received: from mail-qc0-f179.google.com ([209.85.216.179]) (using TLSv1) by na3sys009aob119.postini.com ([74.125.148.12]) with SMTP ID DSNKUCz4fy5mKl9IHKizeuRSl9JEbqd0pVm6@postini.com; Thu, 16 Aug 2012 06:41:21 PDT Received: by qcse14 with SMTP id e14so2028256qcs.38 for ; Thu, 16 Aug 2012 06:41:19 -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=aov8pS5p5/aO9xPMDRERtUdA1wtDuo5lcMKc7eyMU1ugR3KPDbmjTS3DCiOy6Gpopg JByAZuIPUcCA7EtaYF++0ACTc4IJ2TcH2PpMn+0/OjK+VAYZS0ti7rJL9o/Aaacgx3T0 G+3gGbGXawhkbM4qFfNaMoxT3AEPlmMOpQ9KgBmCpzBBfEkxxAzZ4WDTXRrG9PWNQ4Lz lpkEfcGpLkWtPVKGorOTqIucEYXvJzKByIpkhIHCyI+D9yAfaZAFCA1jpga23fLAXfaE r2VF0iRgJGAiv+H496yhpVqyn+bsC4w5iGwj342qAvssHN6y7vFdYX1a2LyMpidUU5nP lNXA== Received: by 10.60.2.193 with SMTP id 1mr1025861oew.29.1345124478954; Thu, 16 Aug 2012 06:41:18 -0700 (PDT) Received: from barack.emea.dhcp.ti.com (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id x10sm2977371oeb.8.2012.08.16.06.41.15 (version=SSLv3 cipher=OTHER); Thu, 16 Aug 2012 06:41:17 -0700 (PDT) From: Peter Ujfalusi To: Mark Brown , Liam Girdwood , Tony Lindgren Subject: [PATCH v3 7/9] ASoC: omap-mcbsp: Remove cpu_is_omap* checks from the code Date: Thu, 16 Aug 2012 16:41:06 +0300 Message-Id: <1345124468-8876-8-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1345124468-8876-1-git-send-email-peter.ujfalusi@ti.com> References: <1345124468-8876-1-git-send-email-peter.ujfalusi@ti.com> X-Gm-Message-State: ALoCoQlrJDs3bQFSQmXcaeowGb8Dcl9nktMQ/kmg1c/DIbwC2SetsUJ2xeVrcqw4Wo7PU2y76mkM 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.246 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; }