From mboxrd@z Thu Jan 1 00:00:00 1970 From: p.ittershagen@googlemail.com (Philipp Ittershagen) Date: Thu, 10 May 2012 16:16:36 +0200 Subject: interface for a hardware trigger driver In-Reply-To: <20120510131849.GA28844@ahauptfedora.berlin.teseq.com> References: <20120510090907.GA9154@ahauptfedora.berlin.teseq.com> <20120510125211.GB5622@peter> <20120510131849.GA28844@ahauptfedora.berlin.teseq.com> Message-ID: <20120510141636.GA11972@peter> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi Andre, On Thu, May 10, 2012 at 03:18:49PM +0200, Andre Haupt wrote: > Or better, reading the device file blocks and returns the trigger status (none, > triggered, aborted) and writing to the device file wakes up the sleeping > processes. > > So cat /dev/mydevice would block until an interrupt occurs or someone does > an echo foo > /dev/mydevice. this is even better, yes. > > I vagely remember having done that in the first place. I cant remember > why i went with the ioctl stuff back then, though. It's always good to drop ioctl code ;) Using the semantics you mentionend above for read() and write(), the code gets simpler and easier to follow IMHO. Greetings, Philipp