From: Bodo Eggert <7eggert@gmx.de>
To: Ayman KHAMOUMA <ayman.khamouma@st.com>, linux-kernel@vger.kernel.org
Subject: Re: Sysfs with no struc device ?
Date: Tue, 31 Mar 2009 21:24:49 +0200 [thread overview]
Message-ID: <E1LojZq-0001MG-AM@be1.7eggert.dyndns.org> (raw)
In-Reply-To: <clPat-8uW-5@gated-at.bofh.it>
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?
next parent reply other threads:[~2009-03-31 19:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <clPat-8uW-5@gated-at.bofh.it>
2009-03-31 19:24 ` Bodo Eggert [this message]
2009-03-31 16:19 Ayman KHAMOUMA
2009-03-31 19:27 ` Alan Cox
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=E1LojZq-0001MG-AM@be1.7eggert.dyndns.org \
--to=7eggert@gmx.de \
--cc=ayman.khamouma@st.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®