From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966265AbcCPLbm (ORCPT ); Wed, 16 Mar 2016 07:31:42 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:10292 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934141AbcCPLbj (ORCPT ); Wed, 16 Mar 2016 07:31:39 -0400 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Wed, 16 Mar 2016 04:30:09 -0700 Message-ID: <56E940FC.3030506@nvidia.com> Date: Wed, 16 Mar 2016 16:48:20 +0530 From: Laxman Dewangan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Linus Walleij CC: Rob Herring , =?UTF-8?B?UGF3ZcWCIE1vbGw=?= , Mark Rutland , Markus Pargmann , Stephen Warren , Thierry Reding , Benoit Parrot , Alexandre Courbot , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V2 5/5] gpio: of: Add support to have multiple gpios in gpio-hog References: <1457703804-3016-1-git-send-email-ldewangan@nvidia.com> <1457703804-3016-6-git-send-email-ldewangan@nvidia.com> In-Reply-To: X-Originating-IP: [10.19.65.30] X-ClientProxiedBy: BGMAIL104.nvidia.com (10.25.59.13) To bgmail102.nvidia.com (10.25.59.11) 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 Tuesday 15 March 2016 07:51 PM, Linus Walleij wrote: > On Fri, Mar 11, 2016 at 2:43 PM, Laxman Dewangan wrote: > >> The child node for gpio hogs under gpio controller's node >> provide the mechanism to automatic GPIO request and >> configuration as part of the gpio-controller's driver >> probe function. >> >> Currently, property "gpio" takes one gpios for such >> configuration. Add support to have multiple GPIOs in >> this property so that multiple GPIOs of gpio-controller >> can be configured by this mechanism with one child node. >> >> Signed-off-by: Laxman Dewangan >> Cc: Benoit Parrot >> Cc: Alexandre Courbot >> >> --- >> Changes from V1: >> - Add "labels" property for GPIO label names. > Actually it's just "label" as seen from the code and the binding. > Though it would make sense to have labels (pluralis) as it can be more > than one and accompanies "gpios" which is plural. > > Rob: what is the pattern here? > > (Grep the existing bindings to check how multiple labels are handled > in other subsystems...) No property found for "labels" in the bindings folder. However, "label" is used for single string. If Rob is fine then we can go with "labels" to start something new.. > (...) >> - if (name && of_property_read_string(np, "line-name", name)) >> - *name = np->name; >> + if (!name) >> + goto out; >> >> + ret = of_property_read_string(np, "line-name", name); >> + if (ret) >> + ret = of_property_read_string_index(np, "label", gpio_index, >> + name); >> + if (ret) >> + *name = np->name; > This looks to me like if "line-name" is specified, all lines will get the > same name if gpios contain more than one item. Is this what we want? yaah, line-name is deprecated property and so not adding array string here. Array string will be supported with label only. I did not add print as deprecated property to avoid noise in log. We will be hardly have "labels" and "line-names" together. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laxman Dewangan Subject: Re: [PATCH V2 5/5] gpio: of: Add support to have multiple gpios in gpio-hog Date: Wed, 16 Mar 2016 16:48:20 +0530 Message-ID: <56E940FC.3030506@nvidia.com> References: <1457703804-3016-1-git-send-email-ldewangan@nvidia.com> <1457703804-3016-6-git-send-email-ldewangan@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Linus Walleij Cc: Rob Herring , =?UTF-8?B?UGF3ZcWCIE1vbGw=?= , Mark Rutland , Markus Pargmann , Stephen Warren , Thierry Reding , Benoit Parrot , Alexandre Courbot , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: devicetree@vger.kernel.org On Tuesday 15 March 2016 07:51 PM, Linus Walleij wrote: > On Fri, Mar 11, 2016 at 2:43 PM, Laxman Dewangan wrote: > >> The child node for gpio hogs under gpio controller's node >> provide the mechanism to automatic GPIO request and >> configuration as part of the gpio-controller's driver >> probe function. >> >> Currently, property "gpio" takes one gpios for such >> configuration. Add support to have multiple GPIOs in >> this property so that multiple GPIOs of gpio-controller >> can be configured by this mechanism with one child node. >> >> Signed-off-by: Laxman Dewangan >> Cc: Benoit Parrot >> Cc: Alexandre Courbot >> >> --- >> Changes from V1: >> - Add "labels" property for GPIO label names. > Actually it's just "label" as seen from the code and the binding. > Though it would make sense to have labels (pluralis) as it can be more > than one and accompanies "gpios" which is plural. > > Rob: what is the pattern here? > > (Grep the existing bindings to check how multiple labels are handled > in other subsystems...) No property found for "labels" in the bindings folder. However, "label" is used for single string. If Rob is fine then we can go with "labels" to start something new.. > (...) >> - if (name && of_property_read_string(np, "line-name", name)) >> - *name = np->name; >> + if (!name) >> + goto out; >> >> + ret = of_property_read_string(np, "line-name", name); >> + if (ret) >> + ret = of_property_read_string_index(np, "label", gpio_index, >> + name); >> + if (ret) >> + *name = np->name; > This looks to me like if "line-name" is specified, all lines will get the > same name if gpios contain more than one item. Is this what we want? yaah, line-name is deprecated property and so not adding array string here. Array string will be supported with label only. I did not add print as deprecated property to avoid noise in log. We will be hardly have "labels" and "line-names" together. -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html