Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge commit 'a5479e389e989acfeca9c32eeb0083d086202280' into for-2.6.32

+33 -15
+3 -2
include/sound/soc-dai.h
··· 112 112 int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); 113 113 114 114 int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, 115 - unsigned int mask, int slots); 115 + unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); 116 116 117 117 int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); 118 118 ··· 146 146 */ 147 147 int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); 148 148 int (*set_tdm_slot)(struct snd_soc_dai *dai, 149 - unsigned int mask, int slots); 149 + unsigned int tx_mask, unsigned int rx_mask, 150 + int slots, int slot_width); 150 151 int (*set_tristate)(struct snd_soc_dai *dai, int tristate); 151 152 152 153 /*
+3 -2
sound/soc/codecs/wm9081.c
··· 1149 1149 return 0; 1150 1150 } 1151 1151 1152 + /* FIXME: Needs to handle slot_width */ 1152 1153 static int wm9081_set_tdm_slot(struct snd_soc_dai *dai, 1153 - unsigned int mask, int slots) 1154 + unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) 1154 1155 { 1155 1156 struct snd_soc_codec *codec = dai->codec; 1156 1157 unsigned int aif1 = snd_soc_read(codec, WM9081_AUDIO_INTERFACE_1); ··· 1163 1162 1164 1163 aif1 |= (slots - 1) << WM9081_AIFDAC_TDM_MODE_SHIFT; 1165 1164 1166 - switch (mask) { 1165 + switch (rx_mask) { 1167 1166 case 1: 1168 1167 break; 1169 1168 case 2:
+1 -1
sound/soc/pxa/magician.c
··· 190 190 if (ret < 0) 191 191 return ret; 192 192 193 - ret = snd_soc_dai_set_tdm_slot(cpu_dai, 1, 1); 193 + ret = snd_soc_dai_set_tdm_slot(cpu_dai, 1, 0, 1, width); 194 194 if (ret < 0) 195 195 return ret; 196 196
+20 -7
sound/soc/pxa/pxa-ssp.c
··· 375 375 * Set the active slots in TDM/Network mode 376 376 */ 377 377 static int pxa_ssp_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, 378 - unsigned int mask, int slots) 378 + unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) 379 379 { 380 380 struct ssp_priv *priv = cpu_dai->private_data; 381 381 struct ssp_device *ssp = priv->dev.ssp; 382 382 u32 sscr0; 383 383 384 - sscr0 = ssp_read_reg(ssp, SSCR0) & ~SSCR0_SlotsPerFrm(7); 384 + sscr0 = ssp_read_reg(ssp, SSCR0); 385 + sscr0 &= ~(SSCR0_MOD | SSCR0_SlotsPerFrm(8) | SSCR0_EDSS | SSCR0_DSS); 385 386 386 - /* set number of active slots */ 387 - sscr0 |= SSCR0_SlotsPerFrm(slots); 387 + /* set slot width */ 388 + if (slot_width > 16) 389 + sscr0 |= SSCR0_EDSS | SSCR0_DataSize(slot_width - 16); 390 + else 391 + sscr0 |= SSCR0_DataSize(slot_width); 392 + 393 + if (slots > 1) { 394 + /* enable network mode */ 395 + sscr0 |= SSCR0_MOD; 396 + 397 + /* set number of active slots */ 398 + sscr0 |= SSCR0_SlotsPerFrm(slots); 399 + 400 + /* set active slot mask */ 401 + ssp_write_reg(ssp, SSTSA, tx_mask); 402 + ssp_write_reg(ssp, SSRSA, rx_mask); 403 + } 388 404 ssp_write_reg(ssp, SSCR0, sscr0); 389 405 390 - /* set active slot mask */ 391 - ssp_write_reg(ssp, SSTSA, mask); 392 - ssp_write_reg(ssp, SSRSA, mask); 393 406 return 0; 394 407 } 395 408
+6 -3
sound/soc/soc-core.c
··· 2223 2223 /** 2224 2224 * snd_soc_dai_set_tdm_slot - configure DAI TDM. 2225 2225 * @dai: DAI 2226 - * @mask: DAI specific mask representing used slots. 2226 + * @tx_mask: bitmask representing active TX slots. 2227 + * @rx_mask: bitmask representing active RX slots. 2227 2228 * @slots: Number of slots in use. 2229 + * @slot_width: Width in bits for each slot. 2228 2230 * 2229 2231 * Configures a DAI for TDM operation. Both mask and slots are codec and DAI 2230 2232 * specific. 2231 2233 */ 2232 2234 int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, 2233 - unsigned int mask, int slots) 2235 + unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) 2234 2236 { 2235 2237 if (dai->ops && dai->ops->set_tdm_slot) 2236 - return dai->ops->set_tdm_slot(dai, mask, slots); 2238 + return dai->ops->set_tdm_slot(dai, tx_mask, rx_mask, 2239 + slots, slot_width); 2237 2240 else 2238 2241 return -EINVAL; 2239 2242 }