All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [alsa-cvslog] alsa-kernel: cmipci: disable "Modem" control on version 39 or newer chips
       [not found] <ALOGGER1197288764.96@alsa-project.org>
@ 2007-12-10 13:02 ` Thierry Vignaud
  2007-12-10 15:10   ` Clemens Ladisch
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Vignaud @ 2007-12-10 13:02 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

Clemens Ladisch <clemens@ladisch.de> writes:

> changeset:   5582:5082de4abb26
> tag:         tip
> user:        cladisch
> date:        Mon Dec 10 12:28:52 2007 +0100
> files:       pci/cmipci.c
> description:
> cmipci: disable "Modem" control on version 39 or newer chips
> 
> On version 39 or newer chips, we better remove the "Modem" control
> because this register bit now mutes the front channels of the
> multichannel stream.

shouldn't that deserve a comment in the code?
 
> diff -r eb09731e73d7 -r 5082de4abb26 pci/cmipci.c
> --- a/pci/cmipci.c	Mon Dec 03 17:08:40 2007 +0100
> +++ b/pci/cmipci.c	Mon Dec 10 12:28:52 2007 +0100
> @@ -2651,10 +2651,8 @@ static struct snd_kcontrol_new snd_cmipc
>  };
>  
>  /* card control switches */
> -static struct snd_kcontrol_new snd_cmipci_control_switches[] __devinitdata = {
> -	// DEFINE_CARD_SWITCH("Joystick", joystick), /* now module option */
> -	DEFINE_CARD_SWITCH("Modem", modem),
> -};
> +static struct snd_kcontrol_new snd_cmipci_modem_switch __devinitdata =
> +DEFINE_CARD_SWITCH("Modem", modem);
>  
>  
>  static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_device)
> @@ -2735,9 +2733,9 @@ static int __devinit snd_cmipci_mixer_ne
>  	}
>  
>  	/* card switches */
> -	sw = snd_cmipci_control_switches;
> -	for (idx = 0; idx < ARRAY_SIZE(snd_cmipci_control_switches); idx++, sw++) {
> -		err = snd_ctl_add(cm->card, snd_ctl_new1(sw, cm));
> +	if (cm->chip_version < 39) {
> +		err = snd_ctl_add(cm->card,
> +				  snd_ctl_new1(&snd_cmipci_modem_switch, cm));
>  		if (err < 0)
>  			return err;
>  	}
> 
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Alsa-cvslog mailing list
> Alsa-cvslog@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [alsa-cvslog] alsa-kernel: cmipci: disable "Modem" control on version 39 or newer chips
  2007-12-10 13:02 ` [alsa-cvslog] alsa-kernel: cmipci: disable "Modem" control on version 39 or newer chips Thierry Vignaud
@ 2007-12-10 15:10   ` Clemens Ladisch
  2007-12-10 17:23     ` Thierry Vignaud
  0 siblings, 1 reply; 3+ messages in thread
From: Clemens Ladisch @ 2007-12-10 15:10 UTC (permalink / raw)
  To: Thierry Vignaud; +Cc: alsa-devel

Thierry Vignaud wrote:
> Clemens Ladisch <clemens@ladisch.de> writes:
> > description:
> > cmipci: disable "Modem" control on version 39 or newer chips
> > 
> > On version 39 or newer chips, we better remove the "Modem" control
> > because this register bit now mutes the front channels of the
> > multichannel stream.
> 
> shouldn't that deserve a comment in the code?

Not in my opinion.  The "if (version < 39)" makes clear in which version
the control is used, and both the old and new bits are documented in the
respective data sheets. 


Regards,
Clemens

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [alsa-cvslog] alsa-kernel: cmipci: disable "Modem" control on version 39 or newer chips
  2007-12-10 15:10   ` Clemens Ladisch
@ 2007-12-10 17:23     ` Thierry Vignaud
  0 siblings, 0 replies; 3+ messages in thread
From: Thierry Vignaud @ 2007-12-10 17:23 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

"Clemens Ladisch" <clemens@ladisch.de> writes:

> > > description:
> > > cmipci: disable "Modem" control on version 39 or newer chips
> > > 
> > > On version 39 or newer chips, we better remove the "Modem" control
> > > because this register bit now mutes the front channels of the
> > > multichannel stream.
> > 
> > shouldn't that deserve a comment in the code?
> 
> Not in my opinion.  The "if (version < 39)" makes clear in which
> version the control is used, and both the old and new bits are
> documented in the respective data sheets.

Still a comment would prevent forcing people do double check the data
sheets in order to understand the code...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-10 17:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <ALOGGER1197288764.96@alsa-project.org>
2007-12-10 13:02 ` [alsa-cvslog] alsa-kernel: cmipci: disable "Modem" control on version 39 or newer chips Thierry Vignaud
2007-12-10 15:10   ` Clemens Ladisch
2007-12-10 17:23     ` Thierry Vignaud

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.