Commit 6f403346 authored by Linus Torvalds's avatar 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 - Add STAC9205 PCI_QUIRK for Dell Vostro 1700
  ASoC: Do not write to invalid registers on the wm9712.
  ALSA: hda - Set mixer name after codec patch
  ASoC: add missing parameter to mx27vis_hifi_hw_free()
  ASoC: sh: FSI:: don't check platform_get_irq's return value against zero
  ALSA: sound/core/pcm_timer.c: use lib/gcd.c
  ALSA: hda - Add MSI blacklist
  ALSA: hda - Add support for the new 27 inch IMacs
  ALSA: hda - Fix NULL dereference with enable_beep=0 option
parents 9c717de9 54a26089
...@@ -403,4 +403,5 @@ STAC9872 ...@@ -403,4 +403,5 @@ STAC9872
Cirrus Logic CS4206/4207 Cirrus Logic CS4206/4207
======================== ========================
mbp55 MacBook Pro 5,5 mbp55 MacBook Pro 5,5
imac27 IMac 27 Inch
auto BIOS setup (default) auto BIOS setup (default)
...@@ -5,6 +5,7 @@ config SND_TIMER ...@@ -5,6 +5,7 @@ config SND_TIMER
config SND_PCM config SND_PCM
tristate tristate
select SND_TIMER select SND_TIMER
select GCD
config SND_HWDEP config SND_HWDEP
tristate tristate
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <linux/time.h> #include <linux/time.h>
#include <linux/gcd.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/timer.h> #include <sound/timer.h>
...@@ -28,22 +29,6 @@ ...@@ -28,22 +29,6 @@
* Timer functions * Timer functions
*/ */
/* Greatest common divisor */
static unsigned long gcd(unsigned long a, unsigned long b)
{
unsigned long r;
if (a < b) {
r = a;
a = b;
b = r;
}
while ((r = a % b) != 0) {
a = b;
b = r;
}
return b;
}
void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream) void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream)
{ {
unsigned long rate, mult, fsize, l, post; unsigned long rate, mult, fsize, l, post;
......
...@@ -1086,11 +1086,6 @@ int snd_hda_codec_configure(struct hda_codec *codec) ...@@ -1086,11 +1086,6 @@ int snd_hda_codec_configure(struct hda_codec *codec)
if (err < 0) if (err < 0)
return err; return err;
} }
/* audio codec should override the mixer name */
if (codec->afg || !*codec->bus->card->mixername)
snprintf(codec->bus->card->mixername,
sizeof(codec->bus->card->mixername),
"%s %s", codec->vendor_name, codec->chip_name);
if (is_generic_config(codec)) { if (is_generic_config(codec)) {
err = snd_hda_parse_generic_codec(codec); err = snd_hda_parse_generic_codec(codec);
...@@ -1109,6 +1104,11 @@ int snd_hda_codec_configure(struct hda_codec *codec) ...@@ -1109,6 +1104,11 @@ int snd_hda_codec_configure(struct hda_codec *codec)
patched: patched:
if (!err && codec->patch_ops.unsol_event) if (!err && codec->patch_ops.unsol_event)
err = init_unsol_queue(codec->bus); err = init_unsol_queue(codec->bus);
/* audio codec should override the mixer name */
if (!err && (codec->afg || !*codec->bus->card->mixername))
snprintf(codec->bus->card->mixername,
sizeof(codec->bus->card->mixername),
"%s %s", codec->vendor_name, codec->chip_name);
return err; return err;
} }
EXPORT_SYMBOL_HDA(snd_hda_codec_configure); EXPORT_SYMBOL_HDA(snd_hda_codec_configure);
......
...@@ -2322,6 +2322,7 @@ static void __devinit check_probe_mask(struct azx *chip, int dev) ...@@ -2322,6 +2322,7 @@ static void __devinit check_probe_mask(struct azx *chip, int dev)
* white/black-list for enable_msi * white/black-list for enable_msi
*/ */
static struct snd_pci_quirk msi_black_list[] __devinitdata = { static struct snd_pci_quirk msi_black_list[] __devinitdata = {
SND_PCI_QUIRK(0x1043, 0x81f2, "ASUS", 0), /* Athlon64 X2 + nvidia */
{} {}
}; };
......
...@@ -66,6 +66,7 @@ struct cs_spec { ...@@ -66,6 +66,7 @@ struct cs_spec {
/* available models */ /* available models */
enum { enum {
CS420X_MBP55, CS420X_MBP55,
CS420X_IMAC27,
CS420X_AUTO, CS420X_AUTO,
CS420X_MODELS CS420X_MODELS
}; };
...@@ -827,7 +828,8 @@ static void cs_automute(struct hda_codec *codec) ...@@ -827,7 +828,8 @@ static void cs_automute(struct hda_codec *codec)
AC_VERB_SET_PIN_WIDGET_CONTROL, AC_VERB_SET_PIN_WIDGET_CONTROL,
hp_present ? 0 : PIN_OUT); hp_present ? 0 : PIN_OUT);
} }
if (spec->board_config == CS420X_MBP55) { if (spec->board_config == CS420X_MBP55 ||
spec->board_config == CS420X_IMAC27) {
unsigned int gpio = hp_present ? 0x02 : 0x08; unsigned int gpio = hp_present ? 0x02 : 0x08;
snd_hda_codec_write(codec, 0x01, 0, snd_hda_codec_write(codec, 0x01, 0,
AC_VERB_SET_GPIO_DATA, gpio); AC_VERB_SET_GPIO_DATA, gpio);
...@@ -1069,12 +1071,14 @@ static int cs_parse_auto_config(struct hda_codec *codec) ...@@ -1069,12 +1071,14 @@ static int cs_parse_auto_config(struct hda_codec *codec)
static const char *cs420x_models[CS420X_MODELS] = { static const char *cs420x_models[CS420X_MODELS] = {
[CS420X_MBP55] = "mbp55", [CS420X_MBP55] = "mbp55",
[CS420X_IMAC27] = "imac27",
[CS420X_AUTO] = "auto", [CS420X_AUTO] = "auto",
}; };
static struct snd_pci_quirk cs420x_cfg_tbl[] = { static struct snd_pci_quirk cs420x_cfg_tbl[] = {
SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55), SND_PCI_QUIRK(0x10de, 0xcb79, "MacBookPro 5,5", CS420X_MBP55),
SND_PCI_QUIRK(0x8086, 0x7270, "IMac 27 Inch", CS420X_IMAC27),
{} /* terminator */ {} /* terminator */
}; };
...@@ -1097,8 +1101,23 @@ static struct cs_pincfg mbp55_pincfgs[] = { ...@@ -1097,8 +1101,23 @@ static struct cs_pincfg mbp55_pincfgs[] = {
{} /* terminator */ {} /* terminator */
}; };
static struct cs_pincfg imac27_pincfgs[] = {
{ 0x09, 0x012b4050 },
{ 0x0a, 0x90100140 },
{ 0x0b, 0x90100142 },
{ 0x0c, 0x018b3020 },
{ 0x0d, 0x90a00110 },
{ 0x0e, 0x400000f0 },
{ 0x0f, 0x01cbe030 },
{ 0x10, 0x014be060 },
{ 0x12, 0x01ab9070 },
{ 0x15, 0x400000f0 },
{} /* terminator */
};
static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = { static struct cs_pincfg *cs_pincfgs[CS420X_MODELS] = {
[CS420X_MBP55] = mbp55_pincfgs, [CS420X_MBP55] = mbp55_pincfgs,
[CS420X_IMAC27] = imac27_pincfgs,
}; };
static void fix_pincfg(struct hda_codec *codec, int model) static void fix_pincfg(struct hda_codec *codec, int model)
...@@ -1128,6 +1147,7 @@ static int patch_cs420x(struct hda_codec *codec) ...@@ -1128,6 +1147,7 @@ static int patch_cs420x(struct hda_codec *codec)
fix_pincfg(codec, spec->board_config); fix_pincfg(codec, spec->board_config);
switch (spec->board_config) { switch (spec->board_config) {
case CS420X_IMAC27:
case CS420X_MBP55: case CS420X_MBP55:
/* GPIO1 = headphones */ /* GPIO1 = headphones */
/* GPIO3 = speakers */ /* GPIO3 = speakers */
......
...@@ -2104,6 +2104,7 @@ static unsigned int ref9205_pin_configs[12] = { ...@@ -2104,6 +2104,7 @@ static unsigned int ref9205_pin_configs[12] = {
10280204 10280204
1028021F 1028021F
10280228 (Dell Vostro 1500) 10280228 (Dell Vostro 1500)
10280229 (Dell Vostro 1700)
*/ */
static unsigned int dell_9205_m42_pin_configs[12] = { static unsigned int dell_9205_m42_pin_configs[12] = {
0x0321101F, 0x03A11020, 0x400003FA, 0x90170310, 0x0321101F, 0x03A11020, 0x400003FA, 0x90170310,
...@@ -2189,6 +2190,8 @@ static struct snd_pci_quirk stac9205_cfg_tbl[] = { ...@@ -2189,6 +2190,8 @@ static struct snd_pci_quirk stac9205_cfg_tbl[] = {
"Dell Inspiron", STAC_9205_DELL_M44), "Dell Inspiron", STAC_9205_DELL_M44),
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228, SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0228,
"Dell Vostro 1500", STAC_9205_DELL_M42), "Dell Vostro 1500", STAC_9205_DELL_M42),
SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0229,
"Dell Vostro 1700", STAC_9205_DELL_M42),
/* Gateway */ /* Gateway */
SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD), SND_PCI_QUIRK(0x107b, 0x0560, "Gateway T6834c", STAC_9205_EAPD),
SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD), SND_PCI_QUIRK(0x107b, 0x0565, "Gateway T1616", STAC_9205_EAPD),
...@@ -3779,15 +3782,16 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out ...@@ -3779,15 +3782,16 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
err = snd_hda_attach_beep_device(codec, nid); err = snd_hda_attach_beep_device(codec, nid);
if (err < 0) if (err < 0)
return err; return err;
/* IDT/STAC codecs have linear beep tone parameter */ if (codec->beep) {
codec->beep->linear_tone = 1; /* IDT/STAC codecs have linear beep tone parameter */
/* if no beep switch is available, make its own one */ codec->beep->linear_tone = 1;
caps = query_amp_caps(codec, nid, HDA_OUTPUT); /* if no beep switch is available, make its own one */
if (codec->beep && caps = query_amp_caps(codec, nid, HDA_OUTPUT);
!((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT)) { if (!(caps & AC_AMPCAP_MUTE)) {
err = stac92xx_beep_switch_ctl(codec); err = stac92xx_beep_switch_ctl(codec);
if (err < 0) if (err < 0)
return err; return err;
}
} }
} }
#endif #endif
......
...@@ -463,7 +463,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg, ...@@ -463,7 +463,8 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
{ {
u16 *cache = codec->reg_cache; u16 *cache = codec->reg_cache;
soc_ac97_ops.write(codec->ac97, reg, val); if (reg < 0x7c)
soc_ac97_ops.write(codec->ac97, reg, val);
reg = reg >> 1; reg = reg >> 1;
if (reg < (ARRAY_SIZE(wm9712_reg))) if (reg < (ARRAY_SIZE(wm9712_reg)))
cache[reg] = val; cache[reg] = val;
......
...@@ -180,7 +180,8 @@ static int mx27vis_hifi_hw_free(struct snd_pcm_substream *substream) ...@@ -180,7 +180,8 @@ static int mx27vis_hifi_hw_free(struct snd_pcm_substream *substream)
struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
/* disable the PLL */ /* disable the PLL */
return codec_dai->ops->set_pll(codec_dai, IGNORED_ARG, 0, 0); return codec_dai->ops->set_pll(codec_dai, IGNORED_ARG, IGNORED_ARG,
0, 0);
} }
/* /*
......
...@@ -876,7 +876,7 @@ static int fsi_probe(struct platform_device *pdev) ...@@ -876,7 +876,7 @@ static int fsi_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (!res || !irq) { if (!res || (int)irq <= 0) {
dev_err(&pdev->dev, "Not enough FSI platform resources.\n"); dev_err(&pdev->dev, "Not enough FSI platform resources.\n");
ret = -ENODEV; ret = -ENODEV;
goto exit; goto exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment