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=-5.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 B75F6C433E0 for ; Thu, 14 May 2020 12:48:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8437720722 for ; Thu, 14 May 2020 12:48:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="osEpHVY3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbgENMsr (ORCPT ); Thu, 14 May 2020 08:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725955AbgENMsq (ORCPT ); Thu, 14 May 2020 08:48:46 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F3D8C061A0C for ; Thu, 14 May 2020 05:48:46 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id fu13so12403438pjb.5 for ; Thu, 14 May 2020 05:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=HH9s1RO49ZtqpXezfn4WcfsL3Wu1eFjXG3a4er9M5VM=; b=osEpHVY3rjAZwkvGBQY6IZcjr+rWAvBBT3RR2pRCeF8WQqqjBUcFijQ2A1iO4kddqZ cGXn0Vybzjm5R+LuztSsPhQouakQyqEMsBeXFhyv+6rf8lg3reNxZFCiW3/eqQKp0IlF fMLZ/2w4qfZDRCenzSetTk/2Kx3ILp8b+M4mObysfC7J+jcb0hOWINsIOuPU+qwiU+/4 6opd3ZsAdTqC/4MboMI3ou9/eUjY+hOx2QbPa3m25L/2PB1ifPfqBNR4hlwD1nKqTwHJ L8ln7mINjlXveb0G4HGo32bwGC81ztYrCjy6GdOqWHRnfVJxWwsQIevDwAZrk3VKCWOA 3C8g== 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:content-transfer-encoding :in-reply-to:user-agent; bh=HH9s1RO49ZtqpXezfn4WcfsL3Wu1eFjXG3a4er9M5VM=; b=Y93q6nZ9A+AgxLmypExnaz0s3C7cwfAxLKFx5tpwywXeEm8lmFrREd56IX8kn+FJ3A /oCiWT2uOIuyGi1ELfSrpDvRp56TaST6U/vy18WdNm/94tM0L+penEtzfechxcGJCDq1 VUxqT84cfat2aeugNDfygip9eZfkYxTwYeHKoKPSIxPNs4uCUb/xsXjhwbiESm7g1NFO xjNbwnBYRxg/I/ck+67C71ATT72gP9RwYfym+1Vg+0lZwfGY6hkToZkhSM19yO9f2AmU grN7Blxq+swzrE7TZDCOSeDrE3bJEiIQgNeCAOkEGRYprR3SZ5AOS6011J9wF8ZmUBuL QFbg== X-Gm-Message-State: AOAM530P+QCXj4+D1VJzi4vB517q+0B6sxMmdyRBH/KSD1AKuD3SCrmO 85z4j54WCLN2JsmBGiCrLh7oLdgkxlNs X-Google-Smtp-Source: ABdhPJxdddKbpOXRE7WZ+kpkkncGEFB3l+dgPbB0dnOaYGPN7BHIpGk9Y0Z1bXstUpFiVvx4TZRSqQ== X-Received: by 2002:a17:902:d70f:: with SMTP id w15mr4121397ply.55.1589460525640; Thu, 14 May 2020 05:48:45 -0700 (PDT) Received: from Mani-XPS-13-9360 ([2409:4072:406:efde:ac17:556c:1ce3:639f]) by smtp.gmail.com with ESMTPSA id t21sm2126873pgu.39.2020.05.14.05.48.34 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 May 2020 05:48:44 -0700 (PDT) Date: Thu, 14 May 2020 18:18:31 +0530 From: Manivannan Sadhasivam To: Geert Uytterhoeven Cc: Kieran Bingham , 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 , Niklas =?iso-8859-1?Q?S=F6derlund?= , Sakari Ailus , Hans Verkuil , Hyun Kwon , Rob Herring , Jacopo Mondi , Laurent Pinchart , Niklas =?iso-8859-1?Q?S=F6derlund?= Subject: Re: [PATCH v9 2/4] media: i2c: Add MAX9286 driver Message-ID: <20200514124831.GG2877@Mani-XPS-13-9360> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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