Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1347537ybk; Thu, 14 May 2020 06:52:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLXjg7aDmSxiRPtgggcEkCtS5AcevvvgqKGCSXtp+gxXgAwMmQi4C74/qxVOaWK5ki3vVk X-Received: by 2002:a17:906:5f98:: with SMTP id a24mr4076184eju.214.1589464352150; Thu, 14 May 2020 06:52:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589464352; cv=none; d=google.com; s=arc-20160816; b=q6n+b5AVymgkXkzjGzyygJ3WeLFAbk9LbtLDZ/pTnzDkMiXQT55nporb6TnW0lu/O/ YBAh3tIaduxZ/uQasyfsuvSsPEI6s9e0wHYdkZCkvvEaJUtVtAyAnXJkcodSlscuUcKz nzzzh4Sfnq6cmjYnMXmcfjFCIVRDVe+Zi6+BTcroqp96I+dDaOvRoYcuIwfBF7JsB5+j C54/bsWWGRADk+2UeYVbR+f+r+oWsIkhAdzlseM+SRRvb7tG3B44H+h2f5Zco/t1AquJ eGLiJefHf2hBT0eLu3l6QFK9jHnJ8rkjc9oMqoJGIyxm4G/7ym3yEwk3GLIXhBHz2XRx xZUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:reply-to :dkim-signature; bh=1tEDuIjltZmGvxNuT+1asxU8SrqrSkj1tBA/M3QuSWo=; b=sRpj4v9RBckCLXiHjD4x4VRJ1dQcE/KFWc7UQPWguAVtVraor0qA68QbpcJwEIvUV9 asG6+72I9s88B9Y06luEyiVWk9s4FzFeztHgdgeUqsctl/ObCkYUfDk9+Dc6TstcpbNO DGcHB6XVKkJmGWpEyznd7aEIdPIHJ7+LvReBP5EJfQoqPUKBVOrEEjanxegprLulzjol xo6+wbXBLY1IpbHWtK4pJ6kdJAfglwU48JHWaUCtDzBBNv/Dus/jmkaHBTW0FoOFfBra e814H9E8gOYPrR4SNZr0AIAeEN94fU/rdgECC3+iWjfwPva5yw9uI9C3lZKj6ZfyXAUs 6SKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=aBTl4rsP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l19si1762973edr.184.2020.05.14.06.52.08; Thu, 14 May 2020 06:52:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=aBTl4rsP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726245AbgENNug (ORCPT + 99 others); Thu, 14 May 2020 09:50:36 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:38040 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbgENNuf (ORCPT ); Thu, 14 May 2020 09:50:35 -0400 Received: from [192.168.0.20] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9F2C0259; Thu, 14 May 2020 15:50:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1589464232; bh=57FjFvG/SssRG+W/xhAVtBZHMRugzREFdjSdETfXt6k=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=aBTl4rsPkZxZs/ah6v+P+aXuEqAFh/pNQXMb235hHpcC0NacbkpwJsXq7zijt4hIR qtkNVQvobueazyIxOkErh/HWKgB5HtPI15D2SsnxkJWDz3RRUMfQqOtCAAFNE+TqBz nD0gS4YkD4V98uHNIvUJo3NXpUXD8tyYgdTNQzyY= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH v9 2/4] media: i2c: Add MAX9286 driver To: Manivannan Sadhasivam , Geert Uytterhoeven Cc: 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?= 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> <20200514124831.GG2877@Mani-XPS-13-9360> From: Kieran Bingham Organization: Ideas on Board Message-ID: <8f1b0a8a-35b2-1d00-c156-74d9ec3058d6@ideasonboard.com> Date: Thu, 14 May 2020 14:50:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200514124831.GG2877@Mani-XPS-13-9360> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/05/2020 13:48, Manivannan Sadhasivam wrote: > On Thu, May 14, 2020 at 01:59:35PM +0200, Geert Uytterhoeven wrote: >> 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. >> > > Ah, my bad! Somehow I got confused that this delivers static name... Sorry for > the noise, Kieran. > >>> 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. >> > > Well, I should've pointed this instead of above... > > (lack of coffee) > >> 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. >> > > Ack. > > I think you should CC Linus W for next iteration to get review for gpiolib > implementation. Good idea. I think I'll drop the names though for now. -- Kieran > > Thanks, > Mani > >> 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