From: Greg KH <greg@kroah.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-hotplug-devel@lists.sourceforge.net
Subject: [PATCH] sysfs sound class patch for OSS drivers - [1/2]
Date: Wed, 07 Jan 2004 23:23:35 +0000 [thread overview]
Message-ID: <20040107232335.GD2540@kroah.com> (raw)
In-Reply-To: <20040107232137.GC2540@kroah.com>
Adds sysfs sound class support for all OSS drivers
Note, this is based on a previous patch from Leann Ogasawara
<ogasawara@osdl.org>, but modified a lot by me.
diff -Nru a/sound/oss/soundcard.c b/sound/oss/soundcard.c
--- a/sound/oss/soundcard.c Wed Jan 7 15:10:03 2004
+++ b/sound/oss/soundcard.c Wed Jan 7 15:10:03 2004
@@ -73,6 +73,7 @@
unsigned long seq_time = 0; /* Time for /dev/sequencer */
+extern struct class sound_class;
/*
* Table for configurable mixer volume handling
@@ -569,6 +570,9 @@
devfs_mk_cdev(MKDEV(SOUND_MAJOR, dev_list[i].minor),
S_IFCHR | dev_list[i].mode,
"sound/%s", dev_list[i].name);
+ simple_add_class_device(&sound_class,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor),
+ NULL, "%s", dev_list[i].name);
if (!dev_list[i].num)
continue;
@@ -578,6 +582,10 @@
dev_list[i].minor + (j*0x10)),
S_IFCHR | dev_list[i].mode,
"sound/%s%d", dev_list[i].name, j);
+ simple_add_class_device(&sound_class,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
+ NULL,
+ "%s%d", dev_list[i].name, j);
}
}
@@ -593,10 +601,13 @@
for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
devfs_remove("sound/%s", dev_list[i].name);
+ simple_remove_class_device(MKDEV(SOUND_MAJOR, dev_list[i].minor));
if (!dev_list[i].num)
continue;
- for (j = 1; j < *dev_list[i].num; j++)
+ for (j = 1; j < *dev_list[i].num; j++) {
devfs_remove("sound/%s%d", dev_list[i].name, j);
+ simple_remove_class_device(MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
+ }
}
unregister_sound_special(1);
diff -Nru a/sound/sound_core.c b/sound/sound_core.c
--- a/sound/sound_core.c Wed Jan 7 15:10:03 2004
+++ b/sound/sound_core.c Wed Jan 7 15:10:03 2004
@@ -65,6 +65,11 @@
extern int msnd_pinnacle_init(void);
#endif
+struct class sound_class = {
+ .name = "sound",
+};
+EXPORT_SYMBOL(sound_class);
+
/*
* Low level list operator. Scan the ordered list, find a hole and
* join into it. Called with the lock asserted
@@ -171,6 +176,8 @@
devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor),
S_IFCHR | mode, s->name);
+ simple_add_class_device(&sound_class, MKDEV(SOUND_MAJOR, s->unit_minor),
+ NULL, s->name+6);
return r;
fail:
@@ -193,6 +200,7 @@
spin_unlock(&sound_loader_lock);
if (p) {
devfs_remove(p->name);
+ simple_remove_class_device(MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p);
}
}
@@ -556,6 +564,7 @@
empty */
unregister_chrdev(SOUND_MAJOR, "sound");
devfs_remove("sound");
+ class_unregister(&sound_class);
}
static int __init init_soundcore(void)
@@ -565,6 +574,7 @@
return -EBUSY;
}
devfs_mk_dir ("sound");
+ class_register(&sound_class);
return 0;
}
-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
WARNING: multiple messages have this Message-ID (diff)
From: Greg KH <greg@kroah.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-hotplug-devel@lists.sourceforge.net
Subject: [PATCH] sysfs sound class patch for OSS drivers - [1/2]
Date: Wed, 7 Jan 2004 15:23:35 -0800 [thread overview]
Message-ID: <20040107232335.GD2540@kroah.com> (raw)
In-Reply-To: <20040107232137.GC2540@kroah.com>
Adds sysfs sound class support for all OSS drivers
Note, this is based on a previous patch from Leann Ogasawara
<ogasawara@osdl.org>, but modified a lot by me.
diff -Nru a/sound/oss/soundcard.c b/sound/oss/soundcard.c
--- a/sound/oss/soundcard.c Wed Jan 7 15:10:03 2004
+++ b/sound/oss/soundcard.c Wed Jan 7 15:10:03 2004
@@ -73,6 +73,7 @@
unsigned long seq_time = 0; /* Time for /dev/sequencer */
+extern struct class sound_class;
/*
* Table for configurable mixer volume handling
@@ -569,6 +570,9 @@
devfs_mk_cdev(MKDEV(SOUND_MAJOR, dev_list[i].minor),
S_IFCHR | dev_list[i].mode,
"sound/%s", dev_list[i].name);
+ simple_add_class_device(&sound_class,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor),
+ NULL, "%s", dev_list[i].name);
if (!dev_list[i].num)
continue;
@@ -578,6 +582,10 @@
dev_list[i].minor + (j*0x10)),
S_IFCHR | dev_list[i].mode,
"sound/%s%d", dev_list[i].name, j);
+ simple_add_class_device(&sound_class,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
+ NULL,
+ "%s%d", dev_list[i].name, j);
}
}
@@ -593,10 +601,13 @@
for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
devfs_remove("sound/%s", dev_list[i].name);
+ simple_remove_class_device(MKDEV(SOUND_MAJOR, dev_list[i].minor));
if (!dev_list[i].num)
continue;
- for (j = 1; j < *dev_list[i].num; j++)
+ for (j = 1; j < *dev_list[i].num; j++) {
devfs_remove("sound/%s%d", dev_list[i].name, j);
+ simple_remove_class_device(MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
+ }
}
unregister_sound_special(1);
diff -Nru a/sound/sound_core.c b/sound/sound_core.c
--- a/sound/sound_core.c Wed Jan 7 15:10:03 2004
+++ b/sound/sound_core.c Wed Jan 7 15:10:03 2004
@@ -65,6 +65,11 @@
extern int msnd_pinnacle_init(void);
#endif
+struct class sound_class = {
+ .name = "sound",
+};
+EXPORT_SYMBOL(sound_class);
+
/*
* Low level list operator. Scan the ordered list, find a hole and
* join into it. Called with the lock asserted
@@ -171,6 +176,8 @@
devfs_mk_cdev(MKDEV(SOUND_MAJOR, s->unit_minor),
S_IFCHR | mode, s->name);
+ simple_add_class_device(&sound_class, MKDEV(SOUND_MAJOR, s->unit_minor),
+ NULL, s->name+6);
return r;
fail:
@@ -193,6 +200,7 @@
spin_unlock(&sound_loader_lock);
if (p) {
devfs_remove(p->name);
+ simple_remove_class_device(MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p);
}
}
@@ -556,6 +564,7 @@
empty */
unregister_chrdev(SOUND_MAJOR, "sound");
devfs_remove("sound");
+ class_unregister(&sound_class);
}
static int __init init_soundcore(void)
@@ -565,6 +574,7 @@
return -EBUSY;
}
devfs_mk_dir ("sound");
+ class_register(&sound_class);
return 0;
}
next prev parent reply other threads:[~2004-01-07 23:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-07 23:21 [PATCH] sysfs sound class patches - [0/2] Greg KH
2004-01-07 23:21 ` Greg KH
2004-01-07 23:23 ` Greg KH [this message]
2004-01-07 23:23 ` [PATCH] sysfs sound class patch for OSS drivers - [1/2] Greg KH
2004-01-07 23:24 ` [PATCH] sysfs sound class patch for ALSA drivers - [2/2] Greg KH
2004-01-07 23:24 ` Greg KH
2004-01-08 20:08 ` [PATCH] sysfs sound class patch for OSS drivers - [1/2] Andreas Jellinghaus
2004-01-08 20:08 ` Andreas Jellinghaus
2004-01-08 12:41 ` [PATCH] sysfs sound class patches - [0/2] Kristof vansant
2004-01-08 13:40 ` Kristof vansant
2004-01-08 17:33 ` Takashi Iwai
2004-01-08 17:33 ` Takashi Iwai
2004-01-09 8:00 ` Greg KH
2004-01-09 8:00 ` Greg KH
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=20040107232335.GD2540@kroah.com \
--to=greg@kroah.com \
--cc=akpm@osdl.org \
--cc=linux-hotplug-devel@lists.sourceforge.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.