Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753370AbaBYRff (ORCPT ); Tue, 25 Feb 2014 12:35:35 -0500 Received: from avon.wwwdotorg.org ([70.85.31.133]:33454 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752992AbaBYRfb (ORCPT ); Tue, 25 Feb 2014 12:35:31 -0500 Message-ID: <530CD45A.8050803@wwwdotorg.org> Date: Tue, 25 Feb 2014 10:35:22 -0700 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Linus Walleij , Alexandre Courbot , Grant Likely , "devicetree@vger.kernel.org" CC: Chen-Yu Tsai , Heikki Krogerus , Johannes Berg , "David S. Miller" , Rhyland Klein , linux-wireless , netdev , linux-kernel , Arnd Bergmann , Mark Gross Subject: Re: [PATCH 2/4] net: rfkill: gpio: remove gpio names References: <1392900697-27577-1-git-send-email-heikki.krogerus@linux.intel.com> <1392900697-27577-3-git-send-email-heikki.krogerus@linux.intel.com> <53062F97.3050407@wwwdotorg.org> <5306E599.7020605@wwwdotorg.org> In-Reply-To: X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/25/2014 02:13 AM, Linus Walleij wrote: > On Fri, Feb 21, 2014 at 6:35 AM, Stephen Warren wrote: >> On 02/20/2014 06:55 PM, Chen-Yu Tsai wrote: > >>> That's correct. However using con_id to pass this results in different >>> behavior across DT and ACPI. A better way is to export the labeling >>> function so consumers can set meaningful labels themselves. ... > As in tegra30-beaver.dts... > > sdhci@78000000 { > status = "okay"; > cd-gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>; > wp-gpios = <&gpio TEGRA_GPIO(T, 3) GPIO_ACTIVE_HIGH>; > power-gpios = <&gpio TEGRA_GPIO(D, 7) GPIO_ACTIVE_HIGH>; > bus-width = <4>; > }; > > Instead of passing the GPIOs as index 0,1,2 they are named > and I do admit this has a nice "things are under control" aspect > to it. > > In the ACPI case the con_id is not used for anything. > > So it is basically there to satisfy the habit in some device > tree bindings to name gpio arrays instead of just passing gpios = <...>; > (The latter should be encouraged going forward.) Do you really want to switch from named GPIO lookups to index-based GPIO lookups? Index-based lookups make it much harder to extend the DT binding in a backwards-compatible fashion, especially in the face of optional GPIOs (of which all of CD, WP, power are). If we switch to a single gpios property, I'd assert we should still do named-based lookups using a parallel gpio-names property, just like most (all?) other resource types now support. If we do that, we'll still need the name parameter. -- 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/