Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc8a327d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa

* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa: (264 commits)
  [ALSA] version 1.0.15
  [ALSA] Fix thinko in cs4231 mce down check
  [ALSA] sun-cs4231: improved waiting after MCE down
  [ALSA] sun-cs4231: use cs4231-regs.h
  [ALSA] This simplifies and fixes waiting loops of the mce_down()
  [ALSA] This patch adds support for a wavetable chip on
  [ALSA] This patch removes open_mutex from the ad1848-lib as
  [ALSA] fix bootup crash in snd_gus_interrupt()
  [ALSA] hda-codec - Fix SKU ID function for realtek codecs
  [ALSA] Support  ASUS P701 eeepc [0x1043 0x82a1] support
  [ALSA] hda-codec - Add array terminator for dmic in STAC codec
  [ALSA] hdsp - Fix zero division
  [ALSA] usb-audio - Fix double comment
  [ALSA] hda-codec - Fix STAC922x volume knob control
  [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz
  [ALSA] hda-codec - Fix for Fujitsu Lifebook C1410
  [ALSA] mpu-401: remove MPU401_INFO_UART_ONLY flag
  [ALSA] mpu-401: do not require an ACK byte for the ENTER_UART command
  [ALSA] via82xx - Add DXS quirk for Shuttle AK31v2
  [ALSA] hda-codec - Fix input_mux numbers for vaio stac92xx
  ...
parents 92d15c2c 24837e6f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1933,7 +1933,7 @@ M: seasons@makosteszta.sote.hu
D: Original author of software suspend

N: Jaroslav Kysela
E: perex@suse.cz
E: perex@perex.cz
W: http://www.perex.cz
D: Original Author and Maintainer for HP 10/100 Mbit Network Adapters
D: ISA PnP
+107 −8
Original line number Diff line number Diff line
@@ -365,13 +365,14 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
  Module snd-cmipci
  -----------------

    Module for C-Media CMI8338 and 8738 PCI sound cards.
    Module for C-Media CMI8338/8738/8768/8770 PCI sound cards.

    mpu_port	- 0x300,0x310,0x320,0x330 = legacy port,
		  1 = integrated PCI port,
    mpu_port    - port address of MIDI interface (8338 only):
		  0x300,0x310,0x320,0x330 = legacy port,
		  0 = disable (default)
    fm_port     - 0x388 = legacy port,
		  1 = integrated PCI port (default),
    fm_port     - port address of OPL-3 FM synthesizer (8x38 only):
		  0x388 = legacy port,
		  1 = integrated PCI port (default on 8738),
		  0 = disable
    soft_ac3    - Software-conversion of raw SPDIF packets (model 033 only)
                  (default = 1)
@@ -768,6 +769,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    single_cmd  - Use single immediate commands to communicate with
		codecs (for debugging only)
    enable_msi	- Enable Message Signaled Interrupt (MSI) (default = off)
    power_save	- Automatic power-saving timtout (in second, 0 =
		disable)
    power_save_controller - Reset HD-audio controller in power-saving mode
		(default = on)

    This module supports one card and autoprobe.

@@ -828,6 +833,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.

	ALC268
	  3stack	3-stack model
	  toshiba	Toshiba A205
	  acer		Acer laptops
	  auto		auto-config reading BIOS (default)

	ALC662
@@ -842,7 +849,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
	  3stack-dig	3-jack with SPDIF I/O
	  6stack-dig	6-jack digital with SPDIF I/O
	  arima		Arima W820Di1
	  targa		Targa T8, MSI-1049 T8
	  asus-a7j	ASUS A7J
	  asus-a7m	ASUS A7M
	  macpro	MacPro support
	  mbp3		Macbook Pro rev3
	  imac24	iMac 24'' with jack detection
	  w2jc		ASUS W2JC
	  auto		auto-config reading BIOS (default)
@@ -854,6 +865,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
	  3stack-6ch-dig 3-jack 6-channel with SPDIF I/O
	  6stack-dig-demo  6-jack digital for Intel demo board
	  acer		Acer laptops (Travelmate 3012WTMi, Aspire 5600, etc)
	  acer-aspire	Acer Aspire 9810
	  medion	Medion Laptops
	  medion-md2	Medion MD2
	  targa-dig	Targa/MSI
@@ -862,6 +874,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
	  lenovo-101e	Lenovo 101E
	  lenovo-nb0763	Lenovo NB0763
	  lenovo-ms7195-dig Lenovo MS7195
	  haier-w66	Haier W66
	  6stack-hp	HP machines with 6stack (Nettle boards)
	  3stack-hp	HP machines with 3stack (Lucknow, Samba boards)
	  auto		auto-config reading BIOS (default)
@@ -885,6 +898,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
	  3stack-660-digout 3-jack with SPDIF OUT (for ALC660VD)
	  lenovo	Lenovo 3000 C200
	  dallas	Dallas laptops
	  hp		HP TX1000
	  auto		auto-config reading BIOS (default)

	CMI9880
@@ -920,6 +934,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
	  3stack	3-stack, shared surrounds
	  laptop	2-channel only (FSC V2060, Samsung M50)
	  laptop-eapd	2-channel with EAPD (Samsung R65, ASUS A6J)
	  laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
	  ultra		2-channel with EAPD (Samsung Ultra tablet PC)

	AD1988
@@ -945,14 +960,30 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
			can be adjusted.  Appearing only when compiled with
			$CONFIG_SND_DEBUG=y

	STAC9200/9205/9254
	STAC9200
	  ref		Reference board
	  dell-d21	Dell (unknown)
	  dell-d22	Dell (unknown)
	  dell-d23	Dell (unknown)
	  dell-m21	Dell Inspiron 630m, Dell Inspiron 640m
	  dell-m22	Dell Latitude D620, Dell Latitude D820
	  dell-m23	Dell XPS M1710, Dell Precision M90
	  dell-m24	Dell Latitude 120L
	  dell-m25	Dell Inspiron E1505n
	  dell-m26	Dell Inspiron 1501
	  dell-m27	Dell Inspiron E1705/9400
	  gateway	Gateway laptops with EAPD control

	STAC9205/9254
	  ref		Reference board
	  dell-m42	Dell (unknown)
	  dell-m43	Dell Precision
	  dell-m44	Dell Inspiron

	STAC9220/9221
	  ref		Reference board
	  3stack	D945 3stack
	  5stack	D945 5stack + SPDIF
	  dell		Dell XPS M1210
	  intel-mac-v1	Intel Mac Type 1
	  intel-mac-v2	Intel Mac Type 2
	  intel-mac-v3	Intel Mac Type 3
@@ -964,6 +995,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
	  macbook-pro	Intel Mac Book Pro 2nd generation (eq. type 3)
	  imac-intel	Intel iMac (eq. type 2)
	  imac-intel-20	Intel iMac (newer version) (eq. type 3)
	  dell-d81	Dell (unknown)
	  dell-d82	Dell (unknown)
	  dell-m81	Dell (unknown)
	  dell-m82	Dell XPS M1210

	STAC9202/9250/9251
	  ref		Reference board, base config
@@ -975,6 +1010,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
	  ref		Reference board
	  3stack	D965 3stack
	  5stack	D965 5stack + SPDIF
	  dell-3stack	Dell Dimension E520

	STAC9872
	  vaio		Setup for VAIO FE550G/SZ110
@@ -989,6 +1025,9 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    subsystem ID (output of "lspci -nv") to ALSA BTS or alsa-devel
    ML (see the section "Links and Addresses").

    power_save and power_save_controller options are for power-saving
    mode.  See powersave.txt for details.

    Note 2: If you get click noises on output, try the module option
	    position_fix=1 or 2.  position_fix=1 will use the SD_LPIB
	    register value without FIFO size correction as the current
@@ -1349,7 +1388,6 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    port	- port number or -1 (disable)
    irq		- IRQ number or -1 (disable)
    pnp		- PnP detection - 0 = disable, 1 = enable (default)
    uart_enter	- Issue UART_ENTER command at open - bool, default = on

    This module supports multiple devices and PnP.
    
@@ -1630,6 +1668,21 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    
    The power-management is supported.

  Module snd-sc6000
  -----------------

    Module for Gallant SC-6000 soundcard.

    port	- Port # (0x220 or 0x240)
    mss_port	- MSS Port # (0x530 or 0xe80)
    irq		- IRQ # (5,7,9,10,11)
    mpu_irq	- MPU-401 IRQ # (5,7,9,10) ,0 - no MPU-401 irq
    dma		- DMA # (1,3,0)

    This module supports multiple cards.

    This card is also known as Audio Excel DSP 16 or Zoltrix AV302.

  Module snd-sgalaxy
  ------------------

@@ -1650,9 +1703,11 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    Module for ENSONIQ SoundScape PnP cards.

    port	- Port # (PnP setup)
    wss_port	- WSS Port # (PnP setup)
    irq		- IRQ # (PnP setup)
    mpu_irq	- MPU-401 IRQ # (PnP setup)
    dma		- DMA # (PnP setup)
    dma2	- 2nd DMA # (PnP setup, -1 to disable)

    This module supports multiple cards.  ISA PnP must be enabled.
    You need sscape_ctl tool in alsa-tools package for loading
@@ -1697,8 +1752,52 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
    dma2            - DMA2 # for CS4232 PCM interface.
    isapnp          - ISA PnP detection - 0 = disable, 1 = enable (default)

    The below are options for wavefront_synth features:
    wf_raw	    - Assume that we need to boot the OS (default:no)
	If yes, then during driver loading, the state of the board is
	ignored, and we reset the board and load the firmware anyway.
    fx_raw	    - Assume that the FX process needs help (default:yes)
	If false, we'll leave the FX processor in whatever state it is
	when the driver is loaded.  The default is to download the
	microprogram and associated coefficients to set it up for
	"default" operation, whatever that means.
    debug_default   - Debug parameters for card initialization
    wait_usecs	    - How long to wait without sleeping, usecs
		      (default:150)
	This magic number seems to give pretty optimal throughput
	based on my limited experimentation. 
	If you want to play around with it and find a better value, be
	my guest. Remember, the idea is to get a number that causes us
	to just busy wait for as many WaveFront commands as possible,
	without coming up with a number so large that we hog the whole
	CPU. 
	Specifically, with this number, out of about 134,000 status
	waits, only about 250 result in a sleep. 
    sleep_interval  - How long to sleep when waiting for reply
		      (default: 100)
    sleep_tries	    - How many times to try sleeping during a wait
		      (default: 50)
    ospath	    - Pathname to processed ICS2115 OS firmware
		      (default:wavefront.os)
	The path name of the ISC2115 OS firmware.  In the recent
	version, it's handled via firmware loader framework, so it
	must be installed in the proper path, typically,
	/lib/firmware.
    reset_time	    - How long to wait for a reset to take effect
		      (default:2)
    ramcheck_time   - How many seconds to wait for the RAM test
		      (default:20)
    osrun_time	    - How many seconds to wait for the ICS2115 OS
		      (default:10)

    This module supports multiple cards and ISA PnP.

    Note: the firmware file "wavefront.os" was located in the earlier
          version in /etc.  Now it's loaded via firmware loader, and
	  must be in the proper firmware path, such as /lib/firmware.
	  Copy (or symlink) the file appropriately if you get an error
	  regarding firmware downloading after upgrading the kernel.

  Module snd-sonicvibes
  ---------------------

+11 −6
Original line number Diff line number Diff line
              Brief Notes on C-Media 8738/8338 Driver
              =======================================
         Brief Notes on C-Media 8338/8738/8768/8770 Driver
         =================================================

                   Takashi Iwai <tiwai@suse.de>

@@ -209,10 +209,13 @@ In addition to the standard SB mixer, CM8x38 provides more functions.
MIDI CONTROLLER
---------------

The MPU401-UART interface is disabled as default.  You need to set
module option "mpu_port" with a valid I/O port address to enable the
MIDI support.  The valid I/O ports are 0x300, 0x310, 0x320 and 0x330.
Choose the value which doesn't conflict with other cards.
With CMI8338 chips, the MPU401-UART interface is disabled as default.
You need to set the module option "mpu_port" to a valid I/O port address
to enable MIDI support.  Valid I/O ports are 0x300, 0x310, 0x320 and
0x330.  Choose a value that doesn't conflict with other cards.

With CMI8738 and newer chips, the MIDI interface is enabled by default
and the driver automatically chooses a port address.

There is _no_ hardware wavetable function on this chip (except for
OPL3 synth below).
@@ -230,6 +233,8 @@ Set "fm_port" module option for more cards.
The output quality of FM OPL/3 is, however, very weird.
I don't know why..

CMI8768 and newer chips do not have the FM synth.


Joystick and Modem
------------------
+135 −49
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@
      </affiliation>
     </author>

     <date>November 17, 2005</date>
     <edition>0.3.6</edition>
     <date>September 10, 2007</date>
     <edition>0.3.7</edition>

    <abstract>
      <para>
@@ -405,8 +405,9 @@
  /* definition of the chip-specific record */
  struct mychip {
          struct snd_card *card;
          // rest of implementation will be in the section
          // "PCI Resource Managements"
          /* rest of implementation will be in the section
           * "PCI Resource Managements"
           */
  };

  /* chip-specific destructor
@@ -414,7 +415,7 @@
   */
  static int snd_mychip_free(struct mychip *chip)
  {
          .... // will be implemented later...
          .... /* will be implemented later... */
  }

  /* component-destructor
@@ -440,8 +441,9 @@

          *rchip = NULL;

          // check PCI availability here
          // (see "PCI Resource Managements")
          /* check PCI availability here
           * (see "PCI Resource Managements")
           */
          ....

          /* allocate a chip-specific data with zero filled */
@@ -451,12 +453,13 @@

          chip->card = card;

          // rest of initialization here; will be implemented
          // later, see "PCI Resource Managements"
          /* rest of initialization here; will be implemented
           * later, see "PCI Resource Managements"
           */
          ....

          if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
                                    chip, &ops)) < 0) {
          err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
          if (err < 0) {
                  snd_mychip_free(chip);
                  return err;
          }
@@ -490,7 +493,8 @@
                  return -ENOMEM;

          /* (3) */
          if ((err = snd_mychip_create(card, pci, &chip)) < 0) {
          err = snd_mychip_create(card, pci, &chip);
          if (err < 0) {
                  snd_card_free(card);
                  return err;
          }
@@ -502,10 +506,11 @@
                  card->shortname, chip->ioport, chip->irq);

          /* (5) */
          .... // implemented later
          .... /* implemented later */

          /* (6) */
          if ((err = snd_card_register(card)) < 0) {
          err = snd_card_register(card);
          if (err < 0) {
                  snd_card_free(card);
                  return err;
          }
@@ -605,7 +610,8 @@
<![CDATA[
  struct mychip *chip;
  ....
  if ((err = snd_mychip_create(card, pci, &chip)) < 0) {
  err = snd_mychip_create(card, pci, &chip);
  if (err < 0) {
          snd_card_free(card);
          return err;
  }
@@ -666,7 +672,8 @@
          <informalexample>
            <programlisting>
<![CDATA[
  if ((err = snd_card_register(card)) < 0) {
  err = snd_card_register(card);
  if (err < 0) {
          snd_card_free(card);
          return err;
  }
@@ -1091,7 +1098,7 @@
  static int snd_mychip_free(struct mychip *chip)
  {
          /* disable hardware here if any */
          .... // (not implemented in this document)
          .... /* (not implemented in this document) */

          /* release the irq */
          if (chip->irq >= 0)
@@ -1119,7 +1126,8 @@
          *rchip = NULL;

          /* initialize the PCI entry */
          if ((err = pci_enable_device(pci)) < 0)
          err = pci_enable_device(pci);
          if (err < 0)
                  return err;
          /* check PCI availability (28bit DMA) */
          if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 ||
@@ -1141,7 +1149,8 @@
          chip->irq = -1;

          /* (1) PCI resource allocation */
          if ((err = pci_request_regions(pci, "My Chip")) < 0) {
          err = pci_request_regions(pci, "My Chip");
          if (err < 0) {
                  kfree(chip);
                  pci_disable_device(pci);
                  return err;
@@ -1156,10 +1165,10 @@
          chip->irq = pci->irq;

          /* (2) initialization of the chip hardware */
          .... //   (not implemented in this document)
          .... /*   (not implemented in this document) */

          if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
                                    chip, &ops)) < 0) {
          err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
          if (err < 0) {
                  snd_mychip_free(chip);
                  return err;
          }
@@ -1233,7 +1242,8 @@
        <informalexample>
          <programlisting>
<![CDATA[
  if ((err = pci_enable_device(pci)) < 0)
  err = pci_enable_device(pci);
  if (err < 0)
          return err;
  if (pci_set_dma_mask(pci, DMA_28BIT_MASK) < 0 ||
      pci_set_consistent_dma_mask(pci, DMA_28BIT_MASK) < 0) {
@@ -1294,7 +1304,8 @@
        <informalexample>
          <programlisting>
<![CDATA[
  if ((err = pci_request_regions(pci, "My Chip")) < 0) { 
  err = pci_request_regions(pci, "My Chip");
  if (err < 0) { 
          kfree(chip);
          pci_disable_device(pci);
          return err;
@@ -1322,7 +1333,7 @@
          <programlisting>
<![CDATA[
  if (request_irq(pci->irq, snd_mychip_interrupt,
                  IRQF_DISABLED|IRQF_SHARED, "My Chip", chip)) {
                  IRQF_SHARED, "My Chip", chip)) {
          printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
          snd_mychip_free(chip);
          return -EBUSY;
@@ -1773,7 +1784,8 @@
          struct snd_pcm_runtime *runtime = substream->runtime;

          runtime->hw = snd_mychip_playback_hw;
          // more hardware-initialization will be done here
          /* more hardware-initialization will be done here */
          ....
          return 0;
  }

@@ -1781,7 +1793,8 @@
  static int snd_mychip_playback_close(struct snd_pcm_substream *substream)
  {
          struct mychip *chip = snd_pcm_substream_chip(substream);
          // the hardware-specific codes will be here
          /* the hardware-specific codes will be here */
          ....
          return 0;

  }
@@ -1793,7 +1806,8 @@
          struct snd_pcm_runtime *runtime = substream->runtime;

          runtime->hw = snd_mychip_capture_hw;
          // more hardware-initialization will be done here
          /* more hardware-initialization will be done here */
          ....
          return 0;
  }

@@ -1801,7 +1815,8 @@
  static int snd_mychip_capture_close(struct snd_pcm_substream *substream)
  {
          struct mychip *chip = snd_pcm_substream_chip(substream);
          // the hardware-specific codes will be here
          /* the hardware-specific codes will be here */
          ....
          return 0;

  }
@@ -1844,10 +1859,12 @@
  {
          switch (cmd) {
          case SNDRV_PCM_TRIGGER_START:
                  // do something to start the PCM engine
                  /* do something to start the PCM engine */
                  ....
                  break;
          case SNDRV_PCM_TRIGGER_STOP:
                  // do something to stop the PCM engine
                  /* do something to stop the PCM engine */
                  ....
                  break;
          default:
                  return -EINVAL;
@@ -1900,8 +1917,8 @@
          struct snd_pcm *pcm;
          int err;

          if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1,
                                 &pcm)) < 0) 
          err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, &pcm);
          if (err < 0) 
                  return err;
          pcm->private_data = chip;
          strcpy(pcm->name, "My Chip");
@@ -1939,8 +1956,8 @@
          struct snd_pcm *pcm;
          int err;

          if ((err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1,
                                 &pcm)) < 0) 
          err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, &pcm);
          if (err < 0) 
                  return err;
          pcm->private_data = chip;
          strcpy(pcm->name, "My Chip");
@@ -2097,7 +2114,7 @@
          struct mychip *chip = snd_pcm_chip(pcm);
          /* free your own data */
          kfree(chip->my_private_pcm_data);
          // do what you like else
          /* do what you like else */
          ....
  }

@@ -2884,10 +2901,10 @@ struct _snd_pcm_runtime {
<![CDATA[
  switch (cmd) {
  case SNDRV_PCM_TRIGGER_START:
          // do something to start the PCM engine
          /* do something to start the PCM engine */
          break;
  case SNDRV_PCM_TRIGGER_STOP:
          // do something to stop the PCM engine
          /* do something to stop the PCM engine */
          break;
  default:
          return -EINVAL;
@@ -3071,7 +3088,7 @@ struct _snd_pcm_runtime {
                  spin_unlock(&chip->lock);
                  snd_pcm_period_elapsed(chip->substream);
                  spin_lock(&chip->lock);
                  // acknowledge the interrupt if necessary
                  /* acknowledge the interrupt if necessary */
          }
          ....
          spin_unlock(&chip->lock);
@@ -3134,7 +3151,7 @@ struct _snd_pcm_runtime {
                          snd_pcm_period_elapsed(substream);
                          spin_lock(&chip->lock);
                  }
                  // acknowledge the interrupt if necessary
                  /* acknowledge the interrupt if necessary */
          }
          ....
          spin_unlock(&chip->lock);
@@ -3455,6 +3472,13 @@ struct _snd_pcm_runtime {
      (casted to unsigned long) of some record to this field, too. 
      </para>

      <para>
      The <structfield>tlv</structfield> field can be used to provide
      metadata about the control; see the
      <link linkend="control-interface-tlv">
      <citetitle>Metadata</citetitle></link> subsection.
      </para>

      <para>
        The other three are
	<link linkend="control-interface-callbacks"><citetitle>
@@ -3604,7 +3628,7 @@ struct _snd_pcm_runtime {
	    <title>Example of info callback</title>
            <programlisting>
<![CDATA[
  static int snd_myctl_info(struct snd_kcontrol *kcontrol,
  static int snd_myctl_mono_info(struct snd_kcontrol *kcontrol,
                          struct snd_ctl_elem_info *uinfo)
  {
          uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
@@ -3639,7 +3663,7 @@ struct _snd_pcm_runtime {
          <informalexample>
            <programlisting>
<![CDATA[
  static int snd_myctl_info(struct snd_kcontrol *kcontrol,
  static int snd_myctl_enum_info(struct snd_kcontrol *kcontrol,
                          struct snd_ctl_elem_info *uinfo)
  {
          static char *texts[4] = {
@@ -3658,6 +3682,16 @@ struct _snd_pcm_runtime {
            </programlisting>
          </informalexample>
        </para>

        <para>
	  Some common info callbacks are prepared for easy use:
	<function>snd_ctl_boolean_mono_info()</function> and
	<function>snd_ctl_boolean_stereo_info()</function>.
	Obviously, the former is an info callback for a mono channel
	boolean item, just like <function>snd_myctl_mono_info</function>
	above, and the latter is for a stereo channel boolean item.
	</para>

      </section>

      <section id="control-interface-callbacks-get">
@@ -3794,7 +3828,8 @@ struct _snd_pcm_runtime {
        <informalexample>
          <programlisting>
<![CDATA[
  if ((err = snd_ctl_add(card, snd_ctl_new1(&my_control, chip))) < 0)
  err = snd_ctl_add(card, snd_ctl_new1(&my_control, chip));
  if (err < 0)
          return err;
]]>
          </programlisting>
@@ -3843,6 +3878,56 @@ struct _snd_pcm_runtime {
      </para>
    </section>

    <section id="control-interface-tlv">
      <title>Metadata</title>
      <para>
      To provide information about the dB values of a mixer control, use
      on of the <constant>DECLARE_TLV_xxx</constant> macros from
      <filename>&lt;sound/tlv.h&gt;</filename> to define a variable
      containing this information, set the<structfield>tlv.p
      </structfield> field to point to this variable, and include the
      <constant>SNDRV_CTL_ELEM_ACCESS_TLV_READ</constant> flag in the
      <structfield>access</structfield> field; like this:
      <informalexample>
        <programlisting>
<![CDATA[
  static DECLARE_TLV_DB_SCALE(db_scale_my_control, -4050, 150, 0);

  static struct snd_kcontrol_new my_control __devinitdata = {
          ...
          .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
                    SNDRV_CTL_ELEM_ACCESS_TLV_READ,
          ...
          .tlv.p = db_scale_my_control,
  };
]]>
        </programlisting>
      </informalexample>
      </para>

      <para>
      The <function>DECLARE_TLV_DB_SCALE</function> macro defines
      information about a mixer control where each step in the control's
      value changes the dB value by a constant dB amount.
      The first parameter is the name of the variable to be defined.
      The second parameter is the minimum value, in units of 0.01 dB.
      The third parameter is the step size, in units of 0.01 dB.
      Set the fourth parameter to 1 if the minimum value actually mutes
      the control.
      </para>

      <para>
      The <function>DECLARE_TLV_DB_LINEAR</function> macro defines
      information about a mixer control where the control's value affects
      the output linearly.
      The first parameter is the name of the variable to be defined.
      The second parameter is the minimum value, in units of 0.01 dB.
      The third parameter is the maximum value, in units of 0.01 dB.
      If the minimum value mutes the control, set the second parameter to
      <constant>TLV_DB_GAIN_MUTE</constant>.
      </para>
    </section>

  </chapter>


@@ -3880,7 +3965,7 @@ struct _snd_pcm_runtime {
  {
          struct mychip *chip = ac97->private_data;
          ....
          // read a register value here from the codec
          /* read a register value here from the codec */
          return the_register_value;
  }

@@ -3889,7 +3974,7 @@ struct _snd_pcm_runtime {
  {
          struct mychip *chip = ac97->private_data;
          ....
          // write the given register value to the codec
          /* write the given register value to the codec */
  }

  static int snd_mychip_ac97(struct mychip *chip)
@@ -3902,7 +3987,8 @@ struct _snd_pcm_runtime {
                  .read = snd_mychip_ac97_read,
          };

          if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &bus)) < 0)
          err = snd_ac97_bus(chip->card, 0, &ops, NULL, &bus);
          if (err < 0)
                  return err;
          memset(&ac97, 0, sizeof(ac97));
          ac97.private_data = chip;
@@ -4447,10 +4533,10 @@ struct _snd_pcm_runtime {
        <informalexample>
          <programlisting>
<![CDATA[
  struct list_head *list;
  struct snd_rawmidi_substream *substream;
  list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) {
          substream = list_entry(list, struct snd_rawmidi_substream, list);
  list_for_each_entry(substream,
                      &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams,
                      list {
          sprintf(substream->name, "My MIDI Port %d", substream->number + 1);
  }
  /* same for SNDRV_RAWMIDI_STREAM_INPUT */
+0 −7
Original line number Diff line number Diff line
@@ -303,10 +303,3 @@ ICE1712 supports only the unconventional format, interleaved
the buffer as the conventional (mono or 2-channels, 8 or 16bit) format
on OSS.
USB devices
-----------
Some USB devices support only 24bit format packed in 3bytes.  This
format is not supported by OSS and no conversion is provided by kernel
OSS emulation.  You can use the user-space OSS emulation via libaoss
instead.
Loading