From patchwork Thu Jul 3 14:16:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Dyer X-Patchwork-Id: 4473651 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 275FFBEEAA for ; Thu, 3 Jul 2014 14:16:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50E892018B for ; Thu, 3 Jul 2014 14:16:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F105201D5 for ; Thu, 3 Jul 2014 14:16:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757565AbaGCOQ2 (ORCPT ); Thu, 3 Jul 2014 10:16:28 -0400 Received: from kdh-gw.itdev.co.uk ([89.21.227.133]:26956 "EHLO hermes.kdh.itdev.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753665AbaGCOQK (ORCPT ); Thu, 3 Jul 2014 10:16:10 -0400 Received: from [192.168.1.103] (pfsense-01.kdh.itdev.co.uk [192.168.1.8]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by hermes.kdh.itdev.co.uk (Postfix) with ESMTPSA id 152117EA4F; Thu, 3 Jul 2014 15:16:07 +0100 (BST) Message-ID: <53B565A6.9020306@itdev.co.uk> Date: Thu, 03 Jul 2014 15:16:06 +0100 From: Nick Dyer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Dmitry Torokhov CC: Sekhar Nori , Stephen Warren , "linux-input@vger.kernel.org" , Linux OMAP List , "swarren@wwwdotorg.org" Subject: Re: atmel_mxt_ts: defaulting irqflags to IRQF_TRIGGER_FALLING References: <53B284AE.3070302@ti.com> <5995217832cc40f5bcf132ac5c6c2546@HQMAIL105.nvidia.com> <53B3E3A8.4070605@ti.com> <53B3F2F2.90707@itdev.co.uk> In-Reply-To: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 02/07/14 18:25, Dmitry Torokhov wrote: > In this case board code should take care of setting up the interrupt > properly and the driver should simply use 0 as flags in request_irq(). > By the way, doesn't generic DT infrastructure already allow specifying > interrupt triggers and sets them up properly? Yes. I've checked and tested this behaviour today. If you don't specify a trigger type, then when you request the irq it trusts that the platform has already set it up correctly: http://lxr.free-electrons.com/source/kernel/irq/manage.c#L1208 Stephen: you should be able to set up the interrupt config in the device tree. I believe this should be done by putting IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_EDGE_FALLING in the third field in the "interrupts" definition, although I haven't a tegra DTS device to test on at the moment. I've applied the patch below, which is basically what Sekhar had originally, with a minor extra fix. I've merged it into the appropriate parts of my for upstream series at https://github.com/ndyer/linux/commits/for-next --- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscree index dc46100..15efb3b 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1453,7 +1453,7 @@ static int mxt_check_retrigen(struct mxt_data *data) int error; int val; - if (data->pdata->irqflags & IRQF_TRIGGER_LOW) + if (irq_get_trigger_type(data->irq) & IRQF_TRIGGER_LOW) return 0; if (data->T18_address) { @@ -3155,9 +3155,6 @@ static struct mxt_platform_data *mxt_parse_dt(struct i2c_c pdata->gpio_reset = of_get_named_gpio_flags(dev->of_node, "atmel,reset-gpio", 0, NULL); - /* Default to this. Properties can be added to configure it later */ - pdata->irqflags = IRQF_TRIGGER_FALLING; - of_property_read_string(dev->of_node, "atmel,cfg_name", &pdata->cfg_name);