public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Takashi Iwai <tiwai@suse.de>
Cc: perex@suse.cz, Tjeerd.Mulder@fujitsu-siemens.com,
	kernel list <linux-kernel@vger.kernel.org>
Subject: via82xx cmd line parsing is evil [was Re: Sound on newer arima notebook...]
Date: Thu, 1 Apr 2004 10:09:54 +0200	[thread overview]
Message-ID: <20040401080954.GA464@elf.ucw.cz> (raw)
In-Reply-To: <s5h7jx1xdel.wl@alsa2.suse.de>

Hi!

> > ...seems to work okay, except that mixers are strangely renumbered in
> > aumix. PCM2 has to be set to high if I want to hear something. Master
> > volume does not do anything.
> 
> tuning ac97_quirk option will help.
> (perhaps ac97_quirk=1)

via82xx command line parsing code is *evil*. It has completely
different parameters as a module / in kernel, and in-kernel parameters
shift according to the joystick support! (which is config_time option). Ouch.

Is there some easy way to convert MODULE_PARM with an array to some
more modern interface?
								Pavel

static int dxs_support[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)];
....
MODULE_PARM(dxs_support, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(dxs_support, "Support for DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = no VRA)");
MODULE_PARM_SYNTAX(dxs_support, SNDRV_ENABLED ",allows:{{0,4}},dialog:list");
....
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
#define SUPPORT_JOYSTICK 1
#endif
....
/* format is: snd-via82xx=enable,index,id,
                          mpu_port,joystick,
                          ac97_quirk,ac97_clock,dxs_support */

static int __init alsa_card_via82xx_setup(char *str)
{
        static unsigned __initdata nr_dev = 0;

        if (nr_dev >= SNDRV_CARDS)
                return 0;
        (void)(get_option(&str,&enable[nr_dev]) == 2 &&
               get_option(&str,&index[nr_dev]) == 2 &&
               get_id(&str,&id[nr_dev]) == 2 &&
               get_option_long(&str,&mpu_port[nr_dev]) == 2 &&
#ifdef SUPPORT_JOYSTICK
               get_option(&str,&joystick[nr_dev]) == 2 &&
#endif
               get_option(&str,&ac97_quirk[nr_dev]) == 2 &&
               get_option(&str,&ac97_clock[nr_dev]) == 2 &&
               get_option(&str,&dxs_support[nr_dev]) == 2);
        nr_dev++;
        return 1;
}


-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

  reply	other threads:[~2004-04-01  8:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-31 14:52 Sound on newer arima notebook Pavel Machek
2004-03-31 15:08 ` Takashi Iwai
2004-04-01  8:09   ` Pavel Machek [this message]
2004-04-01  8:23     ` via82xx cmd line parsing is evil [was Re: Sound on newer arima notebook...] Takashi Iwai
2004-04-01  8:29       ` Pavel Machek
2004-04-01  8:37         ` Takashi Iwai
2004-04-01  9:04           ` Takashi Iwai
2004-04-01  9:04           ` Pavel Machek
2004-04-01  9:15             ` Takashi Iwai
2004-04-01 10:41               ` Pavel Machek
2004-04-01 18:24               ` Pavel Machek
2004-04-01 18:28                 ` Takashi Iwai

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=20040401080954.GA464@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=Tjeerd.Mulder@fujitsu-siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --cc=tiwai@suse.de \
    /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