From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Engelmayer Subject: [RFC] Configure GPIO settings via the device tree Date: Fri, 13 Jul 2012 10:04:40 +0200 Message-ID: <20120713100440.7a80e05f@frequentis.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" To: grant.likely@secretlab.ca, linus.walleij@stericsson.com, devicetree-discuss@lists.ozlabs.org Cc: linuxppc-dev@lists.ozlabs.org, christian.engelmayer@frequentis.com List-Id: devicetree@vger.kernel.org Hello, I am looking for a way to configure GPIO initial settings and exports to the userspace via Sysfs in a generic way via a device tree. The purpose would be to have the same features as when initializing and exporting pins via platform code, eg. static struct gpio leds_gpios[] = { { 32, GPIOF_OUT_INIT_HIGH, "Power LED" }, /* default to ON */ { 33, GPIOF_OUT_INIT_LOW, "Green LED" }, /* default to OFF */ { 34, GPIOF_OUT_INIT_LOW, "Red LED" }, /* default to OFF */ { 35, GPIOF_OUT_INIT_LOW, "Blue LED" }, /* default to OFF */ { ... }, }; ,however, with no need for the kernel to know anything more about those pins and their later handling by simple userpsace drivers than the setup information provided in the device tree. This should also attack the problem of unstable GPIO numbers in the case of daughtercards on different base boards and would help provide a defined API to the userspace based on pin labels with the board specifics hidden in one place in the device tree. Is there already a way for realizing such a scenario ? Regards, Christian