Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753702AbaLAOSq (ORCPT ); Mon, 1 Dec 2014 09:18:46 -0500 Received: from a.ns.miles-group.at ([95.130.255.143]:65275 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753448AbaLAOSo (ORCPT ); Mon, 1 Dec 2014 09:18:44 -0500 Message-ID: <547C78BF.3030709@nod.at> Date: Mon, 01 Dec 2014 15:18:39 +0100 From: Richard Weinberger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Linus Walleij CC: Harald Geyer , "linux-gpio@vger.kernel.org" , Javier Martinez Canillas , Alexandre Courbot , Stephen Warren , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: iio: dht11 broken References: <547B4464.9090300@nod.at> <547C4A26.3070108@nod.at> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 01.12.2014 um 15:08 schrieb Linus Walleij: > On Mon, Dec 1, 2014 at 11:59 AM, Richard Weinberger wrote: >> Am 01.12.2014 um 11:49 schrieb Harald Geyer: > >>> Any input from gpiolib people about what the proper fix would be in >>> their opinion, of course is appreciated. I don't think the dht11 driver >>> is doing anything unreasonable per se, so maybe they can clarify how >>> the API is intended to be used? >> >> Your driver sets up a GPIO as IRQ and then you switch the mode to output >> to enable the DHT sensor. >> This is not an API issue, it is an design issue. >> I'm not a hardware expert but AFAIK setting an IRQ pin into output mode can >> lead to undefined behavior. > > Well that check is there exactly to prevent madness like this. > > IRQs on pins set to output *does* *not* *make* *sense*. > > Remove the IRQ before setting the pin to output and vice > versa and everyone will be happier. Thanks for the confirmation. I'll cook up a patch. Thanks, //richard -- 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/