Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: "Hennerich, Michael" <Michael.Hennerich@analog.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Drivers <Drivers@analog.com>,
	"device-drivers-devel@blackfin.uclinux.org"
	<device-drivers-devel@blackfin.uclinux.org>
Subject: Re: [PATCH] IIO: TRIGGER: New sysfs based trigger
Date: Thu, 03 Feb 2011 10:13:41 +0000	[thread overview]
Message-ID: <4D4A7FD5.7020804@cam.ac.uk> (raw)
In-Reply-To: <544AC56F16B56944AEC3BD4E3D591771324C1659B8@LIMKCMBX1.ad.analog.com>

On 02/02/11 19:21, Hennerich, Michael wrote:
> Jonathan Cameron wrote on 2011-02-02:
>> On 02/02/11 13:30, michael.hennerich@analog.com wrote:
>>> From: Michael Hennerich <michael.hennerich@analog.com>
>>>
>>> This patch adds a new trigger that can be invoked by writing the sysfs
>>> file: trigger_now. This approach can be valuable during automated
>>> testing or in situations, where other trigger methods are not
>>> applicable. For example no RTC or spare GPIOs. Last but not least we
>>> can allow user space applications to produce
>> triggers.
>> Excellent.  Very handy for testing as you say.
>>
>> If we really want to commonly use this from userspace we will want a
>> means of registering more than one such trigger but this does fine for
>> test rigs. To do multiple triggers with this we could either just take
>> a module parameter or have a 'request_trigger' attribute under some
>> parent device.
>> Still that's a question for another day.  The current functionality is
>> enough to be getting on with.
> 
> Well - you can register as many triggers as you want.
> This is what platform_device.id is for.
Good point. I was clearly half asleep last night!

Thanks for the clarification.

Jonathan
> 
> See example below -
> 
> static struct platform_device iio_sysfs_trigger = {
>         .name           = "iio_sysfs_trigger",
>         .id             = 0,
>         .dev = {
>                 .platform_data = NULL,
>         },
> };
> 
> static struct platform_device iio_sysfs_trigger1 = {
>         .name           = "iio_sysfs_trigger",
>         .id             = 1,
>         .dev = {
>                 .platform_data = NULL,
>         },
> };
> 
> 
>         &bfin_dpmc,
> 
> static struct platform_device *my_devices[] __initdata = {
> 
> #if defined(CONFIG_IIO_SYSFS_TRIGGER) || defined(CONFIG_IIO_SYSFS_TRIGGER _MODULE)
>         &iio_sysfs_trigger,
>         &iio_sysfs_trigger1,
> #endif
> }
> 
> In the driver use:
> 
>> +     trig->name = kasprintf(GFP_KERNEL, "sysfstrig%d", pdev->id);
> 
> What the gpio trigger driver does is not necessary
> - it only replicates functionality already provided by the platform device bus.
> 
> -Michael
> 
> 
> Greetings,
> Michael
> 
> --
> Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
> Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368; Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin, Margaret Seif
> 
> 


  reply	other threads:[~2011-02-03 10:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 13:30 [PATCH] IIO: TRIGGER: New sysfs based trigger michael.hennerich
2011-02-02 18:22 ` Jonathan Cameron
2011-02-02 19:21   ` Hennerich, Michael
2011-02-03 10:13     ` Jonathan Cameron [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-02 19:21 michael.hennerich
2011-02-02 19:42 ` Greg KH
2011-02-02 19:55   ` Hennerich, Michael
2011-02-02 20:27     ` Greg KH
2011-02-02 20:36   ` Hennerich, Michael
2011-02-02 20:47     ` Mark Brown
2011-02-02 20:58     ` Greg KH
2011-02-03  9:58       ` Hennerich, Michael
2011-02-03 17:13         ` Greg KH
2011-02-04  8:38           ` Hennerich, Michael
2011-02-04 10:51             ` Jonathan Cameron
2011-02-04 14:55             ` Greg KH
2011-02-04 15:27               ` Jonathan Cameron
2011-02-04 15:34               ` Hennerich, Michael
2011-02-04 15:44                 ` Jonathan Cameron
2011-02-02 19:43 ` Greg KH
2011-02-02 19:50   ` Mark Brown
2011-02-02 20:26     ` Greg KH
2011-02-02 20:31       ` Mark Brown
2011-02-02 20:48         ` Greg KH
2011-02-02 20:13   ` Hennerich, Michael
2011-02-02 20:29     ` Greg KH
2011-02-03 10:10 michael.hennerich
2011-02-07 10:05 michael.hennerich

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=4D4A7FD5.7020804@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=Drivers@analog.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=linux-iio@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox