From 2e0192f13c4428bb624838a9cc6713b6237bab3b Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Tue, 7 May 2013 19:38:52 +0800 Subject: [PATCH 1/8] ASoC: wm0010: fix error return code in wm0010_boot() Fix to return -ENOMEM in the memory malloc of 'out' and 'img_swap' error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown --- sound/soc/codecs/wm0010.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c index ad2fee4bb4cd..fe5e10fd51df 100644 --- a/sound/soc/codecs/wm0010.c +++ b/sound/soc/codecs/wm0010.c @@ -667,6 +667,7 @@ static int wm0010_boot(struct snd_soc_codec *codec) /* On wm0010 only the CLKCTRL1 value is used */ pll_rec.clkctrl1 = wm0010->pll_clkctrl1; + ret = -ENOMEM; len = pll_rec.length + 8; out = kzalloc(len, GFP_KERNEL); if (!out) { From 2371e9cf14074c7d2542da56c5d6161fbe29a946 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Wed, 8 May 2013 09:14:20 +0200 Subject: [PATCH 2/8] ASoC: ux500: Swap even/odd AD slot definitions AD slots definitions for ab8500 codec were erroneously swapped between even and odd channels. Fix this by swapping the definitions to be coherent with the channel number. Signed-off-by: Fabio Baltieri Acked-by: Lee Jones Signed-off-by: Mark Brown --- sound/soc/codecs/ab8500-codec.h | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sound/soc/codecs/ab8500-codec.h b/sound/soc/codecs/ab8500-codec.h index 114f69a0c629..306d0bc8455f 100644 --- a/sound/soc/codecs/ab8500-codec.h +++ b/sound/soc/codecs/ab8500-codec.h @@ -348,25 +348,25 @@ /* AB8500_ADSLOTSELX */ #define AB8500_ADSLOTSELX_AD_OUT1_TO_SLOT_ODD 0x00 -#define AB8500_ADSLOTSELX_AD_OUT2_TO_SLOT_ODD 0x01 -#define AB8500_ADSLOTSELX_AD_OUT3_TO_SLOT_ODD 0x02 -#define AB8500_ADSLOTSELX_AD_OUT4_TO_SLOT_ODD 0x03 -#define AB8500_ADSLOTSELX_AD_OUT5_TO_SLOT_ODD 0x04 -#define AB8500_ADSLOTSELX_AD_OUT6_TO_SLOT_ODD 0x05 -#define AB8500_ADSLOTSELX_AD_OUT7_TO_SLOT_ODD 0x06 -#define AB8500_ADSLOTSELX_AD_OUT8_TO_SLOT_ODD 0x07 -#define AB8500_ADSLOTSELX_ZEROES_TO_SLOT_ODD 0x08 -#define AB8500_ADSLOTSELX_TRISTATE_TO_SLOT_ODD 0x0F +#define AB8500_ADSLOTSELX_AD_OUT2_TO_SLOT_ODD 0x10 +#define AB8500_ADSLOTSELX_AD_OUT3_TO_SLOT_ODD 0x20 +#define AB8500_ADSLOTSELX_AD_OUT4_TO_SLOT_ODD 0x30 +#define AB8500_ADSLOTSELX_AD_OUT5_TO_SLOT_ODD 0x40 +#define AB8500_ADSLOTSELX_AD_OUT6_TO_SLOT_ODD 0x50 +#define AB8500_ADSLOTSELX_AD_OUT7_TO_SLOT_ODD 0x60 +#define AB8500_ADSLOTSELX_AD_OUT8_TO_SLOT_ODD 0x70 +#define AB8500_ADSLOTSELX_ZEROES_TO_SLOT_ODD 0x80 +#define AB8500_ADSLOTSELX_TRISTATE_TO_SLOT_ODD 0xF0 #define AB8500_ADSLOTSELX_AD_OUT1_TO_SLOT_EVEN 0x00 -#define AB8500_ADSLOTSELX_AD_OUT2_TO_SLOT_EVEN 0x10 -#define AB8500_ADSLOTSELX_AD_OUT3_TO_SLOT_EVEN 0x20 -#define AB8500_ADSLOTSELX_AD_OUT4_TO_SLOT_EVEN 0x30 -#define AB8500_ADSLOTSELX_AD_OUT5_TO_SLOT_EVEN 0x40 -#define AB8500_ADSLOTSELX_AD_OUT6_TO_SLOT_EVEN 0x50 -#define AB8500_ADSLOTSELX_AD_OUT7_TO_SLOT_EVEN 0x60 -#define AB8500_ADSLOTSELX_AD_OUT8_TO_SLOT_EVEN 0x70 -#define AB8500_ADSLOTSELX_ZEROES_TO_SLOT_EVEN 0x80 -#define AB8500_ADSLOTSELX_TRISTATE_TO_SLOT_EVEN 0xF0 +#define AB8500_ADSLOTSELX_AD_OUT2_TO_SLOT_EVEN 0x01 +#define AB8500_ADSLOTSELX_AD_OUT3_TO_SLOT_EVEN 0x02 +#define AB8500_ADSLOTSELX_AD_OUT4_TO_SLOT_EVEN 0x03 +#define AB8500_ADSLOTSELX_AD_OUT5_TO_SLOT_EVEN 0x04 +#define AB8500_ADSLOTSELX_AD_OUT6_TO_SLOT_EVEN 0x05 +#define AB8500_ADSLOTSELX_AD_OUT7_TO_SLOT_EVEN 0x06 +#define AB8500_ADSLOTSELX_AD_OUT8_TO_SLOT_EVEN 0x07 +#define AB8500_ADSLOTSELX_ZEROES_TO_SLOT_EVEN 0x08 +#define AB8500_ADSLOTSELX_TRISTATE_TO_SLOT_EVEN 0x0F #define AB8500_ADSLOTSELX_EVEN_SHIFT 0 #define AB8500_ADSLOTSELX_ODD_SHIFT 4 From 61559af111e41761f5f4f20ce0897345eb59076e Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 9 May 2013 21:14:20 +0800 Subject: [PATCH 3/8] ASoC: da7213: Fix setting dmic_samplephase and dmic_clk_rate When set dmic_samplephase and dmic_clk_rate bits for dmic_cfg, current code checks pdata->dmic_data_sel which is wrong. Signed-off-by: Axel Lin Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/codecs/da7213.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index 41230ad1c3e0..4a6f1daf911f 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c @@ -1488,17 +1488,17 @@ static int da7213_probe(struct snd_soc_codec *codec) DA7213_DMIC_DATA_SEL_SHIFT); break; } - switch (pdata->dmic_data_sel) { + switch (pdata->dmic_samplephase) { case DA7213_DMIC_SAMPLE_ON_CLKEDGE: case DA7213_DMIC_SAMPLE_BETWEEN_CLKEDGE: - dmic_cfg |= (pdata->dmic_data_sel << + dmic_cfg |= (pdata->dmic_samplephase << DA7213_DMIC_SAMPLEPHASE_SHIFT); break; } - switch (pdata->dmic_data_sel) { + switch (pdata->dmic_clk_rate) { case DA7213_DMIC_CLK_3_0MHZ: case DA7213_DMIC_CLK_1_5MHZ: - dmic_cfg |= (pdata->dmic_data_sel << + dmic_cfg |= (pdata->dmic_clk_rate << DA7213_DMIC_CLK_RATE_SHIFT); break; } From a62ee234a572b4c98fe98cf5fb18e4e8b0f6e43d Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Sun, 12 May 2013 14:31:19 +0200 Subject: [PATCH 4/8] sound: Fix make allmodconfig on MIPS correctly Commit d4702b189c ("sound: Fix make allmodconfig on MIPS") added a (negative) dependency on ISA_DMA_SUPPORT_BROKEN. Since that Kconfig symbol doesn't exist, this dependency will always evaluate to true. Apparently GENERIC_ISA_DMA_SUPPORT_BROKEN was meant to be used here. Signed-off-by: Paul Bolle Signed-off-by: Takashi Iwai --- sound/oss/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig index 51c4ba95a32d..1a9640254433 100644 --- a/sound/oss/Kconfig +++ b/sound/oss/Kconfig @@ -250,7 +250,7 @@ config MSND_FIFOSIZE menuconfig SOUND_OSS tristate "OSS sound modules" depends on ISA_DMA_API && VIRT_TO_BUS - depends on !ISA_DMA_SUPPORT_BROKEN + depends on !GENERIC_ISA_DMA_SUPPORT_BROKEN help OSS is the Open Sound System suite of sound card drivers. They make sound programming easier since they provide a common API. Say Y or From b1b9fbd0507aac4ddce14f513d52332f50be89dc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 14 May 2013 12:58:47 +0200 Subject: [PATCH 5/8] ALSA: hda - Check the activity of the NID to be powered down When an inactive path is powered down with spec->power_down_unused flag, we should check the activity of each widget in the path whether it's still referred from any active path. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_generic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index ac079f93c535..ae85bbd2e6f8 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -606,6 +606,10 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid, return false; } +/* check whether the NID is referred by any active paths */ +#define is_active_nid_for_any(codec, nid) \ + is_active_nid(codec, nid, HDA_OUTPUT, 0) + /* get the default amp value for the target state */ static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid, int dir, unsigned int caps, bool enable) @@ -759,7 +763,8 @@ static void path_power_down_sync(struct hda_codec *codec, struct nid_path *path) for (i = 0; i < path->depth; i++) { hda_nid_t nid = path->path[i]; - if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D3)) { + if (!snd_hda_check_power_state(codec, nid, AC_PWRST_D3) && + !is_active_nid_for_any(codec, nid)) { snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_POWER_STATE, AC_PWRST_D3); @@ -4157,7 +4162,7 @@ static unsigned int snd_hda_gen_path_power_filter(struct hda_codec *codec, return power_state; if (get_wcaps_type(get_wcaps(codec, nid)) >= AC_WID_POWER) return power_state; - if (is_active_nid(codec, nid, HDA_OUTPUT, 0)) + if (is_active_nid_for_any(codec, nid)) return power_state; return AC_PWRST_D3; } From 088578617d2aaab05ea96b529f16c9a2f1cfbbee Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Mon, 6 May 2013 11:01:05 +1000 Subject: [PATCH 6/8] ALSA: snd-aoa: Add a layout entry for PowerBook6,5 Either one or a combination of commits 81e5d86 "Register i2c devices from device-tree" and 3a3dd01 "Improve detection of devices from device-tree" broke sound on PowerBook6,5 machines. Fix it by adding an entry to the new driver to match PowerBook6,5 machines. Signed-off-by: Michael Ellerman Acked-by: Benjamin Herrenschmidt Signed-off-by: Takashi Iwai --- sound/aoa/fabrics/layout.c | 8 ++++++++ sound/aoa/soundbus/i2sbus/core.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index 552b97afbca5..61ab640e195f 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c @@ -113,6 +113,7 @@ MODULE_ALIAS("sound-layout-100"); MODULE_ALIAS("aoa-device-id-14"); MODULE_ALIAS("aoa-device-id-22"); MODULE_ALIAS("aoa-device-id-35"); +MODULE_ALIAS("aoa-device-id-44"); /* onyx with all but microphone connected */ static struct codec_connection onyx_connections_nomic[] = { @@ -361,6 +362,13 @@ static struct layout layouts[] = { .connections = tas_connections_nolineout, }, }, + /* PowerBook6,5 */ + { .device_id = 44, + .codecs[0] = { + .name = "tas", + .connections = tas_connections_all, + }, + }, /* PowerBook6,7 */ { .layout_id = 80, .codecs[0] = { diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index 010658335881..15e76131b501 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -200,7 +200,8 @@ static int i2sbus_add_dev(struct macio_dev *macio, * We probably cannot handle all device-id machines, * so restrict to those we do handle for now. */ - if (id && (*id == 22 || *id == 14 || *id == 35)) { + if (id && (*id == 22 || *id == 14 || *id == 35 || + *id == 44)) { snprintf(dev->sound.modalias, 32, "aoa-device-id-%d", *id); ok = 1; From 436c4a0cfbc4c7a95c4ea37dbd9f697d5dfd553f Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Wed, 15 May 2013 13:56:00 +0200 Subject: [PATCH 7/8] ALSA: hda - Add headset mic support for another Dell machine BugLink: https://bugs.launchpad.net/bugs/1180351 Signed-off-by: David Henningsson Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 6bf47f7326ad..59d2e91a9ab6 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3482,6 +3482,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x1028, 0x05c9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05ca, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05cb, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1028, 0x05de, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05e9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05ea, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1028, 0x05eb, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), From e6135fe960bba1d1a3a6b6818839e6d8d3f21293 Mon Sep 17 00:00:00 2001 From: Torstein Hegge Date: Thu, 16 May 2013 20:26:17 +0200 Subject: [PATCH 8/8] ALSA: usb-audio: proc: use found syncmaxsize to determine feedback format freqshift is only set for the data endpoint and syncmaxsize is only set for the sync endpoint. This results in a syncmaxsize of zero used in the proc output feedback format calculation, which gives a feedback format incorrectly shown as 8.16 for UAC2 devices. As neither the data nor the sync endpoint gives all the relevant content, output the two combined. Also remove the sync_endpoint "packet size" which is always zero and the sync_endpoint "momentary freq" which is constant. Tested with UAC2 async and UAC1 adaptive, not tested with UAC1 async. Reported-by: B. Zhang Signed-off-by: Torstein Hegge Signed-off-by: Takashi Iwai --- sound/usb/proc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sound/usb/proc.c b/sound/usb/proc.c index 135c76871063..5f761ab34c01 100644 --- a/sound/usb/proc.c +++ b/sound/usb/proc.c @@ -116,21 +116,22 @@ static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct s } static void proc_dump_ep_status(struct snd_usb_substream *subs, - struct snd_usb_endpoint *ep, + struct snd_usb_endpoint *data_ep, + struct snd_usb_endpoint *sync_ep, struct snd_info_buffer *buffer) { - if (!ep) + if (!data_ep) return; - snd_iprintf(buffer, " Packet Size = %d\n", ep->curpacksize); + snd_iprintf(buffer, " Packet Size = %d\n", data_ep->curpacksize); snd_iprintf(buffer, " Momentary freq = %u Hz (%#x.%04x)\n", subs->speed == USB_SPEED_FULL - ? get_full_speed_hz(ep->freqm) - : get_high_speed_hz(ep->freqm), - ep->freqm >> 16, ep->freqm & 0xffff); - if (ep->freqshift != INT_MIN) { - int res = 16 - ep->freqshift; + ? get_full_speed_hz(data_ep->freqm) + : get_high_speed_hz(data_ep->freqm), + data_ep->freqm >> 16, data_ep->freqm & 0xffff); + if (sync_ep && data_ep->freqshift != INT_MIN) { + int res = 16 - data_ep->freqshift; snd_iprintf(buffer, " Feedback Format = %d.%d\n", - (ep->syncmaxsize > 3 ? 32 : 24) - res, res); + (sync_ep->syncmaxsize > 3 ? 32 : 24) - res, res); } } @@ -140,8 +141,7 @@ static void proc_dump_substream_status(struct snd_usb_substream *subs, struct sn snd_iprintf(buffer, " Status: Running\n"); snd_iprintf(buffer, " Interface = %d\n", subs->interface); snd_iprintf(buffer, " Altset = %d\n", subs->altset_idx); - proc_dump_ep_status(subs, subs->data_endpoint, buffer); - proc_dump_ep_status(subs, subs->sync_endpoint, buffer); + proc_dump_ep_status(subs, subs->data_endpoint, subs->sync_endpoint, buffer); } else { snd_iprintf(buffer, " Status: Stop\n"); }