Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (297 commits)
  ALSA: asihpi - Replace with snd_ctl_boolean_mono_info()
  ALSA: asihpi - HPI version 4.08
  ALSA: asihpi - Add volume mute controls
  ALSA: asihpi - Control name updates
  ALSA: asihpi - Use size_t for sizeof result
  ALSA: asihpi - Explicitly include mutex.h
  ALSA: asihpi - Add new node and message defines
  ALSA: asihpi - Make local function static
  ALSA: asihpi - Fix minor typos and spelling
  ALSA: asihpi - Remove unused structures, macros and functions
  ALSA: asihpi - Remove spurious adapter index check
  ALSA: asihpi - Revise snd_pcm_debug_name, get rid of DEBUG_NAME macro
  ALSA: asihpi - DSP code loader API now independent of OS
  ALSA: asihpi - Remove controlex structs and associated special data transfer code
  ALSA: asihpi - Increase request and response buffer sizes
  ALSA: asihpi - Give more meaningful name to hpi request message type
  ALSA: usb-audio - Add quirk for  Roland / BOSS BR-800
  ALSA: hda - Remove a superfluous argument of via_auto_init_output()
  ALSA: hda - Fix indep-HP path (de-)activation for VT1708* codecs
  ALSA: hda - Add documentation for codec-specific mixer controls
  ...
  • Loading branch information
