All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"Linux Media Mailing List" <linux-media@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Kieran Bingham" <kieran.bingham@ideasonboard.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Jacopo Mondi" <jacopo@jmondi.org>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Sakari Ailus" <sakari.ailus@iki.fi>,
	"Hans Verkuil" <hverkuil@xs4all.nl>,
	"Hyun Kwon" <hyunk@xilinx.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Jacopo Mondi" <jacopo+renesas@jmondi.org>,
	"Laurent Pinchart" <laurent.pinchart+renesas@ideasonboard.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: Re: [PATCH v9 2/4] media: i2c: Add MAX9286 driver
Date: Thu, 14 May 2020 18:18:31 +0530	[thread overview]
Message-ID: <20200514124831.GG2877@Mani-XPS-13-9360> (raw)
In-Reply-To: <CAMuHMdWSEY2q1f1iobrSXHYWzweV9yjk4i1ROj2Yde7DJMiabQ@mail.gmail.com>

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
> <kieran.bingham+renesas@ideasonboard.com> 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 <jacopo+renesas@jmondi.org>
> > >>>> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> > >>>> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > >>>> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> > >>>> --- /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

  reply	other threads:[~2020-05-14 12:48 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 15:51 [PATCH v9 0/4] MAX9286 GMSL Support (+RDACM20) Kieran Bingham
2020-05-12 15:51 ` [PATCH v9 1/4] dt-bindings: media: i2c: Add bindings for Maxim Integrated MAX9286 Kieran Bingham
2020-05-12 22:33   ` Rob Herring
2020-05-13 12:54     ` Jacopo Mondi
2020-05-14  9:43       ` [PATCH] fixup! dt-bindings: media: i2c: Add bindings for Maxima Integrated MAX9286 Kieran Bingham
2020-05-14 10:20         ` Jacopo Mondi
2020-05-12 22:36   ` [PATCH v9 1/4] dt-bindings: media: i2c: Add bindings for Maxim " Rob Herring
2020-05-13 12:28     ` Jacopo Mondi
2020-05-12 15:51 ` [PATCH v9 2/4] media: i2c: Add MAX9286 driver Kieran Bingham
2020-05-12 17:40   ` Manivannan Sadhasivam
2020-05-14  9:53     ` Kieran Bingham
2020-05-14  9:59       ` Manivannan Sadhasivam
2020-05-14 10:05         ` Kieran Bingham
2020-05-12 18:17   ` Manivannan Sadhasivam
2020-05-14 10:02     ` Kieran Bingham
2020-05-14 10:13       ` Manivannan Sadhasivam
2020-05-14 11:47         ` Kieran Bingham
2020-05-14 11:59           ` Geert Uytterhoeven
2020-05-14 12:48             ` Manivannan Sadhasivam [this message]
2020-05-14 13:50               ` Kieran Bingham
2020-05-14 11:47         ` Kieran Bingham
2020-05-14 12:27           ` Kieran Bingham
2020-05-14 12:54             ` Manivannan Sadhasivam
2020-05-16 21:51   ` Sakari Ailus
2020-05-18 11:45     ` Kieran Bingham
2020-05-18 12:38       ` Jacopo Mondi
2020-05-18 13:09         ` Kieran Bingham
2020-05-18 16:11           ` [PATCH] fixes! [max9286]: Validate link formats Kieran Bingham
2020-05-18 18:44             ` Kieran Bingham
2020-05-19  8:13               ` Sakari Ailus
2020-05-19  7:56             ` Jacopo Mondi
2020-05-19  9:00               ` Kieran Bingham
2020-05-19  8:10       ` [PATCH v9 2/4] media: i2c: Add MAX9286 driver Sakari Ailus
2020-05-19  8:55         ` Kieran Bingham
2020-05-19  9:03           ` Sakari Ailus
2020-05-20  0:50       ` Laurent Pinchart
2020-05-26  8:54         ` Sakari Ailus
2020-05-12 15:51 ` [PATCH v9 3/4] dt-bindings: media: i2c: Add bindings for IMI RDACM2x Kieran Bingham
2020-05-12 15:51 ` [PATCH v9 4/4] media: i2c: Add RDACM20 driver Kieran Bingham
2020-05-16 22:36   ` Sakari Ailus
2020-05-18  7:35     ` Jacopo Mondi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200514124831.GG2877@Mani-XPS-13-9360 \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=hverkuil@xs4all.nl \
    --cc=hyunk@xilinx.com \
    --cc=jacopo+renesas@jmondi.org \
    --cc=jacopo@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.