public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chase Douglas <cndougla@purdue.edu>
To: linux-kernel@vger.kernel.org
Subject: sysfs and configuration of a driver
Date: Tue, 12 Jul 2005 16:01:20 -0500	[thread overview]
Message-ID: <42D42FA0.4060802@purdue.edu> (raw)

I'm trying to update the ati_remote module so that it is configurable
without having to change the source and recompile. I'm rather new to
kernel module development and was wondering how I should go about
creating an interface for configuration. My current implementation
creates a device node for configuration. When you read from it, it dumps
key bindings for the remote. When you write to it, you can change the
key bindings like this:

echo "play KIND_FILTERED 207" > /dev/ati_remote

Which would change the play button on the remote to send the KEY_PLAY
(207 in linux/input.h) button instead of what was previously configured.
This works alright, but it seems to me that this should be handled in
sysfs. I was thinking that since hardly anyone would have more than one
remote, there should be one interface that would configure any remote
that is plugged into the computer. It should be permanent in my opinion
so I thought it should go somewhere in /sys/module/ati_remote/.

Would this be a good way of configuring the remote? If it is, how can I
create a sysfs file in the module directory and not the actual usb
device directory?

If this isn't a good way, how should it be done?

Also, how could a permanent configuration be achieved so that if you
reboot the computer or re-modprobe the driver, your previous mappings
are still intact?

Thank you

P.S.: Please CC me to your responses



                 reply	other threads:[~2005-07-12 21:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=42D42FA0.4060802@purdue.edu \
    --to=cndougla@purdue.edu \
    --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