Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1434768AbdDZOmZ (ORCPT ); Wed, 26 Apr 2017 10:42:25 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:36304 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1434666AbdDZOmU (ORCPT ); Wed, 26 Apr 2017 10:42:20 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Linus Walleij Date: Wed, 26 Apr 2017 16:42:18 +0200 Message-ID: Subject: Re: [PATCH v2 2/4] gpio - Add EXAR XRA1403 SPI GPIO expander driver To: Benjamin Henrion Cc: Nandor Han , Greg KH , "David S. Miller" , Geert Uytterhoeven , Mauro Carvalho Chehab , Daniel Vetter , Alexandre Courbot , Rob Herring , Mark Rutland , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Semi Malinen Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1468 Lines: 37 On Tue, Apr 25, 2017 at 9:07 AM, Benjamin Henrion wrote: > I doubt you will be able to convince the majority of people toggling > GPIOs via a simple shell script to switch to write a complex C > program. Not to mention cross compilation and the libraries > dependencies here. I do not need to convince anyone, I'm not into politics. The way to attract users to the character device is by offering better features... so we smack in the following goodies: - Need a userspace ABI? No more need to select CONFIG_GPIO_SYSFS! The chardev is always there for any gpio chip in newer kernels! Board vendors would have to actively delete core code to disable it! - Need open drain? The chardev will support that, the sysfs will never. - Need to set/get multiple lines with a single context switch? Chardev does this. Also the set operation will turn into a single register write if your driver implements .set_multiple() - All future needs: line biasing? Schmitt triggers? Drive strengths? All that will use the character device, and the sysfs ABI will never support any of it. > Is there some good cli tools to access the new char device? If they > are shipped with most distros, that would reduce the pain. I have those that come with the kernel: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/gpio Then libgpiod as mentioned: https://github.com/brgl/libgpiod/tree/master/src/tools Yours, Linus Walleij