Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753309AbaDYJ36 (ORCPT ); Fri, 25 Apr 2014 05:29:58 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:49143 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753257AbaDYJ3u (ORCPT ); Fri, 25 Apr 2014 05:29:50 -0400 MIME-Version: 1.0 In-Reply-To: References: <1398130543-19454-1-git-send-email-haojian.zhuang@linaro.org> Date: Fri, 25 Apr 2014 11:29:49 +0200 Message-ID: Subject: Re: [PATCH 1/2] gpio: pl061: get gpio base from alias id From: Linus Walleij To: Haojian Zhuang Cc: Grant Likely , Xu Wei , Rob Herring , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Baruch Siach 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, Apr 25, 2014 at 2:27 AM, Haojian Zhuang wrote: > Go it. But the gpio sysfs interface is using the gpio name with an > internal number. It'll make developer confusion since it's different > from datasheet > or schematics. Is there any plan to remove the confusion? First I am as always very suspicious about the sysfs interface since it is often used for madness like reimplementing leds-gpio.c, gpio_keys.c, extcon-gpio.c, gpio-regulator.c spi-gpio.c, w1-gpio.c or gpio_wdt.c in userspace for no good reason when the kernel should handle it. Yet there are exceptions where it's actually warranted. There is a possibility to set a label on the gpio line, so this should be used. C.f. commit 781f6d710d4482eab05cfaad50060a0ea8c0e4e0 "gpio: generic: Add label to platform data" Something like this is needed in this and other drivers needing to label its GPIO lines. It's much like how we name all pins in a pin controller really. I don't exactly know how we should achieve the same for labels to offsets in any given gpio_chip using some generic device tree labels for example, but I imagine it could be implemented in a generic fashion? Describing the names of gpio lines should be quite obvious hardware description suitable for the device tree. 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/