diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-28 17:25:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-28 17:25:01 -0400 |
commit | 68d99b2c8efcb6ed3807a55569300c53b5f88be5 (patch) | |
tree | f189c8f2132d3668a2f0e503f5c3f8695b26a1c8 /include/sound | |
parent | 0e59e7e7feb5a12938fbf9135147eeda3238c6c4 (diff) | |
parent | 8128c9f21509f9a8b6da94ac432d845dda458406 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (549 commits)
ALSA: hda - Fix ADC input-amp handling for Cx20549 codec
ALSA: hda - Keep EAPD turned on for old Conexant chips
ALSA: hda/realtek - Fix missing volume controls with ALC260
ASoC: wm8940: Properly set codec->dapm.bias_level
ALSA: hda - Fix pin-config for ASUS W90V
ALSA: hda - Fix surround/CLFE headphone and speaker pins order
ALSA: hda - Fix typo
ALSA: Update the sound git tree URL
ALSA: HDA: Add new revision for ALC662
ASoC: max98095: Convert codec->hw_write to snd_soc_write
ASoC: keep pointer to resource so it can be freed
ASoC: sgtl5000: Fix wrong mask in some snd_soc_update_bits calls
ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2
ASoC: da7210: Add support for line out and DAC
ASoC: da7210: Add support for DAPM
ALSA: hda/realtek - Fix DAC assignments of multiple speakers
ASoC: Use SGTL5000_LINREG_VDDD_MASK instead of hardcoded mask value
ASoC: Set sgtl5000->ldo in ldo_regulator_register
ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture
ASoC: wm8994: Use SND_SOC_DAPM_AIF_OUT for AIF3 Capture
...
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/adau1373.h | 34 | ||||
-rw-r--r-- | include/sound/asound.h | 4 | ||||
-rw-r--r-- | include/sound/initval.h | 2 | ||||
-rw-r--r-- | include/sound/jack.h | 1 | ||||
-rw-r--r-- | include/sound/mpu401.h | 7 | ||||
-rw-r--r-- | include/sound/pcm.h | 4 | ||||
-rw-r--r-- | include/sound/saif.h | 16 | ||||
-rw-r--r-- | include/sound/soc-dai.h | 37 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 16 | ||||
-rw-r--r-- | include/sound/soc.h | 107 | ||||
-rw-r--r-- | include/sound/tpa6130a2-plat.h | 6 | ||||
-rw-r--r-- | include/sound/wm1250-ev1.h | 27 | ||||
-rw-r--r-- | include/sound/wm5100.h | 59 |
13 files changed, 249 insertions, 71 deletions
diff --git a/include/sound/adau1373.h b/include/sound/adau1373.h new file mode 100644 index 000000000000..1b19c7666574 --- /dev/null +++ b/include/sound/adau1373.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Analog Devices ADAU1373 Audio Codec drive | ||
3 | * | ||
4 | * Copyright 2011 Analog Devices Inc. | ||
5 | * Author: Lars-Peter Clausen <lars@metafoo.de> | ||
6 | * | ||
7 | * Licensed under the GPL-2 or later. | ||
8 | */ | ||
9 | |||
10 | #ifndef __SOUND_ADAU1373_H__ | ||
11 | #define __SOUND_ADAU1373_H__ | ||
12 | |||
13 | enum adau1373_micbias_voltage { | ||
14 | ADAU1373_MICBIAS_2_9V = 0, | ||
15 | ADAU1373_MICBIAS_2_2V = 1, | ||
16 | ADAU1373_MICBIAS_2_6V = 2, | ||
17 | ADAU1373_MICBIAS_1_8V = 3, | ||
18 | }; | ||
19 | |||
20 | #define ADAU1373_DRC_SIZE 13 | ||
21 | |||
22 | struct adau1373_platform_data { | ||
23 | bool input_differential[4]; | ||
24 | bool lineout_differential; | ||
25 | bool lineout_ground_sense; | ||
26 | |||
27 | unsigned int num_drc; | ||
28 | uint8_t drc_setting[3][ADAU1373_DRC_SIZE]; | ||
29 | |||
30 | enum adau1373_micbias_voltage micbias1; | ||
31 | enum adau1373_micbias_voltage micbias2; | ||
32 | }; | ||
33 | |||
34 | #endif | ||
diff --git a/include/sound/asound.h b/include/sound/asound.h index 5d6074faa279..a2e4ff5ba9e9 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -706,7 +706,7 @@ struct snd_timer_tread { | |||
706 | * * | 706 | * * |
707 | ****************************************************************************/ | 707 | ****************************************************************************/ |
708 | 708 | ||
709 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6) | 709 | #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) |
710 | 710 | ||
711 | struct snd_ctl_card_info { | 711 | struct snd_ctl_card_info { |
712 | int card; /* card number */ | 712 | int card; /* card number */ |
@@ -803,6 +803,8 @@ struct snd_ctl_elem_info { | |||
803 | unsigned int items; /* R: number of items */ | 803 | unsigned int items; /* R: number of items */ |
804 | unsigned int item; /* W: item number */ | 804 | unsigned int item; /* W: item number */ |
805 | char name[64]; /* R: value name */ | 805 | char name[64]; /* R: value name */ |
806 | __u64 names_ptr; /* W: names list (ELEM_ADD only) */ | ||
807 | unsigned int names_length; | ||
806 | } enumerated; | 808 | } enumerated; |
807 | unsigned char reserved[128]; | 809 | unsigned char reserved[128]; |
808 | } value; | 810 | } value; |
diff --git a/include/sound/initval.h b/include/sound/initval.h index 1daa6dff8297..f99a0d2ddfe7 100644 --- a/include/sound/initval.h +++ b/include/sound/initval.h | |||
@@ -62,7 +62,7 @@ static int snd_legacy_find_free_irq(int *irq_table) | |||
62 | { | 62 | { |
63 | while (*irq_table != -1) { | 63 | while (*irq_table != -1) { |
64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, | 64 | if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, |
65 | IRQF_DISABLED | IRQF_PROBE_SHARED, "ALSA Test IRQ", | 65 | IRQF_PROBE_SHARED, "ALSA Test IRQ", |
66 | (void *) irq_table)) { | 66 | (void *) irq_table)) { |
67 | free_irq(*irq_table, (void *) irq_table); | 67 | free_irq(*irq_table, (void *) irq_table); |
68 | return *irq_table; | 68 | return *irq_table; |
diff --git a/include/sound/jack.h b/include/sound/jack.h index c140fc7cbd3f..63c790742db4 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h | |||
@@ -42,6 +42,7 @@ enum snd_jack_types { | |||
42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ | 42 | SND_JACK_MECHANICAL = 0x0008, /* If detected separately */ |
43 | SND_JACK_VIDEOOUT = 0x0010, | 43 | SND_JACK_VIDEOOUT = 0x0010, |
44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, | 44 | SND_JACK_AVOUT = SND_JACK_LINEOUT | SND_JACK_VIDEOOUT, |
45 | SND_JACK_LINEIN = 0x0020, | ||
45 | 46 | ||
46 | /* Kept separate from switches to facilitate implementation */ | 47 | /* Kept separate from switches to facilitate implementation */ |
47 | SND_JACK_BTN_0 = 0x4000, | 48 | SND_JACK_BTN_0 = 0x4000, |
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h index 1f1d53f8830b..20230db00ef1 100644 --- a/include/sound/mpu401.h +++ b/include/sound/mpu401.h | |||
@@ -50,7 +50,10 @@ | |||
50 | #define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ | 50 | #define MPU401_INFO_INTEGRATED (1 << 2) /* integrated h/w port */ |
51 | #define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ | 51 | #define MPU401_INFO_MMIO (1 << 3) /* MMIO access */ |
52 | #define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ | 52 | #define MPU401_INFO_TX_IRQ (1 << 4) /* independent TX irq */ |
53 | #define MPU401_INFO_IRQ_HOOK (1 << 5) /* mpu401 irq handler is called | ||
54 | from driver irq handler */ | ||
53 | #define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */ | 55 | #define MPU401_INFO_NO_ACK (1 << 6) /* No ACK cmd needed */ |
56 | #define MPU401_INFO_USE_TIMER (1 << 15) /* internal */ | ||
54 | 57 | ||
55 | #define MPU401_MODE_BIT_INPUT 0 | 58 | #define MPU401_MODE_BIT_INPUT 0 |
56 | #define MPU401_MODE_BIT_OUTPUT 1 | 59 | #define MPU401_MODE_BIT_OUTPUT 1 |
@@ -73,8 +76,7 @@ struct snd_mpu401 { | |||
73 | unsigned long port; /* base port of MPU-401 chip */ | 76 | unsigned long port; /* base port of MPU-401 chip */ |
74 | unsigned long cport; /* port + 1 (usually) */ | 77 | unsigned long cport; /* port + 1 (usually) */ |
75 | struct resource *res; /* port resource */ | 78 | struct resource *res; /* port resource */ |
76 | int irq; /* IRQ number of MPU-401 chip (-1 = poll) */ | 79 | int irq; /* IRQ number of MPU-401 chip */ |
77 | int irq_flags; | ||
78 | 80 | ||
79 | unsigned long mode; /* MPU401_MODE_XXXX */ | 81 | unsigned long mode; /* MPU401_MODE_XXXX */ |
80 | int timer_invoked; | 82 | int timer_invoked; |
@@ -131,7 +133,6 @@ int snd_mpu401_uart_new(struct snd_card *card, | |||
131 | unsigned long port, | 133 | unsigned long port, |
132 | unsigned int info_flags, | 134 | unsigned int info_flags, |
133 | int irq, | 135 | int irq, |
134 | int irq_flags, | ||
135 | struct snd_rawmidi ** rrawmidi); | 136 | struct snd_rawmidi ** rrawmidi); |
136 | 137 | ||
137 | #endif /* __SOUND_MPU401_H */ | 138 | #endif /* __SOUND_MPU401_H */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 54cb079b7bf1..0cf91b2f08ca 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -825,6 +825,8 @@ int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime, | |||
825 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, | 825 | int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime, |
826 | unsigned int cond, | 826 | unsigned int cond, |
827 | snd_pcm_hw_param_t var); | 827 | snd_pcm_hw_param_t var); |
828 | int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime, | ||
829 | unsigned int base_rate); | ||
828 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, | 830 | int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime, |
829 | unsigned int cond, | 831 | unsigned int cond, |
830 | int var, | 832 | int var, |
@@ -1035,6 +1037,8 @@ static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) | |||
1035 | atomic_dec(&substream->mmap_count); | 1037 | atomic_dec(&substream->mmap_count); |
1036 | } | 1038 | } |
1037 | 1039 | ||
1040 | int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream, | ||
1041 | struct vm_area_struct *area); | ||
1038 | /* mmap for io-memory area */ | 1042 | /* mmap for io-memory area */ |
1039 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) | 1043 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) |
1040 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP | 1044 | #define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP |
diff --git a/include/sound/saif.h b/include/sound/saif.h new file mode 100644 index 000000000000..d0e0de7984ec --- /dev/null +++ b/include/sound/saif.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __SOUND_SAIF_H__ | ||
10 | #define __SOUND_SAIF_H__ | ||
11 | |||
12 | struct mxs_saif_platform_data { | ||
13 | int (*init) (void); | ||
14 | int (*get_master_id) (unsigned int saif_id); | ||
15 | }; | ||
16 | #endif | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 5ad5f3a50c68..2413acc54883 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -24,13 +24,13 @@ struct snd_pcm_substream; | |||
24 | * Describes the physical PCM data formating and clocking. Add new formats | 24 | * Describes the physical PCM data formating and clocking. Add new formats |
25 | * to the end. | 25 | * to the end. |
26 | */ | 26 | */ |
27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | 27 | #define SND_SOC_DAIFMT_I2S 1 /* I2S mode */ |
28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | 28 | #define SND_SOC_DAIFMT_RIGHT_J 2 /* Right Justified mode */ |
29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | 29 | #define SND_SOC_DAIFMT_LEFT_J 3 /* Left Justified mode */ |
30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 4 /* L data MSB after FRM LRC */ |
31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 5 /* L data MSB during FRM LRC */ |
32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 6 /* AC97 */ |
33 | #define SND_SOC_DAIFMT_PDM 6 /* Pulse density modulation */ | 33 | #define SND_SOC_DAIFMT_PDM 7 /* Pulse density modulation */ |
34 | 34 | ||
35 | /* left and right justified also known as MSB and LSB respectively */ | 35 | /* left and right justified also known as MSB and LSB respectively */ |
36 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J | 36 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J |
@@ -42,8 +42,8 @@ struct snd_pcm_substream; | |||
42 | * DAI bit clocks can be be gated (disabled) when the DAI is not | 42 | * DAI bit clocks can be be gated (disabled) when the DAI is not |
43 | * sending or receiving PCM data in a frame. This can be used to save power. | 43 | * sending or receiving PCM data in a frame. This can be used to save power. |
44 | */ | 44 | */ |
45 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | 45 | #define SND_SOC_DAIFMT_CONT (1 << 4) /* continuous clock */ |
46 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ | 46 | #define SND_SOC_DAIFMT_GATED (2 << 4) /* clock is gated */ |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * DAI hardware signal inversions. | 49 | * DAI hardware signal inversions. |
@@ -51,10 +51,10 @@ struct snd_pcm_substream; | |||
51 | * Specifies whether the DAI can also support inverted clocks for the specified | 51 | * Specifies whether the DAI can also support inverted clocks for the specified |
52 | * format. | 52 | * format. |
53 | */ | 53 | */ |
54 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | 54 | #define SND_SOC_DAIFMT_NB_NF (1 << 8) /* normal bit clock + frame */ |
55 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */ | 55 | #define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */ |
56 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */ | 56 | #define SND_SOC_DAIFMT_IB_NF (3 << 8) /* invert BCLK + nor FRM */ |
57 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */ | 57 | #define SND_SOC_DAIFMT_IB_IF (4 << 8) /* invert BCLK + FRM */ |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * DAI hardware clock masters. | 60 | * DAI hardware clock masters. |
@@ -63,10 +63,10 @@ struct snd_pcm_substream; | |||
63 | * i.e. if the codec is clk and FRM master then the interface is | 63 | * i.e. if the codec is clk and FRM master then the interface is |
64 | * clk and frame slave. | 64 | * clk and frame slave. |
65 | */ | 65 | */ |
66 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */ | 66 | #define SND_SOC_DAIFMT_CBM_CFM (1 << 12) /* codec clk & FRM master */ |
67 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */ | 67 | #define SND_SOC_DAIFMT_CBS_CFM (2 << 12) /* codec clk slave & FRM master */ |
68 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | 68 | #define SND_SOC_DAIFMT_CBM_CFS (3 << 12) /* codec clk master & frame slave */ |
69 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */ | 69 | #define SND_SOC_DAIFMT_CBS_CFS (4 << 12) /* codec clk & FRM slave */ |
70 | 70 | ||
71 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | 71 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f |
72 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | 72 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 |
@@ -242,6 +242,9 @@ struct snd_soc_dai { | |||
242 | void *playback_dma_data; | 242 | void *playback_dma_data; |
243 | void *capture_dma_data; | 243 | void *capture_dma_data; |
244 | 244 | ||
245 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
246 | unsigned int rate; | ||
247 | |||
245 | /* parent platform/codec */ | 248 | /* parent platform/codec */ |
246 | union { | 249 | union { |
247 | struct snd_soc_platform *platform; | 250 | struct snd_soc_platform *platform; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index e0583b7769cb..17a4c17f19f5 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -381,6 +381,9 @@ int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, | |||
381 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, | 381 | int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, |
382 | const char *pin); | 382 | const char *pin); |
383 | 383 | ||
384 | /* Mostly internal - should not normally be used */ | ||
385 | void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason); | ||
386 | |||
384 | /* dapm widget types */ | 387 | /* dapm widget types */ |
385 | enum snd_soc_dapm_type { | 388 | enum snd_soc_dapm_type { |
386 | snd_soc_dapm_input = 0, /* input pin */ | 389 | snd_soc_dapm_input = 0, /* input pin */ |
@@ -473,6 +476,8 @@ struct snd_soc_dapm_widget { | |||
473 | unsigned char ext:1; /* has external widgets */ | 476 | unsigned char ext:1; /* has external widgets */ |
474 | unsigned char force:1; /* force state */ | 477 | unsigned char force:1; /* force state */ |
475 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ | 478 | unsigned char ignore_suspend:1; /* kept enabled over suspend */ |
479 | unsigned char new_power:1; /* power from this run */ | ||
480 | unsigned char power_checked:1; /* power checked this run */ | ||
476 | int subseq; /* sort within widget type */ | 481 | int subseq; /* sort within widget type */ |
477 | 482 | ||
478 | int (*power_check)(struct snd_soc_dapm_widget *w); | 483 | int (*power_check)(struct snd_soc_dapm_widget *w); |
@@ -492,6 +497,9 @@ struct snd_soc_dapm_widget { | |||
492 | 497 | ||
493 | /* used during DAPM updates */ | 498 | /* used during DAPM updates */ |
494 | struct list_head power_list; | 499 | struct list_head power_list; |
500 | struct list_head dirty; | ||
501 | int inputs; | ||
502 | int outputs; | ||
495 | }; | 503 | }; |
496 | 504 | ||
497 | struct snd_soc_dapm_update { | 505 | struct snd_soc_dapm_update { |
@@ -524,6 +532,8 @@ struct snd_soc_dapm_context { | |||
524 | enum snd_soc_bias_level target_bias_level; | 532 | enum snd_soc_bias_level target_bias_level; |
525 | struct list_head list; | 533 | struct list_head list; |
526 | 534 | ||
535 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
536 | |||
527 | #ifdef CONFIG_DEBUG_FS | 537 | #ifdef CONFIG_DEBUG_FS |
528 | struct dentry *debugfs_dapm; | 538 | struct dentry *debugfs_dapm; |
529 | #endif | 539 | #endif |
@@ -535,4 +545,10 @@ struct snd_soc_dapm_widget_list { | |||
535 | struct snd_soc_dapm_widget *widgets[0]; | 545 | struct snd_soc_dapm_widget *widgets[0]; |
536 | }; | 546 | }; |
537 | 547 | ||
548 | struct snd_soc_dapm_stats { | ||
549 | int power_checks; | ||
550 | int path_checks; | ||
551 | int neighbour_checks; | ||
552 | }; | ||
553 | |||
538 | #endif | 554 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index aa19f5a32ba8..11cfb5953e06 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/regmap.h> | ||
22 | #include <sound/core.h> | 23 | #include <sound/core.h> |
23 | #include <sound/pcm.h> | 24 | #include <sound/pcm.h> |
24 | #include <sound/control.h> | 25 | #include <sound/control.h> |
@@ -27,13 +28,20 @@ | |||
27 | /* | 28 | /* |
28 | * Convenience kcontrol builders | 29 | * Convenience kcontrol builders |
29 | */ | 30 | */ |
30 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | 31 | #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \ |
31 | ((unsigned long)&(struct soc_mixer_control) \ | 32 | ((unsigned long)&(struct soc_mixer_control) \ |
32 | {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ | 33 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ |
33 | .platform_max = xmax, .invert = xinvert}) | 34 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ |
35 | .invert = xinvert}) | ||
36 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | ||
37 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert) | ||
34 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 38 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
35 | ((unsigned long)&(struct soc_mixer_control) \ | 39 | ((unsigned long)&(struct soc_mixer_control) \ |
36 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) | 40 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) |
41 | #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \ | ||
42 | ((unsigned long)&(struct soc_mixer_control) \ | ||
43 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ | ||
44 | .max = xmax, .platform_max = xmax, .invert = xinvert}) | ||
37 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ | 45 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ |
38 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 46 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
39 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 47 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
@@ -47,40 +55,36 @@ | |||
47 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 55 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
48 | .put = snd_soc_put_volsw, \ | 56 | .put = snd_soc_put_volsw, \ |
49 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 57 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
50 | #define SOC_DOUBLE(xname, xreg, shift_left, shift_right, xmax, xinvert) \ | 58 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ |
51 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 59 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
52 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 60 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
53 | .put = snd_soc_put_volsw, \ | 61 | .put = snd_soc_put_volsw, \ |
54 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 62 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
55 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 63 | max, invert) } |
56 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
57 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ | 64 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ |
58 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 65 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
59 | .info = snd_soc_info_volsw_2r, \ | 66 | .info = snd_soc_info_volsw, \ |
60 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 67 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
61 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 68 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
62 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 69 | xmax, xinvert) } |
63 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | 70 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ |
64 | #define SOC_DOUBLE_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert, tlv_array) \ | ||
65 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 71 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
66 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 72 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
67 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | 73 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ |
68 | .tlv.p = (tlv_array), \ | 74 | .tlv.p = (tlv_array), \ |
69 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 75 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
70 | .put = snd_soc_put_volsw, \ | 76 | .put = snd_soc_put_volsw, \ |
71 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 77 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
72 | {.reg = xreg, .shift = shift_left, .rshift = shift_right,\ | 78 | max, invert) } |
73 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
74 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ | 79 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ |
75 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 80 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
76 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 81 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
77 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | 82 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ |
78 | .tlv.p = (tlv_array), \ | 83 | .tlv.p = (tlv_array), \ |
79 | .info = snd_soc_info_volsw_2r, \ | 84 | .info = snd_soc_info_volsw, \ |
80 | .get = snd_soc_get_volsw_2r, .put = snd_soc_put_volsw_2r, \ | 85 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
81 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 86 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
82 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 87 | xmax, xinvert) } |
83 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
84 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ | 88 | #define SOC_DOUBLE_S8_TLV(xname, xreg, xmin, xmax, tlv_array) \ |
85 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 89 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
86 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 90 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
@@ -120,14 +124,13 @@ | |||
120 | .info = snd_soc_info_volsw, \ | 124 | .info = snd_soc_info_volsw, \ |
121 | .get = xhandler_get, .put = xhandler_put, \ | 125 | .get = xhandler_get, .put = xhandler_put, \ |
122 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 126 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
123 | #define SOC_DOUBLE_EXT(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | 127 | #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ |
124 | xhandler_get, xhandler_put) \ | 128 | xhandler_get, xhandler_put) \ |
125 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 129 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
126 | .info = snd_soc_info_volsw, \ | 130 | .info = snd_soc_info_volsw, \ |
127 | .get = xhandler_get, .put = xhandler_put, \ | 131 | .get = xhandler_get, .put = xhandler_put, \ |
128 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 132 | .private_value = \ |
129 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 133 | SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) } |
130 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
131 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 134 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
132 | xhandler_get, xhandler_put, tlv_array) \ | 135 | xhandler_get, xhandler_put, tlv_array) \ |
133 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 136 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -145,20 +148,18 @@ | |||
145 | .tlv.p = (tlv_array), \ | 148 | .tlv.p = (tlv_array), \ |
146 | .info = snd_soc_info_volsw, \ | 149 | .info = snd_soc_info_volsw, \ |
147 | .get = xhandler_get, .put = xhandler_put, \ | 150 | .get = xhandler_get, .put = xhandler_put, \ |
148 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 151 | .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ |
149 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | 152 | xmax, xinvert) } |
150 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
151 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | 153 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ |
152 | xhandler_get, xhandler_put, tlv_array) \ | 154 | xhandler_get, xhandler_put, tlv_array) \ |
153 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 155 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
154 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 156 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
155 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | 157 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ |
156 | .tlv.p = (tlv_array), \ | 158 | .tlv.p = (tlv_array), \ |
157 | .info = snd_soc_info_volsw_2r, \ | 159 | .info = snd_soc_info_volsw, \ |
158 | .get = xhandler_get, .put = xhandler_put, \ | 160 | .get = xhandler_get, .put = xhandler_put, \ |
159 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | 161 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
160 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | 162 | xmax, xinvert) } |
161 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
162 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 163 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
163 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 164 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
164 | .info = snd_soc_info_bool_ext, \ | 165 | .info = snd_soc_info_bool_ext, \ |
@@ -260,6 +261,7 @@ extern struct snd_ac97_bus_ops soc_ac97_ops; | |||
260 | enum snd_soc_control_type { | 261 | enum snd_soc_control_type { |
261 | SND_SOC_I2C = 1, | 262 | SND_SOC_I2C = 1, |
262 | SND_SOC_SPI, | 263 | SND_SOC_SPI, |
264 | SND_SOC_REGMAP, | ||
263 | }; | 265 | }; |
264 | 266 | ||
265 | enum snd_soc_compress_type { | 267 | enum snd_soc_compress_type { |
@@ -274,7 +276,7 @@ enum snd_soc_pcm_subclass { | |||
274 | }; | 276 | }; |
275 | 277 | ||
276 | int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, | 278 | int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, |
277 | unsigned int freq, int dir); | 279 | int source, unsigned int freq, int dir); |
278 | int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, | 280 | int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, |
279 | unsigned int freq_in, unsigned int freq_out); | 281 | unsigned int freq_in, unsigned int freq_out); |
280 | 282 | ||
@@ -391,12 +393,8 @@ int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, | |||
391 | struct snd_ctl_elem_value *ucontrol); | 393 | struct snd_ctl_elem_value *ucontrol); |
392 | int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, | 394 | int snd_soc_put_volsw(struct snd_kcontrol *kcontrol, |
393 | struct snd_ctl_elem_value *ucontrol); | 395 | struct snd_ctl_elem_value *ucontrol); |
394 | int snd_soc_info_volsw_2r(struct snd_kcontrol *kcontrol, | 396 | #define snd_soc_get_volsw_2r snd_soc_get_volsw |
395 | struct snd_ctl_elem_info *uinfo); | 397 | #define snd_soc_put_volsw_2r snd_soc_put_volsw |
396 | int snd_soc_get_volsw_2r(struct snd_kcontrol *kcontrol, | ||
397 | struct snd_ctl_elem_value *ucontrol); | ||
398 | int snd_soc_put_volsw_2r(struct snd_kcontrol *kcontrol, | ||
399 | struct snd_ctl_elem_value *ucontrol); | ||
400 | int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol, | 398 | int snd_soc_info_volsw_s8(struct snd_kcontrol *kcontrol, |
401 | struct snd_ctl_elem_info *uinfo); | 399 | struct snd_ctl_elem_info *uinfo); |
402 | int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | 400 | int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, |
@@ -576,9 +574,11 @@ struct snd_soc_codec { | |||
576 | const void *reg_def_copy; | 574 | const void *reg_def_copy; |
577 | const struct snd_soc_cache_ops *cache_ops; | 575 | const struct snd_soc_cache_ops *cache_ops; |
578 | struct mutex cache_rw_mutex; | 576 | struct mutex cache_rw_mutex; |
577 | int val_bytes; | ||
579 | 578 | ||
580 | /* dapm */ | 579 | /* dapm */ |
581 | struct snd_soc_dapm_context dapm; | 580 | struct snd_soc_dapm_context dapm; |
581 | unsigned int ignore_pmdown_time:1; /* pmdown_time is ignored at stop */ | ||
582 | 582 | ||
583 | #ifdef CONFIG_DEBUG_FS | 583 | #ifdef CONFIG_DEBUG_FS |
584 | struct dentry *debugfs_codec_root; | 584 | struct dentry *debugfs_codec_root; |
@@ -607,7 +607,7 @@ struct snd_soc_codec_driver { | |||
607 | 607 | ||
608 | /* codec wide operations */ | 608 | /* codec wide operations */ |
609 | int (*set_sysclk)(struct snd_soc_codec *codec, | 609 | int (*set_sysclk)(struct snd_soc_codec *codec, |
610 | int clk_id, unsigned int freq, int dir); | 610 | int clk_id, int source, unsigned int freq, int dir); |
611 | int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source, | 611 | int (*set_pll)(struct snd_soc_codec *codec, int pll_id, int source, |
612 | unsigned int freq_in, unsigned int freq_out); | 612 | unsigned int freq_in, unsigned int freq_out); |
613 | 613 | ||
@@ -619,7 +619,7 @@ struct snd_soc_codec_driver { | |||
619 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); | 619 | int (*volatile_register)(struct snd_soc_codec *, unsigned int); |
620 | int (*readable_register)(struct snd_soc_codec *, unsigned int); | 620 | int (*readable_register)(struct snd_soc_codec *, unsigned int); |
621 | int (*writable_register)(struct snd_soc_codec *, unsigned int); | 621 | int (*writable_register)(struct snd_soc_codec *, unsigned int); |
622 | short reg_cache_size; | 622 | unsigned int reg_cache_size; |
623 | short reg_cache_step; | 623 | short reg_cache_step; |
624 | short reg_word_size; | 624 | short reg_word_size; |
625 | const void *reg_cache_default; | 625 | const void *reg_cache_default; |
@@ -630,10 +630,14 @@ struct snd_soc_codec_driver { | |||
630 | /* codec bias level */ | 630 | /* codec bias level */ |
631 | int (*set_bias_level)(struct snd_soc_codec *, | 631 | int (*set_bias_level)(struct snd_soc_codec *, |
632 | enum snd_soc_bias_level level); | 632 | enum snd_soc_bias_level level); |
633 | bool idle_bias_off; | ||
633 | 634 | ||
634 | void (*seq_notifier)(struct snd_soc_dapm_context *, | 635 | void (*seq_notifier)(struct snd_soc_dapm_context *, |
635 | enum snd_soc_dapm_type, int); | 636 | enum snd_soc_dapm_type, int); |
636 | 637 | ||
638 | /* codec stream completion event */ | ||
639 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
640 | |||
637 | /* probe ordering - for components with runtime dependencies */ | 641 | /* probe ordering - for components with runtime dependencies */ |
638 | int probe_order; | 642 | int probe_order; |
639 | int remove_order; | 643 | int remove_order; |
@@ -669,6 +673,9 @@ struct snd_soc_platform_driver { | |||
669 | /* platform stream ops */ | 673 | /* platform stream ops */ |
670 | struct snd_pcm_ops *ops; | 674 | struct snd_pcm_ops *ops; |
671 | 675 | ||
676 | /* platform stream completion event */ | ||
677 | int (*stream_event)(struct snd_soc_dapm_context *dapm, int event); | ||
678 | |||
672 | /* probe ordering - for components with runtime dependencies */ | 679 | /* probe ordering - for components with runtime dependencies */ |
673 | int probe_order; | 680 | int probe_order; |
674 | int remove_order; | 681 | int remove_order; |
@@ -703,6 +710,8 @@ struct snd_soc_dai_link { | |||
703 | const char *cpu_dai_name; | 710 | const char *cpu_dai_name; |
704 | const char *codec_dai_name; | 711 | const char *codec_dai_name; |
705 | 712 | ||
713 | unsigned int dai_fmt; /* format to set on init */ | ||
714 | |||
706 | /* Keep DAI active over suspend */ | 715 | /* Keep DAI active over suspend */ |
707 | unsigned int ignore_suspend:1; | 716 | unsigned int ignore_suspend:1; |
708 | 717 | ||
@@ -815,9 +824,11 @@ struct snd_soc_card { | |||
815 | struct list_head widgets; | 824 | struct list_head widgets; |
816 | struct list_head paths; | 825 | struct list_head paths; |
817 | struct list_head dapm_list; | 826 | struct list_head dapm_list; |
827 | struct list_head dapm_dirty; | ||
818 | 828 | ||
819 | /* Generic DAPM context for the card */ | 829 | /* Generic DAPM context for the card */ |
820 | struct snd_soc_dapm_context dapm; | 830 | struct snd_soc_dapm_context dapm; |
831 | struct snd_soc_dapm_stats dapm_stats; | ||
821 | 832 | ||
822 | #ifdef CONFIG_DEBUG_FS | 833 | #ifdef CONFIG_DEBUG_FS |
823 | struct dentry *debugfs_card_root; | 834 | struct dentry *debugfs_card_root; |
@@ -840,8 +851,6 @@ struct snd_soc_pcm_runtime { | |||
840 | unsigned int complete:1; | 851 | unsigned int complete:1; |
841 | unsigned int dev_registered:1; | 852 | unsigned int dev_registered:1; |
842 | 853 | ||
843 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
844 | unsigned int rate; | ||
845 | long pmdown_time; | 854 | long pmdown_time; |
846 | 855 | ||
847 | /* runtime devices */ | 856 | /* runtime devices */ |
@@ -936,6 +945,18 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) | |||
936 | INIT_LIST_HEAD(&card->dapm_list); | 945 | INIT_LIST_HEAD(&card->dapm_list); |
937 | } | 946 | } |
938 | 947 | ||
948 | static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) | ||
949 | { | ||
950 | if (mc->reg == mc->rreg && mc->shift == mc->rshift) | ||
951 | return 0; | ||
952 | /* | ||
953 | * mc->reg == mc->rreg && mc->shift != mc->rshift, or | ||
954 | * mc->reg != mc->rreg means that the control is | ||
955 | * stereo (bits in one register or in two registers) | ||
956 | */ | ||
957 | return 1; | ||
958 | } | ||
959 | |||
939 | int snd_soc_util_init(void); | 960 | int snd_soc_util_init(void); |
940 | void snd_soc_util_exit(void); | 961 | void snd_soc_util_exit(void); |
941 | 962 | ||
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h index 89beccb57edd..4cc1093844c8 100644 --- a/include/sound/tpa6130a2-plat.h +++ b/include/sound/tpa6130a2-plat.h | |||
@@ -23,13 +23,7 @@ | |||
23 | #ifndef TPA6130A2_PLAT_H | 23 | #ifndef TPA6130A2_PLAT_H |
24 | #define TPA6130A2_PLAT_H | 24 | #define TPA6130A2_PLAT_H |
25 | 25 | ||
26 | enum tpa_model { | ||
27 | TPA6130A2, | ||
28 | TPA6140A2, | ||
29 | }; | ||
30 | |||
31 | struct tpa6130a2_platform_data { | 26 | struct tpa6130a2_platform_data { |
32 | enum tpa_model id; | ||
33 | int power_gpio; | 27 | int power_gpio; |
34 | }; | 28 | }; |
35 | 29 | ||
diff --git a/include/sound/wm1250-ev1.h b/include/sound/wm1250-ev1.h new file mode 100644 index 000000000000..7dff82834123 --- /dev/null +++ b/include/sound/wm1250-ev1.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * linux/sound/wm1250-ev1.h - Platform data for WM1250-EV1 | ||
3 | * | ||
4 | * Copyright 2011 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM1250_EV1_H | ||
12 | #define __LINUX_SND_WM1250_EV1_H | ||
13 | |||
14 | #define WM1250_EV1_NUM_GPIOS 5 | ||
15 | |||
16 | #define WM1250_EV1_GPIO_CLK_ENA 0 | ||
17 | #define WM1250_EV1_GPIO_CLK_SEL0 1 | ||
18 | #define WM1250_EV1_GPIO_CLK_SEL1 2 | ||
19 | #define WM1250_EV1_GPIO_OSR 3 | ||
20 | #define WM1250_EV1_GPIO_MASTER 4 | ||
21 | |||
22 | |||
23 | struct wm1250_ev1_pdata { | ||
24 | int gpios[WM1250_EV1_NUM_GPIOS]; | ||
25 | }; | ||
26 | |||
27 | #endif | ||
diff --git a/include/sound/wm5100.h b/include/sound/wm5100.h new file mode 100644 index 000000000000..617d0c4a159f --- /dev/null +++ b/include/sound/wm5100.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * linux/sound/wm5100.h -- Platform data for WM5100 | ||
3 | * | ||
4 | * Copyright 2011 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM5100_H | ||
12 | #define __LINUX_SND_WM5100_H | ||
13 | |||
14 | enum wm5100_in_mode { | ||
15 | WM5100_IN_SE = 0, | ||
16 | WM5100_IN_DIFF = 1, | ||
17 | WM5100_IN_DMIC = 2, | ||
18 | }; | ||
19 | |||
20 | enum wm5100_dmic_sup { | ||
21 | WM5100_DMIC_SUP_MICVDD = 0, | ||
22 | WM5100_DMIC_SUP_MICBIAS1 = 1, | ||
23 | WM5100_DMIC_SUP_MICBIAS2 = 2, | ||
24 | WM5100_DMIC_SUP_MICBIAS3 = 3, | ||
25 | }; | ||
26 | |||
27 | enum wm5100_micdet_bias { | ||
28 | WM5100_MICDET_MICBIAS1 = 0, | ||
29 | WM5100_MICDET_MICBIAS2 = 1, | ||
30 | WM5100_MICDET_MICBIAS3 = 2, | ||
31 | }; | ||
32 | |||
33 | struct wm5100_jack_mode { | ||
34 | enum wm5100_micdet_bias bias; | ||
35 | int hp_pol; | ||
36 | int micd_src; | ||
37 | }; | ||
38 | |||
39 | #define WM5100_GPIO_SET 0x10000 | ||
40 | |||
41 | struct wm5100_pdata { | ||
42 | int reset; /** GPIO controlling /RESET, if any */ | ||
43 | int ldo_ena; /** GPIO controlling LODENA, if any */ | ||
44 | int hp_pol; /** GPIO controlling headset polarity, if any */ | ||
45 | int irq_flags; | ||
46 | int gpio_base; | ||
47 | |||
48 | struct wm5100_jack_mode jack_modes[2]; | ||
49 | |||
50 | /* Input pin mode selection */ | ||
51 | enum wm5100_in_mode in_mode[4]; | ||
52 | |||
53 | /* DMIC supply selection */ | ||
54 | enum wm5100_dmic_sup dmic_sup[4]; | ||
55 | |||
56 | int gpio_defaults[6]; | ||
57 | }; | ||
58 | |||
59 | #endif | ||