Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751506AbdH0WaK (ORCPT ); Sun, 27 Aug 2017 18:30:10 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:35629 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352AbdH0WaG (ORCPT ); Sun, 27 Aug 2017 18:30:06 -0400 MIME-Version: 1.0 In-Reply-To: References: <1503418256-5215-1-git-send-email-oleksandrs@mellanox.com> From: Linus Walleij Date: Mon, 28 Aug 2017 00:30:05 +0200 Message-ID: Subject: Re: [patch v6 0/3] JTAG driver introduction To: Rick Altherr Cc: Oleksandr Shamray , "devicetree@vger.kernel.org" , =?UTF-8?B?SmnFmcOtIFDDrXJrbw==?= , Arnd Bergmann , system-sw-low-level@mellanox.com, Greg KH , OpenBMC Maillist , "linux-kernel@vger.kernel.org" , openocd-devel-owner@lists.sourceforge.net, mec@shout.net, Rob Herring , "linux-serial@vger.kernel.org" , vadimp@maellanox.com, Tobias Klauser , "linux-api@vger.kernel.org" , "linux-arm-kernel@lists.infradead.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 Content-Length: 1624 Lines: 38 On Fri, Aug 25, 2017 at 6:52 PM, Rick Altherr wrote: >> Incidentally, people are sending patches to expose the FTDI >> expanders as common GPIO chips under Linux, so we can >> internally in the kernel or from the usersapce character device >> access them as "some GPIOs". > > I know my team at Google has an internal patch for exactly that. FTDI > expanders are complicated as they can be used as UART, GPIO, I2C, SPI > depending on configuration. Our project was using a mix of I2C and > GPIO so I directly my team to approach it as an MFD. I'd like to see > all of these use cases handled by the kernel but I understand the > other viewpoint of relying on libusb for cross-platform compatiblity. Hm. I see. But I see people pushing the in-kernel method so I think it will eventually win out. >>>> In my worst nightmare they export GPIO lines using >>>> the horrid ABI in /sys/gpio/* >>> >>> https://sourceforge.net/p/openocd/code/ci/v0.10.0/tree/src/jtag/drivers/sysfsgpio.c >> >> Gnah! >> Whoever writes a slot-in replacement making the character device >> take precendence wins lots of karma. > > If they show up at Linux Plumbers or visit San Jose, I'll take them to > dinner. I didn't see any docs for the chardev in Documentation. I > _think_ I understand how it works from reading the relevant sections > of gpiolib.c but I can see how users end up using sysfs instead. I intended tools/gpio/* to be the documentation: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/gpio If we need more written documentation we can do it I guess, Yours, Linus Walleij