From patchwork Wed Jul 2 22:20:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 366496 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 4ADE01400B7 for ; Thu, 3 Jul 2014 08:21:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757922AbaGBWVq (ORCPT ); Wed, 2 Jul 2014 18:21:46 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:64892 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757912AbaGBWVo (ORCPT ); Wed, 2 Jul 2014 18:21:44 -0400 Received: by mail-wg0-f42.google.com with SMTP id z12so11570703wgg.1 for ; Wed, 02 Jul 2014 15:21:43 -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=FngW/EJa5Ql+nxlxjaQupkX4XRVla5tBLgOljaxSNzU=; b=FoHo1zQhzNcJN5eIDVGd6nNtRwzyRfuXR0OE5fP6mQkny8eURIPX4atUZ9Qzfzkn7b 313kNZBI9Z8DrABoh8uJy1fdSXrMpn/BIoWeOisqaqS1UewTMj2hCM3uKRuPmg4dNLIj zKKZuXdCLDqzWqGhh5FY+y9BlpCwvPcvM5TmMrccQRlEPzc+52U2IS19tzHL/vwAwRss AKFawQrjiN6PLZoNbB2WTtst/eSzw9i3cOyC/6FyUHTrTqEQGyf1v9p6LmqGacUoBZOc hni22kFXwT2M6DA18oyMM2mYsJI2snQ0XmIgKXun8BD4fLUkkvtAoHLflUNkrKucjFoV oLKA== X-Received: by 10.180.89.69 with SMTP id bm5mr6954520wib.41.1404339703291; Wed, 02 Jul 2014 15:21:43 -0700 (PDT) Received: from omega.localdomain (p4FD3BDAF.dip0.t-ipconnect.de. [79.211.189.175]) by mx.google.com with ESMTPSA id a13sm57797875wjs.12.2014.07.02.15.21.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jul 2014 15:21:42 -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 v3 net-next 12/13] at86rf230: add sleep cycle timing Date: Thu, 3 Jul 2014 00:20:54 +0200 Message-Id: <1404339655-8456-13-git-send-email-alex.aring@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1404339655-8456-1-git-send-email-alex.aring@gmail.com> References: <1404339655-8456-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 dbf85b8..79ec843 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)