Skip to content

Commit

Permalink
Merge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "Significant changes are:
   - A regression fix for the new HD-audio LPIB delay counting,
     VGA-switcheroo race fix
   - ASoC ams-delta fix for the broken driver loading

  Otherwise a collection of mostly small / trivial fixes."

* tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: emu10k1: add chip details for E-mu 1010 PCIe card
  ALSA: hda - Always check array bounds in alc_get_line_out_pfx
  ASoC: bells: Correct typo in sub speaker DAI name for WM5110
  ALSA: hda - Stop LPIB delay counting on broken hardware
  ALSA: hda - Fix registration race of VGA switcheroo
  ALSA: hda - Clean up superfluous position_fix list entries
  ALSA: ac97 - Fix missing NULL check in snd_ac97_cvol_new()
  ASoC: codecs: da9055: Minor improvement in ALC calibration process
  ASoC: dmaengine: Correct Makefile when sound is built as module
  ASoC: fsi: don't reschedule DMA from an atomic context
  ASoC: fix documentation in soc-jack
  ARM: pxa: Fix build error caused by sram.h rename
  ASoC: wm2200: Fix non-inverted OUT2 mute control
  ASoC: wm2200: Use rev A register patches on rev B
  ASoC: bells: Correct typo in sub speaker DAI name for WM5110
  ASoC: ams-delta: Convert to use snd_soc_register_card()
  ASoC: omap-mcpdm: Remove OMAP revision check
  ASoC: Fix wrong include for McPDM
  ASoC: omap-abe-twl6040: Fix typo of Vibrator
  ASoC: twl6040: Fix Stream DAPM mapping
  • Loading branch information
torvalds committed Oct 18, 2012
2 parents 43c422e + 10f571d commit ec35183
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 79 deletions.
12 changes: 12 additions & 0 deletions arch/arm/mach-omap1/board-ams-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,16 +444,28 @@ static struct omap1_cam_platform_data ams_delta_camera_platform_data = {
.lclk_khz_max = 1334, /* results in 5fps CIF, 10fps QCIF */
};

static struct platform_device ams_delta_audio_device = {
.name = "ams-delta-audio",
.id = -1,
};

static struct platform_device cx20442_codec_device = {
.name = "cx20442-codec",
.id = -1,
};

static struct platform_device *ams_delta_devices[] __initdata = {
&latch1_gpio_device,
&latch2_gpio_device,
&ams_delta_kp_device,
&ams_delta_camera_device,
&ams_delta_audio_device,
};

static struct platform_device *late_devices[] __initdata = {
&ams_delta_nand_device,
&ams_delta_lcd_device,
&cx20442_codec_device,
};

