Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758837Ab2JKQ0r (ORCPT ); Thu, 11 Oct 2012 12:26:47 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:52899 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757643Ab2JKQ0q (ORCPT ); Thu, 11 Oct 2012 12:26:46 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 11 Oct 2012 18:26:44 +0200 Message-ID: Subject: Re: [PATCH][GPIO] Add IRQ edge setter to gpiolib From: Linus Walleij To: Drasko DRASKOVIC Cc: Russell King - ARM Linux , Grant Likely , Thomas Gleixner , linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1402 Lines: 44 On Tue, Oct 9, 2012 at 4:22 PM, Drasko DRASKOVIC wrote: > [Me] >> So can you explain exactly why userspace want to configure >> GPIO pins in interrupt mode, when there is no way whatsoever >> for userspace to handle these IRQs? > > Maybe I understand something wrong, but explicit configuration of GPIO > interrupt trigger type visible in sysfs is possible __only__ from the > userspace today, and that is exactly limitation I am addressing. So this is the real problem is it not? So if we consider this: static irqreturn_t my_callback(int irq, void *dev_id) { return IRQ_HANDLED; } int my_gpio, my_irq, ret; my_gpio = 17; /* For some reason I like this pin */ ret = gpio_request(my_gpio); ret = gpio_direction_input(my_gpio); my_irq = gpio_to_irq(my_gpio); ret = request_any_context_irq(my_irq, my_callback, IRQF_TRIGGER_FALLING, "my gpio thing"); (some error handling removed, based on drivers/mmc/host/mmci.c) What is wrong with this picture? Do you mean that the problem is that the trigger type I just set up for the IRQ connected to the pin is not reflected in GPIO sysfs? Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/