From patchwork Thu Jul 29 21:44:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laine Walker-Avina X-Patchwork-Id: 115337 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6TLshL3031683 for ; Thu, 29 Jul 2010 21:54:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752049Ab0G2Vym (ORCPT ); Thu, 29 Jul 2010 17:54:42 -0400 Received: from exprod7og124.obsmtp.com ([64.18.2.26]:43894 "HELO exprod7og124.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751424Ab0G2Vym (ORCPT ); Thu, 29 Jul 2010 17:54:42 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 29 Jul 2010 21:54:44 +0000 (UTC) X-Greylist: delayed 603 seconds by postgrey-1.27 at vger.kernel.org; Thu, 29 Jul 2010 17:54:41 EDT Received: from source ([204.130.249.21]) by exprod7ob124.postini.com ([64.18.6.12]) with SMTP ID DSNKTFH4oHsMkjcEA+Fj0/y4VA3OhtMhHFAI@postini.com; Thu, 29 Jul 2010 14:54:41 PDT Received: from localhost.localdomain ([172.16.2.46]) by p21.roseville.pasco.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 29 Jul 2010 14:44:10 -0700 From: Laine Walker-Avina To: linux-omap@vger.kernel.org Cc: Laine Walker-Avina Subject: [PATCH v2] OMAP: Make set_gpmc_timing_reg aware of the TIMEPARAGRANULARITY flag Date: Thu, 29 Jul 2010 14:44:26 -0700 Message-Id: <1280439866-32208-1-git-send-email-lwalkera@ieee.org> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <876344jjiy.fsf@deeprootsystems.com> References: <876344jjiy.fsf@deeprootsystems.com> X-OriginalArrivalTime: 29 Jul 2010 21:44:10.0953 (UTC) FILETIME=[2DF79B90:01CB2F67] Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 5bc3ca0..6c3a786 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -171,12 +171,15 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, #endif { u32 l; - int ticks, mask, nr_bits; + int ticks, mask, nr_bits, para_gran; + + para_gran = (gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1) & + GPMC_CONFIG1_TIME_PARA_GRAN ? 2:1); if (time == 0) ticks = 0; else - ticks = gpmc_ns_to_ticks(time); + ticks = gpmc_ns_to_ticks(time/para_gran); nr_bits = end_bit - st_bit + 1; if (ticks >= 1 << nr_bits) { #ifdef DEBUG @@ -191,8 +194,8 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, #ifdef DEBUG printk(KERN_INFO "GPMC CS%d: %-10s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n", - cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000, - (l >> st_bit) & mask, time); + cs, name, ticks, gpmc_get_fclk_period() * para_gran * + ticks / 1000, (l >> st_bit) & mask, time); #endif l &= ~(mask << st_bit); l |= ticks << st_bit;