* [PATCH][RFCA] Sound: adding /proc/driver/{vendor}/{dev_pci}/ac97 entry for es1371 driver
@ 2002-01-09 15:45 salvador
2002-01-09 16:06 ` Tommy Reynolds
0 siblings, 1 reply; 2+ messages in thread
From: salvador @ 2002-01-09 15:45 UTC (permalink / raw)
To: Alan Cox, Marcelo Tosatti, Thomas Sailer, Linux-kernel
Kernel: 2.4.17
Hardware: CT5880+Sigmatel Codec
Module: sound/es1371.c
The following patch adds a proc entry to fetch information about the codec
attached to the CT5880 (ES137x) chip.
Note: Most of the code is already in ac97_codec.c module.
Doubts:
1) This adds something like: /proc/driver/es1371/00:03.00/ac97 I took the
idea from emu10k1.c module. My doubt is about the `:' it looks wrong in a
file name, specially when that's usually used to separate file names/paths.
Should we pass it by a small routine that converts : into something like _?
2) I used a buffer of fixed length as in other modules, but I don't feel
really good doing it. What solutions are recommended? (if any)
diff -ru linux-2.4.17.ori/drivers/sound/es1371.c
linux-2.4.17/drivers/sound/es1371.c
--- linux-2.4.17.ori/drivers/sound/es1371.c Sun Sep 30 16:26:08 2001
+++ linux-2.4.17/drivers/sound/es1371.c Tue Jan 8 21:56:01 2002
@@ -110,6 +110,8 @@
* 31.01.2001 0.30 Register/Unregister gameport
* Fix SETTRIGGER non OSS API conformity
* 14.07.2001 0.31 Add list of laptops needing amplifier control
+ * 08.01.2002 0.32 Add /proc/driver/es1371/{card}/ac97 entry
+ * Salvador E. Tropea <salvador@inti.gov.ar>
*/
/*****************************************************************************/
@@ -2803,6 +2805,7 @@
unsigned long tmo;
signed long tmo2;
unsigned int cssr;
+ char proc_str[80];
if ((res=pci_enable_device(pcidev)))
return res;
@@ -2960,6 +2963,16 @@
for (i = 0; i < sizeof(initvol)/sizeof(initvol[0]); i++) {
val = initvol[i].vol;
mixdev_ioctl(&s->codec, initvol[i].mixch, (unsigned
long)&val);
+ }
+
+ /* create a proc entry to inform about the codec facilities */
+ strcpy(proc_str, "driver/es1371");
+ if (proc_mkdir (proc_str, 0)) {
+ sprintf(proc_str, "driver/es1371/%s", s->dev->slot_name);
+ if (proc_mkdir (proc_str, 0)) {
+ strcat(proc_str, "/ac97");
+ create_proc_read_entry(proc_str, 0, 0,
ac97_read_proc, &s->codec);
+ }
}
/* mute master and PCM when in S/PDIF mode */
if (s->spdif_volume != -1) {
<--------End of patch
--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set@computer.org set@ieee.org
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH][RFCA] Sound: adding /proc/driver/{vendor}/{dev_pci}/ac97 entry for es1371 driver
2002-01-09 15:45 [PATCH][RFCA] Sound: adding /proc/driver/{vendor}/{dev_pci}/ac97 entry for es1371 driver salvador
@ 2002-01-09 16:06 ` Tommy Reynolds
0 siblings, 0 replies; 2+ messages in thread
From: Tommy Reynolds @ 2002-01-09 16:06 UTC (permalink / raw)
To: salvador; +Cc: alan, marcelo, t.sailer, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]
Uttered "salvador" <salvador@inti.gov.ar>, spoke thus:
> Doubts:
> 1) This adds something like: /proc/driver/es1371/00:03.00/ac97 I took the
> idea from emu10k1.c module. My doubt is about the `:' it looks wrong in a
> file name, specially when that's usually used to separate file names/paths.
> Should we pass it by a small routine that converts : into something like _?
I wouldn't change it. In fact, Linux allows _any_ character except a NULL in a
filename, although POSIX doesn't. (Well, I wouldn't use a '/' in a filename
even if I escaped it out the wazoo!)
> 2) I used a buffer of fixed length as in other modules, but I don't feel
> really good doing it. What solutions are recommended? (if any)
The kernel stack is really small and doesn't grow, so a buffer allocated on the
stack could cause "load-dependent instability". Using a "vmalloc" and a "vfree"
is fast, cheap and easy.
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + -- -- -- -- -- -- -- -- -- --
Tommy Reynolds | mailto: <reynolds@redhat.com>
Red Hat, Inc., Embedded Development Services | Phone: +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA | FAX: +1.256.837.3839
Senior Software Developer | Mobile: +1.919.641.2923
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-01-09 16:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-09 15:45 [PATCH][RFCA] Sound: adding /proc/driver/{vendor}/{dev_pci}/ac97 entry for es1371 driver salvador
2002-01-09 16:06 ` Tommy Reynolds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox