From 30efd8debd1ef30be342d374f01e993509f5b76b Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Fri, 22 Feb 2013 10:16:28 +0100 Subject: ALSA: hda - hdmi: Make jacks phantom, if they're not detectable Just as for analog codecs, a jack that isn't suitable for detection (in this case, NO_PRESENCE was set) should be a phantom Jack instead of a normal one. Thanks to Raymond Yau for spotting. Cc: stable@vger.kernel.org BugLink: https://bugs.launchpad.net/bugs/961286 BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=903869 Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_hdmi.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 21425fb51fe0..78e1827d0a95 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1640,6 +1640,9 @@ static int generic_hdmi_build_jack(struct hda_codec *codec, int pin_idx) if (pcmdev > 0) sprintf(hdmi_str + strlen(hdmi_str), ",pcm=%d", pcmdev); + if (!is_jack_detectable(codec, per_pin->pin_nid)) + strncat(hdmi_str, " Phantom", + sizeof(hdmi_str) - strlen(hdmi_str) - 1); return snd_hda_jack_add_kctl(codec, per_pin->pin_nid, hdmi_str, 0); } -- cgit v1.2.3 From d28215996b0c3a900411769039aa3c54cf7008ab Mon Sep 17 00:00:00 2001 From: Mihail Zenkov Date: Fri, 22 Feb 2013 11:25:27 +0000 Subject: ALSA: emu10k1: Fix regression in emu1010 firmware loading This patch fix regression in emu1010 firmware loading after http://git.alsa-project.org/?p=alsa-kprivate.git;a=commitdiff;h=b209c4dfcd960ab176d4746ab7dc442a3edb4575 I just revert small part of this commit. Tested on emu1212m pci. Signed-off-by: Mihail Zenkov Cc: Signed-off-by: Takashi Iwai --- sound/pci/emu10k1/emu10k1_main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sound') diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index a7c296a36a17..5115f1104dfb 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -860,6 +860,11 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu) } snd_printk(KERN_INFO "emu1010: firmware file = %s, size = 0x%zx\n", filename, emu->firmware->size); + err = snd_emu1010_load_firmware(emu); + if (err != 0) { + snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", filename); + return err; + } } /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ -- cgit v1.2.3 From aacfddfdadb3540651d263245069631f341e953a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 25 Feb 2013 09:48:45 +0100 Subject: ALSA: bt87x: Make load_all parameter working again Along with a clean up commit [e9f66d9b9: ALSA: pci: clean up using module_pci_driver()], bt87x driver lost the functionality of load_all parameter. This patch does a partial revert of the commit only for bt87x.c to recover it. Reported-by: Clemens Ladisch Cc: Signed-off-by: Takashi Iwai --- sound/pci/bt87x.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c index cdd100dae855..9febe5509748 100644 --- a/sound/pci/bt87x.c +++ b/sound/pci/bt87x.c @@ -836,6 +836,8 @@ static struct { {0x7063, 0x2000}, /* pcHDTV HD-2000 TV */ }; +static struct pci_driver driver; + /* return the id of the card, or a negative value if it's blacklisted */ static int snd_bt87x_detect_card(struct pci_dev *pci) { @@ -962,11 +964,24 @@ static DEFINE_PCI_DEVICE_TABLE(snd_bt87x_default_ids) = { { } }; -static struct pci_driver bt87x_driver = { +static struct pci_driver driver = { .name = KBUILD_MODNAME, .id_table = snd_bt87x_ids, .probe = snd_bt87x_probe, .remove = snd_bt87x_remove, }; -module_pci_driver(bt87x_driver); +static int __init alsa_card_bt87x_init(void) +{ + if (load_all) + driver.id_table = snd_bt87x_default_ids; + return pci_register_driver(&driver); +} + +static void __exit alsa_card_bt87x_exit(void) +{ + pci_unregister_driver(&driver); +} + +module_init(alsa_card_bt87x_init) +module_exit(alsa_card_bt87x_exit) -- cgit v1.2.3 From c2d3703cdd4954836f348515b802a5dc4c17710e Mon Sep 17 00:00:00 2001 From: Jonas Petersen Date: Sat, 23 Feb 2013 23:38:43 +0100 Subject: ALSA: ice1724: M-Audio Audiophile192: Fix SPDIF input This patch fixes initialization of the AK4114 chip so spdif capture is working properly. Worked out together with Pavel Hofman. Signed-off-by: Jonas Petersen Signed-off-by: Takashi Iwai --- sound/pci/ice1712/revo.c | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'sound') diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index 7641080a9b5d..1112ec1953be 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c @@ -35,6 +35,7 @@ struct revo51_spec { struct snd_i2c_device *dev; struct snd_pt2258 *pt2258; + struct ak4114 *ak4114; }; static void revo_i2s_mclk_changed(struct snd_ice1712 *ice) @@ -359,9 +360,9 @@ static struct snd_ak4xxx_private akm_ap192_priv = { .cif = 0, .data_mask = VT1724_REVO_CDOUT, .clk_mask = VT1724_REVO_CCLK, - .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS1, - .cs_addr = VT1724_REVO_CS1, - .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS1, + .cs_mask = VT1724_REVO_CS0 | VT1724_REVO_CS3, + .cs_addr = VT1724_REVO_CS3, + .cs_none = VT1724_REVO_CS0 | VT1724_REVO_CS3, .add_flags = VT1724_REVO_CCLK, /* high at init */ .mask_flags = 0, }; @@ -372,7 +373,7 @@ static struct snd_ak4xxx_private akm_ap192_priv = { * CCLK (pin 34) -- GPIO1 pin 51 (shared with AK4358) * CSN (pin 35) -- GPIO7 pin 59 */ -#define AK4114_ADDR 0x02 +#define AK4114_ADDR 0x00 static void write_data(struct snd_ice1712 *ice, unsigned int gpio, unsigned int data, int idx) @@ -426,7 +427,7 @@ static unsigned int ap192_4wire_start(struct snd_ice1712 *ice) tmp = snd_ice1712_gpio_read(ice); tmp |= VT1724_REVO_CCLK; /* high at init */ tmp |= VT1724_REVO_CS0; - tmp &= ~VT1724_REVO_CS1; + tmp &= ~VT1724_REVO_CS3; snd_ice1712_gpio_write(ice, tmp); udelay(1); return tmp; @@ -434,7 +435,7 @@ static unsigned int ap192_4wire_start(struct snd_ice1712 *ice) static void ap192_4wire_finish(struct snd_ice1712 *ice, unsigned int tmp) { - tmp |= VT1724_REVO_CS1; + tmp |= VT1724_REVO_CS3; tmp |= VT1724_REVO_CS0; snd_ice1712_gpio_write(ice, tmp); udelay(1); @@ -470,27 +471,32 @@ static unsigned char ap192_ak4114_read(void *private_data, unsigned char addr) static int ap192_ak4114_init(struct snd_ice1712 *ice) { static const unsigned char ak4114_init_vals[] = { - AK4114_RST | AK4114_PWN | AK4114_OCKS0 | AK4114_OCKS1, + AK4114_RST | AK4114_PWN | AK4114_OCKS0, AK4114_DIF_I24I2S, AK4114_TX1E, - AK4114_EFH_1024 | AK4114_DIT | AK4114_IPS(1), + AK4114_EFH_1024 | AK4114_DIT | AK4114_IPS(0), 0, 0 }; static const unsigned char ak4114_init_txcsb[] = { 0x41, 0x02, 0x2c, 0x00, 0x00 }; - struct ak4114 *ak; int err; + struct revo51_spec *spec; + spec = kzalloc(sizeof(*spec), GFP_KERNEL); + if (!spec) + return -ENOMEM; + ice->spec = spec; + err = snd_ak4114_create(ice->card, ap192_ak4114_read, ap192_ak4114_write, ak4114_init_vals, ak4114_init_txcsb, - ice, &ak); + ice, &spec->ak4114); /* AK4114 in Revo cannot detect external rate correctly. * No reason to stop capture stream due to incorrect checks */ - ak->check_flags = AK4114_CHECK_NO_RATE; + spec->ak4114->check_flags = AK4114_CHECK_NO_RATE; return 0; /* error ignored; it's no fatal error */ } @@ -562,6 +568,9 @@ static int revo_init(struct snd_ice1712 *ice) ice); if (err < 0) return err; + err = ap192_ak4114_init(ice); + if (err < 0) + return err; /* unmute all codecs */ snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE, @@ -575,7 +584,7 @@ static int revo_init(struct snd_ice1712 *ice) static int revo_add_controls(struct snd_ice1712 *ice) { - struct revo51_spec *spec; + struct revo51_spec *spec = ice->spec; int err; switch (ice->eeprom.subvendor) { @@ -597,7 +606,9 @@ static int revo_add_controls(struct snd_ice1712 *ice) err = snd_ice1712_akm4xxx_build_controls(ice); if (err < 0) return err; - err = ap192_ak4114_init(ice); + /* only capture SPDIF over AK4114 */ + err = snd_ak4114_build(spec->ak4114, NULL, + ice->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); if (err < 0) return err; break; -- cgit v1.2.3 From b56ddbe55a363eee4ff7410a97050dad08215f7c Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Mon, 25 Feb 2013 09:53:35 +0100 Subject: ALSA: emu10k1: Load firmware when it was already cached This expands the regression fix from d28215996b0c3a900411769039aa3c54cf7008ab. The firmware also needs to be loaded when it was already cached. Signed-off-by: Florian Zeitz Cc: Signed-off-by: Takashi Iwai --- sound/pci/emu10k1/emu10k1_main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'sound') diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 5115f1104dfb..e6b016693240 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -860,11 +860,12 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 *emu) } snd_printk(KERN_INFO "emu1010: firmware file = %s, size = 0x%zx\n", filename, emu->firmware->size); - err = snd_emu1010_load_firmware(emu); - if (err != 0) { - snd_printk(KERN_INFO "emu1010: Loading Firmware file %s failed\n", filename); - return err; - } + } + + err = snd_emu1010_load_firmware(emu); + if (err != 0) { + snd_printk(KERN_INFO "emu1010: Loading Firmware failed\n"); + return err; } /* ID, should read & 0x7f = 0x55 when FPGA programmed. */ -- cgit v1.2.3 From 8554ee405713f8572ed2e8b7d711f4884f253181 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 25 Feb 2013 09:54:43 +0100 Subject: ALSA: hda - Enable beep for ASUS EeeBox EBP1501P Reported-by: Harald Becker Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 61478fd82565..2d4237bc0d8e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -928,6 +928,7 @@ static int alc_codec_rename_from_preset(struct hda_codec *codec) static const struct snd_pci_quirk beep_white_list[] = { SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1), SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1), + SND_PCI_QUIRK(0x1043, 0x8376, "EeePC", 1), SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1), SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1), SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), -- cgit v1.2.3 From d0ec95fe6a8d9c7da6f9ff885cecbe7e328e2a2e Mon Sep 17 00:00:00 2001 From: Mihail Zenkov Date: Fri, 22 Feb 2013 17:59:38 +0000 Subject: ALSA: emu10k1: Allow to switch hardware sampe rate on EMU Commit 57e5c63007955838043e34c732d224b2cbbb128f "emu10k1: allow to disable the SRC" force hardware use only one rate (48000 hz). EMU 0404/1010/1616 have support two hardware sampling rates (44100 and 48000 hz). This patch add check if we have EMU 0404/1010/1616 and choose correct sample rate to restrict. Signed-off-by: Mihail Zenkov Signed-off-by: Takashi Iwai --- sound/pci/emu10k1/emupcm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index 748a286277eb..5ae1d045bdcb 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c @@ -1127,7 +1127,7 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream) struct snd_emu10k1_pcm *epcm; struct snd_emu10k1_pcm_mixer *mix; struct snd_pcm_runtime *runtime = substream->runtime; - int i, err; + int i, err, sample_rate; epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); if (epcm == NULL) @@ -1146,7 +1146,11 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream) kfree(epcm); return err; } - err = snd_pcm_hw_rule_noresample(runtime, 48000); + if (emu->card_capabilities->emu_model && emu->emu1010.internal_clock == 0) + sample_rate = 44100; + else + sample_rate = 48000; + err = snd_pcm_hw_rule_noresample(runtime, sample_rate); if (err < 0) { kfree(epcm); return err; -- cgit v1.2.3