提交 b7c15e4a 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Fix initialization for HP 2011 notebooks
  ALSA: hda - Add support for VMware controller
  ALSA: hda - consitify string arrays
  ALSA: hda - Add add multi-streaming playback for AD1988
  ASoC: EP93xx: fixed LRCLK rate and DMA oper. in I2S code
  ASoC: WM8990: msleep() takes milliseconds not jiffies
  ALSA : au88x0 - Limit number of channels to fix Oops via OSS emu
  ALSA: constify functions in ac97
  ASoC: WL1273 FM radio: Fix breakage with MFD API changes
  ALSA: hda - More coverage for odd-number channels elimination for HDMI
  ALSA: hda - Store PCM parameters properly in HDMI open callback
  ALSA: hda - Rearrange fixup struct in patch_realtek.c
  ALSA: oxygen: Xonar DG: fix CS4245 register writes
  ALSA: hda - Suppress the odd number of channels for HDMI
  ALSA: hda - Add fixup-call in init callback
  ALSA: hda - Reorganize fixup structure for Realtek
  ALSA: hda - Apply Sony VAIO hweq fixup only once
  ALSA: hda - Apply mario fixup only once
  ALSA: hda - Remove unused fixup entry for ALC262
...@@ -477,7 +477,7 @@ struct snd_ac97_template { ...@@ -477,7 +477,7 @@ struct snd_ac97_template {
struct snd_ac97 { struct snd_ac97 {
/* -- lowlevel (hardware) driver specific -- */ /* -- lowlevel (hardware) driver specific -- */
struct snd_ac97_build_ops * build_ops; const struct snd_ac97_build_ops *build_ops;
void *private_data; void *private_data;
void (*private_free) (struct snd_ac97 *ac97); void (*private_free) (struct snd_ac97 *ac97);
/* --- */ /* --- */
......
...@@ -1961,7 +1961,7 @@ static int snd_ac97_dev_disconnect(struct snd_device *device) ...@@ -1961,7 +1961,7 @@ static int snd_ac97_dev_disconnect(struct snd_device *device)
} }
/* build_ops to do nothing */ /* build_ops to do nothing */
static struct snd_ac97_build_ops null_build_ops; static const struct snd_ac97_build_ops null_build_ops;
#ifdef CONFIG_SND_AC97_POWER_SAVE #ifdef CONFIG_SND_AC97_POWER_SAVE
static void do_update_power(struct work_struct *work) static void do_update_power(struct work_struct *work)
......
...@@ -371,7 +371,7 @@ static int patch_yamaha_ymf743_build_spdif(struct snd_ac97 *ac97) ...@@ -371,7 +371,7 @@ static int patch_yamaha_ymf743_build_spdif(struct snd_ac97 *ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_yamaha_ymf743_ops = { static const struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
.build_spdif = patch_yamaha_ymf743_build_spdif, .build_spdif = patch_yamaha_ymf743_build_spdif,
.build_3d = patch_yamaha_ymf7x3_3d, .build_3d = patch_yamaha_ymf7x3_3d,
}; };
...@@ -455,7 +455,7 @@ static int patch_yamaha_ymf753_post_spdif(struct snd_ac97 * ac97) ...@@ -455,7 +455,7 @@ static int patch_yamaha_ymf753_post_spdif(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_yamaha_ymf753_ops = { static const struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
.build_3d = patch_yamaha_ymf7x3_3d, .build_3d = patch_yamaha_ymf7x3_3d,
.build_post_spdif = patch_yamaha_ymf753_post_spdif .build_post_spdif = patch_yamaha_ymf753_post_spdif
}; };
...@@ -502,7 +502,7 @@ static int patch_wolfson_wm9703_specific(struct snd_ac97 * ac97) ...@@ -502,7 +502,7 @@ static int patch_wolfson_wm9703_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_wolfson_wm9703_ops = { static const struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
.build_specific = patch_wolfson_wm9703_specific, .build_specific = patch_wolfson_wm9703_specific,
}; };
...@@ -533,7 +533,7 @@ static int patch_wolfson_wm9704_specific(struct snd_ac97 * ac97) ...@@ -533,7 +533,7 @@ static int patch_wolfson_wm9704_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_wolfson_wm9704_ops = { static const struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
.build_specific = patch_wolfson_wm9704_specific, .build_specific = patch_wolfson_wm9704_specific,
}; };
...@@ -677,7 +677,7 @@ static int patch_wolfson_wm9711_specific(struct snd_ac97 * ac97) ...@@ -677,7 +677,7 @@ static int patch_wolfson_wm9711_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_wolfson_wm9711_ops = { static const struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
.build_specific = patch_wolfson_wm9711_specific, .build_specific = patch_wolfson_wm9711_specific,
}; };
...@@ -871,7 +871,7 @@ static void patch_wolfson_wm9713_resume (struct snd_ac97 * ac97) ...@@ -871,7 +871,7 @@ static void patch_wolfson_wm9713_resume (struct snd_ac97 * ac97)
} }
#endif #endif
static struct snd_ac97_build_ops patch_wolfson_wm9713_ops = { static const struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
.build_specific = patch_wolfson_wm9713_specific, .build_specific = patch_wolfson_wm9713_specific,
.build_3d = patch_wolfson_wm9713_3d, .build_3d = patch_wolfson_wm9713_3d,
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -976,7 +976,7 @@ static int patch_sigmatel_stac97xx_specific(struct snd_ac97 * ac97) ...@@ -976,7 +976,7 @@ static int patch_sigmatel_stac97xx_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = { static const struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
.build_3d = patch_sigmatel_stac9700_3d, .build_3d = patch_sigmatel_stac9700_3d,
.build_specific = patch_sigmatel_stac97xx_specific .build_specific = patch_sigmatel_stac97xx_specific
}; };
...@@ -1023,7 +1023,7 @@ static int patch_sigmatel_stac9708_specific(struct snd_ac97 *ac97) ...@@ -1023,7 +1023,7 @@ static int patch_sigmatel_stac9708_specific(struct snd_ac97 *ac97)
return patch_sigmatel_stac97xx_specific(ac97); return patch_sigmatel_stac97xx_specific(ac97);
} }
static struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = { static const struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
.build_3d = patch_sigmatel_stac9708_3d, .build_3d = patch_sigmatel_stac9708_3d,
.build_specific = patch_sigmatel_stac9708_specific .build_specific = patch_sigmatel_stac9708_specific
}; };
...@@ -1252,7 +1252,7 @@ static int patch_sigmatel_stac9758_specific(struct snd_ac97 *ac97) ...@@ -1252,7 +1252,7 @@ static int patch_sigmatel_stac9758_specific(struct snd_ac97 *ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = { static const struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
.build_3d = patch_sigmatel_stac9700_3d, .build_3d = patch_sigmatel_stac9700_3d,
.build_specific = patch_sigmatel_stac9758_specific .build_specific = patch_sigmatel_stac9758_specific
}; };
...@@ -1327,7 +1327,7 @@ static int patch_cirrus_build_spdif(struct snd_ac97 * ac97) ...@@ -1327,7 +1327,7 @@ static int patch_cirrus_build_spdif(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_cirrus_ops = { static const struct snd_ac97_build_ops patch_cirrus_ops = {
.build_spdif = patch_cirrus_build_spdif .build_spdif = patch_cirrus_build_spdif
}; };
...@@ -1384,7 +1384,7 @@ static int patch_conexant_build_spdif(struct snd_ac97 * ac97) ...@@ -1384,7 +1384,7 @@ static int patch_conexant_build_spdif(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_conexant_ops = { static const struct snd_ac97_build_ops patch_conexant_ops = {
.build_spdif = patch_conexant_build_spdif .build_spdif = patch_conexant_build_spdif
}; };
...@@ -1560,7 +1560,7 @@ static void patch_ad1881_chained(struct snd_ac97 * ac97, int unchained_idx, int ...@@ -1560,7 +1560,7 @@ static void patch_ad1881_chained(struct snd_ac97 * ac97, int unchained_idx, int
} }
} }
static struct snd_ac97_build_ops patch_ad1881_build_ops = { static const struct snd_ac97_build_ops patch_ad1881_build_ops = {
#ifdef CONFIG_PM #ifdef CONFIG_PM
.resume = ad18xx_resume .resume = ad18xx_resume
#endif #endif
...@@ -1647,7 +1647,7 @@ static int patch_ad1885_specific(struct snd_ac97 * ac97) ...@@ -1647,7 +1647,7 @@ static int patch_ad1885_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_ad1885_build_ops = { static const struct snd_ac97_build_ops patch_ad1885_build_ops = {
.build_specific = &patch_ad1885_specific, .build_specific = &patch_ad1885_specific,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.resume = ad18xx_resume .resume = ad18xx_resume
...@@ -1674,7 +1674,7 @@ static int patch_ad1886_specific(struct snd_ac97 * ac97) ...@@ -1674,7 +1674,7 @@ static int patch_ad1886_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_ad1886_build_ops = { static const struct snd_ac97_build_ops patch_ad1886_build_ops = {
.build_specific = &patch_ad1886_specific, .build_specific = &patch_ad1886_specific,
#ifdef CONFIG_PM #ifdef CONFIG_PM
.resume = ad18xx_resume .resume = ad18xx_resume
...@@ -1881,7 +1881,7 @@ static int patch_ad1981a_specific(struct snd_ac97 * ac97) ...@@ -1881,7 +1881,7 @@ static int patch_ad1981a_specific(struct snd_ac97 * ac97)
ARRAY_SIZE(snd_ac97_ad1981x_jack_sense)); ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
} }
static struct snd_ac97_build_ops patch_ad1981a_build_ops = { static const struct snd_ac97_build_ops patch_ad1981a_build_ops = {
.build_post_spdif = patch_ad198x_post_spdif, .build_post_spdif = patch_ad198x_post_spdif,
.build_specific = patch_ad1981a_specific, .build_specific = patch_ad1981a_specific,
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -1936,7 +1936,7 @@ static int patch_ad1981b_specific(struct snd_ac97 *ac97) ...@@ -1936,7 +1936,7 @@ static int patch_ad1981b_specific(struct snd_ac97 *ac97)
ARRAY_SIZE(snd_ac97_ad1981x_jack_sense)); ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
} }
static struct snd_ac97_build_ops patch_ad1981b_build_ops = { static const struct snd_ac97_build_ops patch_ad1981b_build_ops = {
.build_post_spdif = patch_ad198x_post_spdif, .build_post_spdif = patch_ad198x_post_spdif,
.build_specific = patch_ad1981b_specific, .build_specific = patch_ad1981b_specific,
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -2075,7 +2075,7 @@ static int patch_ad1888_specific(struct snd_ac97 *ac97) ...@@ -2075,7 +2075,7 @@ static int patch_ad1888_specific(struct snd_ac97 *ac97)
return patch_build_controls(ac97, snd_ac97_ad1888_controls, ARRAY_SIZE(snd_ac97_ad1888_controls)); return patch_build_controls(ac97, snd_ac97_ad1888_controls, ARRAY_SIZE(snd_ac97_ad1888_controls));
} }
static struct snd_ac97_build_ops patch_ad1888_build_ops = { static const struct snd_ac97_build_ops patch_ad1888_build_ops = {
.build_post_spdif = patch_ad198x_post_spdif, .build_post_spdif = patch_ad198x_post_spdif,
.build_specific = patch_ad1888_specific, .build_specific = patch_ad1888_specific,
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -2124,7 +2124,7 @@ static int patch_ad1980_specific(struct snd_ac97 *ac97) ...@@ -2124,7 +2124,7 @@ static int patch_ad1980_specific(struct snd_ac97 *ac97)
return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1); return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1);
} }
static struct snd_ac97_build_ops patch_ad1980_build_ops = { static const struct snd_ac97_build_ops patch_ad1980_build_ops = {
.build_post_spdif = patch_ad198x_post_spdif, .build_post_spdif = patch_ad198x_post_spdif,
.build_specific = patch_ad1980_specific, .build_specific = patch_ad1980_specific,
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -2239,7 +2239,7 @@ static int patch_ad1985_specific(struct snd_ac97 *ac97) ...@@ -2239,7 +2239,7 @@ static int patch_ad1985_specific(struct snd_ac97 *ac97)
ARRAY_SIZE(snd_ac97_ad1985_controls)); ARRAY_SIZE(snd_ac97_ad1985_controls));
} }
static struct snd_ac97_build_ops patch_ad1985_build_ops = { static const struct snd_ac97_build_ops patch_ad1985_build_ops = {
.build_post_spdif = patch_ad198x_post_spdif, .build_post_spdif = patch_ad198x_post_spdif,
.build_specific = patch_ad1985_specific, .build_specific = patch_ad1985_specific,
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -2531,7 +2531,7 @@ static int patch_ad1986_specific(struct snd_ac97 *ac97) ...@@ -2531,7 +2531,7 @@ static int patch_ad1986_specific(struct snd_ac97 *ac97)
ARRAY_SIZE(snd_ac97_ad1985_controls)); ARRAY_SIZE(snd_ac97_ad1985_controls));
} }
static struct snd_ac97_build_ops patch_ad1986_build_ops = { static const struct snd_ac97_build_ops patch_ad1986_build_ops = {
.build_post_spdif = patch_ad198x_post_spdif, .build_post_spdif = patch_ad198x_post_spdif,
.build_specific = patch_ad1986_specific, .build_specific = patch_ad1986_specific,
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -2636,7 +2636,7 @@ static int patch_alc650_specific(struct snd_ac97 * ac97) ...@@ -2636,7 +2636,7 @@ static int patch_alc650_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_alc650_ops = { static const struct snd_ac97_build_ops patch_alc650_ops = {
.build_specific = patch_alc650_specific, .build_specific = patch_alc650_specific,
.update_jacks = alc650_update_jacks .update_jacks = alc650_update_jacks
}; };
...@@ -2788,7 +2788,7 @@ static int patch_alc655_specific(struct snd_ac97 * ac97) ...@@ -2788,7 +2788,7 @@ static int patch_alc655_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_alc655_ops = { static const struct snd_ac97_build_ops patch_alc655_ops = {
.build_specific = patch_alc655_specific, .build_specific = patch_alc655_specific,
.update_jacks = alc655_update_jacks .update_jacks = alc655_update_jacks
}; };
...@@ -2900,7 +2900,7 @@ static int patch_alc850_specific(struct snd_ac97 *ac97) ...@@ -2900,7 +2900,7 @@ static int patch_alc850_specific(struct snd_ac97 *ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_alc850_ops = { static const struct snd_ac97_build_ops patch_alc850_ops = {
.build_specific = patch_alc850_specific, .build_specific = patch_alc850_specific,
.update_jacks = alc850_update_jacks .update_jacks = alc850_update_jacks
}; };
...@@ -2962,7 +2962,7 @@ static int patch_cm9738_specific(struct snd_ac97 * ac97) ...@@ -2962,7 +2962,7 @@ static int patch_cm9738_specific(struct snd_ac97 * ac97)
return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls)); return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls));
} }
static struct snd_ac97_build_ops patch_cm9738_ops = { static const struct snd_ac97_build_ops patch_cm9738_ops = {
.build_specific = patch_cm9738_specific, .build_specific = patch_cm9738_specific,
.update_jacks = cm9738_update_jacks .update_jacks = cm9738_update_jacks
}; };
...@@ -3053,7 +3053,7 @@ static int patch_cm9739_post_spdif(struct snd_ac97 * ac97) ...@@ -3053,7 +3053,7 @@ static int patch_cm9739_post_spdif(struct snd_ac97 * ac97)
return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif)); return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif));
} }
static struct snd_ac97_build_ops patch_cm9739_ops = { static const struct snd_ac97_build_ops patch_cm9739_ops = {
.build_specific = patch_cm9739_specific, .build_specific = patch_cm9739_specific,
.build_post_spdif = patch_cm9739_post_spdif, .build_post_spdif = patch_cm9739_post_spdif,
.update_jacks = cm9739_update_jacks .update_jacks = cm9739_update_jacks
...@@ -3227,7 +3227,7 @@ static int patch_cm9761_specific(struct snd_ac97 * ac97) ...@@ -3227,7 +3227,7 @@ static int patch_cm9761_specific(struct snd_ac97 * ac97)
return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls)); return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls));
} }
static struct snd_ac97_build_ops patch_cm9761_ops = { static const struct snd_ac97_build_ops patch_cm9761_ops = {
.build_specific = patch_cm9761_specific, .build_specific = patch_cm9761_specific,
.build_post_spdif = patch_cm9761_post_spdif, .build_post_spdif = patch_cm9761_post_spdif,
.update_jacks = cm9761_update_jacks .update_jacks = cm9761_update_jacks
...@@ -3323,7 +3323,7 @@ static int patch_cm9780_specific(struct snd_ac97 *ac97) ...@@ -3323,7 +3323,7 @@ static int patch_cm9780_specific(struct snd_ac97 *ac97)
return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls)); return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls));
} }
static struct snd_ac97_build_ops patch_cm9780_ops = { static const struct snd_ac97_build_ops patch_cm9780_ops = {
.build_specific = patch_cm9780_specific, .build_specific = patch_cm9780_specific,
.build_post_spdif = patch_cm9761_post_spdif /* identical with CM9761 */ .build_post_spdif = patch_cm9761_post_spdif /* identical with CM9761 */
}; };
...@@ -3443,7 +3443,7 @@ static int patch_vt1616_specific(struct snd_ac97 * ac97) ...@@ -3443,7 +3443,7 @@ static int patch_vt1616_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_vt1616_ops = { static const struct snd_ac97_build_ops patch_vt1616_ops = {
.build_specific = patch_vt1616_specific .build_specific = patch_vt1616_specific
}; };
...@@ -3797,7 +3797,7 @@ static int patch_it2646_specific(struct snd_ac97 * ac97) ...@@ -3797,7 +3797,7 @@ static int patch_it2646_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_it2646_ops = { static const struct snd_ac97_build_ops patch_it2646_ops = {
.build_specific = patch_it2646_specific, .build_specific = patch_it2646_specific,
.update_jacks = it2646_update_jacks .update_jacks = it2646_update_jacks
}; };
...@@ -3831,7 +3831,7 @@ static int patch_si3036_specific(struct snd_ac97 * ac97) ...@@ -3831,7 +3831,7 @@ static int patch_si3036_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_si3036_ops = { static const struct snd_ac97_build_ops patch_si3036_ops = {
.build_specific = patch_si3036_specific, .build_specific = patch_si3036_specific,
}; };
...@@ -3898,7 +3898,7 @@ static int patch_ucb1400_specific(struct snd_ac97 * ac97) ...@@ -3898,7 +3898,7 @@ static int patch_ucb1400_specific(struct snd_ac97 * ac97)
return 0; return 0;
} }
static struct snd_ac97_build_ops patch_ucb1400_ops = { static const struct snd_ac97_build_ops patch_ucb1400_ops = {
.build_specific = patch_ucb1400_specific, .build_specific = patch_ucb1400_specific,
}; };
......
...@@ -42,11 +42,7 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_adb = { ...@@ -42,11 +42,7 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_adb = {
.rate_min = 5000, .rate_min = 5000,
.rate_max = 48000, .rate_max = 48000,
.channels_min = 1, .channels_min = 1,
#ifdef CHIP_AU8830
.channels_max = 4,
#else
.channels_max = 2, .channels_max = 2,
#endif
.buffer_bytes_max = 0x10000, .buffer_bytes_max = 0x10000,
.period_bytes_min = 0x1, .period_bytes_min = 0x1,
.period_bytes_max = 0x1000, .period_bytes_max = 0x1000,
...@@ -115,6 +111,17 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_wt = { ...@@ -115,6 +111,17 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_wt = {
.periods_max = 64, .periods_max = 64,
}; };
#endif #endif
#ifdef CHIP_AU8830
static unsigned int au8830_channels[3] = {
1, 2, 4,
};
static struct snd_pcm_hw_constraint_list hw_constraints_au8830_channels = {
.count = ARRAY_SIZE(au8830_channels),
.list = au8830_channels,
.mask = 0,
};
#endif
/* open callback */ /* open callback */
static int snd_vortex_pcm_open(struct snd_pcm_substream *substream) static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
{ {
...@@ -156,6 +163,15 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream) ...@@ -156,6 +163,15 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB
|| VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S) || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S)
runtime->hw = snd_vortex_playback_hw_adb; runtime->hw = snd_vortex_playback_hw_adb;
#ifdef CHIP_AU8830
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) {
runtime->hw.channels_max = 4;
snd_pcm_hw_constraint_list(runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS,
&hw_constraints_au8830_channels);
}
#endif
substream->runtime->private_data = NULL; substream->runtime->private_data = NULL;
} }
#ifndef CHIP_AU8810 #ifndef CHIP_AU8810
......
...@@ -2134,10 +2134,10 @@ int snd_hda_codec_reset(struct hda_codec *codec) ...@@ -2134,10 +2134,10 @@ int snd_hda_codec_reset(struct hda_codec *codec)
* This function returns zero if successful or a negative error code. * This function returns zero if successful or a negative error code.
*/ */
int snd_hda_add_vmaster(struct hda_codec *codec, char *name, int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
unsigned int *tlv, const char **slaves) unsigned int *tlv, const char * const *slaves)
{ {
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
const char **s; const char * const *s;
int err; int err;
for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++) for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++)
...@@ -3689,7 +3689,7 @@ EXPORT_SYMBOL_HDA(snd_hda_build_pcms); ...@@ -3689,7 +3689,7 @@ EXPORT_SYMBOL_HDA(snd_hda_build_pcms);
* If no entries are matching, the function returns a negative value. * If no entries are matching, the function returns a negative value.
*/ */
int snd_hda_check_board_config(struct hda_codec *codec, int snd_hda_check_board_config(struct hda_codec *codec,
int num_configs, const char **models, int num_configs, const char * const *models,
const struct snd_pci_quirk *tbl) const struct snd_pci_quirk *tbl)
{ {
if (codec->modelname && models) { if (codec->modelname && models) {
...@@ -3753,7 +3753,7 @@ EXPORT_SYMBOL_HDA(snd_hda_check_board_config); ...@@ -3753,7 +3753,7 @@ EXPORT_SYMBOL_HDA(snd_hda_check_board_config);
* If no entries are matching, the function returns a negative value. * If no entries are matching, the function returns a negative value.
*/ */
int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
int num_configs, const char **models, int num_configs, const char * const *models,
const struct snd_pci_quirk *tbl) const struct snd_pci_quirk *tbl)
{ {
const struct snd_pci_quirk *q; const struct snd_pci_quirk *q;
...@@ -4690,7 +4690,7 @@ const char *hda_get_input_pin_label(struct hda_codec *codec, hda_nid_t pin, ...@@ -4690,7 +4690,7 @@ const char *hda_get_input_pin_label(struct hda_codec *codec, hda_nid_t pin,
int check_location) int check_location)
{ {
unsigned int def_conf; unsigned int def_conf;
static const char *mic_names[] = { static const char * const mic_names[] = {
"Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic", "Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic",
}; };
int attr; int attr;
......
...@@ -762,7 +762,8 @@ static int check_existing_control(struct hda_codec *codec, const char *type, con ...@@ -762,7 +762,8 @@ static int check_existing_control(struct hda_codec *codec, const char *type, con
/* /*
* build output mixer controls * build output mixer controls
*/ */
static int create_output_mixers(struct hda_codec *codec, const char **names) static int create_output_mixers(struct hda_codec *codec,
const char * const *names)
{ {
struct hda_gspec *spec = codec->spec; struct hda_gspec *spec = codec->spec;
int i, err; int i, err;
...@@ -780,8 +781,8 @@ static int create_output_mixers(struct hda_codec *codec, const char **names) ...@@ -780,8 +781,8 @@ static int create_output_mixers(struct hda_codec *codec, const char **names)
static int build_output_controls(struct hda_codec *codec) static int build_output_controls(struct hda_codec *codec)
{ {
struct hda_gspec *spec = codec->spec; struct hda_gspec *spec = codec->spec;
static const char *types_speaker[] = { "Speaker", "Headphone" }; static const char * const types_speaker[] = { "Speaker", "Headphone" };
static const char *types_line[] = { "Front", "Headphone" }; static const char * const types_line[] = { "Front", "Headphone" };
switch (spec->pcm_vol_nodes) { switch (spec->pcm_vol_nodes) {
case 1: case 1:
......
...@@ -2809,6 +2809,8 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = { ...@@ -2809,6 +2809,8 @@ static DEFINE_PCI_DEVICE_TABLE(azx_ids) = {
#endif #endif
/* Vortex86MX */ /* Vortex86MX */
{ PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC }, { PCI_DEVICE(0x17f3, 0x3010), .driver_data = AZX_DRIVER_GENERIC },
/* VMware HDAudio */
{ PCI_DEVICE(0x15ad, 0x1977), .driver_data = AZX_DRIVER_GENERIC },
/* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */ /* AMD/ATI Generic, PCI class code and Vendor ID for HD Audio */
{ PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID), { PCI_DEVICE(PCI_VENDOR_ID_ATI, PCI_ANY_ID),
.class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8, .class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
......
...@@ -140,7 +140,7 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, ...@@ -140,7 +140,7 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
const char *name); const char *name);
int snd_hda_add_vmaster(struct hda_codec *codec, char *name, int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
unsigned int *tlv, const char **slaves); unsigned int *tlv, const char * const *slaves);
int snd_hda_codec_reset(struct hda_codec *codec); int snd_hda_codec_reset(struct hda_codec *codec);
/* amp value bits */ /* amp value bits */
...@@ -341,10 +341,10 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen); ...@@ -341,10 +341,10 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen);
* Misc * Misc
*/ */
int snd_hda_check_board_config(struct hda_codec *codec, int num_configs, int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
const char **modelnames, const char * const *modelnames,
const struct snd_pci_quirk *pci_list); const struct snd_pci_quirk *pci_list);
int snd_hda_check_board_codec_sid_config(struct hda_codec *codec, int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
int num_configs, const char **models, int num_configs, const char * const *models,
const struct snd_pci_quirk *tbl); const struct snd_pci_quirk *tbl);
int snd_hda_add_new_ctls(struct hda_codec *codec, int snd_hda_add_new_ctls(struct hda_codec *codec,
struct snd_kcontrol_new *knew); struct snd_kcontrol_new *knew);
......
...@@ -418,7 +418,7 @@ static void print_digital_conv(struct snd_info_buffer *buffer, ...@@ -418,7 +418,7 @@ static void print_digital_conv(struct snd_info_buffer *buffer,
static const char *get_pwr_state(u32 state) static const char *get_pwr_state(u32 state)
{ {
static const char *buf[4] = { static const char * const buf[4] = {
"D0", "D1", "D2", "D3" "D0", "D1", "D2", "D3"
}; };
if (state < 4) if (state < 4)
......
...@@ -46,6 +46,9 @@ struct ad198x_spec { ...@@ -46,6 +46,9 @@ struct ad198x_spec {
unsigned int cur_eapd; unsigned int cur_eapd;
unsigned int need_dac_fix; unsigned int need_dac_fix;
hda_nid_t *alt_dac_nid;
struct hda_pcm_stream *stream_analog_alt_playback;
/* capture */ /* capture */
unsigned int num_adc_nids; unsigned int num_adc_nids;
hda_nid_t *adc_nids; hda_nid_t *adc_nids;
...@@ -81,8 +84,8 @@ struct ad198x_spec { ...@@ -81,8 +84,8 @@ struct ad198x_spec {
#endif #endif
/* for virtual master */ /* for virtual master */
hda_nid_t vmaster_nid; hda_nid_t vmaster_nid;
const char **slave_vols; const char * const *slave_vols;
const char **slave_sws; const char * const *slave_sws;
}; };
/* /*
...@@ -130,7 +133,7 @@ static int ad198x_init(struct hda_codec *codec) ...@@ -130,7 +133,7 @@ static int ad198x_init(struct hda_codec *codec)
return 0; return 0;
} }
static const char *ad_slave_vols[] = { static const char * const ad_slave_vols[] = {
"Front Playback Volume", "Front Playback Volume",
"Surround Playback Volume", "Surround Playback Volume",
"Center Playback Volume", "Center Playback Volume",
...@@ -143,7 +146,7 @@ static const char *ad_slave_vols[] = { ...@@ -143,7 +146,7 @@ static const char *ad_slave_vols[] = {
NULL NULL
}; };
static const char *ad_slave_sws[] = { static const char * const ad_slave_sws[] = {
"Front Playback Switch", "Front Playback Switch",
"Surround Playback Switch", "Surround Playback Switch",
"Center Playback Switch", "Center Playback Switch",
...@@ -156,6 +159,25 @@ static const char *ad_slave_sws[] = { ...@@ -156,6 +159,25 @@ static const char *ad_slave_sws[] = {
NULL NULL
}; };
static const char * const ad1988_6stack_fp_slave_vols[] = {
"Front Playback Volume",
"Surround Playback Volume",
"Center Playback Volume",
"LFE Playback Volume",
"Side Playback Volume",
"IEC958 Playback Volume",
NULL
};
static const char * const ad1988_6stack_fp_slave_sws[] = {
"Front Playback Switch",
"Surround Playback Switch",
"Center Playback Switch",
"LFE Playback Switch",
"Side Playback Switch",
"IEC958 Playback Switch",
NULL
};
static void ad198x_free_kctls(struct hda_codec *codec); static void ad198x_free_kctls(struct hda_codec *codec);
#ifdef CONFIG_SND_HDA_INPUT_BEEP #ifdef CONFIG_SND_HDA_INPUT_BEEP
...@@ -309,6 +331,38 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo, ...@@ -309,6 +331,38 @@ static int ad198x_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout); return snd_hda_multi_out_analog_cleanup(codec, &spec->multiout);
} }
static int ad198x_alt_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
unsigned int stream_tag,
unsigned int format,
struct snd_pcm_substream *substream)
{
struct ad198x_spec *spec = codec->spec;
snd_hda_codec_setup_stream(codec, spec->alt_dac_nid[0], stream_tag,
0, format);
return 0;
}
static int ad198x_alt_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream)
{
struct ad198x_spec *spec = codec->spec;
snd_hda_codec_cleanup_stream(codec, spec->alt_dac_nid[0]);
return 0;
}
static struct hda_pcm_stream ad198x_pcm_analog_alt_playback = {
.substreams = 1,
.channels_min = 2,
.channels_max = 2,
/* NID is set in ad198x_build_pcms */
.ops = {
.prepare = ad198x_alt_playback_pcm_prepare,
.cleanup = ad198x_alt_playback_pcm_cleanup
},
};
/* /*
* Digital out * Digital out
*/ */
...@@ -446,6 +500,17 @@ static int ad198x_build_pcms(struct hda_codec *codec) ...@@ -446,6 +500,17 @@ static int ad198x_build_pcms(struct hda_codec *codec)
} }
} }
if (spec->alt_dac_nid && spec->stream_analog_alt_playback) {
codec->num_pcms++;
info = spec->pcm_rec + 2;
info->name = "AD198x Headphone";
info->pcm_type = HDA_PCM_TYPE_AUDIO;
info->stream[SNDRV_PCM_STREAM_PLAYBACK] =
*spec->stream_analog_alt_playback;
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid =
spec->alt_dac_nid[0];
}
return 0; return 0;
} }
...@@ -1069,7 +1134,7 @@ enum { ...@@ -1069,7 +1134,7 @@ enum {
AD1986A_MODELS AD1986A_MODELS
}; };
static const char *ad1986a_models[AD1986A_MODELS] = { static const char * const ad1986a_models[AD1986A_MODELS] = {
[AD1986A_6STACK] = "6stack", [AD1986A_6STACK] = "6stack",
[AD1986A_3STACK] = "3stack", [AD1986A_3STACK] = "3stack",
[AD1986A_LAPTOP] = "laptop", [AD1986A_LAPTOP] = "laptop",
...@@ -1813,7 +1878,7 @@ enum { ...@@ -1813,7 +1878,7 @@ enum {
AD1981_MODELS AD1981_MODELS
}; };
static const char *ad1981_models[AD1981_MODELS] = { static const char * const ad1981_models[AD1981_MODELS] = {
[AD1981_HP] = "hp", [AD1981_HP] = "hp",
[AD1981_THINKPAD] = "thinkpad", [AD1981_THINKPAD] = "thinkpad",
[AD1981_BASIC] = "basic", [AD1981_BASIC] = "basic",
...@@ -2015,6 +2080,7 @@ static int patch_ad1981(struct hda_codec *codec) ...@@ -2015,6 +2080,7 @@ static int patch_ad1981(struct hda_codec *codec)
enum { enum {
AD1988_6STACK, AD1988_6STACK,
AD1988_6STACK_DIG, AD1988_6STACK_DIG,
AD1988_6STACK_DIG_FP,
AD1988_3STACK, AD1988_3STACK,
AD1988_3STACK_DIG, AD1988_3STACK_DIG,
AD1988_LAPTOP, AD1988_LAPTOP,
...@@ -2047,6 +2113,10 @@ static hda_nid_t ad1988_6stack_dac_nids_rev2[4] = { ...@@ -2047,6 +2113,10 @@ static hda_nid_t ad1988_6stack_dac_nids_rev2[4] = {
0x04, 0x05, 0x0a, 0x06 0x04, 0x05, 0x0a, 0x06
}; };
static hda_nid_t ad1988_alt_dac_nid[1] = {
0x03
};
static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = { static hda_nid_t ad1988_3stack_dac_nids_rev2[3] = {
0x04, 0x0a, 0x06 0x04, 0x0a, 0x06
}; };
...@@ -2166,6 +2236,35 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = { ...@@ -2166,6 +2236,35 @@ static struct snd_kcontrol_new ad1988_6stack_mixers2[] = {
{ } /* end */ { } /* end */
}; };
static struct snd_kcontrol_new ad1988_6stack_fp_mixers[] = {
HDA_CODEC_VOLUME("Headphone Playback Volume", 0x03, 0x0, HDA_OUTPUT),
HDA_BIND_MUTE("Front Playback Switch", 0x29, 2, HDA_INPUT),
HDA_BIND_MUTE("Surround Playback Switch", 0x2a, 2, HDA_INPUT),
HDA_BIND_MUTE_MONO("Center Playback Switch", 0x27, 1, 2, HDA_INPUT),
HDA_BIND_MUTE_MONO("LFE Playback Switch", 0x27, 2, 2, HDA_INPUT),
HDA_BIND_MUTE("Side Playback Switch", 0x28, 2, HDA_INPUT),
HDA_BIND_MUTE("Headphone Playback Switch", 0x22, 2, HDA_INPUT),
HDA_BIND_MUTE("Mono Playback Switch", 0x1e, 2, HDA_INPUT),
HDA_CODEC_VOLUME("CD Playback Volume", 0x20, 0x6, HDA_INPUT),
HDA_CODEC_MUTE("CD Playback Switch", 0x20, 0x6, HDA_INPUT),
HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x20, 0x0, HDA_INPUT),
HDA_CODEC_MUTE("Front Mic Playback Switch", 0x20, 0x0, HDA_INPUT),
HDA_CODEC_VOLUME("Line Playback Volume", 0x20, 0x1, HDA_INPUT),
HDA_CODEC_MUTE("Line Playback Switch", 0x20, 0x1, HDA_INPUT),
HDA_CODEC_VOLUME("Mic Playback Volume", 0x20, 0x4, HDA_INPUT),
HDA_CODEC_MUTE("Mic Playback Switch", 0x20, 0x4, HDA_INPUT),
HDA_CODEC_VOLUME("Analog Mix Playback Volume", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Analog Mix Playback Switch", 0x21, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Front Mic Boost Volume", 0x39, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Mic Boost Volume", 0x3c, 0x0, HDA_OUTPUT),
{ } /* end */
};
/* 3-stack mode */ /* 3-stack mode */
static struct snd_kcontrol_new ad1988_3stack_mixers1[] = { static struct snd_kcontrol_new ad1988_3stack_mixers1[] = {
HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT), HDA_CODEC_VOLUME("Front Playback Volume", 0x04, 0x0, HDA_OUTPUT),
...@@ -2445,6 +2544,68 @@ static struct hda_verb ad1988_6stack_init_verbs[] = { ...@@ -2445,6 +2544,68 @@ static struct hda_verb ad1988_6stack_init_verbs[] = {
{ } { }
}; };
static struct hda_verb ad1988_6stack_fp_init_verbs[] = {
/* Front, Surround, CLFE, side DAC; unmute as default */
{0x04, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x06, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x05, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x0a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Headphone; unmute as default */
{0x03, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Port-A front headphon path */
{0x37, AC_VERB_SET_CONNECT_SEL, 0x00}, /* DAC0:03h */
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
{0x22, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
{0x11, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x11, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
/* Port-D line-out path */
{0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
{0x29, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
{0x12, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x12, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
/* Port-F surround path */
{0x2a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
{0x2a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
{0x16, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
/* Port-G CLFE path */
{0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
{0x27, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
{0x24, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x24, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
/* Port-H side path */
{0x28, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
{0x28, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
{0x25, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
{0x25, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
/* Mono out path */
{0x36, AC_VERB_SET_CONNECT_SEL, 0x1}, /* DAC1:04h */
{0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
{0x1e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
{0x13, AC_VERB_SET_AMP_GAIN_MUTE, 0xb01f}, /* unmute, 0dB */
/* Port-B front mic-in path */
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
{0x39, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
/* Port-C line-in path */
{0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
{0x3a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x33, AC_VERB_SET_CONNECT_SEL, 0x0},
/* Port-E mic-in path */
{0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
{0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
{0x3c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x34, AC_VERB_SET_CONNECT_SEL, 0x0},
/* Analog CD Input */
{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
/* Analog Mix output amp */
{0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE | 0x1f}, /* 0dB */
{ }
};
static struct hda_verb ad1988_capture_init_verbs[] = { static struct hda_verb ad1988_capture_init_verbs[] = {
/* mute analog mix */ /* mute analog mix */
{0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)}, {0x20, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
...@@ -2792,7 +2953,9 @@ static int ad1988_auto_create_multi_out_ctls(struct ad198x_spec *spec, ...@@ -2792,7 +2953,9 @@ static int ad1988_auto_create_multi_out_ctls(struct ad198x_spec *spec,
const struct auto_pin_cfg *cfg) const struct auto_pin_cfg *cfg)
{ {
char name[32]; char name[32];
static const char *chname[4] = { "Front", "Surround", NULL /*CLFE*/, "Side" }; static const char * const chname[4] = {
"Front", "Surround", NULL /*CLFE*/, "Side"
};
hda_nid_t nid; hda_nid_t nid;
int i, err; int i, err;
...@@ -3074,13 +3237,13 @@ static int ad1988_auto_init(struct hda_codec *codec) ...@@ -3074,13 +3237,13 @@ static int ad1988_auto_init(struct hda_codec *codec)
return 0; return 0;
} }
/* /*
*/ */
static const char *ad1988_models[AD1988_MODEL_LAST] = { static const char * const ad1988_models[AD1988_MODEL_LAST] = {
[AD1988_6STACK] = "6stack", [AD1988_6STACK] = "6stack",
[AD1988_6STACK_DIG] = "6stack-dig", [AD1988_6STACK_DIG] = "6stack-dig",
[AD1988_6STACK_DIG_FP] = "6stack-dig-fp",
[AD1988_3STACK] = "3stack", [AD1988_3STACK] = "3stack",
[AD1988_3STACK_DIG] = "3stack-dig", [AD1988_3STACK_DIG] = "3stack-dig",
[AD1988_LAPTOP] = "laptop", [AD1988_LAPTOP] = "laptop",
...@@ -3140,6 +3303,7 @@ static int patch_ad1988(struct hda_codec *codec) ...@@ -3140,6 +3303,7 @@ static int patch_ad1988(struct hda_codec *codec)
switch (board_config) { switch (board_config) {
case AD1988_6STACK: case AD1988_6STACK:
case AD1988_6STACK_DIG: case AD1988_6STACK_DIG:
case AD1988_6STACK_DIG_FP:
spec->multiout.max_channels = 8; spec->multiout.max_channels = 8;
spec->multiout.num_dacs = 4; spec->multiout.num_dacs = 4;
if (is_rev2(codec)) if (is_rev2(codec))
...@@ -3152,10 +3316,22 @@ static int patch_ad1988(struct hda_codec *codec) ...@@ -3152,10 +3316,22 @@ static int patch_ad1988(struct hda_codec *codec)
spec->mixers[0] = ad1988_6stack_mixers1_rev2; spec->mixers[0] = ad1988_6stack_mixers1_rev2;
else else
spec->mixers[0] = ad1988_6stack_mixers1; spec->mixers[0] = ad1988_6stack_mixers1;
spec->mixers[1] = ad1988_6stack_mixers2; if (board_config == AD1988_6STACK_DIG_FP) {
spec->mixers[1] = ad1988_6stack_fp_mixers;
spec->slave_vols = ad1988_6stack_fp_slave_vols;
spec->slave_sws = ad1988_6stack_fp_slave_sws;
spec->alt_dac_nid = ad1988_alt_dac_nid;
spec->stream_analog_alt_playback =
&ad198x_pcm_analog_alt_playback;
} else
spec->mixers[1] = ad1988_6stack_mixers2;
spec->num_init_verbs = 1; spec->num_init_verbs = 1;
spec->init_verbs[0] = ad1988_6stack_init_verbs; if (board_config == AD1988_6STACK_DIG_FP)
if (board_config == AD1988_6STACK_DIG) { spec->init_verbs[0] = ad1988_6stack_fp_init_verbs;
else
spec->init_verbs[0] = ad1988_6stack_init_verbs;
if ((board_config == AD1988_6STACK_DIG) ||
(board_config == AD1988_6STACK_DIG_FP)) {
spec->multiout.dig_out_nid = AD1988_SPDIF_OUT; spec->multiout.dig_out_nid = AD1988_SPDIF_OUT;
spec->dig_in_nid = AD1988_SPDIF_IN; spec->dig_in_nid = AD1988_SPDIF_IN;
} }
...@@ -3399,7 +3575,7 @@ static struct hda_amp_list ad1884_loopbacks[] = { ...@@ -3399,7 +3575,7 @@ static struct hda_amp_list ad1884_loopbacks[] = {
}; };
#endif #endif
static const char *ad1884_slave_vols[] = { static const char * const ad1884_slave_vols[] = {
"PCM Playback Volume", "PCM Playback Volume",
"Mic Playback Volume", "Mic Playback Volume",
"Mono Playback Volume", "Mono Playback Volume",
...@@ -3637,7 +3813,7 @@ enum { ...@@ -3637,7 +3813,7 @@ enum {
AD1984_MODELS AD1984_MODELS
}; };
static const char *ad1984_models[AD1984_MODELS] = { static const char * const ad1984_models[AD1984_MODELS] = {
[AD1984_BASIC] = "basic", [AD1984_BASIC] = "basic",
[AD1984_THINKPAD] = "thinkpad", [AD1984_THINKPAD] = "thinkpad",
[AD1984_DELL_DESKTOP] = "dell_desktop", [AD1984_DELL_DESKTOP] = "dell_desktop",
...@@ -4308,7 +4484,7 @@ enum { ...@@ -4308,7 +4484,7 @@ enum {
AD1884A_MODELS AD1884A_MODELS
}; };
static const char *ad1884a_models[AD1884A_MODELS] = { static const char * const ad1884a_models[AD1884A_MODELS] = {
[AD1884A_DESKTOP] = "desktop", [AD1884A_DESKTOP] = "desktop",
[AD1884A_LAPTOP] = "laptop", [AD1884A_LAPTOP] = "laptop",
[AD1884A_MOBILE] = "mobile", [AD1884A_MOBILE] = "mobile",
...@@ -4696,7 +4872,7 @@ enum { ...@@ -4696,7 +4872,7 @@ enum {
AD1882_MODELS AD1882_MODELS
}; };
static const char *ad1882_models[AD1986A_MODELS] = { static const char * const ad1882_models[AD1986A_MODELS] = {
[AD1882_3STACK] = "3stack", [AD1882_3STACK] = "3stack",
[AD1882_6STACK] = "6stack", [AD1882_6STACK] = "6stack",
}; };
......
...@@ -490,7 +490,7 @@ static int parse_digital_input(struct hda_codec *codec) ...@@ -490,7 +490,7 @@ static int parse_digital_input(struct hda_codec *codec)
* create mixer controls * create mixer controls
*/ */
static const char *dir_sfx[2] = { "Playback", "Capture" }; static const char * const dir_sfx[2] = { "Playback", "Capture" };
static int add_mute(struct hda_codec *codec, const char *name, int index, static int add_mute(struct hda_codec *codec, const char *name, int index,
unsigned int pval, int dir, struct snd_kcontrol **kctlp) unsigned int pval, int dir, struct snd_kcontrol **kctlp)
...@@ -1156,7 +1156,7 @@ static int cs_parse_auto_config(struct hda_codec *codec) ...@@ -1156,7 +1156,7 @@ static int cs_parse_auto_config(struct hda_codec *codec)
return 0; return 0;
} }
static const char *cs420x_models[CS420X_MODELS] = { static const char * const cs420x_models[CS420X_MODELS] = {
[CS420X_MBP53] = "mbp53", [CS420X_MBP53] = "mbp53",
[CS420X_MBP55] = "mbp55", [CS420X_MBP55] = "mbp55",
[CS420X_IMAC27] = "imac27", [CS420X_IMAC27] = "imac27",
......
...@@ -608,7 +608,7 @@ static void cmi9880_free(struct hda_codec *codec) ...@@ -608,7 +608,7 @@ static void cmi9880_free(struct hda_codec *codec)
/* /*
*/ */
static const char *cmi9880_models[CMI_MODELS] = { static const char * const cmi9880_models[CMI_MODELS] = {
[CMI_MINIMAL] = "minimal", [CMI_MINIMAL] = "minimal",
[CMI_MIN_FP] = "min_fp", [CMI_MIN_FP] = "min_fp",
[CMI_FULL] = "full", [CMI_FULL] = "full",
......
...@@ -537,13 +537,13 @@ static struct snd_kcontrol_new cxt_beep_mixer[] = { ...@@ -537,13 +537,13 @@ static struct snd_kcontrol_new cxt_beep_mixer[] = {
}; };
#endif #endif
static const char *slave_vols[] = { static const char * const slave_vols[] = {
"Headphone Playback Volume", "Headphone Playback Volume",
"Speaker Playback Volume", "Speaker Playback Volume",
NULL NULL
}; };
static const char *slave_sws[] = { static const char * const slave_sws[] = {
"Headphone Playback Switch", "Headphone Playback Switch",
"Speaker Playback Switch", "Speaker Playback Switch",
NULL NULL
...@@ -1134,7 +1134,7 @@ enum { ...@@ -1134,7 +1134,7 @@ enum {
CXT5045_MODELS CXT5045_MODELS
}; };
static const char *cxt5045_models[CXT5045_MODELS] = { static const char * const cxt5045_models[CXT5045_MODELS] = {
[CXT5045_LAPTOP_HPSENSE] = "laptop-hpsense", [CXT5045_LAPTOP_HPSENSE] = "laptop-hpsense",
[CXT5045_LAPTOP_MICSENSE] = "laptop-micsense", [CXT5045_LAPTOP_MICSENSE] = "laptop-micsense",
[CXT5045_LAPTOP_HPMICSENSE] = "laptop-hpmicsense", [CXT5045_LAPTOP_HPMICSENSE] = "laptop-hpmicsense",
...@@ -1579,7 +1579,7 @@ enum { ...@@ -1579,7 +1579,7 @@ enum {
CXT5047_MODELS CXT5047_MODELS
}; };
static const char *cxt5047_models[CXT5047_MODELS] = { static const char * const cxt5047_models[CXT5047_MODELS] = {
[CXT5047_LAPTOP] = "laptop", [CXT5047_LAPTOP] = "laptop",
[CXT5047_LAPTOP_HP] = "laptop-hp", [CXT5047_LAPTOP_HP] = "laptop-hp",
[CXT5047_LAPTOP_EAPD] = "laptop-eapd", [CXT5047_LAPTOP_EAPD] = "laptop-eapd",
...@@ -1995,7 +1995,7 @@ enum { ...@@ -1995,7 +1995,7 @@ enum {
CXT5051_MODELS CXT5051_MODELS
}; };
static const char *cxt5051_models[CXT5051_MODELS] = { static const char *const cxt5051_models[CXT5051_MODELS] = {
[CXT5051_LAPTOP] = "laptop", [CXT5051_LAPTOP] = "laptop",
[CXT5051_HP] = "hp", [CXT5051_HP] = "hp",
[CXT5051_HP_DV6736] = "hp-dv6736", [CXT5051_HP_DV6736] = "hp-dv6736",
...@@ -3084,7 +3084,7 @@ enum { ...@@ -3084,7 +3084,7 @@ enum {
CXT5066_MODELS CXT5066_MODELS
}; };
static const char *cxt5066_models[CXT5066_MODELS] = { static const char * const cxt5066_models[CXT5066_MODELS] = {
[CXT5066_LAPTOP] = "laptop", [CXT5066_LAPTOP] = "laptop",
[CXT5066_DELL_LAPTOP] = "dell-laptop", [CXT5066_DELL_LAPTOP] = "dell-laptop",
[CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5", [CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5",
...@@ -3746,7 +3746,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec) ...@@ -3746,7 +3746,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
struct conexant_spec *spec = codec->spec; struct conexant_spec *spec = codec->spec;
int i, err; int i, err;
int num_line = 0, num_hp = 0, num_spk = 0; int num_line = 0, num_hp = 0, num_spk = 0;
static const char *texts[3] = { "Front", "Surround", "CLFE" }; static const char * const texts[3] = { "Front", "Surround", "CLFE" };
if (spec->dac_info_filled == 1) if (spec->dac_info_filled == 1)
return cx_auto_add_pb_volume(codec, spec->dac_info[0].dac, return cx_auto_add_pb_volume(codec, spec->dac_info[0].dac,
......
...@@ -817,6 +817,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, ...@@ -817,6 +817,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
struct hdmi_spec *spec = codec->spec; struct hdmi_spec *spec = codec->spec;
struct hdmi_eld *eld; struct hdmi_eld *eld;
struct hda_pcm_stream *codec_pars; struct hda_pcm_stream *codec_pars;
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned int idx; unsigned int idx;
for (idx = 0; idx < spec->num_cvts; idx++) for (idx = 0; idx < spec->num_cvts; idx++)
...@@ -844,6 +845,14 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, ...@@ -844,6 +845,14 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
hinfo->formats = codec_pars->formats; hinfo->formats = codec_pars->formats;
hinfo->maxbps = codec_pars->maxbps; hinfo->maxbps = codec_pars->maxbps;
} }
/* store the updated parameters */
runtime->hw.channels_min = hinfo->channels_min;
runtime->hw.channels_max = hinfo->channels_max;
runtime->hw.formats = hinfo->formats;
runtime->hw.rates = hinfo->rates;
snd_pcm_hw_constraint_step(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
return 0; return 0;
} }
...@@ -1238,6 +1247,9 @@ static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo, ...@@ -1238,6 +1247,9 @@ static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
snd_pcm_hw_constraint_list(substream->runtime, 0, snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, SNDRV_PCM_HW_PARAM_CHANNELS,
hw_constraints_channels); hw_constraints_channels);
} else {
snd_pcm_hw_constraint_step(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2);
} }
return snd_hda_multi_out_dig_open(codec, &spec->multiout); return snd_hda_multi_out_dig_open(codec, &spec->multiout);
......
此差异已折叠。
...@@ -266,7 +266,7 @@ struct sigmatel_spec { ...@@ -266,7 +266,7 @@ struct sigmatel_spec {
struct sigmatel_mic_route int_mic; struct sigmatel_mic_route int_mic;
struct sigmatel_mic_route dock_mic; struct sigmatel_mic_route dock_mic;
const char **spdif_labels; const char * const *spdif_labels;
hda_nid_t dig_in_nid; hda_nid_t dig_in_nid;
hda_nid_t mono_nid; hda_nid_t mono_nid;
...@@ -524,7 +524,7 @@ static unsigned long stac927x_capsws[] = { ...@@ -524,7 +524,7 @@ static unsigned long stac927x_capsws[] = {
HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT), HDA_COMPOSE_AMP_VAL(0x1d, 3, 0, HDA_OUTPUT),
}; };
static const char *stac927x_spdif_labels[5] = { static const char * const stac927x_spdif_labels[5] = {
"Digital Playback", "ADAT", "Analog Mux 1", "Digital Playback", "ADAT", "Analog Mux 1",
"Analog Mux 2", "Analog Mux 3" "Analog Mux 2", "Analog Mux 3"
}; };
...@@ -1062,7 +1062,7 @@ static struct snd_kcontrol_new stac_smux_mixer = { ...@@ -1062,7 +1062,7 @@ static struct snd_kcontrol_new stac_smux_mixer = {
.put = stac92xx_smux_enum_put, .put = stac92xx_smux_enum_put,
}; };
static const char *slave_vols[] = { static const char * const slave_vols[] = {
"Front Playback Volume", "Front Playback Volume",
"Surround Playback Volume", "Surround Playback Volume",
"Center Playback Volume", "Center Playback Volume",
...@@ -1073,7 +1073,7 @@ static const char *slave_vols[] = { ...@@ -1073,7 +1073,7 @@ static const char *slave_vols[] = {
NULL NULL
}; };
static const char *slave_sws[] = { static const char * const slave_sws[] = {
"Front Playback Switch", "Front Playback Switch",
"Surround Playback Switch", "Surround Playback Switch",
"Center Playback Switch", "Center Playback Switch",
...@@ -1354,7 +1354,7 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = { ...@@ -1354,7 +1354,7 @@ static unsigned int *stac9200_brd_tbl[STAC_9200_MODELS] = {
[STAC_9200_PANASONIC] = ref9200_pin_configs, [STAC_9200_PANASONIC] = ref9200_pin_configs,
}; };
static const char *stac9200_models[STAC_9200_MODELS] = { static const char * const stac9200_models[STAC_9200_MODELS] = {
[STAC_AUTO] = "auto", [STAC_AUTO] = "auto",
[STAC_REF] = "ref", [STAC_REF] = "ref",
[STAC_9200_OQO] = "oqo", [STAC_9200_OQO] = "oqo",
...@@ -1500,7 +1500,7 @@ static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = { ...@@ -1500,7 +1500,7 @@ static unsigned int *stac925x_brd_tbl[STAC_925x_MODELS] = {
[STAC_M6] = stac925xM6_pin_configs, [STAC_M6] = stac925xM6_pin_configs,
}; };
static const char *stac925x_models[STAC_925x_MODELS] = { static const char * const stac925x_models[STAC_925x_MODELS] = {
[STAC_925x_AUTO] = "auto", [STAC_925x_AUTO] = "auto",
[STAC_REF] = "ref", [STAC_REF] = "ref",
[STAC_M1] = "m1", [STAC_M1] = "m1",
...@@ -1574,7 +1574,7 @@ static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = { ...@@ -1574,7 +1574,7 @@ static unsigned int *stac92hd73xx_brd_tbl[STAC_92HD73XX_MODELS] = {
[STAC_92HD73XX_INTEL] = intel_dg45id_pin_configs, [STAC_92HD73XX_INTEL] = intel_dg45id_pin_configs,
}; };
static const char *stac92hd73xx_models[STAC_92HD73XX_MODELS] = { static const char * const stac92hd73xx_models[STAC_92HD73XX_MODELS] = {
[STAC_92HD73XX_AUTO] = "auto", [STAC_92HD73XX_AUTO] = "auto",
[STAC_92HD73XX_NO_JD] = "no-jd", [STAC_92HD73XX_NO_JD] = "no-jd",
[STAC_92HD73XX_REF] = "ref", [STAC_92HD73XX_REF] = "ref",
...@@ -1660,7 +1660,7 @@ static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = { ...@@ -1660,7 +1660,7 @@ static unsigned int *stac92hd83xxx_brd_tbl[STAC_92HD83XXX_MODELS] = {
[STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs, [STAC_HP_DV7_4000] = hp_dv7_4000_pin_configs,
}; };
static const char *stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = { static const char * const stac92hd83xxx_models[STAC_92HD83XXX_MODELS] = {
[STAC_92HD83XXX_AUTO] = "auto", [STAC_92HD83XXX_AUTO] = "auto",
[STAC_92HD83XXX_REF] = "ref", [STAC_92HD83XXX_REF] = "ref",
[STAC_92HD83XXX_PWR_REF] = "mic-ref", [STAC_92HD83XXX_PWR_REF] = "mic-ref",
...@@ -1722,7 +1722,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = { ...@@ -1722,7 +1722,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
[STAC_HP_DV4_1222NR] = NULL, [STAC_HP_DV4_1222NR] = NULL,
}; };
static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = { static const char * const stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
[STAC_92HD71BXX_AUTO] = "auto", [STAC_92HD71BXX_AUTO] = "auto",
[STAC_92HD71BXX_REF] = "ref", [STAC_92HD71BXX_REF] = "ref",
[STAC_DELL_M4_1] = "dell-m4-1", [STAC_DELL_M4_1] = "dell-m4-1",
...@@ -1915,7 +1915,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { ...@@ -1915,7 +1915,7 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
[STAC_922X_DELL_M82] = dell_922x_m82_pin_configs, [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs,
}; };
static const char *stac922x_models[STAC_922X_MODELS] = { static const char * const stac922x_models[STAC_922X_MODELS] = {
[STAC_922X_AUTO] = "auto", [STAC_922X_AUTO] = "auto",
[STAC_D945_REF] = "ref", [STAC_D945_REF] = "ref",
[STAC_D945GTP5] = "5stack", [STAC_D945GTP5] = "5stack",
...@@ -2077,7 +2077,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = { ...@@ -2077,7 +2077,7 @@ static unsigned int *stac927x_brd_tbl[STAC_927X_MODELS] = {
[STAC_927X_VOLKNOB] = NULL, [STAC_927X_VOLKNOB] = NULL,
}; };
static const char *stac927x_models[STAC_927X_MODELS] = { static const char * const stac927x_models[STAC_927X_MODELS] = {
[STAC_927X_AUTO] = "auto", [STAC_927X_AUTO] = "auto",
[STAC_D965_REF_NO_JD] = "ref-no-jd", [STAC_D965_REF_NO_JD] = "ref-no-jd",
[STAC_D965_REF] = "ref", [STAC_D965_REF] = "ref",
...@@ -2180,7 +2180,7 @@ static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = { ...@@ -2180,7 +2180,7 @@ static unsigned int *stac9205_brd_tbl[STAC_9205_MODELS] = {
[STAC_9205_EAPD] = NULL, [STAC_9205_EAPD] = NULL,
}; };
static const char *stac9205_models[STAC_9205_MODELS] = { static const char * const stac9205_models[STAC_9205_MODELS] = {
[STAC_9205_AUTO] = "auto", [STAC_9205_AUTO] = "auto",
[STAC_9205_REF] = "ref", [STAC_9205_REF] = "ref",
[STAC_9205_DELL_M42] = "dell-m42", [STAC_9205_DELL_M42] = "dell-m42",
...@@ -3123,7 +3123,7 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs, ...@@ -3123,7 +3123,7 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs,
int type) int type)
{ {
struct sigmatel_spec *spec = codec->spec; struct sigmatel_spec *spec = codec->spec;
static const char *chname[4] = { static const char * const chname[4] = {
"Front", "Surround", NULL /*CLFE*/, "Side" "Front", "Surround", NULL /*CLFE*/, "Side"
}; };
hda_nid_t nid; hda_nid_t nid;
...@@ -3256,7 +3256,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec, ...@@ -3256,7 +3256,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
} }
/* labels for mono mux outputs */ /* labels for mono mux outputs */
static const char *stac92xx_mono_labels[4] = { static const char * const stac92xx_mono_labels[4] = {
"DAC0", "DAC1", "Mixer", "DAC2" "DAC0", "DAC1", "Mixer", "DAC2"
}; };
...@@ -3380,7 +3380,7 @@ static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec) ...@@ -3380,7 +3380,7 @@ static int stac92xx_auto_create_mux_input_ctls(struct hda_codec *codec)
return 0; return 0;
}; };
static const char *stac92xx_spdif_labels[3] = { static const char * const stac92xx_spdif_labels[3] = {
"Digital Playback", "Analog Mux 1", "Analog Mux 2", "Digital Playback", "Analog Mux 1", "Analog Mux 2",
}; };
...@@ -3388,7 +3388,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec) ...@@ -3388,7 +3388,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec)
{ {
struct sigmatel_spec *spec = codec->spec; struct sigmatel_spec *spec = codec->spec;
struct hda_input_mux *spdif_mux = &spec->private_smux; struct hda_input_mux *spdif_mux = &spec->private_smux;
const char **labels = spec->spdif_labels; const char * const *labels = spec->spdif_labels;
int i, num_cons; int i, num_cons;
hda_nid_t con_lst[HDA_MAX_NUM_INPUTS]; hda_nid_t con_lst[HDA_MAX_NUM_INPUTS];
...@@ -3409,7 +3409,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec) ...@@ -3409,7 +3409,7 @@ static int stac92xx_auto_create_spdif_mux_ctls(struct hda_codec *codec)
} }
/* labels for dmic mux inputs */ /* labels for dmic mux inputs */
static const char *stac92xx_dmic_labels[5] = { static const char * const stac92xx_dmic_labels[5] = {
"Analog Inputs", "Digital Mic 1", "Digital Mic 2", "Analog Inputs", "Digital Mic 1", "Digital Mic 2",
"Digital Mic 3", "Digital Mic 4" "Digital Mic 3", "Digital Mic 4"
}; };
...@@ -5333,7 +5333,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec) ...@@ -5333,7 +5333,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
return 0; return 0;
} }
static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec) static int hp_bnb2011_with_dock(struct hda_codec *codec)
{ {
if (codec->vendor_id != 0x111d7605 && if (codec->vendor_id != 0x111d7605 &&
codec->vendor_id != 0x111d76d1) codec->vendor_id != 0x111d76d1)
...@@ -5348,10 +5348,6 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec) ...@@ -5348,10 +5348,6 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
case 0x103c161d: case 0x103c161d:
case 0x103c161e: case 0x103c161e:
case 0x103c161f: case 0x103c161f:
case 0x103c1620:
case 0x103c1621:
case 0x103c1622:
case 0x103c1623:
case 0x103c162a: case 0x103c162a:
case 0x103c162b: case 0x103c162b:
...@@ -5360,41 +5356,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec) ...@@ -5360,41 +5356,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
case 0x103c1631: case 0x103c1631:
case 0x103c1633: case 0x103c1633:
case 0x103c1634:
case 0x103c1635: case 0x103c1635:
case 0x103c164f:
case 0x103c1676:
case 0x103c1677:
case 0x103c1678:
case 0x103c1679:
case 0x103c167a:
case 0x103c167b:
case 0x103c167c:
case 0x103c167d:
case 0x103c167e:
case 0x103c167f:
case 0x103c1680:
case 0x103c1681:
case 0x103c1682:
case 0x103c1683:
case 0x103c1684:
case 0x103c1685:
case 0x103c1686:
case 0x103c1687:
case 0x103c1688:
case 0x103c1689:
case 0x103c168a:
case 0x103c168b:
case 0x103c168c:
case 0x103c168d:
case 0x103c168e:
case 0x103c168f:
case 0x103c1690:
case 0x103c1691:
case 0x103c1692:
case 0x103c3587: case 0x103c3587:
case 0x103c3588: case 0x103c3588:
case 0x103c3589: case 0x103c3589:
...@@ -5402,9 +5366,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec) ...@@ -5402,9 +5366,9 @@ static int stac92hd83xxx_set_system_btl_amp(struct hda_codec *codec)
case 0x103c3667: case 0x103c3667:
case 0x103c3668: case 0x103c3668:
/* set BTL amp level to 13.43dB for louder speaker output */ case 0x103c3669:
return snd_hda_codec_write_cache(codec, codec->afg, 0,
0x7F4, 0x14); return 1;
} }
return 0; return 0;
} }
...@@ -5420,6 +5384,11 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) ...@@ -5420,6 +5384,11 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
if (hp_bnb2011_with_dock(codec)) {
snd_hda_codec_set_pincfg(codec, 0xa, 0x2101201f);
snd_hda_codec_set_pincfg(codec, 0xf, 0x2181205e);
}
/* reset pin power-down; Windows may leave these bits after reboot */ /* reset pin power-down; Windows may leave these bits after reboot */
snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0); snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7EC, 0);
snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0); snd_hda_codec_write_cache(codec, codec->afg, 0, 0x7ED, 0);
...@@ -5546,8 +5515,6 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) ...@@ -5546,8 +5515,6 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
AC_VERB_SET_CONNECT_SEL, num_dacs); AC_VERB_SET_CONNECT_SEL, num_dacs);
} }
stac92hd83xxx_set_system_btl_amp(codec);
codec->proc_widget_hook = stac92hd_proc_hook; codec->proc_widget_hook = stac92hd_proc_hook;
return 0; return 0;
...@@ -6270,7 +6237,7 @@ static unsigned int stac9872_vaio_pin_configs[9] = { ...@@ -6270,7 +6237,7 @@ static unsigned int stac9872_vaio_pin_configs[9] = {
0x90a7013e 0x90a7013e
}; };
static const char *stac9872_models[STAC_9872_MODELS] = { static const char * const stac9872_models[STAC_9872_MODELS] = {
[STAC_9872_AUTO] = "auto", [STAC_9872_AUTO] = "auto",
[STAC_9872_VAIO] = "vaio", [STAC_9872_VAIO] = "vaio",
}; };
......
...@@ -2281,7 +2281,9 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec, ...@@ -2281,7 +2281,9 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
const struct auto_pin_cfg *cfg) const struct auto_pin_cfg *cfg)
{ {
char name[32]; char name[32];
static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; static const char * const chname[4] = {
"Front", "Surround", "C/LFE", "Side"
};
hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b}; hda_nid_t nid, nid_vol, nid_vols[] = {0x17, 0x19, 0x1a, 0x1b};
int i, err; int i, err;
...@@ -2370,7 +2372,7 @@ static void create_hp_imux(struct via_spec *spec) ...@@ -2370,7 +2372,7 @@ static void create_hp_imux(struct via_spec *spec)
{ {
int i; int i;
struct hda_input_mux *imux = &spec->private_imux[1]; struct hda_input_mux *imux = &spec->private_imux[1];
static const char *texts[] = { "OFF", "ON", NULL}; static const char * const texts[] = { "OFF", "ON", NULL};
/* for hp mode select */ /* for hp mode select */
for (i = 0; texts[i]; i++) for (i = 0; texts[i]; i++)
...@@ -2890,7 +2892,9 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec, ...@@ -2890,7 +2892,9 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec,
const struct auto_pin_cfg *cfg) const struct auto_pin_cfg *cfg)
{ {
char name[32]; char name[32];
static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; static const char * const chname[4] = {
"Front", "Surround", "C/LFE", "Side"
};
hda_nid_t nid, nid_vol, nid_vols[] = {0x18, 0x1a, 0x1b, 0x29}; hda_nid_t nid, nid_vol, nid_vols[] = {0x18, 0x1a, 0x1b, 0x29};
int i, err; int i, err;
...@@ -3433,7 +3437,9 @@ static int vt1708B_auto_create_multi_out_ctls(struct via_spec *spec, ...@@ -3433,7 +3437,9 @@ static int vt1708B_auto_create_multi_out_ctls(struct via_spec *spec,
const struct auto_pin_cfg *cfg) const struct auto_pin_cfg *cfg)
{ {
char name[32]; char name[32];
static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; static const char * const chname[4] = {
"Front", "Surround", "C/LFE", "Side"
};
hda_nid_t nid_vols[] = {0x16, 0x18, 0x26, 0x27}; hda_nid_t nid_vols[] = {0x16, 0x18, 0x26, 0x27};
hda_nid_t nid, nid_vol = 0; hda_nid_t nid, nid_vol = 0;
int i, err; int i, err;
...@@ -3861,7 +3867,9 @@ static int vt1708S_auto_create_multi_out_ctls(struct via_spec *spec, ...@@ -3861,7 +3867,9 @@ static int vt1708S_auto_create_multi_out_ctls(struct via_spec *spec,
const struct auto_pin_cfg *cfg) const struct auto_pin_cfg *cfg)
{ {
char name[32]; char name[32];
static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; static const char * const chname[4] = {
"Front", "Surround", "C/LFE", "Side"
};
hda_nid_t nid_vols[] = {0x10, 0x11, 0x24, 0x25}; hda_nid_t nid_vols[] = {0x10, 0x11, 0x24, 0x25};
hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x26, 0x27}; hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x26, 0x27};
hda_nid_t nid, nid_vol, nid_mute; hda_nid_t nid, nid_vol, nid_mute;
...@@ -4304,7 +4312,7 @@ static int vt1702_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin) ...@@ -4304,7 +4312,7 @@ static int vt1702_auto_create_hp_ctls(struct via_spec *spec, hda_nid_t pin)
{ {
int err, i; int err, i;
struct hda_input_mux *imux; struct hda_input_mux *imux;
static const char *texts[] = { "ON", "OFF", NULL}; static const char * const texts[] = { "ON", "OFF", NULL};
if (!pin) if (!pin)
return 0; return 0;
spec->multiout.hp_nid = 0x1D; spec->multiout.hp_nid = 0x1D;
...@@ -4615,7 +4623,9 @@ static int vt1718S_auto_create_multi_out_ctls(struct via_spec *spec, ...@@ -4615,7 +4623,9 @@ static int vt1718S_auto_create_multi_out_ctls(struct via_spec *spec,
const struct auto_pin_cfg *cfg) const struct auto_pin_cfg *cfg)
{ {
char name[32]; char name[32];
static const char *chname[4] = { "Front", "Surround", "C/LFE", "Side" }; static const char * const chname[4] = {
"Front", "Surround", "C/LFE", "Side"
};
hda_nid_t nid_vols[] = {0x8, 0x9, 0xa, 0xb}; hda_nid_t nid_vols[] = {0x8, 0x9, 0xa, 0xb};
hda_nid_t nid_mutes[] = {0x24, 0x25, 0x26, 0x27}; hda_nid_t nid_mutes[] = {0x24, 0x25, 0x26, 0x27};
hda_nid_t nid, nid_vol, nid_mute = 0; hda_nid_t nid, nid_vol, nid_mute = 0;
...@@ -5064,7 +5074,9 @@ static int vt1716S_auto_create_multi_out_ctls(struct via_spec *spec, ...@@ -5064,7 +5074,9 @@ static int vt1716S_auto_create_multi_out_ctls(struct via_spec *spec,
const struct auto_pin_cfg *cfg) const struct auto_pin_cfg *cfg)
{ {
char name[32]; char name[32];
static const char *chname[3] = { "Front", "Surround", "C/LFE" }; static const char * const chname[3] = {
"Front", "Surround", "C/LFE"
};
hda_nid_t nid_vols[] = {0x10, 0x11, 0x25}; hda_nid_t nid_vols[] = {0x10, 0x11, 0x25};
hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x27}; hda_nid_t nid_mutes[] = {0x1C, 0x18, 0x27};
hda_nid_t nid, nid_vol, nid_mute; hda_nid_t nid, nid_vol, nid_mute;
......
...@@ -75,7 +75,7 @@ static void cs4245_write(struct oxygen *chip, unsigned int reg, u8 value) ...@@ -75,7 +75,7 @@ static void cs4245_write(struct oxygen *chip, unsigned int reg, u8 value)
OXYGEN_SPI_CEN_LATCH_CLOCK_HI, OXYGEN_SPI_CEN_LATCH_CLOCK_HI,
CS4245_SPI_ADDRESS | CS4245_SPI_ADDRESS |
CS4245_SPI_WRITE | CS4245_SPI_WRITE |
(value << 8) | reg); (reg << 8) | value);
data->cs4245_regs[reg] = value; data->cs4245_regs[reg] = value;
} }
......
...@@ -44,7 +44,7 @@ config SND_SOC_ALL_CODECS ...@@ -44,7 +44,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_TWL6040 if TWL4030_CORE select SND_SOC_TWL6040 if TWL4030_CORE
select SND_SOC_UDA134X select SND_SOC_UDA134X
select SND_SOC_UDA1380 if I2C select SND_SOC_UDA1380 if I2C
select SND_SOC_WL1273 if WL1273_CORE select SND_SOC_WL1273 if RADIO_WL1273
select SND_SOC_WM2000 if I2C select SND_SOC_WM2000 if I2C
select SND_SOC_WM8350 if MFD_WM8350 select SND_SOC_WM8350 if MFD_WM8350
select SND_SOC_WM8400 if MFD_WM8400 select SND_SOC_WM8400 if MFD_WM8400
......
...@@ -42,7 +42,7 @@ struct wl1273_priv { ...@@ -42,7 +42,7 @@ struct wl1273_priv {
static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core, static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
int rate, int width) int rate, int width)
{ {
struct device *dev = &core->i2c_dev->dev; struct device *dev = &core->client->dev;
int r = 0; int r = 0;
u16 mode; u16 mode;
...@@ -123,13 +123,13 @@ static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core, ...@@ -123,13 +123,13 @@ static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
dev_dbg(dev, "mode: 0x%04x\n", mode); dev_dbg(dev, "mode: 0x%04x\n", mode);
if (core->i2s_mode != mode) { if (core->i2s_mode != mode) {
r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET, mode); r = core->write(core, WL1273_I2S_MODE_CONFIG_SET, mode);
if (r) if (r)
goto out; goto out;
core->i2s_mode = mode; core->i2s_mode = mode;
r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE, r = core->write(core, WL1273_AUDIO_ENABLE,
WL1273_AUDIO_ENABLE_I2S); WL1273_AUDIO_ENABLE_I2S);
if (r) if (r)
goto out; goto out;
} }
...@@ -142,8 +142,7 @@ static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core, ...@@ -142,8 +142,7 @@ static int snd_wl1273_fm_set_i2s_mode(struct wl1273_core *core,
static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core, static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core,
int channel_number) int channel_number)
{ {
struct i2c_client *client = core->i2c_dev; struct device *dev = &core->client->dev;
struct device *dev = &client->dev;
int r = 0; int r = 0;
dev_dbg(dev, "%s\n", __func__); dev_dbg(dev, "%s\n", __func__);
...@@ -154,17 +153,13 @@ static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core, ...@@ -154,17 +153,13 @@ static int snd_wl1273_fm_set_channel_number(struct wl1273_core *core,
goto out; goto out;
if (channel_number == 1 && core->mode == WL1273_MODE_RX) if (channel_number == 1 && core->mode == WL1273_MODE_RX)
r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET, r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_MONO);
WL1273_RX_MONO);
else if (channel_number == 1 && core->mode == WL1273_MODE_TX) else if (channel_number == 1 && core->mode == WL1273_MODE_TX)
r = wl1273_fm_write_cmd(core, WL1273_MONO_SET, r = core->write(core, WL1273_MONO_SET, WL1273_TX_MONO);
WL1273_TX_MONO);
else if (channel_number == 2 && core->mode == WL1273_MODE_RX) else if (channel_number == 2 && core->mode == WL1273_MODE_RX)
r = wl1273_fm_write_cmd(core, WL1273_MOST_MODE_SET, r = core->write(core, WL1273_MOST_MODE_SET, WL1273_RX_STEREO);
WL1273_RX_STEREO);
else if (channel_number == 2 && core->mode == WL1273_MODE_TX) else if (channel_number == 2 && core->mode == WL1273_MODE_TX)
r = wl1273_fm_write_cmd(core, WL1273_MONO_SET, r = core->write(core, WL1273_MONO_SET, WL1273_TX_STEREO);
WL1273_TX_STEREO);
else else
r = -EINVAL; r = -EINVAL;
out: out:
...@@ -237,7 +232,7 @@ static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol, ...@@ -237,7 +232,7 @@ static int snd_wl1273_fm_audio_put(struct snd_kcontrol *kcontrol,
if (wl1273->core->audio_mode == val) if (wl1273->core->audio_mode == val)
return 0; return 0;
r = wl1273_fm_set_audio(wl1273->core, val); r = wl1273->core->set_audio(wl1273->core, val);
if (r < 0) if (r < 0)
return r; return r;
...@@ -272,8 +267,8 @@ static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol, ...@@ -272,8 +267,8 @@ static int snd_wl1273_fm_volume_put(struct snd_kcontrol *kcontrol,
dev_dbg(codec->dev, "%s: enter.\n", __func__); dev_dbg(codec->dev, "%s: enter.\n", __func__);
r = wl1273_fm_set_volume(wl1273->core, r = wl1273->core->set_volume(wl1273->core,
ucontrol->value.integer.value[0]); ucontrol->value.integer.value[0]);
if (r) if (r)
return r; return r;
......
...@@ -25,77 +25,6 @@ ...@@ -25,77 +25,6 @@
#ifndef __WL1273_CODEC_H__ #ifndef __WL1273_CODEC_H__
#define __WL1273_CODEC_H__ #define __WL1273_CODEC_H__
/* I2S protocol, left channel first, data width 16 bits */
#define WL1273_PCM_DEF_MODE 0x00
/* Rx */
#define WL1273_AUDIO_ENABLE_I2S (1 << 0)
#define WL1273_AUDIO_ENABLE_ANALOG (1 << 1)
/* Tx */
#define WL1273_AUDIO_IO_SET_ANALOG 0
#define WL1273_AUDIO_IO_SET_I2S 1
#define WL1273_POWER_SET_OFF 0
#define WL1273_POWER_SET_FM (1 << 0)
#define WL1273_POWER_SET_RDS (1 << 1)
#define WL1273_POWER_SET_RETENTION (1 << 4)
#define WL1273_PUPD_SET_OFF 0x00
#define WL1273_PUPD_SET_ON 0x01
#define WL1273_PUPD_SET_RETENTION 0x10
/* I2S mode */
#define WL1273_IS2_WIDTH_32 0x0
#define WL1273_IS2_WIDTH_40 0x1
#define WL1273_IS2_WIDTH_22_23 0x2
#define WL1273_IS2_WIDTH_23_22 0x3
#define WL1273_IS2_WIDTH_48 0x4
#define WL1273_IS2_WIDTH_50 0x5
#define WL1273_IS2_WIDTH_60 0x6
#define WL1273_IS2_WIDTH_64 0x7
#define WL1273_IS2_WIDTH_80 0x8
#define WL1273_IS2_WIDTH_96 0x9
#define WL1273_IS2_WIDTH_128 0xa
#define WL1273_IS2_WIDTH 0xf
#define WL1273_IS2_FORMAT_STD (0x0 << 4)
#define WL1273_IS2_FORMAT_LEFT (0x1 << 4)
#define WL1273_IS2_FORMAT_RIGHT (0x2 << 4)
#define WL1273_IS2_FORMAT_USER (0x3 << 4)
#define WL1273_IS2_MASTER (0x0 << 6)
#define WL1273_IS2_SLAVEW (0x1 << 6)
#define WL1273_IS2_TRI_AFTER_SENDING (0x0 << 7)
#define WL1273_IS2_TRI_ALWAYS_ACTIVE (0x1 << 7)
#define WL1273_IS2_SDOWS_RR (0x0 << 8)
#define WL1273_IS2_SDOWS_RF (0x1 << 8)
#define WL1273_IS2_SDOWS_FR (0x2 << 8)
#define WL1273_IS2_SDOWS_FF (0x3 << 8)
#define WL1273_IS2_TRI_OPT (0x0 << 10)
#define WL1273_IS2_TRI_ALWAYS (0x1 << 10)
#define WL1273_IS2_RATE_48K (0x0 << 12)
#define WL1273_IS2_RATE_44_1K (0x1 << 12)
#define WL1273_IS2_RATE_32K (0x2 << 12)
#define WL1273_IS2_RATE_22_05K (0x4 << 12)
#define WL1273_IS2_RATE_16K (0x5 << 12)
#define WL1273_IS2_RATE_12K (0x8 << 12)
#define WL1273_IS2_RATE_11_025 (0x9 << 12)
#define WL1273_IS2_RATE_8K (0xa << 12)
#define WL1273_IS2_RATE (0xf << 12)
#define WL1273_I2S_DEF_MODE (WL1273_IS2_WIDTH_32 | \
WL1273_IS2_FORMAT_STD | \
WL1273_IS2_MASTER | \
WL1273_IS2_TRI_AFTER_SENDING | \
WL1273_IS2_SDOWS_RR | \
WL1273_IS2_TRI_OPT | \
WL1273_IS2_RATE_48K)
int wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt); int wl1273_get_format(struct snd_soc_codec *codec, unsigned int *fmt);
#endif /* End of __WL1273_CODEC_H__ */ #endif /* End of __WL1273_CODEC_H__ */
...@@ -1183,7 +1183,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec, ...@@ -1183,7 +1183,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
WM8990_VMIDTOG); WM8990_VMIDTOG);
/* Delay to allow output caps to discharge */ /* Delay to allow output caps to discharge */
msleep(msecs_to_jiffies(300)); msleep(300);
/* Disable VMIDTOG */ /* Disable VMIDTOG */
snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST | snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST |
...@@ -1195,17 +1195,17 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec, ...@@ -1195,17 +1195,17 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
/* Enable outputs */ /* Enable outputs */
snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1b00); snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1b00);
msleep(msecs_to_jiffies(50)); msleep(50);
/* Enable VMID at 2x50k */ /* Enable VMID at 2x50k */
snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f02); snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f02);
msleep(msecs_to_jiffies(100)); msleep(100);
/* Enable VREF */ /* Enable VREF */
snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f03); snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f03);
msleep(msecs_to_jiffies(600)); msleep(600);
/* Enable BUFIOEN */ /* Enable BUFIOEN */
snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST | snd_soc_write(codec, WM8990_ANTIPOP2, WM8990_SOFTST |
...@@ -1250,7 +1250,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec, ...@@ -1250,7 +1250,7 @@ static int wm8990_set_bias_level(struct snd_soc_codec *codec,
/* Disable VMID */ /* Disable VMID */
snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f01); snd_soc_write(codec, WM8990_POWER_MANAGEMENT_1, 0x1f01);
msleep(msecs_to_jiffies(300)); msleep(300);
/* Enable all output discharge bits */ /* Enable all output discharge bits */
snd_soc_write(codec, WM8990_ANTIPOP1, WM8990_DIS_LLINE | snd_soc_write(codec, WM8990_ANTIPOP1, WM8990_DIS_LLINE |
......
...@@ -267,14 +267,16 @@ static int ep93xx_i2s_hw_params(struct snd_pcm_substream *substream, ...@@ -267,14 +267,16 @@ static int ep93xx_i2s_hw_params(struct snd_pcm_substream *substream,
ep93xx_i2s_write_reg(info, EP93XX_I2S_RXWRDLEN, word_len); ep93xx_i2s_write_reg(info, EP93XX_I2S_RXWRDLEN, word_len);
/* /*
* Calculate the sdiv (bit clock) and lrdiv (left/right clock) values. * EP93xx I2S module can be setup so SCLK / LRCLK value can be
* If the lrclk is pulse length is larger than the word size, then the * 32, 64, 128. MCLK / SCLK value can be 2 and 4.
* bit clock will be gated for the unused bits. * We set LRCLK equal to `rate' and minimum SCLK / LRCLK
* value is 64, because our sample size is 32 bit * 2 channels.
* I2S standard permits us to transmit more bits than
* the codec uses.
*/ */
div = (clk_get_rate(info->mclk) / params_rate(params)) * div = clk_get_rate(info->mclk) / params_rate(params);
params_channels(params);
for (sdiv = 2; sdiv <= 4; sdiv += 2) for (sdiv = 2; sdiv <= 4; sdiv += 2)
for (lrdiv = 32; lrdiv <= 128; lrdiv <<= 1) for (lrdiv = 64; lrdiv <= 128; lrdiv <<= 1)
if (sdiv * lrdiv == div) { if (sdiv * lrdiv == div) {
found = 1; found = 1;
goto out; goto out;
...@@ -341,9 +343,7 @@ static struct snd_soc_dai_ops ep93xx_i2s_dai_ops = { ...@@ -341,9 +343,7 @@ static struct snd_soc_dai_ops ep93xx_i2s_dai_ops = {
.set_fmt = ep93xx_i2s_set_dai_fmt, .set_fmt = ep93xx_i2s_set_dai_fmt,
}; };
#define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ #define EP93XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE)
static struct snd_soc_dai_driver ep93xx_i2s_dai = { static struct snd_soc_dai_driver ep93xx_i2s_dai = {
.symmetric_rates= 1, .symmetric_rates= 1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册