From patchwork Wed Jul 2 22:20:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 366503 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 72FF61400B7 for ; Thu, 3 Jul 2014 08:22:41 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758011AbaGBWWQ (ORCPT ); Wed, 2 Jul 2014 18:22:16 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:48207 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757752AbaGBWVk (ORCPT ); Wed, 2 Jul 2014 18:21:40 -0400 Received: by mail-wi0-f178.google.com with SMTP id n15so1252357wiw.11 for ; Wed, 02 Jul 2014 15:21:39 -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=8VG+O5yvgLByFpr5Tfdwu8JoT4M39G8f1FPWs34saFA=; b=rDPUnrjgHTHJhLlz36u3Ry3uYNviUrAc88Qns0mFSSRnl1Ee9D2gQ6QwH2nKcrLWhF Ji+9cpl0atWB3+TMJ7obm2WkoEJtsm7kCYYkC7ootF5EHUr8yNHraAtAQ/4fnMWSvJ+k 16m/dE/F3+mDi/vu4/z4b7Ru950KcyjB3Rat7RTev2sdL1ynm4SNzuaJFt/EX+O/3+l1 LW4kJ3/LsNAbPKp0KGkDGD81Ks1ORtukMud1ukY+4MmBtZ4TULo2gDXBldQwMCBxiGdj P56pYnZCdAT6Vh4+53DjVh+TDB1WIqlmteTNi68nMEQ7QxEFTJP7wmdBSkrZmp2Y55Cz J7Nw== X-Received: by 10.194.250.37 with SMTP id yz5mr542941wjc.47.1404339699254; Wed, 02 Jul 2014 15:21:39 -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.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jul 2014 15:21:38 -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 08/13] at86rf230: rework irq_pol setting Date: Thu, 3 Jul 2014 00:20:50 +0200 Message-Id: <1404339655-8456-9-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 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 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index 492fb7e..46db6f8 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -1276,7 +1276,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_type, irq_pol = IRQ_ACTIVE_HIGH; unsigned int dvdd; u8 csma_seed[2]; @@ -1285,11 +1285,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)) + if (irq_type == IRQ_TYPE_EDGE_FALLING) irq_pol = IRQ_ACTIVE_LOW; - else - irq_pol = IRQ_ACTIVE_HIGH; rc = at86rf230_write_subreg(lp, SR_IRQ_POLARITY, irq_pol); if (rc)