From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262758AbUDAI0o (ORCPT ); Thu, 1 Apr 2004 03:26:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262772AbUDAI0o (ORCPT ); Thu, 1 Apr 2004 03:26:44 -0500 Received: from ns.suse.de ([195.135.220.2]:45718 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id S262758AbUDAI0j (ORCPT ); Thu, 1 Apr 2004 03:26:39 -0500 Date: Thu, 01 Apr 2004 10:23:48 +0200 Message-ID: From: Takashi Iwai To: Pavel Machek Cc: perex@suse.cz, Tjeerd.Mulder@fujitsu-siemens.com, kernel list Subject: Re: via82xx cmd line parsing is evil [was Re: Sound on newer arima notebook...] In-Reply-To: <20040401080954.GA464@elf.ucw.cz> References: <20040331145206.GA384@elf.ucw.cz> <20040401080954.GA464@elf.ucw.cz> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 13) (Rational FORTRAN) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Thu, 1 Apr 2004 10:09:54 +0200, Pavel Machek wrote: > > 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. yep, i know it - it annoys me too... > Is there some easy way to convert MODULE_PARM with an array to some > more modern interface? there is a patch pending in my tree to allow empty boot options, such as snd-via82xx=,,,,,2 but it doesn't improve so much. perhaps the better way would be like snd-via82xx=enable:1,ac97_quirk:4 ?? in this way, it's hard to keep the compatibility with old boot parameters, but i don't think no one will complain if they see it nicer. Takashi > > 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?] >