[<prev] [next>] [day] [month] [year] [list]
Message-Id: <E1LojZq-0001MG-AM@be1.7eggert.dyndns.org>
Date: Tue, 31 Mar 2009 21:24:49 +0200
From: Bodo Eggert <7eggert@....de>
To: Ayman KHAMOUMA <ayman.khamouma@...com>,
linux-kernel@...r.kernel.org
Subject: Re: Sysfs with no struc device ?
Ayman KHAMOUMA <ayman.khamouma@...com> wrote:
> I'm trying to write a module which is supposed to write the state of a pin in
> a sysfs file. As it is neither a char device nor a block device, or anything
> else, I suposed taht I don't need any struct device...I mau be mistaking... So
> my question is: How can I create this file in sysfs without any struct device
> ?
Why don't you create a char device: Reader will get one char per status change
(and one initial char, off cause), while mmap will map the flag? You'd get
the interface you want (except the path beginning with /sys), and more.
Or, if you wanted a more sophisticated way, you could use a one-button-zero-axis
joystick device, very similar to the parport joystick. But I doubt it would make
sense for your usecase?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists