[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YDYMRVgC3BrjISKU@shinobu>
Date: Wed, 24 Feb 2021 17:20:21 +0900
From: William Breathitt Gray <vilhelm.gray@...il.com>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: devicetree@...r.kernel.org, Ahmad Fatoum <a.fatoum@...gutronix.de>,
linux-iio@...r.kernel.org,
Robin van der Gracht <robin@...tonic.nl>,
Linus Walleij <linus.walleij@...aro.org>,
linux-kernel@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
David Jander <david@...tonic.nl>,
Jonathan Cameron <jic23@...nel.org>
Subject: Re: [PATCH v5 2/2] counter: add IRQ or GPIO based event counter
On Wed, Feb 24, 2021 at 05:11:03PM +0900, William Breathitt Gray wrote:
> On Wed, Feb 24, 2021 at 08:35:06AM +0100, Oleksij Rempel wrote:
> > On Wed, Feb 24, 2021 at 11:34:06AM +0900, William Breathitt Gray wrote:
> > > Alternatively, we can take a more generic approach: ignore the GPIO
> > > names and focus solely on the IRQ lines; because the GPIO lines will
> > > always be tied to respective IRQ lines here, using the IRQ as the basis
> > > of the name should always be valid. The "name" member of the struct
> > > irq_chip can work for this. I haven't tested this, but I think something
> > > like this would work:
> > >
> > > cnt_signals[0].name = irq_get_chip(priv->irq)->name;
> >
> > ok, i'll take a look at it.
>
> If that doesn't work, then use devm_kasprintf() to generate the name
> based on the IRQ line number. The idea here is that the user should be
> able to identify that the Signal component for this Count is the
> respective IRQ.
>
> William Breathitt Gray
I realized that these irq_chip names are often just the device name
which isn't very useful either. :-(
In that case, I suppose we really are just left with generating the name
based on the IRQ line number then. This should be fine then:
cnt_signals[0].name = devm_kasprintf(dev, GFP_KERNEL, "IRQ %d",
priv->irq);
if (!cnt_signals[0].name)
return -ENOMEM;
I think this would make it clear to the user that this Signal is the
respective IRQ (whether sourced from GPIO or not).
William Breathitt Gray
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists