From patchwork Thu Nov 26 15:08:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 63186 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAQF9dj8018422 for ; Thu, 26 Nov 2009 15:09:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760649AbZKZPJb (ORCPT ); Thu, 26 Nov 2009 10:09:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760646AbZKZPJb (ORCPT ); Thu, 26 Nov 2009 10:09:31 -0500 Received: from smtp.nokia.com ([192.100.105.134]:27788 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760648AbZKZPJa (ORCPT ); Thu, 26 Nov 2009 10:09:30 -0500 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nAQF9RHR027367; Thu, 26 Nov 2009 09:09:34 -0600 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 26 Nov 2009 17:09:06 +0200 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 26 Nov 2009 17:09:01 +0200 Received: from [127.0.1.1] (essapo-nirac252122.europe.nokia.com [10.162.252.122]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nAQF8ws6015637; Thu, 26 Nov 2009 17:08:59 +0200 Subject: [PATCH 05/12] wl1251: simplify ELP wakeup time calculation To: linville@tuxdriver.com From: Kalle Valo Cc: linux-wireless@vger.kernel.org Date: Thu, 26 Nov 2009 17:08:57 +0200 Message-ID: <20091126150857.917.36804.stgit@tikku> In-Reply-To: <20091126150141.917.35278.stgit@tikku> References: <20091126150141.917.35278.stgit@tikku> User-Agent: StGit/0.15 MIME-Version: 1.0 X-OriginalArrivalTime: 26 Nov 2009 15:09:01.0928 (UTC) FILETIME=[6314BE80:01CA6EAA] X-Nokia-AV: Clean Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/wl12xx/wl1251_ps.c b/drivers/net/wireless/wl12xx/wl1251_ps.c index 54a2720..851dfb6 100644 --- a/drivers/net/wireless/wl12xx/wl1251_ps.c +++ b/drivers/net/wireless/wl12xx/wl1251_ps.c @@ -68,7 +68,7 @@ void wl1251_ps_elp_sleep(struct wl1251 *wl) int wl1251_ps_elp_wakeup(struct wl1251 *wl) { - unsigned long timeout; + unsigned long timeout, start; u32 elp_reg; if (!wl->elp) @@ -76,6 +76,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl) wl1251_debug(DEBUG_PSM, "waking up chip from elp"); + start = jiffies; timeout = jiffies + msecs_to_jiffies(WL1251_WAKEUP_TIMEOUT); wl1251_write32(wl, HW_ACCESS_ELP_CTRL_REG_ADDR, ELPCTRL_WAKE_UP); @@ -96,8 +97,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl) } wl1251_debug(DEBUG_PSM, "wakeup time: %u ms", - jiffies_to_msecs(jiffies) - - (jiffies_to_msecs(timeout) - WL1251_WAKEUP_TIMEOUT)); + jiffies_to_msecs(jiffies - start)); wl->elp = false;