diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/dt-bindings/sound/fsl-imx-audmux.h | 56 | ||||
-rw-r--r-- | include/linux/atmel-ssc.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/arizona/gpio.h | 96 | ||||
-rw-r--r-- | include/linux/platform_data/asoc-s3c.h | 1 | ||||
-rw-r--r-- | include/linux/platform_data/omap-abe-twl6040.h | 49 | ||||
-rw-r--r-- | include/linux/pxa2xx_ssp.h | 11 | ||||
-rw-r--r-- | include/sound/pxa2xx-lib.h | 7 | ||||
-rw-r--r-- | include/sound/rcar_snd.h | 84 | ||||
-rw-r--r-- | include/sound/soc-dapm.h | 199 | ||||
-rw-r--r-- | include/sound/soc-dpcm.h | 2 | ||||
-rw-r--r-- | include/sound/soc.h | 39 |
11 files changed, 389 insertions, 157 deletions
diff --git a/include/dt-bindings/sound/fsl-imx-audmux.h b/include/dt-bindings/sound/fsl-imx-audmux.h new file mode 100644 index 000000000000..50b09e96f247 --- /dev/null +++ b/include/dt-bindings/sound/fsl-imx-audmux.h | |||
@@ -0,0 +1,56 @@ | |||
1 | #ifndef __DT_FSL_IMX_AUDMUX_H | ||
2 | #define __DT_FSL_IMX_AUDMUX_H | ||
3 | |||
4 | #define MX27_AUDMUX_HPCR1_SSI0 0 | ||
5 | #define MX27_AUDMUX_HPCR2_SSI1 1 | ||
6 | #define MX27_AUDMUX_HPCR3_SSI_PINS_4 2 | ||
7 | #define MX27_AUDMUX_PPCR1_SSI_PINS_1 3 | ||
8 | #define MX27_AUDMUX_PPCR2_SSI_PINS_2 4 | ||
9 | #define MX27_AUDMUX_PPCR3_SSI_PINS_3 5 | ||
10 | |||
11 | #define MX31_AUDMUX_PORT1_SSI0 0 | ||
12 | #define MX31_AUDMUX_PORT2_SSI1 1 | ||
13 | #define MX31_AUDMUX_PORT3_SSI_PINS_3 2 | ||
14 | #define MX31_AUDMUX_PORT4_SSI_PINS_4 3 | ||
15 | #define MX31_AUDMUX_PORT5_SSI_PINS_5 4 | ||
16 | #define MX31_AUDMUX_PORT6_SSI_PINS_6 5 | ||
17 | #define MX31_AUDMUX_PORT7_SSI_PINS_7 6 | ||
18 | |||
19 | #define MX51_AUDMUX_PORT1_SSI0 0 | ||
20 | #define MX51_AUDMUX_PORT2_SSI1 1 | ||
21 | #define MX51_AUDMUX_PORT3 2 | ||
22 | #define MX51_AUDMUX_PORT4 3 | ||
23 | #define MX51_AUDMUX_PORT5 4 | ||
24 | #define MX51_AUDMUX_PORT6 5 | ||
25 | #define MX51_AUDMUX_PORT7 6 | ||
26 | |||
27 | /* Register definitions for the i.MX21/27 Digital Audio Multiplexer */ | ||
28 | #define IMX_AUDMUX_V1_PCR_INMMASK(x) ((x) & 0xff) | ||
29 | #define IMX_AUDMUX_V1_PCR_INMEN (1 << 8) | ||
30 | #define IMX_AUDMUX_V1_PCR_TXRXEN (1 << 10) | ||
31 | #define IMX_AUDMUX_V1_PCR_SYN (1 << 12) | ||
32 | #define IMX_AUDMUX_V1_PCR_RXDSEL(x) (((x) & 0x7) << 13) | ||
33 | #define IMX_AUDMUX_V1_PCR_RFCSEL(x) (((x) & 0xf) << 20) | ||
34 | #define IMX_AUDMUX_V1_PCR_RCLKDIR (1 << 24) | ||
35 | #define IMX_AUDMUX_V1_PCR_RFSDIR (1 << 25) | ||
36 | #define IMX_AUDMUX_V1_PCR_TFCSEL(x) (((x) & 0xf) << 26) | ||
37 | #define IMX_AUDMUX_V1_PCR_TCLKDIR (1 << 30) | ||
38 | #define IMX_AUDMUX_V1_PCR_TFSDIR (1 << 31) | ||
39 | |||
40 | /* Register definitions for the i.MX25/31/35/51 Digital Audio Multiplexer */ | ||
41 | #define IMX_AUDMUX_V2_PTCR_TFSDIR (1 << 31) | ||
42 | #define IMX_AUDMUX_V2_PTCR_TFSEL(x) (((x) & 0xf) << 27) | ||
43 | #define IMX_AUDMUX_V2_PTCR_TCLKDIR (1 << 26) | ||
44 | #define IMX_AUDMUX_V2_PTCR_TCSEL(x) (((x) & 0xf) << 22) | ||
45 | #define IMX_AUDMUX_V2_PTCR_RFSDIR (1 << 21) | ||
46 | #define IMX_AUDMUX_V2_PTCR_RFSEL(x) (((x) & 0xf) << 17) | ||
47 | #define IMX_AUDMUX_V2_PTCR_RCLKDIR (1 << 16) | ||
48 | #define IMX_AUDMUX_V2_PTCR_RCSEL(x) (((x) & 0xf) << 12) | ||
49 | #define IMX_AUDMUX_V2_PTCR_SYN (1 << 11) | ||
50 | |||
51 | #define IMX_AUDMUX_V2_PDCR_RXDSEL(x) (((x) & 0x7) << 13) | ||
52 | #define IMX_AUDMUX_V2_PDCR_TXRXEN (1 << 12) | ||
53 | #define IMX_AUDMUX_V2_PDCR_MODE(x) (((x) & 0x3) << 8) | ||
54 | #define IMX_AUDMUX_V2_PDCR_INMMASK(x) ((x) & 0xff) | ||
55 | |||
56 | #endif /* __DT_FSL_IMX_AUDMUX_H */ | ||
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h index deb0ae58b99b..66a0e5384edd 100644 --- a/include/linux/atmel-ssc.h +++ b/include/linux/atmel-ssc.h | |||
@@ -11,7 +11,7 @@ struct atmel_ssc_platform_data { | |||
11 | 11 | ||
12 | struct ssc_device { | 12 | struct ssc_device { |
13 | struct list_head list; | 13 | struct list_head list; |
14 | resource_size_t phybase; | 14 | dma_addr_t phybase; |
15 | void __iomem *regs; | 15 | void __iomem *regs; |
16 | struct platform_device *pdev; | 16 | struct platform_device *pdev; |
17 | struct atmel_ssc_platform_data *pdata; | 17 | struct atmel_ssc_platform_data *pdata; |
diff --git a/include/linux/mfd/arizona/gpio.h b/include/linux/mfd/arizona/gpio.h new file mode 100644 index 000000000000..d2146bb74f89 --- /dev/null +++ b/include/linux/mfd/arizona/gpio.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * GPIO configuration for Arizona devices | ||
3 | * | ||
4 | * Copyright 2013 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef _ARIZONA_GPIO_H | ||
14 | #define _ARIZONA_GPIO_H | ||
15 | |||
16 | #define ARIZONA_GP_FN_TXLRCLK 0x00 | ||
17 | #define ARIZONA_GP_FN_GPIO 0x01 | ||
18 | #define ARIZONA_GP_FN_IRQ1 0x02 | ||
19 | #define ARIZONA_GP_FN_IRQ2 0x03 | ||
20 | #define ARIZONA_GP_FN_OPCLK 0x04 | ||
21 | #define ARIZONA_GP_FN_FLL1_OUT 0x05 | ||
22 | #define ARIZONA_GP_FN_FLL2_OUT 0x06 | ||
23 | #define ARIZONA_GP_FN_PWM1 0x08 | ||
24 | #define ARIZONA_GP_FN_PWM2 0x09 | ||
25 | #define ARIZONA_GP_FN_SYSCLK_UNDERCLOCKED 0x0A | ||
26 | #define ARIZONA_GP_FN_ASYNCCLK_UNDERCLOCKED 0x0B | ||
27 | #define ARIZONA_GP_FN_FLL1_LOCK 0x0C | ||
28 | #define ARIZONA_GP_FN_FLL2_LOCK 0x0D | ||
29 | #define ARIZONA_GP_FN_FLL1_CLOCK_OK 0x0F | ||
30 | #define ARIZONA_GP_FN_FLL2_CLOCK_OK 0x10 | ||
31 | #define ARIZONA_GP_FN_HEADPHONE_DET 0x12 | ||
32 | #define ARIZONA_GP_FN_MIC_DET 0x13 | ||
33 | #define ARIZONA_GP_FN_WSEQ_STATUS 0x15 | ||
34 | #define ARIZONA_GP_FN_CIF_ADDRESS_ERROR 0x16 | ||
35 | #define ARIZONA_GP_FN_ASRC1_LOCK 0x1A | ||
36 | #define ARIZONA_GP_FN_ASRC2_LOCK 0x1B | ||
37 | #define ARIZONA_GP_FN_ASRC_CONFIG_ERROR 0x1C | ||
38 | #define ARIZONA_GP_FN_DRC1_SIGNAL_DETECT 0x1D | ||
39 | #define ARIZONA_GP_FN_DRC1_ANTICLIP 0x1E | ||
40 | #define ARIZONA_GP_FN_DRC1_DECAY 0x1F | ||
41 | #define ARIZONA_GP_FN_DRC1_NOISE 0x20 | ||
42 | #define ARIZONA_GP_FN_DRC1_QUICK_RELEASE 0x21 | ||
43 | #define ARIZONA_GP_FN_DRC2_SIGNAL_DETECT 0x22 | ||
44 | #define ARIZONA_GP_FN_DRC2_ANTICLIP 0x23 | ||
45 | #define ARIZONA_GP_FN_DRC2_DECAY 0x24 | ||
46 | #define ARIZONA_GP_FN_DRC2_NOISE 0x25 | ||
47 | #define ARIZONA_GP_FN_DRC2_QUICK_RELEASE 0x26 | ||
48 | #define ARIZONA_GP_FN_MIXER_DROPPED_SAMPLE 0x27 | ||
49 | #define ARIZONA_GP_FN_AIF1_CONFIG_ERROR 0x28 | ||
50 | #define ARIZONA_GP_FN_AIF2_CONFIG_ERROR 0x29 | ||
51 | #define ARIZONA_GP_FN_AIF3_CONFIG_ERROR 0x2A | ||
52 | #define ARIZONA_GP_FN_SPK_TEMP_SHUTDOWN 0x2B | ||
53 | #define ARIZONA_GP_FN_SPK_TEMP_WARNING 0x2C | ||
54 | #define ARIZONA_GP_FN_UNDERCLOCKED 0x2D | ||
55 | #define ARIZONA_GP_FN_OVERCLOCKED 0x2E | ||
56 | #define ARIZONA_GP_FN_DSP_IRQ1 0x35 | ||
57 | #define ARIZONA_GP_FN_DSP_IRQ2 0x36 | ||
58 | #define ARIZONA_GP_FN_ASYNC_OPCLK 0x3D | ||
59 | #define ARIZONA_GP_FN_BOOT_DONE 0x44 | ||
60 | #define ARIZONA_GP_FN_DSP1_RAM_READY 0x45 | ||
61 | #define ARIZONA_GP_FN_SYSCLK_ENA_STATUS 0x4B | ||
62 | #define ARIZONA_GP_FN_ASYNCCLK_ENA_STATUS 0x4C | ||
63 | |||
64 | #define ARIZONA_GPN_DIR 0x8000 /* GPN_DIR */ | ||
65 | #define ARIZONA_GPN_DIR_MASK 0x8000 /* GPN_DIR */ | ||
66 | #define ARIZONA_GPN_DIR_SHIFT 15 /* GPN_DIR */ | ||
67 | #define ARIZONA_GPN_DIR_WIDTH 1 /* GPN_DIR */ | ||
68 | #define ARIZONA_GPN_PU 0x4000 /* GPN_PU */ | ||
69 | #define ARIZONA_GPN_PU_MASK 0x4000 /* GPN_PU */ | ||
70 | #define ARIZONA_GPN_PU_SHIFT 14 /* GPN_PU */ | ||
71 | #define ARIZONA_GPN_PU_WIDTH 1 /* GPN_PU */ | ||
72 | #define ARIZONA_GPN_PD 0x2000 /* GPN_PD */ | ||
73 | #define ARIZONA_GPN_PD_MASK 0x2000 /* GPN_PD */ | ||
74 | #define ARIZONA_GPN_PD_SHIFT 13 /* GPN_PD */ | ||
75 | #define ARIZONA_GPN_PD_WIDTH 1 /* GPN_PD */ | ||
76 | #define ARIZONA_GPN_LVL 0x0800 /* GPN_LVL */ | ||
77 | #define ARIZONA_GPN_LVL_MASK 0x0800 /* GPN_LVL */ | ||
78 | #define ARIZONA_GPN_LVL_SHIFT 11 /* GPN_LVL */ | ||
79 | #define ARIZONA_GPN_LVL_WIDTH 1 /* GPN_LVL */ | ||
80 | #define ARIZONA_GPN_POL 0x0400 /* GPN_POL */ | ||
81 | #define ARIZONA_GPN_POL_MASK 0x0400 /* GPN_POL */ | ||
82 | #define ARIZONA_GPN_POL_SHIFT 10 /* GPN_POL */ | ||
83 | #define ARIZONA_GPN_POL_WIDTH 1 /* GPN_POL */ | ||
84 | #define ARIZONA_GPN_OP_CFG 0x0200 /* GPN_OP_CFG */ | ||
85 | #define ARIZONA_GPN_OP_CFG_MASK 0x0200 /* GPN_OP_CFG */ | ||
86 | #define ARIZONA_GPN_OP_CFG_SHIFT 9 /* GPN_OP_CFG */ | ||
87 | #define ARIZONA_GPN_OP_CFG_WIDTH 1 /* GPN_OP_CFG */ | ||
88 | #define ARIZONA_GPN_DB 0x0100 /* GPN_DB */ | ||
89 | #define ARIZONA_GPN_DB_MASK 0x0100 /* GPN_DB */ | ||
90 | #define ARIZONA_GPN_DB_SHIFT 8 /* GPN_DB */ | ||
91 | #define ARIZONA_GPN_DB_WIDTH 1 /* GPN_DB */ | ||
92 | #define ARIZONA_GPN_FN_MASK 0x007F /* GPN_DB */ | ||
93 | #define ARIZONA_GPN_FN_SHIFT 0 /* GPN_DB */ | ||
94 | #define ARIZONA_GPN_FN_WIDTH 7 /* GPN_DB */ | ||
95 | |||
96 | #endif | ||
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h index 88272591a895..9efc04dd255a 100644 --- a/include/linux/platform_data/asoc-s3c.h +++ b/include/linux/platform_data/asoc-s3c.h | |||
@@ -36,6 +36,7 @@ struct samsung_i2s { | |||
36 | */ | 36 | */ |
37 | #define QUIRK_NO_MUXPSR (1 << 2) | 37 | #define QUIRK_NO_MUXPSR (1 << 2) |
38 | #define QUIRK_NEED_RSTCLR (1 << 3) | 38 | #define QUIRK_NEED_RSTCLR (1 << 3) |
39 | #define QUIRK_SUPPORTS_TDM (1 << 4) | ||
39 | /* Quirks of the I2S controller */ | 40 | /* Quirks of the I2S controller */ |
40 | u32 quirks; | 41 | u32 quirks; |
41 | dma_addr_t idma_addr; | 42 | dma_addr_t idma_addr; |
diff --git a/include/linux/platform_data/omap-abe-twl6040.h b/include/linux/platform_data/omap-abe-twl6040.h deleted file mode 100644 index 5d298ac10fc2..000000000000 --- a/include/linux/platform_data/omap-abe-twl6040.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | /** | ||
2 | * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header. | ||
3 | * | ||
4 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but | ||
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | * General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
21 | * 02110-1301 USA | ||
22 | */ | ||
23 | |||
24 | #ifndef _OMAP_ABE_TWL6040_H_ | ||
25 | #define _OMAP_ABE_TWL6040_H_ | ||
26 | |||
27 | /* To select if only one channel is connected in a stereo port */ | ||
28 | #define ABE_TWL6040_LEFT (1 << 0) | ||
29 | #define ABE_TWL6040_RIGHT (1 << 1) | ||
30 | |||
31 | struct omap_abe_twl6040_data { | ||
32 | char *card_name; | ||
33 | /* Feature flags for connected audio pins */ | ||
34 | u8 has_hs; | ||
35 | u8 has_hf; | ||
36 | bool has_ep; | ||
37 | u8 has_aux; | ||
38 | u8 has_vibra; | ||
39 | bool has_dmic; | ||
40 | bool has_hsmic; | ||
41 | bool has_mainmic; | ||
42 | bool has_submic; | ||
43 | u8 has_afm; | ||
44 | /* Other features */ | ||
45 | bool jack_detection; /* board can detect jack events */ | ||
46 | int mclk_freq; /* MCLK frequency speed for twl6040 */ | ||
47 | }; | ||
48 | |||
49 | #endif /* _OMAP_ABE_TWL6040_H_ */ | ||
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h index 467cc6307b62..49444203328a 100644 --- a/include/linux/pxa2xx_ssp.h +++ b/include/linux/pxa2xx_ssp.h | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include <linux/list.h> | 22 | #include <linux/list.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/of.h> | ||
25 | |||
24 | 26 | ||
25 | /* | 27 | /* |
26 | * SSP Serial Port Registers | 28 | * SSP Serial Port Registers |
@@ -190,6 +192,8 @@ struct ssp_device { | |||
190 | int irq; | 192 | int irq; |
191 | int drcmr_rx; | 193 | int drcmr_rx; |
192 | int drcmr_tx; | 194 | int drcmr_tx; |
195 | |||
196 | struct device_node *of_node; | ||
193 | }; | 197 | }; |
194 | 198 | ||
195 | /** | 199 | /** |
@@ -218,11 +222,18 @@ static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg) | |||
218 | #ifdef CONFIG_ARCH_PXA | 222 | #ifdef CONFIG_ARCH_PXA |
219 | struct ssp_device *pxa_ssp_request(int port, const char *label); | 223 | struct ssp_device *pxa_ssp_request(int port, const char *label); |
220 | void pxa_ssp_free(struct ssp_device *); | 224 | void pxa_ssp_free(struct ssp_device *); |
225 | struct ssp_device *pxa_ssp_request_of(const struct device_node *of_node, | ||
226 | const char *label); | ||
221 | #else | 227 | #else |
222 | static inline struct ssp_device *pxa_ssp_request(int port, const char *label) | 228 | static inline struct ssp_device *pxa_ssp_request(int port, const char *label) |
223 | { | 229 | { |
224 | return NULL; | 230 | return NULL; |
225 | } | 231 | } |
232 | static inline struct ssp_device *pxa_ssp_request_of(const struct device_node *n, | ||
233 | const char *name) | ||
234 | { | ||
235 | return NULL; | ||
236 | } | ||
226 | static inline void pxa_ssp_free(struct ssp_device *ssp) {} | 237 | static inline void pxa_ssp_free(struct ssp_device *ssp) {} |
227 | #endif | 238 | #endif |
228 | 239 | ||
diff --git a/include/sound/pxa2xx-lib.h b/include/sound/pxa2xx-lib.h index 2fd3d251d9a5..56e818e4a1cb 100644 --- a/include/sound/pxa2xx-lib.h +++ b/include/sound/pxa2xx-lib.h | |||
@@ -6,13 +6,6 @@ | |||
6 | 6 | ||
7 | /* PCM */ | 7 | /* PCM */ |
8 | 8 | ||
9 | struct pxa2xx_pcm_dma_params { | ||
10 | char *name; /* stream identifier */ | ||
11 | u32 dcmd; /* DMA descriptor dcmd field */ | ||
12 | volatile u32 *drcmr; /* the DMA request channel to use */ | ||
13 | u32 dev_addr; /* device physical address for DMA */ | ||
14 | }; | ||
15 | |||
16 | extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, | 9 | extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, |
17 | struct snd_pcm_hw_params *params); | 10 | struct snd_pcm_hw_params *params); |
18 | extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream); | 11 | extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream); |
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h new file mode 100644 index 000000000000..d35412ae03b3 --- /dev/null +++ b/include/sound/rcar_snd.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | * Renesas R-Car SRU/SCU/SSIU/SSI support | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Solutions Corp. | ||
5 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef RCAR_SND_H | ||
13 | #define RCAR_SND_H | ||
14 | |||
15 | #include <linux/sh_clk.h> | ||
16 | |||
17 | #define RSND_GEN1_SRU 0 | ||
18 | #define RSND_GEN1_ADG 1 | ||
19 | #define RSND_GEN1_SSI 2 | ||
20 | |||
21 | #define RSND_GEN2_SRU 0 | ||
22 | #define RSND_GEN2_ADG 1 | ||
23 | #define RSND_GEN2_SSIU 2 | ||
24 | #define RSND_GEN2_SSI 3 | ||
25 | |||
26 | #define RSND_BASE_MAX 4 | ||
27 | |||
28 | /* | ||
29 | * flags | ||
30 | * | ||
31 | * 0xAB000000 | ||
32 | * | ||
33 | * A : clock sharing settings | ||
34 | * B : SSI direction | ||
35 | */ | ||
36 | #define RSND_SSI_CLK_PIN_SHARE (1 << 31) | ||
37 | #define RSND_SSI_CLK_FROM_ADG (1 << 30) /* clock parent is master */ | ||
38 | #define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */ | ||
39 | #define RSND_SSI_DEPENDENT (1 << 28) /* SSI needs SRU/SCU */ | ||
40 | |||
41 | #define RSND_SSI_PLAY (1 << 24) | ||
42 | |||
43 | #define RSND_SSI_SET(_dai_id, _dma_id, _pio_irq, _flags) \ | ||
44 | { .dai_id = _dai_id, .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags } | ||
45 | #define RSND_SSI_UNUSED \ | ||
46 | { .dai_id = -1, .dma_id = -1, .pio_irq = -1, .flags = 0 } | ||
47 | |||
48 | struct rsnd_ssi_platform_info { | ||
49 | int dai_id; | ||
50 | int dma_id; | ||
51 | int pio_irq; | ||
52 | u32 flags; | ||
53 | }; | ||
54 | |||
55 | /* | ||
56 | * flags | ||
57 | */ | ||
58 | #define RSND_SCU_USB_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */ | ||
59 | |||
60 | struct rsnd_scu_platform_info { | ||
61 | u32 flags; | ||
62 | }; | ||
63 | |||
64 | /* | ||
65 | * flags | ||
66 | * | ||
67 | * 0x0000000A | ||
68 | * | ||
69 | * A : generation | ||
70 | */ | ||
71 | #define RSND_GEN1 (1 << 0) /* fixme */ | ||
72 | #define RSND_GEN2 (2 << 0) /* fixme */ | ||
73 | |||
74 | struct rcar_snd_info { | ||
75 | u32 flags; | ||
76 | struct rsnd_ssi_platform_info *ssi_info; | ||
77 | int ssi_info_nr; | ||
78 | struct rsnd_scu_platform_info *scu_info; | ||
79 | int scu_info_nr; | ||
80 | int (*start)(int id); | ||
81 | int (*stop)(int id); | ||
82 | }; | ||
83 | |||
84 | #endif | ||
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 3e479f4e15f5..c728d28ae9a5 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -70,121 +70,144 @@ struct device; | |||
70 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ | 70 | .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ |
71 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} | 71 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} |
72 | 72 | ||
73 | #define SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) \ | ||
74 | .reg = wreg, .mask = 1, .shift = wshift, \ | ||
75 | .on_val = winvert ? 0 : 1, .off_val = winvert ? 1 : 0 | ||
76 | |||
73 | /* path domain */ | 77 | /* path domain */ |
74 | #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ | 78 | #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ |
75 | wcontrols, wncontrols) \ | 79 | wcontrols, wncontrols) \ |
76 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 80 | { .id = snd_soc_dapm_pga, .name = wname, \ |
77 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | 81 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
82 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | ||
78 | #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ | 83 | #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ |
79 | wcontrols, wncontrols) \ | 84 | wcontrols, wncontrols) \ |
80 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | 85 | { .id = snd_soc_dapm_out_drv, .name = wname, \ |
81 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | 86 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
87 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | ||
82 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ | 88 | #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ |
83 | wcontrols, wncontrols)\ | 89 | wcontrols, wncontrols)\ |
84 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 90 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
85 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | 91 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
92 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} | ||
86 | #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ | 93 | #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ |
87 | wcontrols, wncontrols)\ | 94 | wcontrols, wncontrols)\ |
88 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ | 95 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ |
89 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ | 96 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
90 | .num_kcontrols = wncontrols} | 97 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} |
91 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ | 98 | #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ |
92 | { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ | 99 | { .id = snd_soc_dapm_micbias, .name = wname, \ |
93 | .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0} | 100 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
101 | .kcontrol_news = NULL, .num_kcontrols = 0} | ||
94 | #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ | 102 | #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ |
95 | { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ | 103 | { .id = snd_soc_dapm_switch, .name = wname, \ |
96 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} | 104 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
105 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | ||
97 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 106 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
98 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 107 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \ |
99 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} | 108 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
100 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 109 | #define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
101 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 110 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ |
102 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} | 111 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
112 | .kcontrol_news = wcontrols, .num_kcontrols = 1} | ||
103 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 113 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
104 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ | 114 | { .id = snd_soc_dapm_value_mux, .name = wname, \ |
105 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ | 115 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
106 | .num_kcontrols = 1} | 116 | .kcontrol_news = wcontrols, .num_kcontrols = 1} |
107 | 117 | ||
108 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 118 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
109 | #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ | 119 | #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ |
110 | wcontrols) \ | 120 | wcontrols) \ |
111 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 121 | { .id = snd_soc_dapm_pga, .name = wname, \ |
112 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | 122 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
123 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | ||
113 | #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ | 124 | #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ |
114 | wcontrols)\ | 125 | wcontrols)\ |
115 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 126 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
116 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | 127 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
128 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} | ||
117 | #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ | 129 | #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ |
118 | wcontrols)\ | 130 | wcontrols)\ |
119 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ | 131 | { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ |
120 | .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ | 132 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
121 | .num_kcontrols = ARRAY_SIZE(wcontrols)} | 133 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} |
122 | 134 | ||
123 | /* path domain with event - event handler must return 0 for success */ | 135 | /* path domain with event - event handler must return 0 for success */ |
124 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ | 136 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ |
125 | wncontrols, wevent, wflags) \ | 137 | wncontrols, wevent, wflags) \ |
126 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 138 | { .id = snd_soc_dapm_pga, .name = wname, \ |
127 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | 139 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
140 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | ||
128 | .event = wevent, .event_flags = wflags} | 141 | .event = wevent, .event_flags = wflags} |
129 | #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ | 142 | #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ |
130 | wncontrols, wevent, wflags) \ | 143 | wncontrols, wevent, wflags) \ |
131 | { .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ | 144 | { .id = snd_soc_dapm_out_drv, .name = wname, \ |
132 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | 145 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
146 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | ||
133 | .event = wevent, .event_flags = wflags} | 147 | .event = wevent, .event_flags = wflags} |
134 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ | 148 | #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ |
135 | wncontrols, wevent, wflags) \ | 149 | wncontrols, wevent, wflags) \ |
136 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 150 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
137 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | 151 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
152 | .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ | ||
138 | .event = wevent, .event_flags = wflags} | 153 | .event = wevent, .event_flags = wflags} |
139 | #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ | 154 | #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ |
140 | wcontrols, wncontrols, wevent, wflags) \ | 155 | wcontrols, wncontrols, wevent, wflags) \ |
141 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 156 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
142 | .invert = winvert, .kcontrol_news = wcontrols, \ | 157 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
158 | .kcontrol_news = wcontrols, \ | ||
143 | .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} | 159 | .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} |
144 | #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ | 160 | #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ |
145 | wevent, wflags) \ | 161 | wevent, wflags) \ |
146 | { .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ | 162 | { .id = snd_soc_dapm_switch, .name = wname, \ |
147 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | 163 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
164 | .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | ||
148 | .event = wevent, .event_flags = wflags} | 165 | .event = wevent, .event_flags = wflags} |
149 | #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | 166 | #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ |
150 | wevent, wflags) \ | 167 | wevent, wflags) \ |
151 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 168 | { .id = snd_soc_dapm_mux, .name = wname, \ |
152 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | 169 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
170 | .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | ||
153 | .event = wevent, .event_flags = wflags} | 171 | .event = wevent, .event_flags = wflags} |
154 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ | 172 | #define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ |
155 | wevent, wflags) \ | 173 | wevent, wflags) \ |
156 | { .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 174 | { .id = snd_soc_dapm_virt_mux, .name = wname, \ |
157 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | 175 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
176 | .kcontrol_news = wcontrols, .num_kcontrols = 1, \ | ||
158 | .event = wevent, .event_flags = wflags} | 177 | .event = wevent, .event_flags = wflags} |
159 | 178 | ||
160 | /* additional sequencing control within an event type */ | 179 | /* additional sequencing control within an event type */ |
161 | #define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ | 180 | #define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ |
162 | wevent, wflags) \ | 181 | wevent, wflags) \ |
163 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 182 | { .id = snd_soc_dapm_pga, .name = wname, \ |
164 | .invert = winvert, .event = wevent, .event_flags = wflags, \ | 183 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
184 | .event = wevent, .event_flags = wflags, \ | ||
165 | .subseq = wsubseq} | 185 | .subseq = wsubseq} |
166 | #define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ | 186 | #define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ |
167 | wflags) \ | 187 | wflags) \ |
168 | { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ | 188 | { .id = snd_soc_dapm_supply, .name = wname, \ |
169 | .shift = wshift, .invert = winvert, .event = wevent, \ | 189 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
170 | .event_flags = wflags, .subseq = wsubseq} | 190 | .event = wevent, .event_flags = wflags, .subseq = wsubseq} |
171 | 191 | ||
172 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ | 192 | /* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ |
173 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 193 | #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
174 | wevent, wflags) \ | 194 | wevent, wflags) \ |
175 | { .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ | 195 | { .id = snd_soc_dapm_pga, .name = wname, \ |
176 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | 196 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
197 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | ||
177 | .event = wevent, .event_flags = wflags} | 198 | .event = wevent, .event_flags = wflags} |
178 | #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ | 199 | #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ |
179 | wevent, wflags) \ | 200 | wevent, wflags) \ |
180 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 201 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
181 | .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | 202 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
203 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ | ||
182 | .event = wevent, .event_flags = wflags} | 204 | .event = wevent, .event_flags = wflags} |
183 | #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ | 205 | #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ |
184 | wcontrols, wevent, wflags) \ | 206 | wcontrols, wevent, wflags) \ |
185 | { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ | 207 | { .id = snd_soc_dapm_mixer, .name = wname, \ |
186 | .invert = winvert, .kcontrol_news = wcontrols, \ | 208 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
187 | .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} | 209 | .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ |
210 | .event = wevent, .event_flags = wflags} | ||
188 | 211 | ||
189 | /* events that are pre and post DAPM */ | 212 | /* events that are pre and post DAPM */ |
190 | #define SND_SOC_DAPM_PRE(wname, wevent) \ | 213 | #define SND_SOC_DAPM_PRE(wname, wevent) \ |
@@ -199,35 +222,36 @@ struct device; | |||
199 | /* stream domain */ | 222 | /* stream domain */ |
200 | #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ | 223 | #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ |
201 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ | 224 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ |
202 | .reg = wreg, .shift = wshift, .invert = winvert } | 225 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } |
203 | #define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ | 226 | #define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ |
204 | wevent, wflags) \ | 227 | wevent, wflags) \ |
205 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ | 228 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ |
206 | .reg = wreg, .shift = wshift, .invert = winvert, \ | 229 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
207 | .event = wevent, .event_flags = wflags } | 230 | .event = wevent, .event_flags = wflags } |
208 | #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ | 231 | #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ |
209 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ | 232 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ |
210 | .reg = wreg, .shift = wshift, .invert = winvert } | 233 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } |
211 | #define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ | 234 | #define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ |
212 | wevent, wflags) \ | 235 | wevent, wflags) \ |
213 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ | 236 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ |
214 | .reg = wreg, .shift = wshift, .invert = winvert, \ | 237 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
215 | .event = wevent, .event_flags = wflags } | 238 | .event = wevent, .event_flags = wflags } |
216 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ | 239 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ |
217 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 240 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ |
218 | .shift = wshift, .invert = winvert} | 241 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) } |
219 | #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ | 242 | #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ |
220 | wevent, wflags) \ | 243 | wevent, wflags) \ |
221 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 244 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ |
222 | .shift = wshift, .invert = winvert, \ | 245 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
223 | .event = wevent, .event_flags = wflags} | 246 | .event = wevent, .event_flags = wflags} |
247 | |||
224 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ | 248 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ |
225 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 249 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ |
226 | .shift = wshift, .invert = winvert} | 250 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } |
227 | #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ | 251 | #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ |
228 | wevent, wflags) \ | 252 | wevent, wflags) \ |
229 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 253 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ |
230 | .shift = wshift, .invert = winvert, \ | 254 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
231 | .event = wevent, .event_flags = wflags} | 255 | .event = wevent, .event_flags = wflags} |
232 | #define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ | 256 | #define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ |
233 | { .id = snd_soc_dapm_clock_supply, .name = wname, \ | 257 | { .id = snd_soc_dapm_clock_supply, .name = wname, \ |
@@ -241,14 +265,14 @@ struct device; | |||
241 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ | 265 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ |
242 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} | 266 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} |
243 | #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ | 267 | #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ |
244 | { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ | 268 | { .id = snd_soc_dapm_supply, .name = wname, \ |
245 | .shift = wshift, .invert = winvert, .event = wevent, \ | 269 | SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ |
246 | .event_flags = wflags} | 270 | .event = wevent, .event_flags = wflags} |
247 | #define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ | 271 | #define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ |
248 | { .id = snd_soc_dapm_regulator_supply, .name = wname, \ | 272 | { .id = snd_soc_dapm_regulator_supply, .name = wname, \ |
249 | .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ | 273 | .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ |
250 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ | 274 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ |
251 | .invert = wflags} | 275 | .on_val = wflags} |
252 | 276 | ||
253 | 277 | ||
254 | /* dapm kcontrol types */ | 278 | /* dapm kcontrol types */ |
@@ -256,14 +280,26 @@ struct device; | |||
256 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 280 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
257 | .info = snd_soc_info_volsw, \ | 281 | .info = snd_soc_info_volsw, \ |
258 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | 282 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ |
259 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 283 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } |
284 | #define SOC_DAPM_SINGLE_AUTODISABLE(xname, reg, shift, max, invert) \ | ||
285 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
286 | .info = snd_soc_info_volsw, \ | ||
287 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | ||
288 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) } | ||
260 | #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ | 289 | #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ |
261 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 290 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
262 | .info = snd_soc_info_volsw, \ | 291 | .info = snd_soc_info_volsw, \ |
263 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | 292 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ |
264 | .tlv.p = (tlv_array), \ | 293 | .tlv.p = (tlv_array), \ |
265 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | 294 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ |
266 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 295 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } |
296 | #define SOC_DAPM_SINGLE_TLV_AUTODISABLE(xname, reg, shift, max, invert, tlv_array) \ | ||
297 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
298 | .info = snd_soc_info_volsw, \ | ||
299 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | ||
300 | .tlv.p = (tlv_array), \ | ||
301 | .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ | ||
302 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } | ||
267 | #define SOC_DAPM_ENUM(xname, xenum) \ | 303 | #define SOC_DAPM_ENUM(xname, xenum) \ |
268 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 304 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
269 | .info = snd_soc_info_enum_double, \ | 305 | .info = snd_soc_info_enum_double, \ |
@@ -333,6 +369,7 @@ struct snd_soc_dapm_route; | |||
333 | struct snd_soc_dapm_context; | 369 | struct snd_soc_dapm_context; |
334 | struct regulator; | 370 | struct regulator; |
335 | struct snd_soc_dapm_widget_list; | 371 | struct snd_soc_dapm_widget_list; |
372 | struct snd_soc_dapm_update; | ||
336 | 373 | ||
337 | int dapm_reg_event(struct snd_soc_dapm_widget *w, | 374 | int dapm_reg_event(struct snd_soc_dapm_widget *w, |
338 | struct snd_kcontrol *kcontrol, int event); | 375 | struct snd_kcontrol *kcontrol, int event); |
@@ -391,10 +428,12 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, | |||
391 | void snd_soc_dapm_shutdown(struct snd_soc_card *card); | 428 | void snd_soc_dapm_shutdown(struct snd_soc_card *card); |
392 | 429 | ||
393 | /* external DAPM widget events */ | 430 | /* external DAPM widget events */ |
394 | int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, | 431 | int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm, |
395 | struct snd_kcontrol *kcontrol, int connect); | 432 | struct snd_kcontrol *kcontrol, int connect, |
396 | int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, | 433 | struct snd_soc_dapm_update *update); |
397 | struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e); | 434 | int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm, |
435 | struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e, | ||
436 | struct snd_soc_dapm_update *update); | ||
398 | 437 | ||
399 | /* dapm sys fs - used by the core */ | 438 | /* dapm sys fs - used by the core */ |
400 | int snd_soc_dapm_sys_add(struct device *dev); | 439 | int snd_soc_dapm_sys_add(struct device *dev); |
@@ -424,6 +463,8 @@ void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm); | |||
424 | int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, | 463 | int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, |
425 | struct snd_soc_dapm_widget_list **list); | 464 | struct snd_soc_dapm_widget_list **list); |
426 | 465 | ||
466 | struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol); | ||
467 | |||
427 | /* dapm widget types */ | 468 | /* dapm widget types */ |
428 | enum snd_soc_dapm_type { | 469 | enum snd_soc_dapm_type { |
429 | snd_soc_dapm_input = 0, /* input pin */ | 470 | snd_soc_dapm_input = 0, /* input pin */ |
@@ -455,6 +496,7 @@ enum snd_soc_dapm_type { | |||
455 | snd_soc_dapm_dai_in, /* link to DAI structure */ | 496 | snd_soc_dapm_dai_in, /* link to DAI structure */ |
456 | snd_soc_dapm_dai_out, | 497 | snd_soc_dapm_dai_out, |
457 | snd_soc_dapm_dai_link, /* link between two DAI structures */ | 498 | snd_soc_dapm_dai_link, /* link between two DAI structures */ |
499 | snd_soc_dapm_kcontrol, /* Auto-disabled kcontrol */ | ||
458 | }; | 500 | }; |
459 | 501 | ||
460 | enum snd_soc_dapm_subclass { | 502 | enum snd_soc_dapm_subclass { |
@@ -485,7 +527,6 @@ struct snd_soc_dapm_path { | |||
485 | /* source (input) and sink (output) widgets */ | 527 | /* source (input) and sink (output) widgets */ |
486 | struct snd_soc_dapm_widget *source; | 528 | struct snd_soc_dapm_widget *source; |
487 | struct snd_soc_dapm_widget *sink; | 529 | struct snd_soc_dapm_widget *sink; |
488 | struct snd_kcontrol *kcontrol; | ||
489 | 530 | ||
490 | /* status */ | 531 | /* status */ |
491 | u32 connect:1; /* source and sink widgets are connected */ | 532 | u32 connect:1; /* source and sink widgets are connected */ |
@@ -498,6 +539,7 @@ struct snd_soc_dapm_path { | |||
498 | 539 | ||
499 | struct list_head list_source; | 540 | struct list_head list_source; |
500 | struct list_head list_sink; | 541 | struct list_head list_sink; |
542 | struct list_head list_kcontrol; | ||
501 | struct list_head list; | 543 | struct list_head list; |
502 | }; | 544 | }; |
503 | 545 | ||
@@ -518,12 +560,10 @@ struct snd_soc_dapm_widget { | |||
518 | /* dapm control */ | 560 | /* dapm control */ |
519 | int reg; /* negative reg = no direct dapm */ | 561 | int reg; /* negative reg = no direct dapm */ |
520 | unsigned char shift; /* bits to shift */ | 562 | unsigned char shift; /* bits to shift */ |
521 | unsigned int value; /* widget current value */ | ||
522 | unsigned int mask; /* non-shifted mask */ | 563 | unsigned int mask; /* non-shifted mask */ |
523 | unsigned int on_val; /* on state value */ | 564 | unsigned int on_val; /* on state value */ |
524 | unsigned int off_val; /* off state value */ | 565 | unsigned int off_val; /* off state value */ |
525 | unsigned char power:1; /* block power status */ | 566 | unsigned char power:1; /* block power status */ |
526 | unsigned char invert:1; /* invert the power bit */ | ||
527 | unsigned char active:1; /* active stream on DAC, ADC's */ | 567 | unsigned char active:1; /* active stream on DAC, ADC's */ |
528 | unsigned char connected:1; /* connected codec pin */ | 568 | unsigned char connected:1; /* connected codec pin */ |
529 | unsigned char new:1; /* cnew complete */ | 569 | unsigned char new:1; /* cnew complete */ |
@@ -559,7 +599,6 @@ struct snd_soc_dapm_widget { | |||
559 | }; | 599 | }; |
560 | 600 | ||
561 | struct snd_soc_dapm_update { | 601 | struct snd_soc_dapm_update { |
562 | struct snd_soc_dapm_widget *widget; | ||
563 | struct snd_kcontrol *kcontrol; | 602 | struct snd_kcontrol *kcontrol; |
564 | int reg; | 603 | int reg; |
565 | int mask; | 604 | int mask; |
@@ -573,8 +612,6 @@ struct snd_soc_dapm_context { | |||
573 | struct delayed_work delayed_work; | 612 | struct delayed_work delayed_work; |
574 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ | 613 | unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ |
575 | 614 | ||
576 | struct snd_soc_dapm_update *update; | ||
577 | |||
578 | void (*seq_notifier)(struct snd_soc_dapm_context *, | 615 | void (*seq_notifier)(struct snd_soc_dapm_context *, |
579 | enum snd_soc_dapm_type, int); | 616 | enum snd_soc_dapm_type, int); |
580 | 617 | ||
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h index 04598f1efd77..047d657c331c 100644 --- a/include/sound/soc-dpcm.h +++ b/include/sound/soc-dpcm.h | |||
@@ -133,6 +133,6 @@ void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream, | |||
133 | /* internal use only */ | 133 | /* internal use only */ |
134 | int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); | 134 | int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); |
135 | int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); | 135 | int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); |
136 | int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *); | 136 | int soc_dpcm_runtime_update(struct snd_soc_card *); |
137 | 137 | ||
138 | #endif | 138 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 6eabee7ec15a..8e2ad52078b6 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -30,13 +30,13 @@ | |||
30 | /* | 30 | /* |
31 | * Convenience kcontrol builders | 31 | * Convenience kcontrol builders |
32 | */ | 32 | */ |
33 | #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \ | 33 | #define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert, xautodisable) \ |
34 | ((unsigned long)&(struct soc_mixer_control) \ | 34 | ((unsigned long)&(struct soc_mixer_control) \ |
35 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ | 35 | {.reg = xreg, .rreg = xreg, .shift = shift_left, \ |
36 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ | 36 | .rshift = shift_right, .max = xmax, .platform_max = xmax, \ |
37 | .invert = xinvert}) | 37 | .invert = xinvert, .autodisable = xautodisable}) |
38 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ | 38 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \ |
39 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert) | 39 | SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert, xautodisable) |
40 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ | 40 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
41 | ((unsigned long)&(struct soc_mixer_control) \ | 41 | ((unsigned long)&(struct soc_mixer_control) \ |
42 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) | 42 | {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) |
@@ -52,7 +52,7 @@ | |||
52 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 52 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
53 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 53 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
54 | .put = snd_soc_put_volsw, \ | 54 | .put = snd_soc_put_volsw, \ |
55 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 55 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } |
56 | #define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \ | 56 | #define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \ |
57 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 57 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
58 | .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ | 58 | .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ |
@@ -68,7 +68,7 @@ | |||
68 | .tlv.p = (tlv_array), \ | 68 | .tlv.p = (tlv_array), \ |
69 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 69 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
70 | .put = snd_soc_put_volsw, \ | 70 | .put = snd_soc_put_volsw, \ |
71 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 71 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } |
72 | #define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \ | 72 | #define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \ |
73 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 73 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
74 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 74 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
@@ -97,7 +97,7 @@ | |||
97 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 97 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
98 | .put = snd_soc_put_volsw, \ | 98 | .put = snd_soc_put_volsw, \ |
99 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ | 99 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
100 | max, invert) } | 100 | max, invert, 0) } |
101 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ | 101 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ |
102 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 102 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
103 | .info = snd_soc_info_volsw, \ | 103 | .info = snd_soc_info_volsw, \ |
@@ -119,7 +119,7 @@ | |||
119 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 119 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
120 | .put = snd_soc_put_volsw, \ | 120 | .put = snd_soc_put_volsw, \ |
121 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ | 121 | .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ |
122 | max, invert) } | 122 | max, invert, 0) } |
123 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ | 123 | #define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ |
124 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 124 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
125 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 125 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
@@ -190,14 +190,14 @@ | |||
190 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 190 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
191 | .info = snd_soc_info_volsw, \ | 191 | .info = snd_soc_info_volsw, \ |
192 | .get = xhandler_get, .put = xhandler_put, \ | 192 | .get = xhandler_get, .put = xhandler_put, \ |
193 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 193 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) } |
194 | #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ | 194 | #define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ |
195 | xhandler_get, xhandler_put) \ | 195 | xhandler_get, xhandler_put) \ |
196 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 196 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
197 | .info = snd_soc_info_volsw, \ | 197 | .info = snd_soc_info_volsw, \ |
198 | .get = xhandler_get, .put = xhandler_put, \ | 198 | .get = xhandler_get, .put = xhandler_put, \ |
199 | .private_value = \ | 199 | .private_value = \ |
200 | SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) } | 200 | SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert, 0) } |
201 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 201 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
202 | xhandler_get, xhandler_put, tlv_array) \ | 202 | xhandler_get, xhandler_put, tlv_array) \ |
203 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 203 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -206,7 +206,7 @@ | |||
206 | .tlv.p = (tlv_array), \ | 206 | .tlv.p = (tlv_array), \ |
207 | .info = snd_soc_info_volsw, \ | 207 | .info = snd_soc_info_volsw, \ |
208 | .get = xhandler_get, .put = xhandler_put, \ | 208 | .get = xhandler_get, .put = xhandler_put, \ |
209 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 209 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) } |
210 | #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | 210 | #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ |
211 | xhandler_get, xhandler_put, tlv_array) \ | 211 | xhandler_get, xhandler_put, tlv_array) \ |
212 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 212 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
@@ -216,7 +216,7 @@ | |||
216 | .info = snd_soc_info_volsw, \ | 216 | .info = snd_soc_info_volsw, \ |
217 | .get = xhandler_get, .put = xhandler_put, \ | 217 | .get = xhandler_get, .put = xhandler_put, \ |
218 | .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ | 218 | .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ |
219 | xmax, xinvert) } | 219 | xmax, xinvert, 0) } |
220 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | 220 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ |
221 | xhandler_get, xhandler_put, tlv_array) \ | 221 | xhandler_get, xhandler_put, tlv_array) \ |
222 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 222 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
@@ -234,7 +234,7 @@ | |||
234 | .private_value = xdata } | 234 | .private_value = xdata } |
235 | #define SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \ | 235 | #define SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \ |
236 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 236 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
237 | .info = snd_soc_info_enum_ext, \ | 237 | .info = snd_soc_info_enum_double, \ |
238 | .get = xhandler_get, .put = xhandler_put, \ | 238 | .get = xhandler_get, .put = xhandler_put, \ |
239 | .private_value = (unsigned long)&xenum } | 239 | .private_value = (unsigned long)&xenum } |
240 | 240 | ||
@@ -468,6 +468,8 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, | |||
468 | void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); | 468 | void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); |
469 | 469 | ||
470 | int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); | 470 | int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); |
471 | int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops, | ||
472 | struct platform_device *pdev); | ||
471 | 473 | ||
472 | /* | 474 | /* |
473 | *Controls | 475 | *Controls |
@@ -475,6 +477,8 @@ int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); | |||
475 | struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, | 477 | struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, |
476 | void *data, const char *long_name, | 478 | void *data, const char *long_name, |
477 | const char *prefix); | 479 | const char *prefix); |
480 | struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card, | ||
481 | const char *name); | ||
478 | int snd_soc_add_codec_controls(struct snd_soc_codec *codec, | 482 | int snd_soc_add_codec_controls(struct snd_soc_codec *codec, |
479 | const struct snd_kcontrol_new *controls, int num_controls); | 483 | const struct snd_kcontrol_new *controls, int num_controls); |
480 | int snd_soc_add_platform_controls(struct snd_soc_platform *platform, | 484 | int snd_soc_add_platform_controls(struct snd_soc_platform *platform, |
@@ -485,8 +489,6 @@ int snd_soc_add_dai_controls(struct snd_soc_dai *dai, | |||
485 | const struct snd_kcontrol_new *controls, int num_controls); | 489 | const struct snd_kcontrol_new *controls, int num_controls); |
486 | int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, | 490 | int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, |
487 | struct snd_ctl_elem_info *uinfo); | 491 | struct snd_ctl_elem_info *uinfo); |
488 | int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, | ||
489 | struct snd_ctl_elem_info *uinfo); | ||
490 | int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol, | 492 | int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol, |
491 | struct snd_ctl_elem_value *ucontrol); | 493 | struct snd_ctl_elem_value *ucontrol); |
492 | int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, | 494 | int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, |
@@ -497,8 +499,6 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
497 | struct snd_ctl_elem_value *ucontrol); | 499 | struct snd_ctl_elem_value *ucontrol); |
498 | int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, | 500 | int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, |
499 | struct snd_ctl_elem_info *uinfo); | 501 | struct snd_ctl_elem_info *uinfo); |
500 | int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol, | ||
501 | struct snd_ctl_elem_info *uinfo); | ||
502 | #define snd_soc_info_bool_ext snd_ctl_boolean_mono_info | 502 | #define snd_soc_info_bool_ext snd_ctl_boolean_mono_info |
503 | int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, | 503 | int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, |
504 | struct snd_ctl_elem_value *ucontrol); | 504 | struct snd_ctl_elem_value *ucontrol); |
@@ -1042,6 +1042,7 @@ struct snd_soc_card { | |||
1042 | /* Generic DAPM context for the card */ | 1042 | /* Generic DAPM context for the card */ |
1043 | struct snd_soc_dapm_context dapm; | 1043 | struct snd_soc_dapm_context dapm; |
1044 | struct snd_soc_dapm_stats dapm_stats; | 1044 | struct snd_soc_dapm_stats dapm_stats; |
1045 | struct snd_soc_dapm_update *update; | ||
1045 | 1046 | ||
1046 | #ifdef CONFIG_DEBUG_FS | 1047 | #ifdef CONFIG_DEBUG_FS |
1047 | struct dentry *debugfs_card_root; | 1048 | struct dentry *debugfs_card_root; |
@@ -1087,7 +1088,9 @@ struct snd_soc_pcm_runtime { | |||
1087 | /* mixer control */ | 1088 | /* mixer control */ |
1088 | struct soc_mixer_control { | 1089 | struct soc_mixer_control { |
1089 | int min, max, platform_max; | 1090 | int min, max, platform_max; |
1090 | unsigned int reg, rreg, shift, rshift, invert; | 1091 | unsigned int reg, rreg, shift, rshift; |
1092 | unsigned int invert:1; | ||
1093 | unsigned int autodisable:1; | ||
1091 | }; | 1094 | }; |
1092 | 1095 | ||
1093 | struct soc_bytes { | 1096 | struct soc_bytes { |