From patchwork Sat Jun 28 18:33:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 365298 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 2F0421400BE for ; Sun, 29 Jun 2014 04:34:50 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932241AbaF1Seq (ORCPT ); Sat, 28 Jun 2014 14:34:46 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:55382 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932227AbaF1Seo (ORCPT ); Sat, 28 Jun 2014 14:34:44 -0400 Received: by mail-wi0-f176.google.com with SMTP id n3so4253510wiv.9 for ; Sat, 28 Jun 2014 11:34: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=HvUONc9IGQpnKKKhBIKmiiIC8wgxffUUnLuYq6h6zTI=; b=ETJPlkOiKQ+7Dxnl0DiZndFwOTScwC36BZFY1kfeJaD7b5c2plFYUx67huuYDe3o8P rckcEsGH1IodZ4F37L6F22HEjfLmDCfrCpiNc5eGIL4mwtviivaXb1n2zkVPEvgbmYlf rqXayCwWbsErEiGefowS3nVsmwSqH9JD2p3HxR2NI9b4HxBVPqJx2Tbv1bMVlAc4gb42 M1JKEwMgq3pmkQC7hDYEvcQ2Uvob1lTLf1InuQ21aqPSzq1PI0XBGrJE0fViz8yaglaZ omuV3GHCN4bxg/V/qaTbWkgbGNiY1GsdULIJhOwSlNrTTcajBxcBEGweMElBcQ1YV+BN Zf4w== X-Received: by 10.180.84.5 with SMTP id u5mr18766243wiy.33.1403980483659; Sat, 28 Jun 2014 11:34:43 -0700 (PDT) Received: from omega.localdomain (p4FD3BDAF.dip0.t-ipconnect.de. [79.211.189.175]) by mx.google.com with ESMTPSA id m3sm29433289wjr.49.2014.06.28.11.34.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Jun 2014 11:34: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, werner@almesberger.net, Alexander Aring Subject: [PATCH net-next 08/13] at86rf230: rework irq_pol setting Date: Sat, 28 Jun 2014 20:33:46 +0200 Message-Id: <1403980431-6201-9-git-send-email-alex.aring@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1403980431-6201-1-git-send-email-alex.aring@gmail.com> References: <1403980431-6201-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 This patch rework the irq_pol register setting for rising and falling interrupt settings only. The default behaviour should be rising flag. Also use IRQ_TYPE_* defines instead of IRQF_* defines. There is no functionality change but irq_get_trigger_type returns IRQ_TYPE_* defines. Signed-off-by: Alexander Aring --- drivers/net/ieee802154/at86rf230.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 35088a8..4ac7c4b 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -1278,7 +1278,7 @@ static struct at86rf2xx_chip_data at86rf212_data = { static int at86rf230_hw_init(struct at86rf230_local *lp) { - int rc, irq_pol, irq_type; + int rc, irq_pol, irq_type = IRQ_ACTIVE_HIGH; unsigned int dvdd; u8 csma_seed[2]; @@ -1287,11 +1287,8 @@ static int at86rf230_hw_init(struct at86rf230_local *lp) return rc; irq_type = irq_get_trigger_type(lp->spi->irq); - /* configure irq polarity, defaults to high active */ - if (irq_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) - irq_pol = IRQ_ACTIVE_LOW; - else - irq_pol = IRQ_ACTIVE_HIGH; + if (irq_type == IRQ_TYPE_EDGE_FALLING) + irq_type = IRQ_ACTIVE_LOW; rc = at86rf230_write_subreg(lp, SR_IRQ_POLARITY, irq_pol); if (rc)