* Sysfs with no struc device ?
@ 2009-03-31 16:19 Ayman KHAMOUMA
2009-03-31 19:27 ` Alan Cox
0 siblings, 1 reply; 3+ messages in thread
From: Ayman KHAMOUMA @ 2009-03-31 16:19 UTC (permalink / raw)
To: linux-kernel
Hi everybody,
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 ?
Regards,
Ayman
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Sysfs with no struc device ?
2009-03-31 16:19 Sysfs with no struc device ? Ayman KHAMOUMA
@ 2009-03-31 19:27 ` Alan Cox
0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2009-03-31 19:27 UTC (permalink / raw)
To: Ayman KHAMOUMA; +Cc: linux-kernel
On Tue, 31 Mar 2009 18:19:41 +0200
Ayman KHAMOUMA <ayman.khamouma@st.com> wrote:
> Hi everybody,
>
> 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 ?
Wrong question I think - if its a platform device then create a
platform_device for it ..
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Sysfs with no struc device ?
[not found] <clPat-8uW-5@gated-at.bofh.it>
@ 2009-03-31 19:24 ` Bodo Eggert
0 siblings, 0 replies; 3+ messages in thread
From: Bodo Eggert @ 2009-03-31 19:24 UTC (permalink / raw)
To: Ayman KHAMOUMA, linux-kernel
Ayman KHAMOUMA <ayman.khamouma@st.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?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-31 19:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-31 16:19 Sysfs with no struc device ? Ayman KHAMOUMA
2009-03-31 19:27 ` Alan Cox
[not found] <clPat-8uW-5@gated-at.bofh.it>
2009-03-31 19:24 ` Bodo Eggert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®