From patchwork Wed Jul 2 15:10:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 366390 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 93BEA1400E8 for ; Thu, 3 Jul 2014 01:10:38 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754751AbaGBPKf (ORCPT ); Wed, 2 Jul 2014 11:10:35 -0400 Received: from mail-we0-f180.google.com ([74.125.82.180]:45665 "EHLO mail-we0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754460AbaGBPKa (ORCPT ); Wed, 2 Jul 2014 11:10:30 -0400 Received: by mail-we0-f180.google.com with SMTP id x48so11429388wes.11 for ; Wed, 02 Jul 2014 08:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AyEDz87z3PWwfM+bHnvOZPOJVbQFyFKeACBC5DAxGJ0=; b=iqhy+KGPpFH2ODMXVSu7xebjIA0u1NSE35tICTs/r09MUGn3WA7Pm4q9nHuhJ8nDc5 3bYcu3plCUJqvsJRzyJaT6s6X2ZhavMM8y+yP2naaAhMGOdfywkgMBboUGfaEa5fAp11 tbkQZf0WRRHgPKB2XqgTsCfZbpXD0X28EAbFobx9frj/p1Wt+yG3IEakbxZ72TdNNIxg n31p9wjkf3MXaBxDa1Ml9ZI5C27YPC1H6XYxkvLqLDa/4fBHciI2yjxCkAPOZ09x/MBD aUDGQg6kLRMZLqu05jBbwiWdLHlR2kfCtF0zYHSElgERV+wCsg0tdBtpdDk3pIO+x9w8 UAAg== X-Received: by 10.194.158.164 with SMTP id wv4mr3480635wjb.124.1404313829122; Wed, 02 Jul 2014 08:10:29 -0700 (PDT) Received: from omega.localdomain (p4FD3BDAF.dip0.t-ipconnect.de. [79.211.189.175]) by mx.google.com with ESMTPSA id cj8sm55656607wjb.5.2014.07.02.08.10.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jul 2014 08:10:28 -0700 (PDT) From: Alexander Aring To: alex.bluesman.smirnov@gmail.com Cc: dbaryshkov@gmail.com, linux-zigbee-devel@lists.sourceforge.net, netdev@vger.kernel.org, stilwellt@openlabs.co, Alexander Aring Subject: [PATCH v2 net-next 12/13] at86rf230: add sleep cycle timing Date: Wed, 2 Jul 2014 17:10:09 +0200 Message-Id: <1404313810-30232-13-git-send-email-alex.aring@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1404313810-30232-1-git-send-email-alex.aring@gmail.com> References: <1404313810-30232-1-git-send-email-alex.aring@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Alexander Aring --- drivers/net/ieee802154/at86rf230.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 517a30f..336940b 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -42,6 +42,7 @@ struct at86rf230_local; * All timings are in us. */ struct at86rf2xx_chip_data { + u16 t_sleep_cycle; u16 t_channel_switch; u16 t_reset_to_off; u16 t_off_to_aack; @@ -1250,6 +1251,7 @@ static struct ieee802154_ops at86rf230_ops = { }; static struct at86rf2xx_chip_data at86rf233_data = { + .t_sleep_cycle = 330, .t_channel_switch = 11, .t_reset_to_off = 26, .t_off_to_aack = 80, @@ -1265,6 +1267,7 @@ static struct at86rf2xx_chip_data at86rf233_data = { }; static struct at86rf2xx_chip_data at86rf231_data = { + .t_sleep_cycle = 330, .t_channel_switch = 24, .t_reset_to_off = 37, .t_off_to_aack = 110, @@ -1280,6 +1283,7 @@ static struct at86rf2xx_chip_data at86rf231_data = { }; static struct at86rf2xx_chip_data at86rf212_data = { + .t_sleep_cycle = 330, .t_channel_switch = 11, .t_reset_to_off = 26, .t_off_to_aack = 200, @@ -1338,7 +1342,8 @@ static int at86rf230_hw_init(struct at86rf230_local *lp) if (rc) return rc; /* Wait the next SLEEP cycle */ - msleep(100); + usleep_range(lp->data->t_sleep_cycle, + lp->data->t_sleep_cycle + 100); rc = at86rf230_read_subreg(lp, SR_DVDD_OK, &dvdd); if (rc)