static void __init ams_delta_init(void)
Expand Down
2 changes: 2 additions & 0 deletions sound/pci/ac97/ac97_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,8 @@ static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigne
tmp.index = ac97->num;
kctl = snd_ctl_new1(&tmp, ac97);
}
if (!kctl)
return -ENOMEM;
if (reg >= AC97_PHONE && reg <= AC97_PCM)
set_tlv_db_scale(kctl, db_scale_5bit_12db_max);
else
Expand Down
9 changes: 9 additions & 0 deletions sound/pci/emu10k1/emu10k1_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,15 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.ca0108_chip = 1,
.spk71 = 1,
.emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 new revision */
/* Tested by Maxim Kachur <[email protected]> 17th Oct 2012. */
/* This is MAEM8986, 0202 is MAEM8980 */
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40071102,
.driver = "Audigy2", .name = "E-mu 1010 PCIe [MAEM8986]",
.id = "EMU1010",
.emu10k2_chip = 1,
.ca0108_chip = 1,
.spk71 = 1,
.emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 PCIe */
/* Tested by [email protected] 8th July 2005. */
/* This is MAEM8810, 0202 is MAEM8820 */
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102,
Expand Down
42 changes: 26 additions & 16 deletions sound/pci/hda/hda_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ struct azx {

/* VGA-switcheroo setup */
unsigned int use_vga_switcheroo:1;
unsigned int vga_switcheroo_registered:1;
unsigned int init_failed:1; /* delayed init failed */
unsigned int disabled:1; /* disabled by VGA-switcher */

Expand Down Expand Up @@ -2157,9 +2158,12 @@ static unsigned int azx_get_position(struct azx *chip,
if (delay < 0)
delay += azx_dev->bufsize;
if (delay >= azx_dev->period_bytes) {
snd_printdd("delay %d > period_bytes %d\n",
delay, azx_dev->period_bytes);
delay = 0; /* something is wrong */
snd_printk(KERN_WARNING SFX
"Unstable LPIB (%d >= %d); "
"disabling LPIB delay counting\n",
delay, azx_dev->period_bytes);
delay = 0;
chip->driver_caps &= ~AZX_DCAPS_COUNT_LPIB_DELAY;
}
azx_dev->substream->runtime->delay =
bytes_to_frames(azx_dev->substream->runtime, delay);
Expand Down Expand Up @@ -2640,7 +2644,9 @@ static void azx_vs_set_state(struct pci_dev *pci,
if (disabled) {
azx_suspend(&pci->dev);
chip->disabled = true;
snd_hda_lock_devices(chip->bus);
if (snd_hda_lock_devices(chip->bus))
snd_printk(KERN_WARNING SFX
"Cannot lock devices!\n");
} else {
snd_hda_unlock_devices(chip->bus);
chip->disabled = false;
Expand Down Expand Up @@ -2683,14 +2689,20 @@ static const struct vga_switcheroo_client_ops azx_vs_ops = {

static int __devinit register_vga_switcheroo(struct azx *chip)
{
int err;

if (!chip->use_vga_switcheroo)
return 0;
/* FIXME: currently only handling DIS controller
* is there any machine with two switchable HDMI audio controllers?
*/
return vga_switcheroo_register_audio_client(chip->pci, &azx_vs_ops,
err = vga_switcheroo_register_audio_client(chip->pci, &azx_vs_ops,
VGA_SWITCHEROO_DIS,
chip->bus != NULL);
if (err < 0)
return err;
chip->vga_switcheroo_registered = 1;
return 0;
}
#else
#define init_vga_switcheroo(chip) /* NOP */
Expand All @@ -2712,7 +2724,8 @@ static int azx_free(struct azx *chip)
if (use_vga_switcheroo(chip)) {
if (chip->disabled && chip->bus)
snd_hda_unlock_devices(chip->bus);
vga_switcheroo_unregister_client(chip->pci);
if (chip->vga_switcheroo_registered)
vga_switcheroo_unregister_client(chip->pci);
}

if (chip->initialized) {
Expand Down Expand Up @@ -2813,8 +2826,6 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = {
SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1043, 0x1ac3, "ASUS X53S", POS_FIX_POSBUF),
SND_PCI_QUIRK(0x1043, 0x1b43, "ASUS K53E", POS_FIX_POSBUF),
SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
Expand Down Expand Up @@ -3062,14 +3073,6 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
}

ok:
err = register_vga_switcheroo(chip);
if (err < 0) {
snd_printk(KERN_ERR SFX
"Error registering VGA-switcheroo client\n");
azx_free(chip);
return err;
}

err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
if (err < 0) {
snd_printk(KERN_ERR SFX "Error creating device [card]!\n");
Expand Down Expand Up @@ -3340,6 +3343,13 @@ static int __devinit azx_probe(struct pci_dev *pci,
if (pci_dev_run_wake(pci))
pm_runtime_put_noidle(&pci->dev);

err = register_vga_switcheroo(chip);
if (err < 0) {
snd_printk(KERN_ERR SFX
"Error registering VGA-switcheroo client\n");
goto out_free;
}

dev++;
return 0;

Expand Down
4 changes: 3 additions & 1 deletion sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -2598,8 +2598,10 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch,
return "PCM";
break;
}
if (snd_BUG_ON(ch >= ARRAY_SIZE(channel_name)))
if (ch >= ARRAY_SIZE(channel_name)) {
snd_BUG();
return "PCM";
}

return channel_name[ch];
}
Expand Down
5 changes: 3 additions & 2 deletions sound/soc/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o
snd-soc-core-objs += soc-pcm.o soc-compress.o soc-io.o

snd-soc-dmaengine-pcm-objs := soc-dmaengine-pcm.o
obj-$(CONFIG_SND_SOC_DMAENGINE_PCM) += snd-soc-dmaengine-pcm.o
ifneq ($(CONFIG_SND_SOC_DMAENGINE_PCM),)
snd-soc-core-objs += soc-dmaengine-pcm.o
endif

obj-$(CONFIG_SND_SOC) += snd-soc-core.o
obj-$(CONFIG_SND_SOC) += codecs/
Expand Down
22 changes: 21 additions & 1 deletion sound/soc/codecs/da9055.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@
#define DA9055_AIF_WORD_S24_LE (2 << 2)
#define DA9055_AIF_WORD_S32_LE (3 << 2)

/* MIC_L_CTRL bit fields */
#define DA9055_MIC_L_MUTE_EN (1 << 6)

/* MIC_R_CTRL bit fields */
#define DA9055_MIC_R_MUTE_EN (1 << 6)

/* MIXIN_L_CTRL bit fields */
#define DA9055_MIXIN_L_MIX_EN (1 << 3)

Expand Down Expand Up @@ -476,7 +482,7 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
u8 reg_val, adc_left, adc_right;
u8 reg_val, adc_left, adc_right, mic_left, mic_right;
int avg_left_data, avg_right_data, offset_l, offset_r;

if (ucontrol->value.integer.value[0]) {
Expand All @@ -485,6 +491,16 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
* offsets must be done first
*/

/* Save current values from Mic control registers */
mic_left = snd_soc_read(codec, DA9055_MIC_L_CTRL);
mic_right = snd_soc_read(codec, DA9055_MIC_R_CTRL);

/* Mute Mic PGA Left and Right */
snd_soc_update_bits(codec, DA9055_MIC_L_CTRL,
DA9055_MIC_L_MUTE_EN, DA9055_MIC_L_MUTE_EN);
snd_soc_update_bits(codec, DA9055_MIC_R_CTRL,
DA9055_MIC_R_MUTE_EN, DA9055_MIC_R_MUTE_EN);

/* Save current values from ADC control registers */
adc_left = snd_soc_read(codec, DA9055_ADC_L_CTRL);
adc_right = snd_soc_read(codec, DA9055_ADC_R_CTRL);
Expand Down Expand Up @@ -520,6 +536,10 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
/* Restore original values of ADC control registers */
snd_soc_write(codec, DA9055_ADC_L_CTRL, adc_left);
snd_soc_write(codec, DA9055_ADC_R_CTRL, adc_right);

/* Restore original values of Mic control registers */
snd_soc_write(codec, DA9055_MIC_L_CTRL, mic_left);
snd_soc_write(codec, DA9055_MIC_R_CTRL, mic_right);
}

return snd_soc_put_volsw(kcontrol, ucontrol);
Expand Down
8 changes: 4 additions & 4 deletions sound/soc/codecs/twl6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,10 @@ static const struct snd_soc_dapm_route intercon[] = {
{"VIBRA DAC", NULL, "Vibra Playback"},

/* ADC -> Stream mapping */
{"ADC Left", NULL, "Legacy Capture"},
{"ADC Left", NULL, "Capture"},
{"ADC Right", NULL, "Legacy Capture"},
{"ADC Right", NULL, "Capture"},
{"Legacy Capture" , NULL, "ADC Left"},
{"Capture", NULL, "ADC Left"},
{"Legacy Capture", NULL, "ADC Right"},
{"Capture" , NULL, "ADC Right"},

/* Capture path */
{"Analog Left Capture Route", "Headset Mic", "HSMIC"},
Expand Down
3 changes: 2 additions & 1 deletion sound/soc/codecs/wm2200.c
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ SOC_DOUBLE_R_TLV("OUT2 Digital Volume", WM2200_DAC_DIGITAL_VOLUME_2L,
WM2200_DAC_DIGITAL_VOLUME_2R, WM2200_OUT2L_VOL_SHIFT, 0x9f, 0,
digital_tlv),
SOC_DOUBLE("OUT2 Switch", WM2200_PDM_1, WM2200_SPK1L_MUTE_SHIFT,
WM2200_SPK1R_MUTE_SHIFT, 1, 0),
WM2200_SPK1R_MUTE_SHIFT, 1, 1),
};

WM2200_MIXER_ENUMS(OUT1L, WM2200_OUT1LMIX_INPUT_1_SOURCE);
Expand Down Expand Up @@ -2091,6 +2091,7 @@ static __devinit int wm2200_i2c_probe(struct i2c_client *i2c,

switch (wm2200->rev) {
case 0:
case 1:
ret = regmap_register_patch(wm2200->regmap, wm2200_reva_patch,
ARRAY_SIZE(wm2200_reva_patch));
if (ret != 0) {
Expand Down
63 changes: 30 additions & 33 deletions sound/soc/omap/ams-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,56 +575,53 @@ static struct snd_soc_card ams_delta_audio_card = {
};

/* Module init/exit */
static struct platform_device *ams_delta_audio_platform_device;
static struct platform_device *cx20442_platform_device;

static int __init ams_delta_module_init(void)
static __devinit int ams_delta_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &ams_delta_audio_card;
int ret;

if (!(machine_is_ams_delta()))
return -ENODEV;

ams_delta_audio_platform_device =
platform_device_alloc("soc-audio", -1);
if (!ams_delta_audio_platform_device)
return -ENOMEM;
card->dev = &pdev->dev;

platform_set_drvdata(ams_delta_audio_platform_device,
&ams_delta_audio_card);

ret = platform_device_add(ams_delta_audio_platform_device);
if (ret)
goto err;

/*
* Codec platform device could be registered from elsewhere (board?),
* but I do it here as it makes sense only if used with the card.
*/
cx20442_platform_device =
platform_device_register_simple("cx20442-codec", -1, NULL, 0);
ret = snd_soc_register_card(card);
if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
card->dev = NULL;
return ret;
}
return 0;
err:
platform_device_put(ams_delta_audio_platform_device);
return ret;
}
late_initcall(ams_delta_module_init);

static void __exit ams_delta_module_exit(void)
static int __devexit ams_delta_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);

if (tty_unregister_ldisc(N_V253) != 0)
dev_warn(&ams_delta_audio_platform_device->dev,
dev_warn(&pdev->dev,
"failed to unregister V253 line discipline\n");

snd_soc_jack_free_gpios(&ams_delta_hook_switch,
ARRAY_SIZE(ams_delta_hook_switch_gpios),
ams_delta_hook_switch_gpios);

platform_device_unregister(cx20442_platform_device);
platform_device_unregister(ams_delta_audio_platform_device);
snd_soc_unregister_card(card);
card->dev = NULL;
return 0;
}
module_exit(ams_delta_module_exit);

#define DRV_NAME "ams-delta-audio"

static struct platform_driver ams_delta_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
},
.probe = ams_delta_probe,
.remove = __devexit_p(ams_delta_remove),
};

module_platform_driver(ams_delta_driver);

MODULE_AUTHOR("Janusz Krzysztofik <[email protected]>");
MODULE_DESCRIPTION("ALSA SoC driver for Amstrad E3 (Delta) videophone");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRV_NAME);
2 changes: 1 addition & 1 deletion sound/soc/omap/omap-abe-twl6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
twl6040_disconnect_pin(dapm, pdata->has_hf, "Ext Spk");
twl6040_disconnect_pin(dapm, pdata->has_ep, "Earphone Spk");
twl6040_disconnect_pin(dapm, pdata->has_aux, "Line Out");
twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vinrator");
twl6040_disconnect_pin(dapm, pdata->has_vibra, "Vibrator");
twl6040_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic");
twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic");
twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic");
Expand Down
9 changes: 2 additions & 7 deletions sound/soc/omap/omap-mcpdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <sound/pcm_params.h>
#include <sound/soc.h>

#include <plat/omap_hwmod.h>
#include "omap-mcpdm.h"
#include "omap-pcm.h"

Expand Down Expand Up @@ -260,13 +259,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
mutex_lock(&mcpdm->mutex);

if (!dai->active) {
/* Enable watch dog for ES above ES 1.0 to avoid saturation */
if (omap_rev() != OMAP4430_REV_ES1_0) {
u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);

omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL,
ctrl | MCPDM_WD_EN);
}
omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
omap_mcpdm_open_streams(mcpdm);
}
mutex_unlock(&mcpdm->mutex);
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/pxa/mmp-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#include <linux/slab.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/platform_data/dma-mmp_tdma.h>
#include <linux/platform_data/mmp_audio.h>
#include <sound/pxa2xx-lib.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <mach/sram.h>
#include <sound/dmaengine_pcm.h>

struct mmp_dma_data {
Expand Down
Loading

0 comments on commit ec35183

Please sign in to comment.