All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: devicetree@vger.kernel.org,
	Ahmad Fatoum <a.fatoum@pengutronix.de>,
	linux-iio@vger.kernel.org,
	Robin van der Gracht <robin@protonic.nl>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	David Jander <david@protonic.nl>,
	Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH v5 2/2] counter: add IRQ or GPIO based event counter
Date: Fri, 26 Feb 2021 15:58:36 +0900	[thread overview]
Message-ID: <YDicHHebw9scA7to@shinobu> (raw)
In-Reply-To: <20210226064601.io6tznddikhcmvb3@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 2411 bytes --]

On Fri, Feb 26, 2021 at 07:46:01AM +0100, Oleksij Rempel wrote:
> On Wed, Feb 24, 2021 at 05:20:21PM +0900, William Breathitt Gray wrote:
> > 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).
> 
> ack, with one correction. cnt_signals should be allocated, otherwise
> this value will be set per driver not per device.
> 
> Regards,
> Oleksij
> -- 
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Yes you're right, cnt_signals will need to be allocated then because
these will be different per device.

Thanks,

William Breathitt Gray

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-02-26  6:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 13:53 [PATCH v5 0/2] add support for GPIO or IRQ based evemt counter Oleksij Rempel
2021-02-08 13:53 ` [PATCH v5 1/2] dt-bindings: counter: add event-counter binding Oleksij Rempel
2021-02-10 18:41   ` Rob Herring
2021-02-12  9:22     ` Linus Walleij
2021-02-12  9:29   ` Linus Walleij
2021-02-08 13:53 ` [PATCH v5 2/2] counter: add IRQ or GPIO based event counter Oleksij Rempel
2021-02-08 14:14   ` William Breathitt Gray
2021-02-12  9:26   ` Linus Walleij
2021-02-15  7:58     ` Oleksij Rempel
2021-02-14  8:54   ` William Breathitt Gray
2021-02-15  9:17     ` Oleksij Rempel
2021-02-22  1:43       ` William Breathitt Gray
2021-02-23 10:06         ` Oleksij Rempel
2021-02-23 17:45           ` Oleksij Rempel
2021-02-24  2:34             ` William Breathitt Gray
2021-02-24  7:35               ` Oleksij Rempel
2021-02-24  8:11                 ` William Breathitt Gray
2021-02-24  8:20                   ` William Breathitt Gray
2021-02-26  6:46                     ` Oleksij Rempel
2021-02-26  6:58                       ` William Breathitt Gray [this message]
2021-03-02 15:37               ` Linus Walleij
2021-02-14  7:43 ` [PATCH v5 0/2] add support for GPIO or IRQ based evemt counter William Breathitt Gray

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=YDicHHebw9scA7to@shinobu \
    --to=vilhelm.gray@gmail.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=david@protonic.nl \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=robin@protonic.nl \
    /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.