torvalds committed Jul 23, 2011
2 parents 9d1c021 + 76531d4 commit e498037
Show file tree
Hide file tree
Showing 225 changed files with 31,768 additions and 25,966 deletions.
10 changes: 5 additions & 5 deletions Documentation/DocBook/writing-an-alsa-driver.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@
}
chip->port = pci_resource_start(pci, 0);
if (request_irq(pci->irq, snd_mychip_interrupt,
IRQF_SHARED, "My Chip", chip)) {
IRQF_SHARED, KBUILD_MODNAME, chip)) {
printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
snd_mychip_free(chip);
return -EBUSY;
Expand Down Expand Up @@ -1197,7 +1197,7 @@
/* pci_driver definition */
static struct pci_driver driver = {
.name = "My Own Chip",
.name = KBUILD_MODNAME,
.id_table = snd_mychip_ids,
.probe = snd_mychip_probe,
.remove = __devexit_p(snd_mychip_remove),
Expand Down Expand Up @@ -1340,7 +1340,7 @@
<programlisting>
<![CDATA[
if (request_irq(pci->irq, snd_mychip_interrupt,
IRQF_SHARED, "My Chip", chip)) {
IRQF_SHARED, KBUILD_MODNAME, chip)) {
printk(KERN_ERR "cannot grab irq %d\n", pci->irq);
snd_mychip_free(chip);
return -EBUSY;
Expand Down Expand Up @@ -1616,7 +1616,7 @@
<programlisting>
<![CDATA[
static struct pci_driver driver = {
.name = "My Own Chip",
.name = KBUILD_MODNAME,
.id_table = snd_mychip_ids,
.probe = snd_mychip_probe,
.remove = __devexit_p(snd_mychip_remove),
Expand Down Expand Up @@ -5816,7 +5816,7 @@ struct _snd_pcm_runtime {
<programlisting>
<![CDATA[
static struct pci_driver driver = {
.name = "My Chip",
.name = KBUILD_MODNAME,
.id_table = snd_my_ids,
.probe = snd_my_probe,
.remove = __devexit_p(snd_my_remove),
Expand Down
100 changes: 100 additions & 0 deletions Documentation/sound/alsa/HD-Audio-Controls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
This file explains the codec-specific mixer controls.

Realtek codecs
--------------

* Channel Mode
This is an enum control to change the surround-channel setup,
appears only when the surround channels are available.
It gives the number of channels to be used, "2ch", "4ch", "6ch",
and "8ch". According to the configuration, this also controls the
jack-retasking of multi-I/O jacks.

* Auto-Mute Mode
This is an enum control to change the auto-mute behavior of the
headphone and line-out jacks. If built-in speakers and headphone
and/or line-out jacks are available on a machine, this controls
appears.
When there are only either headphones or line-out jacks, it gives
"Disabled" and "Enabled" state. When enabled, the speaker is muted
automatically when a jack is plugged.

When both headphone and line-out jacks are present, it gives
"Disabled", "Speaker Only" and "Line-Out+Speaker". When
speaker-only is chosen, plugging into a headphone or a line-out jack
mutes the speakers, but not line-outs. When line-out+speaker is
selected, plugging to a headphone jack mutes both speakers and
line-outs.


IDT/Sigmatel codecs
-------------------

* Analog Loopback
This control enables/disables the analog-loopback circuit. This
appears only when "loopback" is set to true in a codec hint
(see HD-Audio.txt). Note that on some codecs the analog-loopback
and the normal PCM playback are exclusive, i.e. when this is on, you
won't hear any PCM stream.

* Swap Center/LFE
Swaps the center and LFE channel order. Normally, the left
corresponds to the center and the right to the LFE. When this is
ON, the left to the LFE and the right to the center.

* Headphone as Line Out
When this control is ON, treat the headphone jacks as line-out
jacks. That is, the headphone won't auto-mute the other line-outs,
and no HP-amp is set to the pins.

* Mic Jack Mode, Line Jack Mode, etc
These enum controls the direction and the bias of the input jack
pins. Depending on the jack type, it can set as "Mic In" and "Line
In", for determining the input bias, or it can be set to "Line Out"
when the pin is a multi-I/O jack for surround channels.


VIA codecs
----------

* Smart 5.1
An enum control to re-task the multi-I/O jacks for surround outputs.
When it's ON, the corresponding input jacks (usually a line-in and a
mic-in) are switched as the surround and the CLFE output jacks.

* Independent HP
When this enum control is enabled, the headphone output is routed
from an individual stream (the third PCM such as hw:0,2) instead of
the primary stream. In the case the headphone DAC is shared with a
side or a CLFE-channel DAC, the DAC is switched to the headphone
automatically.

* Loopback Mixing
An enum control to determine whether the analog-loopback route is
enabled or not. When it's enabled, the analog-loopback is mixed to
the front-channel. Also, the same route is used for the headphone
and speaker outputs. As a side-effect, when this mode is set, the
individual volume controls will be no longer available for
headphones and speakers because there is only one DAC connected to a
mixer widget.

* Dynamic Power-Control
This control determines whether the dynamic power-control per jack
detection is enabled or not. When enabled, the widgets power state
(D0/D3) are changed dynamically depending on the jack plugging
state for saving power consumptions. However, if your system
doesn't provide a proper jack-detection, this won't work; in such a
case, turn this control OFF.

* Jack Detect
This control is provided only for VT1708 codec which gives no proper
unsolicited event per jack plug. When this is on, the driver polls
the jack detection so that the headphone auto-mute can work, while
turning this off would reduce the power consumption.


Conexant codecs
---------------

* Auto-Mute Mode
See Reatek codecs.
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ L: [email protected]
L: [email protected] (moderated for non-subscribers)
W: http://wiki.analog.com/
S: Supported
F: sound/soc/codecs/adau*
F: sound/soc/codecs/adav*
F: sound/soc/codecs/ad1*
F: sound/soc/codecs/ssm*

Expand Down
1 change: 1 addition & 0 deletions include/linux/pci_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@
#define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041
#define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042
#define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043
#define PCI_SUBDEVICE_ID_CREATIVE_SB1270 0x0062
#define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000

#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */
Expand Down
4 changes: 3 additions & 1 deletion include/sound/rawmidi.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/spinlock.h>
#include <linux/wait.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>

#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
#include "seq_device.h"
Expand Down Expand Up @@ -63,6 +64,7 @@ struct snd_rawmidi_global_ops {
};

struct snd_rawmidi_runtime {
struct snd_rawmidi_substream *substream;
unsigned int drain: 1, /* drain stage */
oss: 1; /* OSS compatible mode */
/* midi stream buffer */
Expand All @@ -79,7 +81,7 @@ struct snd_rawmidi_runtime {
/* event handler (new bytes, input only) */
void (*event)(struct snd_rawmidi_substream *substream);
/* defers calls to event [input] or ops->trigger [output] */
struct tasklet_struct tasklet;
struct work_struct event_work;
/* private data */
void *private_data;
void (*private_free)(struct snd_rawmidi_substream *substream);
Expand Down
4 changes: 4 additions & 0 deletions include/sound/soc-dai.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ struct snd_soc_dai_driver {
struct snd_soc_pcm_stream capture;
struct snd_soc_pcm_stream playback;
unsigned int symmetric_rates:1;

/* probe ordering - for components with runtime dependencies */
int probe_order;
int remove_order;
};

/*
Expand Down
7 changes: 6 additions & 1 deletion include/sound/soc-dapm.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num);
int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm,
const struct snd_soc_dapm_route *route, int num);

/* dapm events */
int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
Expand Down Expand Up @@ -429,6 +431,7 @@ struct snd_soc_dapm_path {
/* status */
u32 connect:1; /* source and sink widgets are connected */
u32 walked:1; /* path has been walked */
u32 weak:1; /* path ignored for power management */

int (*connected)(struct snd_soc_dapm_widget *source,
struct snd_soc_dapm_widget *sink);
Expand All @@ -444,6 +447,7 @@ struct snd_soc_dapm_widget {
char *name; /* widget name */
char *sname; /* stream name */
struct snd_soc_codec *codec;
struct snd_soc_platform *platform;
struct list_head list;
struct snd_soc_dapm_context *dapm;

Expand Down Expand Up @@ -507,10 +511,11 @@ struct snd_soc_dapm_context {

struct device *dev; /* from parent - for debug */
struct snd_soc_codec *codec; /* parent codec */
struct snd_soc_platform *platform; /* parent platform */
struct snd_soc_card *card; /* parent card */

/* used during DAPM updates */
int dev_power;
enum snd_soc_bias_level target_bias_level;
struct list_head list;

#ifdef CONFIG_DEBUG_FS
Expand Down
59 changes: 53 additions & 6 deletions include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@
#define SOC_VALUE_ENUM_SINGLE_DECL(name, xreg, xshift, xmask, xtexts, xvalues) \
SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)

/*
* Component probe and remove ordering levels for components with runtime
* dependencies.
*/
#define SND_SOC_COMP_ORDER_FIRST -2
#define SND_SOC_COMP_ORDER_EARLY -1
#define SND_SOC_COMP_ORDER_NORMAL 0
#define SND_SOC_COMP_ORDER_LATE 1
#define SND_SOC_COMP_ORDER_LAST 2

/*
* Bias levels
*
Expand All @@ -214,10 +224,10 @@
* @OFF: Power Off. No restrictions on transition times.
*/
enum snd_soc_bias_level {
SND_SOC_BIAS_OFF,
SND_SOC_BIAS_STANDBY,
SND_SOC_BIAS_PREPARE,
SND_SOC_BIAS_ON,
SND_SOC_BIAS_OFF = 0,
SND_SOC_BIAS_STANDBY = 1,
SND_SOC_BIAS_PREPARE = 2,
SND_SOC_BIAS_ON = 3,
};

struct snd_jack;
Expand Down Expand Up @@ -258,6 +268,11 @@ enum snd_soc_compress_type {
SND_SOC_RBTREE_COMPRESSION
};

enum snd_soc_pcm_subclass {
SND_SOC_PCM_CLASS_PCM = 0,
SND_SOC_PCM_CLASS_BE = 1,
};

int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
unsigned int freq, int dir);
int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
Expand Down Expand Up @@ -297,6 +312,10 @@ int snd_soc_default_readable_register(struct snd_soc_codec *codec,
unsigned int reg);
int snd_soc_default_writable_register(struct snd_soc_codec *codec,
unsigned int reg);
int snd_soc_platform_read(struct snd_soc_platform *platform,
unsigned int reg);
int snd_soc_platform_write(struct snd_soc_platform *platform,
unsigned int reg, unsigned int val);

/* Utility functions to get clock rates from various things */
int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
Expand Down Expand Up @@ -349,6 +368,8 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
const char *prefix);
int snd_soc_add_controls(struct snd_soc_codec *codec,
const struct snd_kcontrol_new *controls, int num_controls);
int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
const struct snd_kcontrol_new *controls, int num_controls);
int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo);
int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
Expand Down Expand Up @@ -612,6 +633,10 @@ struct snd_soc_codec_driver {

void (*seq_notifier)(struct snd_soc_dapm_context *,
enum snd_soc_dapm_type, int);

/* probe ordering - for components with runtime dependencies */
int probe_order;
int remove_order;
};

/* SoC platform interface */
Expand All @@ -623,10 +648,17 @@ struct snd_soc_platform_driver {
int (*resume)(struct snd_soc_dai *dai);

/* pcm creation and destruction */
int (*pcm_new)(struct snd_card *, struct snd_soc_dai *,
struct snd_pcm *);
int (*pcm_new)(struct snd_soc_pcm_runtime *);
void (*pcm_free)(struct snd_pcm *);

/* Default control and setup, added after probe() is run */
const struct snd_kcontrol_new *controls;
int num_controls;
const struct snd_soc_dapm_widget *dapm_widgets;
int num_dapm_widgets;
const struct snd_soc_dapm_route *dapm_routes;
int num_dapm_routes;

/*
* For platform caused delay reporting.
* Optional.
Expand All @@ -636,6 +668,14 @@ struct snd_soc_platform_driver {

/* platform stream ops */
struct snd_pcm_ops *ops;

/* probe ordering - for components with runtime dependencies */
int probe_order;
int remove_order;

/* platform IO - used for platform DAPM */
unsigned int (*read)(struct snd_soc_platform *, unsigned int);
int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
};

struct snd_soc_platform {
Expand All @@ -650,6 +690,8 @@ struct snd_soc_platform {
struct snd_soc_card *card;
struct list_head list;
struct list_head card_list;

struct snd_soc_dapm_context dapm;
};

struct snd_soc_dai_link {
Expand Down Expand Up @@ -725,8 +767,10 @@ struct snd_soc_card {

/* callbacks */
int (*set_bias_level)(struct snd_soc_card *,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level);
int (*set_bias_level_post)(struct snd_soc_card *,
struct snd_soc_dapm_context *dapm,
enum snd_soc_bias_level level);

long pmdown_time;
Expand Down Expand Up @@ -789,6 +833,9 @@ struct snd_soc_pcm_runtime {
struct device dev;
struct snd_soc_card *card;
struct snd_soc_dai_link *dai_link;
struct mutex pcm_mutex;
enum snd_soc_pcm_subclass pcm_subclass;
struct snd_pcm_ops ops;

unsigned int complete:1;
unsigned int dev_registered:1;
Expand Down
Loading

0 comments on commit e498037

Please sign in to comment.