From patchwork Fri Dec 30 15:43:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Lilja X-Patchwork-Id: 9492299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 053E060417 for ; Fri, 30 Dec 2016 15:46:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3C961FEBD for ; Fri, 30 Dec 2016 15:46:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D48F420564; Fri, 30 Dec 2016 15:46:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1CFF21FEBD for ; Fri, 30 Dec 2016 15:46:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cMzM6-0007iB-54; Fri, 30 Dec 2016 15:44:30 +0000 Received: from mail.lysator.liu.se ([130.236.254.3]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cMzM2-0007gF-Ip for linux-arm-kernel@lists.infradead.org; Fri, 30 Dec 2016 15:44:27 +0000 Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 3B8B140040 for ; Fri, 30 Dec 2016 16:43:48 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 21CA140033; Fri, 30 Dec 2016 16:43:47 +0100 (CET) Received: from localhost.localdomain (h-38-149.a328.priv.bahnhof.se [46.59.38.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id EE0D240015; Fri, 30 Dec 2016 16:43:44 +0100 (CET) From: Magnus Lilja To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2] mfd: mc13xxx: Set the irq type. Date: Fri, 30 Dec 2016 16:43:33 +0100 Message-Id: <1483112613-18092-1-git-send-email-lilja.magnus@gmail.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161230_074426_863295_A48E5470 X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shc_work@mail.ru, Lee Jones , "# 3 . 18 . x" , vz@mleia.com, festevam@gmail.com, shawnguo@kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 10f9edaeaa30 ("mfd: mc13xxx: Use regmap irq framework for interrupts") removed the passing of the IRQF_TRIGGER_HIGH flag when registering the interrupt. This commit fixes that problem by setting the IRQF_TRIGGER_HIGH flag in case no irq type is set via irqd framework (e.g. device tree). In the latter case the irq flag from irqd is used. Tested on i.MX31 PDK hardware. Fixes: 10f9edaeaa30 ("mfd: mc13xxx: Use regmap irq framework for interrupts") Cc: # 3.18.x Cc: Lee Jones Signed-off-by: Magnus Lilja Reviewed-by: Fabio Estevam --- Changes from v1 (which was part of a patch series): - Now uses irqd_-functions to check if irq type is defined - Added Fixes: and Cc: to stable kernel. drivers/mfd/mc13xxx-core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index d7f54e4..e1757ea 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "mc13xxx.h" @@ -410,6 +411,7 @@ int mc13xxx_common_init(struct device *dev) struct mc13xxx *mc13xxx = dev_get_drvdata(dev); u32 revision; int i, ret; + unsigned int flags; mc13xxx->dev = dev; @@ -440,7 +442,11 @@ int mc13xxx_common_init(struct device *dev) mc13xxx->irq_chip.irqs = mc13xxx->irqs; mc13xxx->irq_chip.num_irqs = ARRAY_SIZE(mc13xxx->irqs); - ret = regmap_add_irq_chip(mc13xxx->regmap, mc13xxx->irq, IRQF_ONESHOT, + flags = irqd_get_trigger_type(irq_get_irq_data(mc13xxx->irq)); + flags = (flags == IRQ_TYPE_NONE) ? IRQF_TRIGGER_HIGH : flags; + + ret = regmap_add_irq_chip(mc13xxx->regmap, mc13xxx->irq, + IRQF_ONESHOT | flags, 0, &mc13xxx->irq_chip, &mc13xxx->irq_data); if (ret) return ret;