From patchwork Mon Nov 30 08:18:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 63630 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 nAU8IWvA026355 for ; Mon, 30 Nov 2009 08:18:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414AbZK3ISU (ORCPT ); Mon, 30 Nov 2009 03:18:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753393AbZK3ISU (ORCPT ); Mon, 30 Nov 2009 03:18:20 -0500 Received: from smtp.nokia.com ([192.100.105.134]:36634 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753368AbZK3IST (ORCPT ); Mon, 30 Nov 2009 03:18:19 -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 nAU8IHTI027605; Mon, 30 Nov 2009 02:18:24 -0600 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Nov 2009 10:18:09 +0200 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 30 Nov 2009 10:18:09 +0200 Received: from [127.0.1.1] (essapo-nirac252146.europe.nokia.com [10.162.252.146]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nAU8I70U012471; Mon, 30 Nov 2009 10:18:08 +0200 Subject: [PATCH v2 05/11] wl1251: simplify ELP wakeup time calculation To: linville@tuxdriver.com From: Kalle Valo Cc: linux-wireless@vger.kernel.org Date: Mon, 30 Nov 2009 10:18:06 +0200 Message-ID: <20091130081806.17360.54969.stgit@tikku> In-Reply-To: <20091130081706.17360.48084.stgit@tikku> References: <20091130081706.17360.48084.stgit@tikku> User-Agent: StGit/0.15 MIME-Version: 1.0 X-OriginalArrivalTime: 30 Nov 2009 08:18:09.0514 (UTC) FILETIME=[A6BFE4A0:01CA7195] 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;