diff options
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/l3.h | 18 | ||||
| -rw-r--r-- | include/sound/s3c24xx_uda134x.h | 14 | ||||
| -rw-r--r-- | include/sound/soc-dai.h | 231 | ||||
| -rw-r--r-- | include/sound/soc-dapm.h | 2 | ||||
| -rw-r--r-- | include/sound/soc.h | 206 | ||||
| -rw-r--r-- | include/sound/uda134x.h | 26 |
6 files changed, 325 insertions, 172 deletions
diff --git a/include/sound/l3.h b/include/sound/l3.h new file mode 100644 index 000000000000..423a08f0f1b0 --- /dev/null +++ b/include/sound/l3.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #ifndef _L3_H_ | ||
| 2 | #define _L3_H_ 1 | ||
| 3 | |||
| 4 | struct l3_pins { | ||
| 5 | void (*setdat)(int); | ||
| 6 | void (*setclk)(int); | ||
| 7 | void (*setmode)(int); | ||
| 8 | int data_hold; | ||
| 9 | int data_setup; | ||
| 10 | int clock_high; | ||
| 11 | int mode_hold; | ||
| 12 | int mode; | ||
| 13 | int mode_setup; | ||
| 14 | }; | ||
| 15 | |||
| 16 | int l3_write(struct l3_pins *adap, u8 addr, u8 *data, int len); | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/sound/s3c24xx_uda134x.h b/include/sound/s3c24xx_uda134x.h new file mode 100644 index 000000000000..33df4cb909d3 --- /dev/null +++ b/include/sound/s3c24xx_uda134x.h | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #ifndef _S3C24XX_UDA134X_H_ | ||
| 2 | #define _S3C24XX_UDA134X_H_ 1 | ||
| 3 | |||
| 4 | #include <sound/uda134x.h> | ||
| 5 | |||
| 6 | struct s3c24xx_uda134x_platform_data { | ||
| 7 | int l3_clk; | ||
| 8 | int l3_mode; | ||
| 9 | int l3_data; | ||
| 10 | void (*power) (int); | ||
| 11 | int model; | ||
| 12 | }; | ||
| 13 | |||
| 14 | #endif | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h new file mode 100644 index 000000000000..24247f763608 --- /dev/null +++ b/include/sound/soc-dai.h | |||
| @@ -0,0 +1,231 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/soc-dai.h -- ALSA SoC Layer | ||
| 3 | * | ||
| 4 | * Copyright: 2005-2008 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 | * Digital Audio Interface (DAI) API. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_SND_SOC_DAI_H | ||
| 14 | #define __LINUX_SND_SOC_DAI_H | ||
| 15 | |||
| 16 | |||
| 17 | #include <linux/list.h> | ||
| 18 | |||
| 19 | struct snd_pcm_substream; | ||
| 20 | |||
| 21 | /* | ||
| 22 | * DAI hardware audio formats. | ||
| 23 | * | ||
| 24 | * Describes the physical PCM data formating and clocking. Add new formats | ||
| 25 | * to the end. | ||
| 26 | */ | ||
| 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | ||
| 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | ||
| 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | ||
| 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM LRC */ | ||
| 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM LRC */ | ||
| 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | ||
| 33 | |||
| 34 | /* left and right justified also known as MSB and LSB respectively */ | ||
| 35 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J | ||
| 36 | #define SND_SOC_DAIFMT_LSB SND_SOC_DAIFMT_RIGHT_J | ||
| 37 | |||
| 38 | /* | ||
| 39 | * DAI Clock gating. | ||
| 40 | * | ||
| 41 | * DAI bit clocks can be be gated (disabled) when not the DAI is not | ||
| 42 | * sending or receiving PCM data in a frame. This can be used to save power. | ||
| 43 | */ | ||
| 44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | ||
| 45 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ | ||
| 46 | |||
| 47 | /* | ||
| 48 | * DAI Left/Right Clocks. | ||
| 49 | * | ||
| 50 | * Specifies whether the DAI can support different samples for similtanious | ||
| 51 | * playback and capture. This usually requires a seperate physical frame | ||
| 52 | * clock for playback and capture. | ||
| 53 | */ | ||
| 54 | #define SND_SOC_DAIFMT_SYNC (0 << 5) /* Tx FRM = Rx FRM */ | ||
| 55 | #define SND_SOC_DAIFMT_ASYNC (1 << 5) /* Tx FRM ~ Rx FRM */ | ||
| 56 | |||
| 57 | /* | ||
| 58 | * TDM | ||
| 59 | * | ||
| 60 | * Time Division Multiplexing. Allows PCM data to be multplexed with other | ||
| 61 | * data on the DAI. | ||
| 62 | */ | ||
| 63 | #define SND_SOC_DAIFMT_TDM (1 << 6) | ||
| 64 | |||
| 65 | /* | ||
| 66 | * DAI hardware signal inversions. | ||
| 67 | * | ||
| 68 | * Specifies whether the DAI can also support inverted clocks for the specified | ||
| 69 | * format. | ||
| 70 | */ | ||
| 71 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | ||
| 72 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | ||
| 73 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | ||
| 74 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | ||
| 75 | |||
| 76 | /* | ||
| 77 | * DAI hardware clock masters. | ||
| 78 | * | ||
| 79 | * This is wrt the codec, the inverse is true for the interface | ||
| 80 | * i.e. if the codec is clk and frm master then the interface is | ||
| 81 | * clk and frame slave. | ||
| 82 | */ | ||
| 83 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | ||
| 84 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | ||
| 85 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | ||
| 86 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | ||
| 87 | |||
| 88 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | ||
| 89 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | ||
| 90 | #define SND_SOC_DAIFMT_INV_MASK 0x0f00 | ||
| 91 | #define SND_SOC_DAIFMT_MASTER_MASK 0xf000 | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Master Clock Directions | ||
| 95 | */ | ||
| 96 | #define SND_SOC_CLOCK_IN 0 | ||
| 97 | #define SND_SOC_CLOCK_OUT 1 | ||
| 98 | |||
| 99 | struct snd_soc_dai_ops; | ||
| 100 | struct snd_soc_dai; | ||
| 101 | struct snd_ac97_bus_ops; | ||
| 102 | |||
| 103 | /* Digital Audio Interface registration */ | ||
| 104 | int snd_soc_register_dai(struct snd_soc_dai *dai); | ||
| 105 | void snd_soc_unregister_dai(struct snd_soc_dai *dai); | ||
| 106 | int snd_soc_register_dais(struct snd_soc_dai *dai, size_t count); | ||
| 107 | void snd_soc_unregister_dais(struct snd_soc_dai *dai, size_t count); | ||
| 108 | |||
| 109 | /* Digital Audio Interface clocking API.*/ | ||
| 110 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, | ||
| 111 | unsigned int freq, int dir); | ||
| 112 | |||
| 113 | int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | ||
| 114 | int div_id, int div); | ||
| 115 | |||
| 116 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | ||
| 117 | int pll_id, unsigned int freq_in, unsigned int freq_out); | ||
| 118 | |||
| 119 | /* Digital Audio interface formatting */ | ||
| 120 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | ||
| 121 | |||
| 122 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | ||
| 123 | unsigned int mask, int slots); | ||
| 124 | |||
| 125 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | ||
| 126 | |||
| 127 | /* Digital Audio Interface mute */ | ||
| 128 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | ||
| 129 | |||
| 130 | /* | ||
| 131 | * Digital Audio Interface. | ||
| 132 | * | ||
| 133 | * Describes the Digital Audio Interface in terms of it's ALSA, DAI and AC97 | ||
| 134 | * operations an capabilities. Codec and platfom drivers will register a this | ||
| 135 | * structure for every DAI they have. | ||
| 136 | * | ||
| 137 | * This structure covers the clocking, formating and ALSA operations for each | ||
| 138 | * interface a | ||
| 139 | */ | ||
| 140 | struct snd_soc_dai_ops { | ||
| 141 | /* | ||
| 142 | * DAI clocking configuration, all optional. | ||
| 143 | * Called by soc_card drivers, normally in their hw_params. | ||
| 144 | */ | ||
| 145 | int (*set_sysclk)(struct snd_soc_dai *dai, | ||
| 146 | int clk_id, unsigned int freq, int dir); | ||
| 147 | int (*set_pll)(struct snd_soc_dai *dai, | ||
| 148 | int pll_id, unsigned int freq_in, unsigned int freq_out); | ||
| 149 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); | ||
| 150 | |||
| 151 | /* | ||
| 152 | * DAI format configuration | ||
| 153 | * Called by soc_card drivers, normally in their hw_params. | ||
| 154 | */ | ||
| 155 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | ||
| 156 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | ||
| 157 | unsigned int mask, int slots); | ||
| 158 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | ||
| 159 | |||
| 160 | /* | ||
| 161 | * DAI digital mute - optional. | ||
| 162 | * Called by soc-core to minimise any pops. | ||
| 163 | */ | ||
| 164 | int (*digital_mute)(struct snd_soc_dai *dai, int mute); | ||
| 165 | |||
| 166 | /* | ||
| 167 | * ALSA PCM audio operations - all optional. | ||
| 168 | * Called by soc-core during audio PCM operations. | ||
| 169 | */ | ||
| 170 | int (*startup)(struct snd_pcm_substream *, | ||
| 171 | struct snd_soc_dai *); | ||
| 172 | void (*shutdown)(struct snd_pcm_substream *, | ||
| 173 | struct snd_soc_dai *); | ||
| 174 | int (*hw_params)(struct snd_pcm_substream *, | ||
| 175 | struct snd_pcm_hw_params *, struct snd_soc_dai *); | ||
| 176 | int (*hw_free)(struct snd_pcm_substream *, | ||
| 177 | struct snd_soc_dai *); | ||
| 178 | int (*prepare)(struct snd_pcm_substream *, | ||
| 179 | struct snd_soc_dai *); | ||
| 180 | int (*trigger)(struct snd_pcm_substream *, int, | ||
| 181 | struct snd_soc_dai *); | ||
| 182 | }; | ||
| 183 | |||
| 184 | /* | ||
| 185 | * Digital Audio Interface runtime data. | ||
| 186 | * | ||
| 187 | * Holds runtime data for a DAI. | ||
| 188 | */ | ||
| 189 | struct snd_soc_dai { | ||
| 190 | /* DAI description */ | ||
| 191 | char *name; | ||
| 192 | unsigned int id; | ||
| 193 | int ac97_control; | ||
| 194 | |||
| 195 | struct device *dev; | ||
| 196 | |||
| 197 | /* DAI callbacks */ | ||
| 198 | int (*probe)(struct platform_device *pdev, | ||
| 199 | struct snd_soc_dai *dai); | ||
| 200 | void (*remove)(struct platform_device *pdev, | ||
| 201 | struct snd_soc_dai *dai); | ||
| 202 | int (*suspend)(struct snd_soc_dai *dai); | ||
| 203 | int (*resume)(struct snd_soc_dai *dai); | ||
| 204 | |||
| 205 | /* ops */ | ||
| 206 | struct snd_soc_dai_ops ops; | ||
| 207 | |||
| 208 | /* DAI capabilities */ | ||
| 209 | struct snd_soc_pcm_stream capture; | ||
| 210 | struct snd_soc_pcm_stream playback; | ||
| 211 | |||
| 212 | /* DAI runtime info */ | ||
| 213 | struct snd_pcm_runtime *runtime; | ||
| 214 | struct snd_soc_codec *codec; | ||
| 215 | unsigned int active; | ||
| 216 | unsigned char pop_wait:1; | ||
| 217 | void *dma_data; | ||
| 218 | |||
| 219 | /* DAI private data */ | ||
| 220 | void *private_data; | ||
| 221 | |||
| 222 | /* parent codec/platform */ | ||
| 223 | union { | ||
| 224 | struct snd_soc_codec *codec; | ||
| 225 | struct snd_soc_platform *platform; | ||
| 226 | }; | ||
| 227 | |||
| 228 | struct list_head list; | ||
| 229 | }; | ||
| 230 | |||
| 231 | #endif | ||
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index ca699a3017f3..7ee2f70ca42e 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -221,8 +221,6 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, | |||
| 221 | int num); | 221 | int num); |
| 222 | 222 | ||
| 223 | /* dapm path setup */ | 223 | /* dapm path setup */ |
| 224 | int __deprecated snd_soc_dapm_connect_input(struct snd_soc_codec *codec, | ||
| 225 | const char *sink_name, const char *control_name, const char *src_name); | ||
| 226 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); | 224 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); |
| 227 | void snd_soc_dapm_free(struct snd_soc_device *socdev); | 225 | void snd_soc_dapm_free(struct snd_soc_device *socdev); |
| 228 | int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | 226 | int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 5e0189876afd..f86e455d3828 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | #include <sound/control.h> | 21 | #include <sound/control.h> |
| 22 | #include <sound/ac97_codec.h> | 22 | #include <sound/ac97_codec.h> |
| 23 | 23 | ||
| 24 | #define SND_SOC_VERSION "0.13.2" | ||
| 25 | |||
| 26 | /* | 24 | /* |
| 27 | * Convenience kcontrol builders | 25 | * Convenience kcontrol builders |
| 28 | */ | 26 | */ |
| @@ -145,105 +143,31 @@ enum snd_soc_bias_level { | |||
| 145 | SND_SOC_BIAS_OFF, | 143 | SND_SOC_BIAS_OFF, |
| 146 | }; | 144 | }; |
| 147 | 145 | ||
| 148 | /* | ||
| 149 | * Digital Audio Interface (DAI) types | ||
| 150 | */ | ||
| 151 | #define SND_SOC_DAI_AC97 0x1 | ||
| 152 | #define SND_SOC_DAI_I2S 0x2 | ||
| 153 | #define SND_SOC_DAI_PCM 0x4 | ||
| 154 | #define SND_SOC_DAI_AC97_BUS 0x8 /* for custom i.e. non ac97_codec.c */ | ||
| 155 | |||
| 156 | /* | ||
| 157 | * DAI hardware audio formats | ||
| 158 | */ | ||
| 159 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | ||
| 160 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right justified mode */ | ||
| 161 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | ||
| 162 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM or LRC */ | ||
| 163 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM or LRC */ | ||
| 164 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | ||
| 165 | |||
| 166 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J | ||
| 167 | #define SND_SOC_DAIFMT_LSB SND_SOC_DAIFMT_RIGHT_J | ||
| 168 | |||
| 169 | /* | ||
| 170 | * DAI Gating | ||
| 171 | */ | ||
| 172 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | ||
| 173 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated when not Tx/Rx */ | ||
| 174 | |||
| 175 | /* | ||
| 176 | * DAI Sync | ||
| 177 | * Synchronous LR (Left Right) clocks and Frame signals. | ||
| 178 | */ | ||
| 179 | #define SND_SOC_DAIFMT_SYNC (0 << 5) /* Tx FRM = Rx FRM */ | ||
| 180 | #define SND_SOC_DAIFMT_ASYNC (1 << 5) /* Tx FRM ~ Rx FRM */ | ||
| 181 | |||
| 182 | /* | ||
| 183 | * TDM | ||
| 184 | */ | ||
| 185 | #define SND_SOC_DAIFMT_TDM (1 << 6) | ||
| 186 | |||
| 187 | /* | ||
| 188 | * DAI hardware signal inversions | ||
| 189 | */ | ||
| 190 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bclk + frm */ | ||
| 191 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | ||
| 192 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | ||
| 193 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | ||
| 194 | |||
| 195 | /* | ||
| 196 | * DAI hardware clock masters | ||
| 197 | * This is wrt the codec, the inverse is true for the interface | ||
| 198 | * i.e. if the codec is clk and frm master then the interface is | ||
| 199 | * clk and frame slave. | ||
| 200 | */ | ||
| 201 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | ||
| 202 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | ||
| 203 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | ||
| 204 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | ||
| 205 | |||
| 206 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | ||
| 207 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | ||
| 208 | #define SND_SOC_DAIFMT_INV_MASK 0x0f00 | ||
| 209 | #define SND_SOC_DAIFMT_MASTER_MASK 0xf000 | ||
| 210 | |||
| 211 | |||
| 212 | /* | ||
| 213 | * Master Clock Directions | ||
| 214 | */ | ||
| 215 | #define SND_SOC_CLOCK_IN 0 | ||
| 216 | #define SND_SOC_CLOCK_OUT 1 | ||
| 217 | |||
| 218 | /* | ||
| 219 | * AC97 codec ID's bitmask | ||
| 220 | */ | ||
| 221 | #define SND_SOC_DAI_AC97_ID0 (1 << 0) | ||
| 222 | #define SND_SOC_DAI_AC97_ID1 (1 << 1) | ||
| 223 | #define SND_SOC_DAI_AC97_ID2 (1 << 2) | ||
| 224 | #define SND_SOC_DAI_AC97_ID3 (1 << 3) | ||
| 225 | |||
| 226 | struct snd_soc_device; | 146 | struct snd_soc_device; |
| 227 | struct snd_soc_pcm_stream; | 147 | struct snd_soc_pcm_stream; |
| 228 | struct snd_soc_ops; | 148 | struct snd_soc_ops; |
| 229 | struct snd_soc_dai_mode; | 149 | struct snd_soc_dai_mode; |
| 230 | struct snd_soc_pcm_runtime; | 150 | struct snd_soc_pcm_runtime; |
| 231 | struct snd_soc_dai; | 151 | struct snd_soc_dai; |
| 152 | struct snd_soc_platform; | ||
| 232 | struct snd_soc_codec; | 153 | struct snd_soc_codec; |
| 233 | struct snd_soc_machine_config; | ||
| 234 | struct soc_enum; | 154 | struct soc_enum; |
| 235 | struct snd_soc_ac97_ops; | 155 | struct snd_soc_ac97_ops; |
| 236 | struct snd_soc_clock_info; | ||
| 237 | 156 | ||
| 238 | typedef int (*hw_write_t)(void *,const char* ,int); | 157 | typedef int (*hw_write_t)(void *,const char* ,int); |
| 239 | typedef int (*hw_read_t)(void *,char* ,int); | 158 | typedef int (*hw_read_t)(void *,char* ,int); |
| 240 | 159 | ||
| 241 | extern struct snd_ac97_bus_ops soc_ac97_ops; | 160 | extern struct snd_ac97_bus_ops soc_ac97_ops; |
| 242 | 161 | ||
| 162 | int snd_soc_register_platform(struct snd_soc_platform *platform); | ||
| 163 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); | ||
| 164 | int snd_soc_register_codec(struct snd_soc_codec *codec); | ||
| 165 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); | ||
| 166 | |||
| 243 | /* pcm <-> DAI connect */ | 167 | /* pcm <-> DAI connect */ |
| 244 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 168 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
| 245 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); | 169 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); |
| 246 | int snd_soc_register_card(struct snd_soc_device *socdev); | 170 | int snd_soc_init_card(struct snd_soc_device *socdev); |
| 247 | 171 | ||
| 248 | /* set runtime hw params */ | 172 | /* set runtime hw params */ |
| 249 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, | 173 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, |
| @@ -263,27 +187,6 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, | |||
| 263 | struct snd_ac97_bus_ops *ops, int num); | 187 | struct snd_ac97_bus_ops *ops, int num); |
| 264 | void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); | 188 | void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); |
| 265 | 189 | ||
| 266 | /* Digital Audio Interface clocking API.*/ | ||
| 267 | int snd_soc_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, | ||
| 268 | unsigned int freq, int dir); | ||
| 269 | |||
| 270 | int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | ||
| 271 | int div_id, int div); | ||
| 272 | |||
| 273 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | ||
| 274 | int pll_id, unsigned int freq_in, unsigned int freq_out); | ||
| 275 | |||
| 276 | /* Digital Audio interface formatting */ | ||
| 277 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | ||
| 278 | |||
| 279 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | ||
| 280 | unsigned int mask, int slots); | ||
| 281 | |||
| 282 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | ||
| 283 | |||
| 284 | /* Digital Audio Interface mute */ | ||
| 285 | int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | ||
| 286 | |||
| 287 | /* | 190 | /* |
| 288 | *Controls | 191 | *Controls |
| 289 | */ | 192 | */ |
| @@ -341,66 +244,14 @@ struct snd_soc_ops { | |||
| 341 | int (*trigger)(struct snd_pcm_substream *, int); | 244 | int (*trigger)(struct snd_pcm_substream *, int); |
| 342 | }; | 245 | }; |
| 343 | 246 | ||
| 344 | /* ASoC DAI ops */ | ||
| 345 | struct snd_soc_dai_ops { | ||
| 346 | /* DAI clocking configuration */ | ||
| 347 | int (*set_sysclk)(struct snd_soc_dai *dai, | ||
| 348 | int clk_id, unsigned int freq, int dir); | ||
| 349 | int (*set_pll)(struct snd_soc_dai *dai, | ||
| 350 | int pll_id, unsigned int freq_in, unsigned int freq_out); | ||
| 351 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); | ||
| 352 | |||
| 353 | /* DAI format configuration */ | ||
| 354 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | ||
| 355 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | ||
| 356 | unsigned int mask, int slots); | ||
| 357 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | ||
| 358 | |||
| 359 | /* digital mute */ | ||
| 360 | int (*digital_mute)(struct snd_soc_dai *dai, int mute); | ||
| 361 | }; | ||
| 362 | |||
| 363 | /* SoC DAI (Digital Audio Interface) */ | ||
| 364 | struct snd_soc_dai { | ||
| 365 | /* DAI description */ | ||
| 366 | char *name; | ||
| 367 | unsigned int id; | ||
| 368 | unsigned char type; | ||
| 369 | |||
| 370 | /* DAI callbacks */ | ||
| 371 | int (*probe)(struct platform_device *pdev, | ||
| 372 | struct snd_soc_dai *dai); | ||
| 373 | void (*remove)(struct platform_device *pdev, | ||
| 374 | struct snd_soc_dai *dai); | ||
| 375 | int (*suspend)(struct platform_device *pdev, | ||
| 376 | struct snd_soc_dai *dai); | ||
| 377 | int (*resume)(struct platform_device *pdev, | ||
| 378 | struct snd_soc_dai *dai); | ||
| 379 | |||
| 380 | /* ops */ | ||
| 381 | struct snd_soc_ops ops; | ||
| 382 | struct snd_soc_dai_ops dai_ops; | ||
| 383 | |||
| 384 | /* DAI capabilities */ | ||
| 385 | struct snd_soc_pcm_stream capture; | ||
| 386 | struct snd_soc_pcm_stream playback; | ||
| 387 | |||
| 388 | /* DAI runtime info */ | ||
| 389 | struct snd_pcm_runtime *runtime; | ||
| 390 | struct snd_soc_codec *codec; | ||
| 391 | unsigned int active; | ||
| 392 | unsigned char pop_wait:1; | ||
| 393 | void *dma_data; | ||
| 394 | |||
| 395 | /* DAI private data */ | ||
| 396 | void *private_data; | ||
| 397 | }; | ||
| 398 | |||
| 399 | /* SoC Audio Codec */ | 247 | /* SoC Audio Codec */ |
| 400 | struct snd_soc_codec { | 248 | struct snd_soc_codec { |
| 401 | char *name; | 249 | char *name; |
| 402 | struct module *owner; | 250 | struct module *owner; |
| 403 | struct mutex mutex; | 251 | struct mutex mutex; |
| 252 | struct device *dev; | ||
| 253 | |||
| 254 | struct list_head list; | ||
| 404 | 255 | ||
| 405 | /* callbacks */ | 256 | /* callbacks */ |
| 406 | int (*set_bias_level)(struct snd_soc_codec *, | 257 | int (*set_bias_level)(struct snd_soc_codec *, |
| @@ -426,6 +277,7 @@ struct snd_soc_codec { | |||
| 426 | short reg_cache_step; | 277 | short reg_cache_step; |
| 427 | 278 | ||
| 428 | /* dapm */ | 279 | /* dapm */ |
| 280 | u32 pop_time; | ||
| 429 | struct list_head dapm_widgets; | 281 | struct list_head dapm_widgets; |
| 430 | struct list_head dapm_paths; | 282 | struct list_head dapm_paths; |
| 431 | enum snd_soc_bias_level bias_level; | 283 | enum snd_soc_bias_level bias_level; |
| @@ -435,6 +287,11 @@ struct snd_soc_codec { | |||
| 435 | /* codec DAI's */ | 287 | /* codec DAI's */ |
| 436 | struct snd_soc_dai *dai; | 288 | struct snd_soc_dai *dai; |
| 437 | unsigned int num_dai; | 289 | unsigned int num_dai; |
| 290 | |||
| 291 | #ifdef CONFIG_DEBUG_FS | ||
| 292 | struct dentry *debugfs_reg; | ||
| 293 | struct dentry *debugfs_pop_time; | ||
| 294 | #endif | ||
| 438 | }; | 295 | }; |
| 439 | 296 | ||
| 440 | /* codec device */ | 297 | /* codec device */ |
| @@ -448,13 +305,12 @@ struct snd_soc_codec_device { | |||
| 448 | /* SoC platform interface */ | 305 | /* SoC platform interface */ |
| 449 | struct snd_soc_platform { | 306 | struct snd_soc_platform { |
| 450 | char *name; | 307 | char *name; |
| 308 | struct list_head list; | ||
| 451 | 309 | ||
| 452 | int (*probe)(struct platform_device *pdev); | 310 | int (*probe)(struct platform_device *pdev); |
| 453 | int (*remove)(struct platform_device *pdev); | 311 | int (*remove)(struct platform_device *pdev); |
| 454 | int (*suspend)(struct platform_device *pdev, | 312 | int (*suspend)(struct snd_soc_dai *dai); |
| 455 | struct snd_soc_dai *dai); | 313 | int (*resume)(struct snd_soc_dai *dai); |
| 456 | int (*resume)(struct platform_device *pdev, | ||
| 457 | struct snd_soc_dai *dai); | ||
| 458 | 314 | ||
| 459 | /* pcm creation and destruction */ | 315 | /* pcm creation and destruction */ |
| 460 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, | 316 | int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, |
| @@ -484,9 +340,14 @@ struct snd_soc_dai_link { | |||
| 484 | struct snd_pcm *pcm; | 340 | struct snd_pcm *pcm; |
| 485 | }; | 341 | }; |
| 486 | 342 | ||
| 487 | /* SoC machine */ | 343 | /* SoC card */ |
| 488 | struct snd_soc_machine { | 344 | struct snd_soc_card { |
| 489 | char *name; | 345 | char *name; |
| 346 | struct device *dev; | ||
| 347 | |||
| 348 | struct list_head list; | ||
| 349 | |||
| 350 | int instantiated; | ||
| 490 | 351 | ||
| 491 | int (*probe)(struct platform_device *pdev); | 352 | int (*probe)(struct platform_device *pdev); |
| 492 | int (*remove)(struct platform_device *pdev); | 353 | int (*remove)(struct platform_device *pdev); |
| @@ -499,23 +360,26 @@ struct snd_soc_machine { | |||
| 499 | int (*resume_post)(struct platform_device *pdev); | 360 | int (*resume_post)(struct platform_device *pdev); |
| 500 | 361 | ||
| 501 | /* callbacks */ | 362 | /* callbacks */ |
| 502 | int (*set_bias_level)(struct snd_soc_machine *, | 363 | int (*set_bias_level)(struct snd_soc_card *, |
| 503 | enum snd_soc_bias_level level); | 364 | enum snd_soc_bias_level level); |
| 504 | 365 | ||
| 505 | /* CPU <--> Codec DAI links */ | 366 | /* CPU <--> Codec DAI links */ |
| 506 | struct snd_soc_dai_link *dai_link; | 367 | struct snd_soc_dai_link *dai_link; |
| 507 | int num_links; | 368 | int num_links; |
| 369 | |||
| 370 | struct snd_soc_device *socdev; | ||
| 371 | |||
| 372 | struct snd_soc_platform *platform; | ||
| 373 | struct delayed_work delayed_work; | ||
| 374 | struct work_struct deferred_resume_work; | ||
| 508 | }; | 375 | }; |
| 509 | 376 | ||
| 510 | /* SoC Device - the audio subsystem */ | 377 | /* SoC Device - the audio subsystem */ |
| 511 | struct snd_soc_device { | 378 | struct snd_soc_device { |
| 512 | struct device *dev; | 379 | struct device *dev; |
| 513 | struct snd_soc_machine *machine; | 380 | struct snd_soc_card *card; |
| 514 | struct snd_soc_platform *platform; | ||
| 515 | struct snd_soc_codec *codec; | 381 | struct snd_soc_codec *codec; |
| 516 | struct snd_soc_codec_device *codec_dev; | 382 | struct snd_soc_codec_device *codec_dev; |
| 517 | struct delayed_work delayed_work; | ||
| 518 | struct work_struct deferred_resume_work; | ||
| 519 | void *codec_data; | 383 | void *codec_data; |
| 520 | }; | 384 | }; |
| 521 | 385 | ||
| @@ -542,4 +406,6 @@ struct soc_enum { | |||
| 542 | void *dapm; | 406 | void *dapm; |
| 543 | }; | 407 | }; |
| 544 | 408 | ||
| 409 | #include <sound/soc-dai.h> | ||
| 410 | |||
| 545 | #endif | 411 | #endif |
diff --git a/include/sound/uda134x.h b/include/sound/uda134x.h new file mode 100644 index 000000000000..475ef8bb7dcd --- /dev/null +++ b/include/sound/uda134x.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* | ||
| 2 | * uda134x.h -- UDA134x ALSA SoC Codec driver | ||
| 3 | * | ||
| 4 | * Copyright 2007 Dension Audio Systems Ltd. | ||
| 5 | * Author: Zoltan Devai | ||
| 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 _UDA134X_H | ||
| 13 | #define _UDA134X_H | ||
| 14 | |||
| 15 | #include <sound/l3.h> | ||
| 16 | |||
| 17 | struct uda134x_platform_data { | ||
| 18 | struct l3_pins l3; | ||
| 19 | void (*power) (int); | ||
| 20 | int model; | ||
| 21 | #define UDA134X_UDA1340 1 | ||
| 22 | #define UDA134X_UDA1341 2 | ||
| 23 | #define UDA134X_UDA1344 3 | ||
| 24 | }; | ||
| 25 | |||
| 26 | #endif /* _UDA134X_H */ | ||
