From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbbALK2G (ORCPT ); Mon, 12 Jan 2015 05:28:06 -0500 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:18684 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752020AbbALK2E (ORCPT ); Mon, 12 Jan 2015 05:28:04 -0500 X-IronPort-AV: E=Sophos;i="5.07,743,1413270000"; d="scan'208";a="54462795" Message-ID: <54B3A1B0.1010005@broadcom.com> Date: Mon, 12 Jan 2015 11:28:00 +0100 From: Arend van Spriel User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.24) Gecko/20111103 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: Linus Walleij CC: Benoit Parrot , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Alexandre Courbot , "Maxime Ripard" , Jiri Prchal , Pantelis Antoniou Subject: Re: [Patch v5 2/2] gpio: Document GPIO hogging mechanism References: <1419019671-25377-1-git-send-email-bparrot@ti.com> <1419019671-25377-3-git-send-email-bparrot@ti.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/12/15 11:20, Linus Walleij wrote: > On Fri, Dec 19, 2014 at 9:07 PM, Benoit Parrot wrote: > >> Add GPIO hogging documentation to gpio.txt >> >> Signed-off-by: Benoit Parrot >> Reviewed-by: Alexandre Courbot > > This is starting to look good ... > >> + line_b { >> + gpio-hog; >> + gpios =<6 0>; >> + state = "output-low"; > > I don't like the state string. > > Instead have boolean properties for all states. > > line_b { > gpio-hog; > gpios =<6 0>; > output-low; > line-name = "foo-bar-gpio"; > } > > Then use of_property_read_bool() in the code to check which > state is to be selected intially. You can check that no mutually > exclusive state are selected, I don't like that an arbitrary string > select the state like that, if we do it that way an enumerator would > be better, I prefer bools. To avoid the mutual exclusive state checking, would it not be more straightforward to use numeric enum values defined in boot/dts/include. Regards, Arend > 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/