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: 1313111 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 491AC3FC23 for ; Mon, 13 Aug 2012 14:22:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752213Ab2HMOW4 (ORCPT ); Mon, 13 Aug 2012 10:22:56 -0400 Received: from na3sys009aog119.obsmtp.com ([74.125.149.246]:35178 "EHLO na3sys009aog119.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170Ab2HMOW4 (ORCPT ); Mon, 13 Aug 2012 10:22:56 -0400 Received: from mail-qc0-f180.google.com ([209.85.216.180]) (using TLSv1) by na3sys009aob119.postini.com ([74.125.148.12]) with SMTP ID DSNKUCkNvy21ebcdHgIFPoGc14IDf1TmjyDn@postini.com; Mon, 13 Aug 2012 07:22:55 PDT Received: by qcmv28 with SMTP id v28so2460663qcm.11 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=cjRlDcAkEKm5enPvDSxtkn7wS10qrr0Gn4xQRnb0WoCPU9qqm6ujem/4mE604dLDkU HPG4SlNFZTesmvPY6CZ0xrn4eljV3pbBhrh6w64OWpFUg8sAJWYTeY5kayS5tKD9N2V2 XR5a2amkLTFVo1a7lsxWatFz68yfNSOCETDzUwhJm7l+msg5gL0ya6LWdNcy9xHq3U1b R99XQdqVTQMPK30fMSKXqClXq9Cr61BsNqUmPzhk6hTmaLn8gvPtBA73YJ4J6OZ/6Dql VdHCikojanvH1FM5xdAWywjjS+a2s72Odc9rTRgHFF34c5w6f2E+yWAIJtCk2JalaZ10 BccQ== 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 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 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: ALoCoQl3BvjfCuCV8hTUxnXHO2ykgBcQ4xjOJFL1CrWbXwfWm0bQ2kYgtATKX72v2jb0hrdVLsNC 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; }