Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6567803rdb; Fri, 15 Dec 2023 02:11:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6WGeQ1H6hU6Sa5obtFOSQAldzbWr+y+ZMeisSH8NjP5qdZ4381ItI3FQReFLZuu6xCmmU X-Received: by 2002:a05:6358:91a8:b0:170:2b30:6597 with SMTP id j40-20020a05635891a800b001702b306597mr11106153rwa.8.1702635098911; Fri, 15 Dec 2023 02:11:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702635098; cv=none; d=google.com; s=arc-20160816; b=Rf6+8wral1AAAN7R1r4ePL7LnZjazwBsymuhSsU8T3KZoQtAJ+MMUJKU1bod8ayiCK UzBYWmvXwrVvfPMrnzbFp9wogsHfU1EKNM4gGdinEU+I+E2KsckN7yUKx2PZND3z3Wvd zzbRsFQvyWYuRU4coOd/8Y97ZKqsidQxTCsiywxJto3kUR3RGWIK1D6hG8Y0ITS04kdw Cq2ndj/kcWR1bS2Wfjoc3RmTZ8pPjUgvgGz1MzHgiXIMOIPrSa1K4WyGMsr/Q70BFgEw hsLILg9tU+KNNBdP0OnEHcdr+kGhb71JkZNyGvo4psV2GGBujdS1hfuB2rTZY4HY00oc KNbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZClYto7PgJCCrr0ox+LMP+1wuJLrVj3d03JzNgsPUVE=; fh=tkeKFJoffBkBfmI2U1Voj2y/DvUP3ToJLorIETzbrSk=; b=GriMAbYhNI2P+H97ZTTAuK7QhTGEo9MNqTFrbUz66T6kPw3LZgwCmtAuizyDgr4Utk vM8fyTx6Asxj3u/MFzCsQJsLqfFY/oaMnCxTCkbzl83AGcghpbRKWu9TzM+3Y7Bnurk7 ClCMmetZDkk2iieAicDqluO3sDnWaCZFrbDDNBz/O7fXHcbalWVlC3UONlo67eutZzpY 7N0GxtfO+xKTk50omzwsLTqf2pTeIK0XcfQ/ueD1gzm6IZxl7eakObS7G3C8WUTi3FJR tXlVva+imdIwz5SHAB6u3SKVhU7UyYWpc4dkXMFadRnvUKq2nD5N8qtVcJDrO5jwDrpX adpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m+9D8p19; spf=pass (google.com: domain of linux-kernel+bounces-724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-724-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id f15-20020a170902ce8f00b001d09c544508si12947189plg.420.2023.12.15.02.11.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 02:11:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m+9D8p19; spf=pass (google.com: domain of linux-kernel+bounces-724-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-724-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D2216B22EBF for ; Fri, 15 Dec 2023 10:10:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAE2A18E3D; Fri, 15 Dec 2023 10:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="m+9D8p19" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8C9618C19; Fri, 15 Dec 2023 10:10:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B13EC433C8; Fri, 15 Dec 2023 10:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702635020; bh=+IMN7z6g0qShOLd7JcJytNXZiHwmS0VJRsZHt710esw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m+9D8p19mbxf3P4K+cVu7TGd58XZW4cSBfa0UMFmNj0ZbLfzDFvbz7YJmhWovgD1v iVuLvZo9uJ/7K1Ie75G6FKXP3CW5kEpWLhrnRppmukD9l8fA9Qa1WyKmrxR+cReG83 EhY5DdE1Gg/Xl3lQgxOT4rYqEamS6daiSkVydzfx0vaML5olCe2/dbr5prX767MHCg VM9Y3FPxhedwr7gKTjGSK2kUR4AckQ0VKpb+BcFsnMPsiPehVD/YOPmmx9+KJqMsxc wKnVOzp4qTPQU5PBxQ5/MHpDer92ucS1MczoX/LiJusTKU8w+M3Bh8BnCHoxfJgp34 bVsypLfswEIxg== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rE595-0007cv-02; Fri, 15 Dec 2023 11:10:15 +0100 Date: Fri, 15 Dec 2023 11:10:15 +0100 From: Johan Hovold To: Stan Bertrand Cc: linux-usb@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] USB: serial: ftdi_sio: add ftdi serial to gpiochip label Message-ID: References: <20231003001135.2713961-1-sbertrand@witekio.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003001135.2713961-1-sbertrand@witekio.com> On Mon, Oct 02, 2023 at 05:11:35PM -0700, Stan Bertrand wrote: > From: Stanislas Bertrand > > Use ftdi serial number on gpiochip label. > Allows to interface with gpiod utils using the serial number: > > $ gpiodetect > gpiochip5 [ftdi-cbus-FTRelay2] (4 lines) > gpiochip6 [ftdi-cbus] (4 lines) > gpiochip7 [ftdi-cbus-A106TPEC] (4 lines) > > $ gpioget ftdi-cbus-FTRelay2 2 > 0 I don't think this is a good idea, for example, as not all devices have a unique serial string. Looks like the naming of gpiochips are all over the place, and ideally this should not have been something that was left up to individual driver to decide. I see several drivers using the name of the corresponding platform device as label, which works in most cases, but not always either. The only unique and always available identifier is the gpiochip's place in the device tree itself. For USB, we already encode the bus topology in the USB device names (e.g. 1-11.5.1) and we could possibly consider using that. But we already have USB serial devices with multiple GPIO chips so also that would require some further thought (e.g. using the interface name instead). Johan