From d523b0c808a5c5cbde9ac89427d98ee6288f5f2f Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 15 Apr 2009 11:39:01 -0700 Subject: ALSA: hda_intel.c - Consolidate bitfields Commit fa00e046b41663cbda9b1affc0594669e5f14219 added a new bitfield not adjacent to other bitfields in the same struct. Moved the new one. Signed-off-by: Joe Perches Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index bc882f8f163..21e99cfa8c4 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -312,7 +312,6 @@ struct azx_dev { unsigned int period_bytes; /* size of the period in bytes */ unsigned int frags; /* number for period in the play buffer */ unsigned int fifo_size; /* FIFO size */ - unsigned int start_flag: 1; /* stream full start flag */ unsigned long start_jiffies; /* start + minimum jiffies */ unsigned long min_jiffies; /* minimum jiffies before position is valid */ @@ -333,6 +332,7 @@ struct azx_dev { unsigned int opened :1; unsigned int running :1; unsigned int irq_pending :1; + unsigned int start_flag: 1; /* stream full start flag */ /* * For VIA: * A flag to ensure DMA position is 0 -- cgit v1.2.3 From 4611b043ce9c45cd8ac760b8379b02ceffe26b0d Mon Sep 17 00:00:00 2001 From: Daniel T Chen Date: Wed, 15 Apr 2009 19:43:35 -0400 Subject: ALSA: Intel8x0: Remove conflicting quirk for SSID 0x103c0934 While cleaning up quirks, I noticed that there is a duplicated quirk for the SSID 0x103c0934. Looking back through the bug reports, I've concluded that there is only one necessary quirk (hp_mute_led), so this patch removes the conflicting one. Reference: Ubuntu #44066 (https://launchpad.net/bugs/44066) Signed-off-by: Daniel T Chen Signed-off-by: Takashi Iwai --- sound/pci/intel8x0.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 5dced5b7938..b3180d063d3 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -1894,12 +1894,6 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { .name = "HP nc6000", .type = AC97_TUNE_MUTE_LED }, - { - .subvendor = 0x103c, - .subdevice = 0x0934, - .name = "HP nx8220", - .type = AC97_TUNE_MUTE_LED - }, { .subvendor = 0x103c, .subdevice = 0x129d, -- cgit v1.2.3 From c82834251ceb81b7575927c767500bd8c4a7f928 Mon Sep 17 00:00:00 2001 From: Daniel T Chen Date: Wed, 15 Apr 2009 19:48:08 -0400 Subject: ALSA: Intel8x0: Add hp_only quirk for SSID 0x1028016a (Dell Inspiron 8600) Subject says it all. Briefly, use hp_only for another Dell Inspiron 8600. Reference: Ubuntu #41015 (https://launchpad.net/bugs/41015) Signed-off-by: Daniel T Chen Signed-off-by: Takashi Iwai --- sound/pci/intel8x0.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index b3180d063d3..8042d539889 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -1852,6 +1852,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = { .name = "Dell Unknown", /* STAC9750/51 */ .type = AC97_TUNE_HP_ONLY }, + { + .subvendor = 0x1028, + .subdevice = 0x016a, + .name = "Dell Inspiron 8600", /* STAC9750/51 */ + .type = AC97_TUNE_HP_ONLY + }, { .subvendor = 0x1028, .subdevice = 0x0186, -- cgit v1.2.3 From ffd0e56c606836581da5df742a43ce8015ca7475 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 16 Apr 2009 12:20:24 +0200 Subject: ALSA: hda - Fix headphone-detection on some machines with STAC/IDT codecs When the headphone can have no unique DAC, the current code doesn't check the HP-detection although it should. Put the hp-detection check before the DAC check to fix this bug. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_sigmatel.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index ce30b459aee..917bc5d3ac2 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -3076,6 +3076,11 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs, unsigned int wid_caps; for (i = 0; i < num_outs && i < ARRAY_SIZE(chname); i++) { + if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) { + wid_caps = get_wcaps(codec, pins[i]); + if (wid_caps & AC_WCAP_UNSOL_CAP) + spec->hp_detect = 1; + } nid = dac_nids[i]; if (!nid) continue; @@ -3119,11 +3124,6 @@ static int create_multi_out_ctls(struct hda_codec *codec, int num_outs, err = create_controls_idx(codec, name, idx, nid, 3); if (err < 0) return err; - if (type == AUTO_PIN_HP_OUT && !spec->hp_detect) { - wid_caps = get_wcaps(codec, pins[i]); - if (wid_caps & AC_WCAP_UNSOL_CAP) - spec->hp_detect = 1; - } } } return 0; -- cgit v1.2.3 From 4dc1f87f079d5c6b01284d08b28eff2c4fbd15c4 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 16 Apr 2009 14:19:19 +0200 Subject: ALSA: hda - Add upper-limit of mixer amp for AD1884A-laptop model, too Add the upper-limit of mixer amp for AD1884A-laptop model just like the mobile model for some HP laptops. Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_analog.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 38ad3f7b040..9bcd8ab5a27 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -3977,6 +3977,14 @@ static int patch_ad1884a(struct hda_codec *codec) spec->input_mux = &ad1884a_laptop_capture_source; codec->patch_ops.unsol_event = ad1884a_hp_unsol_event; codec->patch_ops.init = ad1884a_hp_init; + /* set the upper-limit for mixer amp to 0dB for avoiding the + * possible damage by overloading + */ + snd_hda_override_amp_caps(codec, 0x20, HDA_INPUT, + (0x17 << AC_AMPCAP_OFFSET_SHIFT) | + (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | + (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) | + (1 << AC_AMPCAP_MUTE_SHIFT)); break; case AD1884A_MOBILE: spec->mixers[0] = ad1884a_mobile_mixers; -- cgit v1.2.3 From a5735b7ede1d1ca81ebf491d699530715b105560 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Wed, 15 Apr 2009 20:24:45 +0200 Subject: ASoC: pxa-ssp: allow setting of dai format 0 pxa_ssp_set_dai_fmt() currently has an early exit if the desired format equals the current configuration. This is correct behaviour unless this function is called with a zero value parameter for the first time. Zero is a valid value for this function, but the early exit is bogus in this case. Hence, set priv->dai_fmt to -1 in the beginning so we can configure the port. Signed-off-by: Daniel Mack Cc: pHilipp Zabel Signed-off-by: Mark Brown --- sound/soc/pxa/pxa-ssp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index c7c1996a544..152118cb5d6 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -806,6 +806,7 @@ static int pxa_ssp_probe(struct platform_device *pdev, goto err_priv; } + priv->dai_fmt = (unsigned int) -1; dai->private_data = priv; return 0; -- cgit v1.2.3 From 01c4cad4f76cebdb4d0db37a9775554478fb7149 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 16 Apr 2009 10:32:20 +0100 Subject: ASoC: Fix jive_wm8750.c build problems Fix build errors in sound/soc/s3c24xx/jive_wm8750.c from changes to ASoC. Signed-off-by: Ben Dooks Signed-off-by: Mark Brown --- sound/soc/s3c24xx/jive_wm8750.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/s3c24xx/jive_wm8750.c b/sound/soc/s3c24xx/jive_wm8750.c index 32063790d95..93e6c87b739 100644 --- a/sound/soc/s3c24xx/jive_wm8750.c +++ b/sound/soc/s3c24xx/jive_wm8750.c @@ -69,8 +69,8 @@ static int jive_hw_params(struct snd_pcm_substream *substream, break; } - s3c_i2sv2_calc_rate(&div, NULL, params_rate(params), - s3c2412_get_iisclk()); + s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params), + s3c2412_get_iisclk()); /* set codec DAI configuration */ ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | @@ -145,8 +145,9 @@ static struct snd_soc_dai_link jive_dai = { }; /* jive audio machine driver */ -static struct snd_soc_machine snd_soc_machine_jive = { +static struct snd_soc_card snd_soc_machine_jive = { .name = "Jive", + .platform = &s3c24xx_soc_platform, .dai_link = &jive_dai, .num_links = 1, }; @@ -157,9 +158,8 @@ static struct wm8750_setup_data jive_wm8750_setup = { /* jive audio subsystem */ static struct snd_soc_device jive_snd_devdata = { - .machine = &snd_soc_machine_jive, - .platform = &s3c24xx_soc_platform, - .codec_dev = &soc_codec_dev_wm8750_spi, + .card = &snd_soc_machine_jive, + .codec_dev = &soc_codec_dev_wm8750, .codec_data = &jive_wm8750_setup, }; -- cgit v1.2.3 From 1d2b7ae9a0994c166014e9a07a61d9cfee6215a0 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 16 Apr 2009 10:32:23 +0100 Subject: ASoC: s3c-i2s-v2.c fix for s3c_i2sv2_iis_calc_rate The definition of s3c_i2sv2_iis_calc_rate was never renamed from s3c2412_iis_calc_rate, so rename this to allow the build to work. Signed-off-by: Ben Dooks Signed-off-by: Mark Brown --- sound/soc/s3c24xx/s3c-i2s-v2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c index 295a4c91026..545cfff85fb 100644 --- a/sound/soc/s3c24xx/s3c-i2s-v2.c +++ b/sound/soc/s3c24xx/s3c-i2s-v2.c @@ -473,9 +473,9 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai, /* default table of all avaialable root fs divisors */ static unsigned int iis_fs_tab[] = { 256, 512, 384, 768 }; -int s3c2412_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, - unsigned int *fstab, - unsigned int rate, struct clk *clk) +int s3c_i2sv2_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, + unsigned int *fstab, + unsigned int rate, struct clk *clk) { unsigned long clkrate = clk_get_rate(clk); unsigned int div; @@ -531,7 +531,7 @@ int s3c2412_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, return 0; } -EXPORT_SYMBOL_GPL(s3c2412_iis_calc_rate); +EXPORT_SYMBOL_GPL(s3c_i2sv2_iis_calc_rate); int s3c_i2sv2_probe(struct platform_device *pdev, struct snd_soc_dai *dai, -- cgit v1.2.3 From 3715c6aaa913d9fb044b9eb36d957a8d2703723a Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 16 Apr 2009 10:32:22 +0100 Subject: ASoC: Fix s3c-i2s-v2.c snd_soc_dai changes Fix the build error in s3c-i2s-v2.c caused by a change to the snd_soc_dai ops field. Signed-off-by: Ben Dooks Signed-off-by: Mark Brown --- sound/soc/s3c24xx/s3c-i2s-v2.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c index 545cfff85fb..689ffcd17e1 100644 --- a/sound/soc/s3c24xx/s3c-i2s-v2.c +++ b/sound/soc/s3c24xx/s3c-i2s-v2.c @@ -624,10 +624,12 @@ static int s3c2412_i2s_resume(struct snd_soc_dai *dai) int s3c_i2sv2_register_dai(struct snd_soc_dai *dai) { - dai->ops.trigger = s3c2412_i2s_trigger; - dai->ops.hw_params = s3c2412_i2s_hw_params; - dai->ops.set_fmt = s3c2412_i2s_set_fmt; - dai->ops.set_clkdiv = s3c2412_i2s_set_clkdiv; + struct snd_soc_dai_ops *ops = dai->ops; + + ops->trigger = s3c2412_i2s_trigger; + ops->hw_params = s3c2412_i2s_hw_params; + ops->set_fmt = s3c2412_i2s_set_fmt; + ops->set_clkdiv = s3c2412_i2s_set_clkdiv; dai->suspend = s3c2412_i2s_suspend; dai->resume = s3c2412_i2s_resume; -- cgit v1.2.3 From 76fff3680286d3f7f1ced5e38d613deff86caf20 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Thu, 16 Apr 2009 10:32:21 +0100 Subject: ASoC: Fix include build error in s3c2412-i2s.c Fix accidental change of to in s3c2412-i2s.c Signed-off-by: Ben Dooks Signed-off-by: Mark Brown --- sound/soc/s3c24xx/s3c2412-i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/s3c24xx/s3c2412-i2s.c b/sound/soc/s3c24xx/s3c2412-i2s.c index 1ca3cdaa821..b7e0b3f0bfc 100644 --- a/sound/soc/s3c24xx/s3c2412-i2s.c +++ b/sound/soc/s3c24xx/s3c2412-i2s.c @@ -33,8 +33,8 @@ #include -#include #include +#include #include #include "s3c24xx-pcm.h" -- cgit v1.2.3 From 36ce85824549c1aece65478bf9fe2d224ae06f86 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Wed, 15 Apr 2009 13:48:16 +0300 Subject: ASoC: OMAP: Fix DSP_B format in OMAP McBSP DAI driver The DSP format wasn't still correct in OMAP McBSP DAI even after the commit bd25867a6cbe7a00ef7dbe8d9ddebc91b00b9b3f. Thanks to Peter Ujfalusi for noticing and being part of the fix. Now the FS length definition is more clear by defining it with FWID(0). Signed-off-by: Jarkko Nikula Acked-by: Peter Ujfalusi Signed-off-by: Mark Brown --- sound/soc/omap/omap-mcbsp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index 9c09b94f0cf..90f4df7fd90 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -283,7 +283,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, break; case SND_SOC_DAIFMT_DSP_B: regs->srgr2 |= FPER(wlen * channels - 1); - regs->srgr1 |= FWID(wlen * channels - 2); + regs->srgr1 |= FWID(0); break; } @@ -302,6 +302,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai, { struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data); struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; + unsigned int temp_fmt = fmt; if (mcbsp_data->configured) return 0; @@ -328,6 +329,8 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai, /* 0-bit data delay */ regs->rcr2 |= RDATDLY(0); regs->xcr2 |= XDATDLY(0); + /* Invert FS polarity configuration */ + temp_fmt ^= SND_SOC_DAIFMT_NB_IF; break; default: /* Unsupported data format */ @@ -351,7 +354,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_dai *cpu_dai, } /* Set bit clock (CLKX/CLKR) and FS polarities */ - switch (fmt & SND_SOC_DAIFMT_INV_MASK) { + switch (temp_fmt & SND_SOC_DAIFMT_INV_MASK) { case SND_SOC_DAIFMT_NB_NF: /* * Normal BCLK + FS. -- cgit v1.2.3 From 002fbad829883a3ad9b185077f9e54c37dc7502d Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Wed, 15 Apr 2009 13:48:17 +0300 Subject: ASoC: OMAP: Fix FS polarity in OSK5912 machine driver Using inverted FS polarity in OSK5912 must be an error since TLV320AIC23 do not have support for inverted polarities. This is mostly due the hassle with the DSP formats in OMAP McBSP DAI and inversion on OMAP side probably just made this configuration working at some point. Signed-off-by: Jarkko Nikula Acked-by: Arun KS Signed-off-by: Mark Brown --- sound/soc/omap/osk5912.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c index a952a4eb336..a4e149b7f0e 100644 --- a/sound/soc/omap/osk5912.c +++ b/sound/soc/omap/osk5912.c @@ -62,7 +62,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream, /* Set codec DAI configuration */ err = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | - SND_SOC_DAIFMT_NB_IF | + SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); if (err < 0) { printk(KERN_ERR "can't set codec DAI configuration\n"); @@ -72,7 +72,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream, /* Set cpu DAI configuration */ err = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_B | - SND_SOC_DAIFMT_NB_IF | + SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); if (err < 0) { printk(KERN_ERR "can't set cpu DAI configuration\n"); -- cgit v1.2.3 From 5a47fa3d30b5d1977b4e7d1daf5ba5b577258ce1 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Thu, 16 Apr 2009 23:54:04 +0200 Subject: ALSA: emu10k1 - off by 1 in snd_emu10k1_wait() With `while (count++ < 16384)' count reaches 16385. Signed-off-by: Roel Kluin Signed-off-by: Takashi Iwai --- sound/pci/emu10k1/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c index 4bfc31d1b28..c1a5aa15af8 100644 --- a/sound/pci/emu10k1/io.c +++ b/sound/pci/emu10k1/io.c @@ -490,7 +490,7 @@ void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait) if (newtime != curtime) break; } - if (count >= 16384) + if (count > 16384) break; curtime = newtime; } -- cgit v1.2.3 From 3126a1790e897252868941bd29a3dd526b506804 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 15 Apr 2009 23:38:45 -0700 Subject: ALSA: MAINTAINERS - Update SOUND Signed-off-by: Joe Perches Signed-off-by: Takashi Iwai --- MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0cb20d82169..c7ba93599d4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5187,7 +5187,12 @@ M: perex@perex.cz P: Takashi Iwai M: tiwai@suse.de L: alsa-devel@alsa-project.org (subscribers-only) +W: http://www.alsa-project.org/ +T: git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git +T: git git://git.alsa-project.org/alsa-kernel.git S: Maintained +F: Documentation/sound/ +F: include/sound/ F: sound/ SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC) -- cgit v1.2.3 From 93e82ae781e1ca4797cf2a226d3c303975bd99c7 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 17 Apr 2009 18:04:41 +0200 Subject: ALSA: hda - Set function_id only on FG nodes (Re)set function_id only from the value on FG nodes. The current code overrides the value with the last widget. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_codec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index fd6e6f337d1..8820faf6c9d 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -642,19 +642,21 @@ static int get_codec_name(struct hda_codec *codec) */ static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec) { - int i, total_nodes; + int i, total_nodes, function_id; hda_nid_t nid; total_nodes = snd_hda_get_sub_nodes(codec, AC_NODE_ROOT, &nid); for (i = 0; i < total_nodes; i++, nid++) { - codec->function_id = snd_hda_param_read(codec, nid, + function_id = snd_hda_param_read(codec, nid, AC_PAR_FUNCTION_TYPE) & 0xff; - switch (codec->function_id) { + switch (function_id) { case AC_GRP_AUDIO_FUNCTION: codec->afg = nid; + codec->function_id = function_id; break; case AC_GRP_MODEM_FUNCTION: codec->mfg = nid; + codec->function_id = function_id; break; default: break; -- cgit v1.2.3