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: 1331971 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 292A740210 for ; Thu, 16 Aug 2012 13:41:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754103Ab2HPNlV (ORCPT ); Thu, 16 Aug 2012 09:41:21 -0400 Received: from na3sys009aog126.obsmtp.com ([74.125.149.155]:44166 "EHLO na3sys009aog126.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753853Ab2HPNlU (ORCPT ); Thu, 16 Aug 2012 09:41:20 -0400 Received: from mail-ob0-f175.google.com ([209.85.214.175]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKUCz4fy5mKl9IHKizeuRSl9JEbqd0pVm6@postini.com; Thu, 16 Aug 2012 06:41:19 PDT Received: by obc16 with SMTP id 16so3905990obc.34 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=IzU8ZPK8SmapQSiFO2qPLC3/1T8oFatgIGJaWDNqmZsSpP0aA1oc+EakpyLsM2b4AG 1wtWk1wu1BICgqwCc+JTJZ+ZaYzJ6B5tNOGnE+RdNrQkWUDWyImxASkaotFGghlagpBo bGsbUEcljO7S6+yK2SzDBh9cmvjZqE1aa+Zzi/ehWjEB3xTC6rqYueb7pOUZo/n4GQiS 4f7j4jQ5qiZkOWZNHlBh8YdNlJ49z+h43p6hdkXSqJ2Tp7rCXbM6+OOVGuGfElYXtUAo edHDEk9vbxkBsArifZw2acGHjOOfj549GgtuaZg65HGX0Bq39brVbKO22XbcJQ1h1jZ2 VC1Q== 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 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 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: ALoCoQlal3du0crpvQLul+pSreiln1JDduS3qkEmFqE2V34NXVCALFWLHylbgHhAXTlg/WeDPM0s 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 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; }