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=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3482CC433E1 for ; Thu, 14 May 2020 11:59:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D4022065D for ; Thu, 14 May 2020 11:59:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbgENL7u convert rfc822-to-8bit (ORCPT ); Thu, 14 May 2020 07:59:50 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:45233 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgENL7t (ORCPT ); Thu, 14 May 2020 07:59:49 -0400 Received: by mail-oi1-f193.google.com with SMTP id d191so3996461oib.12; Thu, 14 May 2020 04:59:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jEYL14eESp80nRZi1JF+P2foLyJj6Mx55wfqANlAKcc=; b=mOZzvlhKhc0E1a3RCsWPGY0HNbNz76iDOisqeGPJ9V9V4Wivspi+cQYF3H7WaxSWqr 45uvZzoGOPfKCeDuJZNOkUTLRAux98P1OShpPNZV1K7AqsgTbv+HzEz/jIQyqhsLSZaY 0cjxrRws5A2pt8hq0bdagJ8RVZBms4ySMuwLOaen7cz2dF42SYvuklXoDeNcd1mWFRlM gN03DbCaJRlnIFbC5j0ZDn0ReBFQuOe54wO5DDskCoMr4NSjjXxTeR29wCAJQaAaBOfP gaBRUW6YUv6mInUmSdCz6O45ubel2OOCzPZ3u3Y5nGWXAQrG1kF5RVCmoDQOXd6oFLIM mYLA== X-Gm-Message-State: AOAM530ICIdY2081pi8mgQqje1ppQHO5GW7qDiuzndKaRWTVK8uS9vGd 9EdRkhP/Rt49PEFiXrelQYMOUbh3ZZsw25X6xxU= X-Google-Smtp-Source: ABdhPJz88z3dxpOcoyTxa6ill55+uwbWotEXoYTdXICFz750JcG4sRlNn03GSjnTbn3iwd1O8UNJSvWqVG3FrE6YzlA= X-Received: by 2002:aca:895:: with SMTP id 143mr3197679oii.153.1589457587072; Thu, 14 May 2020 04:59:47 -0700 (PDT) MIME-Version: 1.0 References: <20200512155105.1068064-1-kieran.bingham+renesas@ideasonboard.com> <20200512155105.1068064-3-kieran.bingham+renesas@ideasonboard.com> <20200512181706.GA21014@Mani-XPS-13-9360> <11aca587-9438-4fba-081c-b82631e96989@ideasonboard.com> <20200514101356.GF2877@Mani-XPS-13-9360> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 14 May 2020 13:59:35 +0200 Message-ID: Subject: Re: [PATCH v9 2/4] media: i2c: Add MAX9286 driver To: Kieran Bingham Cc: Manivannan Sadhasivam , Linux-Renesas , Linux Media Mailing List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Mauro Carvalho Chehab , Kieran Bingham , Laurent Pinchart , Jacopo Mondi , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Sakari Ailus , Hans Verkuil , Hyun Kwon , Rob Herring , Jacopo Mondi , Laurent Pinchart , =?UTF-8?Q?Niklas_S=C3=B6derlund?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kieran, On Thu, May 14, 2020 at 1:47 PM Kieran Bingham wrote: > On 14/05/2020 11:13, Manivannan Sadhasivam wrote: > > On Thu, May 14, 2020 at 11:02:53AM +0100, Kieran Bingham wrote: > >> On 12/05/2020 19:17, Manivannan Sadhasivam wrote: > >>> On Tue, May 12, 2020 at 04:51:03PM +0100, Kieran Bingham wrote: > >>>> The MAX9286 is a 4-channel GMSL deserializer with coax or STP input and > >>>> CSI-2 output. The device supports multicamera streaming applications, > >>>> and features the ability to synchronise the attached cameras. > >>>> > >>>> CSI-2 output can be configured with 1 to 4 lanes, and a control channel > >>>> is supported over I2C, which implements an I2C mux to facilitate > >>>> communications with connected cameras across the reverse control > >>>> channel. > >>>> > >>>> Signed-off-by: Jacopo Mondi > >>>> Signed-off-by: Kieran Bingham > >>>> Signed-off-by: Laurent Pinchart > >>>> Signed-off-by: Niklas Söderlund > >>>> --- /dev/null > >>>> +++ b/drivers/media/i2c/max9286.c > >>>> +static int max9286_register_gpio(struct max9286_priv *priv) > >>>> +{ > >>>> + struct device *dev = &priv->client->dev; > >>>> + struct gpio_chip *gpio = &priv->gpio; > >>>> + int ret; > >>>> + > >>>> + static const char * const names[] = { > >>>> + "GPIO0OUT", > >>>> + "GPIO1OUT", > >>>> + }; > >>>> + > >>>> + /* Configure the GPIO */ > >>>> + gpio->label = dev_name(dev); > >>> > >>> So if you have more than one MAX9286 in a system, all gpiochips will appear > >>> with the same name. I'd recommend to append the index to distinguish properly. > >> > >> Ah yes, that's a good point, and I think I've even seen that. > >> > >> I'll fix it now. > > Oh, in fact actually this doesn't. > > gpiodetect prints: > > gpiochip10 [4-004c] (2 lines) > gpiochip11 [4-006c] (2 lines) > > and mostly references them as gpiochip10 and gpiochip11. Indeed, dev_name() should be different for each instance. > However, > > > [ 2.318533] gpio gpiochip11: Detected name collision for GPIO name 'GPIO0OUT' > > [ 2.325739] gpio gpiochip11: Detected name collision for GPIO name 'GPIO1OUT' > > That seems to be more of a problem for the gpio library, so I think I'll > just drop the const names. I don't think they add much value. These are the line names. If they're not unique, a warning is printed, but they are still registered. So probably you want to use kasprintf("%s.%s", dev_name(dev), names[i]) to generate names. See "[PATCH] gpiolib: Document that GPIO line names are not globally unique" (https://lore.kernel.org/linux-gpio/20200511101828.30046-1-geert+renesas@glider.be/) to clear up the details. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds