From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756190AbcCOOVq (ORCPT ); Tue, 15 Mar 2016 10:21:46 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:35738 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628AbcCOOVo (ORCPT ); Tue, 15 Mar 2016 10:21:44 -0400 MIME-Version: 1.0 In-Reply-To: <1457703804-3016-6-git-send-email-ldewangan@nvidia.com> References: <1457703804-3016-1-git-send-email-ldewangan@nvidia.com> <1457703804-3016-6-git-send-email-ldewangan@nvidia.com> Date: Tue, 15 Mar 2016 15:21:43 +0100 Message-ID: Subject: Re: [PATCH V2 5/5] gpio: of: Add support to have multiple gpios in gpio-hog From: Linus Walleij To: Laxman Dewangan Cc: Rob Herring , =?UTF-8?Q?Pawe=C5=82_Moll?= , Mark Rutland , Markus Pargmann , Stephen Warren , Thierry Reding , Benoit Parrot , Alexandre Courbot , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...) (...) > - 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? Yours, Linus Walleij