From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47150C433E0 for ; Tue, 19 May 2020 08:57:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 194EA206C3 for ; Tue, 19 May 2020 08:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589878630; bh=QTb3Ql3v/aztTHy7ZsdufagH77Euo0cwl1cejITKAxc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=MtuNbvO+DpW6ivuEHb21HCL6GQa0HaC6w+C0efZ4nFyGHGXrlRJ3kK9/hgV9jWxap dA3P9HBYaTSFkJnlhMMZa3kJAYwR+G+DJALq0CvwvRKYWZHhjecFdQrXkIVbBvBjP2 +XotTNARAPakq6Vg1JoW3ULpQ7c4HGEZYM3tvfUk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728314AbgESI5J (ORCPT ); Tue, 19 May 2020 04:57:09 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:38168 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726333AbgESI5J (ORCPT ); Tue, 19 May 2020 04:57:09 -0400 Received: by mail-lj1-f195.google.com with SMTP id m18so4457855ljo.5; Tue, 19 May 2020 01:57:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PJHKcK00srJhlFb8jqpH0pa2jLjQm3d68mr/bdpPl0o=; b=ILo5fpWBMUHSVbW16rPYP9TgKvY3X/cUYs3uflgQeM57NOpo+x/5oqhmbdKoVh/Bx9 UNezcqu2bgARRPRfYC+1ZqIB2ApMAnUysSbpiBgDHyPPl+K5sl0v7Xtn3Ii1pLPiHw55 7ESNa8J66H8RqFkVTeZYLy3ci9BedqaX7RheApLJbiJ7+RCxl+F7xRBwEDm5356Wnx9N beqAQAPg4FNlJSrMvNOJybHJuYywPGQqESYEMb/Sb/4h2mvv4NeaDiy/6qBIWp+aDhxV q9OocLKeYi8BSkqUfFeoUl6Su9pA2g4GgebVeBHnY9jxSpZvZEj4OfgIvsY5UwmuLeFI Uvtw== X-Gm-Message-State: AOAM5313BcphXphi71knahC3ANFq0VNti1pocoYdCs0yQXBly4dpJNtS JT34Mr6A/ciHhi54oK5zAF8= X-Google-Smtp-Source: ABdhPJw9kdDoj/n3y2c3jAmQFmEOC5xmPBh/xHYXAWLH6k22GtQ5jriaPD5bqpkRAlbM8vWGmhFrXQ== X-Received: by 2002:a2e:898c:: with SMTP id c12mr7157424lji.200.1589878624854; Tue, 19 May 2020 01:57:04 -0700 (PDT) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id z13sm8881061lfd.7.2020.05.19.01.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 01:57:04 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1jay3b-0001TY-4R; Tue, 19 May 2020 10:57:03 +0200 Date: Tue, 19 May 2020 10:57:03 +0200 From: Johan Hovold To: Manivannan Sadhasivam Cc: Linus Walleij , Johan Hovold , Greg KH , linux-usb , "linux-kernel@vger.kernel.org" , patong.mxl@gmail.com, "open list:GPIO SUBSYSTEM" Subject: Re: [PATCH 2/2] usb: serial: xr_serial: Add gpiochip support Message-ID: <20200519085703.GB27787@localhost> References: <20200428195651.6793-1-mani@kernel.org> <20200428195651.6793-3-mani@kernel.org> <20200429124918.GC6443@Mani-XPS-13-9360> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200429124918.GC6443@Mani-XPS-13-9360> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2020 at 06:19:18PM +0530, Manivannan Sadhasivam wrote: > On Wed, Apr 29, 2020 at 02:12:24PM +0200, Linus Walleij wrote: > > On Tue, Apr 28, 2020 at 9:57 PM wrote: > > > > > From: Manivannan Sadhasivam > > > > > > Add gpiochip support for Maxlinear/Exar USB to serial converter > > > for controlling the available gpios. > > > > > > Cc: Linus Walleij > > > Cc: linux-gpio@vger.kernel.org > > > Signed-off-by: Manivannan Sadhasivam > > I would change this: > > > > port_priv->gc.label = "xr_gpios"; > > > > to something that is device-unique, like "xr-gpios-" > > which makes it easy to locate the GPIOs on a specific serial converter > > for lab use. However the USB serial maintainers know better what > > to use here. Whatever makes a USB-to-serial unique from a TTY > > point of view is probably fine with me too. > > > > My idea is that people might want to know which USB cable > > this is sitting on, so I have this USB cable and from this label > > I can always figure out which GPIO device it is. I think we've had this discussion before. First, not every device has a unique serial number. Second, we already have a universal way of distinguishing devices namely by using the bus topology. That's available through sysfs and shouldn't have to be be re-encoded by every driver in the gpiochip name. > Sounds reasonable. I can postfix the PID as below: > > port_priv->gc.label = devm_kasprintf(port->dev, GFP_KERNEL, "XR%04x", > port_priv->idProduct); > > So this will become, "XR1410". So this doesn't really buy us anything; what if you have two of these devices? Johan