public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: salvador <salvador@inti.gov.ar>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	Thomas Sailer <t.sailer@alumni.ethz.ch>,
	Linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH][RFCA] Sound: adding /proc/driver/{vendor}/{dev_pci}/ac97 entry  for es1371 driver
Date: Wed, 09 Jan 2002 12:45:15 -0300	[thread overview]
Message-ID: <3C3C658B.1DDBFA69@inti.gov.ar> (raw)

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




             reply	other threads:[~2002-01-09 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-09 15:45 salvador [this message]
2002-01-09 16:06 ` [PATCH][RFCA] Sound: adding /proc/driver/{vendor}/{dev_pci}/ac97 entry for es1371 driver Tommy Reynolds

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=3C3C658B.1DDBFA69@inti.gov.ar \
    --to=salvador@inti.gov.ar \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=t.sailer@alumni.ethz.ch \
    /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