Commit ec351832 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'sound-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/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
parents 43c422ed 10f571d0
...@@ -444,16 +444,28 @@ static struct omap1_cam_platform_data ams_delta_camera_platform_data = { ...@@ -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 */ .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 = { static struct platform_device *ams_delta_devices[] __initdata = {
&latch1_gpio_device, &latch1_gpio_device,
&latch2_gpio_device, &latch2_gpio_device,
&ams_delta_kp_device, &ams_delta_kp_device,
&ams_delta_camera_device, &ams_delta_camera_device,
&ams_delta_audio_device,
}; };
static struct platform_device *late_devices[] __initdata = { static struct platform_device *late_devices[] __initdata = {
&ams_delta_nand_device, &ams_delta_nand_device,
&ams_delta_lcd_device, &ams_delta_lcd_device,
&cx20442_codec_device,
}; };
static void __init ams_delta_init(void) static void __init ams_delta_init(void)
......
...@@ -1271,6 +1271,8 @@ static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigne ...@@ -1271,6 +1271,8 @@ static int snd_ac97_cvol_new(struct snd_card *card, char *name, int reg, unsigne
tmp.index = ac97->num; tmp.index = ac97->num;
kctl = snd_ctl_new1(&tmp, ac97); kctl = snd_ctl_new1(&tmp, ac97);
} }
if (!kctl)
return -ENOMEM;
if (reg >= AC97_PHONE && reg <= AC97_PCM) if (reg >= AC97_PHONE && reg <= AC97_PCM)
set_tlv_db_scale(kctl, db_scale_5bit_12db_max); set_tlv_db_scale(kctl, db_scale_5bit_12db_max);
else else
......
...@@ -1416,6 +1416,15 @@ static struct snd_emu_chip_details emu_chip_details[] = { ...@@ -1416,6 +1416,15 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.ca0108_chip = 1, .ca0108_chip = 1,
.spk71 = 1, .spk71 = 1,
.emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 new revision */ .emu_model = EMU_MODEL_EMU1010B}, /* EMU 1010 new revision */
/* Tested by Maxim Kachur <mcdebugger@duganet.ru> 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 James@superbug.co.uk 8th July 2005. */ /* Tested by James@superbug.co.uk 8th July 2005. */
/* This is MAEM8810, 0202 is MAEM8820 */ /* This is MAEM8810, 0202 is MAEM8820 */
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102, {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x40011102,
......
...@@ -501,6 +501,7 @@ struct azx { ...@@ -501,6 +501,7 @@ struct azx {
/* VGA-switcheroo setup */ /* VGA-switcheroo setup */
unsigned int use_vga_switcheroo:1; unsigned int use_vga_switcheroo:1;
unsigned int vga_switcheroo_registered:1;
unsigned int init_failed:1; /* delayed init failed */ unsigned int init_failed:1; /* delayed init failed */
unsigned int disabled:1; /* disabled by VGA-switcher */ unsigned int disabled:1; /* disabled by VGA-switcher */
...@@ -2157,9 +2158,12 @@ static unsigned int azx_get_position(struct azx *chip, ...@@ -2157,9 +2158,12 @@ static unsigned int azx_get_position(struct azx *chip,
if (delay < 0) if (delay < 0)
delay += azx_dev->bufsize; delay += azx_dev->bufsize;
if (delay >= azx_dev->period_bytes) { if (delay >= azx_dev->period_bytes) {
snd_printdd("delay %d > period_bytes %d\n", snd_printk(KERN_WARNING SFX
delay, azx_dev->period_bytes); "Unstable LPIB (%d >= %d); "
delay = 0; /* something is wrong */ "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 = azx_dev->substream->runtime->delay =
bytes_to_frames(azx_dev->substream->runtime, delay); bytes_to_frames(azx_dev->substream->runtime, delay);
...@@ -2640,7 +2644,9 @@ static void azx_vs_set_state(struct pci_dev *pci, ...@@ -2640,7 +2644,9 @@ static void azx_vs_set_state(struct pci_dev *pci,
if (disabled) { if (disabled) {
azx_suspend(&pci->dev); azx_suspend(&pci->dev);
chip->disabled = true; 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 { } else {
snd_hda_unlock_devices(chip->bus); snd_hda_unlock_devices(chip->bus);
chip->disabled = false; chip->disabled = false;
...@@ -2683,14 +2689,20 @@ static const struct vga_switcheroo_client_ops azx_vs_ops = { ...@@ -2683,14 +2689,20 @@ static const struct vga_switcheroo_client_ops azx_vs_ops = {
static int __devinit register_vga_switcheroo(struct azx *chip) static int __devinit register_vga_switcheroo(struct azx *chip)
{ {
int err;
if (!chip->use_vga_switcheroo) if (!chip->use_vga_switcheroo)
return 0; return 0;
/* FIXME: currently only handling DIS controller /* FIXME: currently only handling DIS controller
* is there any machine with two switchable HDMI audio controllers? * 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, VGA_SWITCHEROO_DIS,
chip->bus != NULL); chip->bus != NULL);
if (err < 0)
return err;
chip->vga_switcheroo_registered = 1;
return 0;
} }
#else #else
#define init_vga_switcheroo(chip) /* NOP */ #define init_vga_switcheroo(chip) /* NOP */
...@@ -2712,7 +2724,8 @@ static int azx_free(struct azx *chip) ...@@ -2712,7 +2724,8 @@ static int azx_free(struct azx *chip)
if (use_vga_switcheroo(chip)) { if (use_vga_switcheroo(chip)) {
if (chip->disabled && chip->bus) if (chip->disabled && chip->bus)
snd_hda_unlock_devices(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) { if (chip->initialized) {
...@@ -2813,8 +2826,6 @@ static struct snd_pci_quirk position_fix_list[] __devinitdata = { ...@@ -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, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", 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, 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(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB), SND_PCI_QUIRK(0x10de, 0xcb89, "Macbook Pro 7,1", POS_FIX_LPIB),
SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB), SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
...@@ -3062,14 +3073,6 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, ...@@ -3062,14 +3073,6 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci,
} }
ok: 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); err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
if (err < 0) { if (err < 0) {
snd_printk(KERN_ERR SFX "Error creating device [card]!\n"); snd_printk(KERN_ERR SFX "Error creating device [card]!\n");
...@@ -3340,6 +3343,13 @@ static int __devinit azx_probe(struct pci_dev *pci, ...@@ -3340,6 +3343,13 @@ static int __devinit azx_probe(struct pci_dev *pci,
if (pci_dev_run_wake(pci)) if (pci_dev_run_wake(pci))
pm_runtime_put_noidle(&pci->dev); 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++; dev++;
return 0; return 0;
......
...@@ -2598,8 +2598,10 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch, ...@@ -2598,8 +2598,10 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch,
return "PCM"; return "PCM";
break; break;
} }
if (snd_BUG_ON(ch >= ARRAY_SIZE(channel_name))) if (ch >= ARRAY_SIZE(channel_name)) {
snd_BUG();
return "PCM"; return "PCM";
}
return channel_name[ch]; return channel_name[ch];
} }
......
snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-cache.o soc-utils.o 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-core-objs += soc-pcm.o soc-compress.o soc-io.o
snd-soc-dmaengine-pcm-objs := soc-dmaengine-pcm.o ifneq ($(CONFIG_SND_SOC_DMAENGINE_PCM),)
obj-$(CONFIG_SND_SOC_DMAENGINE_PCM) += snd-soc-dmaengine-pcm.o snd-soc-core-objs += soc-dmaengine-pcm.o
endif
obj-$(CONFIG_SND_SOC) += snd-soc-core.o obj-$(CONFIG_SND_SOC) += snd-soc-core.o
obj-$(CONFIG_SND_SOC) += codecs/ obj-$(CONFIG_SND_SOC) += codecs/
......
...@@ -178,6 +178,12 @@ ...@@ -178,6 +178,12 @@
#define DA9055_AIF_WORD_S24_LE (2 << 2) #define DA9055_AIF_WORD_S24_LE (2 << 2)
#define DA9055_AIF_WORD_S32_LE (3 << 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 */ /* MIXIN_L_CTRL bit fields */
#define DA9055_MIXIN_L_MIX_EN (1 << 3) #define DA9055_MIXIN_L_MIX_EN (1 << 3)
...@@ -476,7 +482,7 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol, ...@@ -476,7 +482,7 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); 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; int avg_left_data, avg_right_data, offset_l, offset_r;
if (ucontrol->value.integer.value[0]) { if (ucontrol->value.integer.value[0]) {
...@@ -485,6 +491,16 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol, ...@@ -485,6 +491,16 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
* offsets must be done first * 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 */ /* Save current values from ADC control registers */
adc_left = snd_soc_read(codec, DA9055_ADC_L_CTRL); adc_left = snd_soc_read(codec, DA9055_ADC_L_CTRL);
adc_right = snd_soc_read(codec, DA9055_ADC_R_CTRL); adc_right = snd_soc_read(codec, DA9055_ADC_R_CTRL);
...@@ -520,6 +536,10 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol, ...@@ -520,6 +536,10 @@ static int da9055_put_alc_sw(struct snd_kcontrol *kcontrol,
/* Restore original values of ADC control registers */ /* Restore original values of ADC control registers */
snd_soc_write(codec, DA9055_ADC_L_CTRL, adc_left); snd_soc_write(codec, DA9055_ADC_L_CTRL, adc_left);
snd_soc_write(codec, DA9055_ADC_R_CTRL, adc_right); 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); return snd_soc_put_volsw(kcontrol, ucontrol);
......
...@@ -820,10 +820,10 @@ static const struct snd_soc_dapm_route intercon[] = { ...@@ -820,10 +820,10 @@ static const struct snd_soc_dapm_route intercon[] = {
{"VIBRA DAC", NULL, "Vibra Playback"}, {"VIBRA DAC", NULL, "Vibra Playback"},
/* ADC -> Stream mapping */ /* ADC -> Stream mapping */
{"ADC Left", NULL, "Legacy Capture"}, {"Legacy Capture" , NULL, "ADC Left"},
{"ADC Left", NULL, "Capture"}, {"Capture", NULL, "ADC Left"},
{"ADC Right", NULL, "Legacy Capture"}, {"Legacy Capture", NULL, "ADC Right"},
{"ADC Right", NULL, "Capture"}, {"Capture" , NULL, "ADC Right"},
/* Capture path */ /* Capture path */
{"Analog Left Capture Route", "Headset Mic", "HSMIC"}, {"Analog Left Capture Route", "Headset Mic", "HSMIC"},
......
...@@ -1028,7 +1028,7 @@ SOC_DOUBLE_R_TLV("OUT2 Digital Volume", WM2200_DAC_DIGITAL_VOLUME_2L, ...@@ -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, WM2200_DAC_DIGITAL_VOLUME_2R, WM2200_OUT2L_VOL_SHIFT, 0x9f, 0,
digital_tlv), digital_tlv),
SOC_DOUBLE("OUT2 Switch", WM2200_PDM_1, WM2200_SPK1L_MUTE_SHIFT, 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); WM2200_MIXER_ENUMS(OUT1L, WM2200_OUT1LMIX_INPUT_1_SOURCE);
...@@ -2091,6 +2091,7 @@ static __devinit int wm2200_i2c_probe(struct i2c_client *i2c, ...@@ -2091,6 +2091,7 @@ static __devinit int wm2200_i2c_probe(struct i2c_client *i2c,
switch (wm2200->rev) { switch (wm2200->rev) {
case 0: case 0:
case 1:
ret = regmap_register_patch(wm2200->regmap, wm2200_reva_patch, ret = regmap_register_patch(wm2200->regmap, wm2200_reva_patch,
ARRAY_SIZE(wm2200_reva_patch)); ARRAY_SIZE(wm2200_reva_patch));
if (ret != 0) { if (ret != 0) {
......
...@@ -575,56 +575,53 @@ static struct snd_soc_card ams_delta_audio_card = { ...@@ -575,56 +575,53 @@ static struct snd_soc_card ams_delta_audio_card = {
}; };
/* Module init/exit */ /* Module init/exit */
static struct platform_device *ams_delta_audio_platform_device; static __devinit int ams_delta_probe(struct platform_device *pdev)
static struct platform_device *cx20442_platform_device;
static int __init ams_delta_module_init(void)
{ {
struct snd_soc_card *card = &ams_delta_audio_card;
int ret; int ret;
if (!(machine_is_ams_delta())) card->dev = &pdev->dev;
return -ENODEV;
ams_delta_audio_platform_device =
platform_device_alloc("soc-audio", -1);
if (!ams_delta_audio_platform_device)
return -ENOMEM;
platform_set_drvdata(ams_delta_audio_platform_device, ret = snd_soc_register_card(card);
&ams_delta_audio_card); if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
ret = platform_device_add(ams_delta_audio_platform_device); card->dev = NULL;
if (ret) return 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);
return 0; 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) 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"); "failed to unregister V253 line discipline\n");
snd_soc_jack_free_gpios(&ams_delta_hook_switch, snd_soc_jack_free_gpios(&ams_delta_hook_switch,
ARRAY_SIZE(ams_delta_hook_switch_gpios), ARRAY_SIZE(ams_delta_hook_switch_gpios),
ams_delta_hook_switch_gpios); ams_delta_hook_switch_gpios);
platform_device_unregister(cx20442_platform_device); snd_soc_unregister_card(card);
platform_device_unregister(ams_delta_audio_platform_device); 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 <jkrzyszt@tis.icnet.pl>"); MODULE_AUTHOR("Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>");
MODULE_DESCRIPTION("ALSA SoC driver for Amstrad E3 (Delta) videophone"); MODULE_DESCRIPTION("ALSA SoC driver for Amstrad E3 (Delta) videophone");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRV_NAME);
...@@ -216,7 +216,7 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd) ...@@ -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_hf, "Ext Spk");
twl6040_disconnect_pin(dapm, pdata->has_ep, "Earphone 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_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_hsmic, "Headset Mic");
twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic"); twl6040_disconnect_pin(dapm, pdata->has_mainmic, "Main Handset Mic");
twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic"); twl6040_disconnect_pin(dapm, pdata->has_submic, "Sub Handset Mic");
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <plat/omap_hwmod.h>
#include "omap-mcpdm.h" #include "omap-mcpdm.h"
#include "omap-pcm.h" #include "omap-pcm.h"
...@@ -260,13 +259,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream, ...@@ -260,13 +259,9 @@ static int omap_mcpdm_dai_startup(struct snd_pcm_substream *substream,
mutex_lock(&mcpdm->mutex); mutex_lock(&mcpdm->mutex);
if (!dai->active) { if (!dai->active) {
/* Enable watch dog for ES above ES 1.0 to avoid saturation */ u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
if (omap_rev() != OMAP4430_REV_ES1_0) {
u32 ctrl = omap_mcpdm_read(mcpdm, MCPDM_REG_CTRL);
omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, omap_mcpdm_write(mcpdm, MCPDM_REG_CTRL, ctrl | MCPDM_WD_EN);
ctrl | MCPDM_WD_EN);
}
omap_mcpdm_open_streams(mcpdm); omap_mcpdm_open_streams(mcpdm);
} }
mutex_unlock(&mcpdm->mutex); mutex_unlock(&mcpdm->mutex);
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/dmaengine.h> #include <linux/dmaengine.h>
#include <linux/platform_data/dma-mmp_tdma.h>
#include <linux/platform_data/mmp_audio.h> #include <linux/platform_data/mmp_audio.h>
#include <sound/pxa2xx-lib.h> #include <sound/pxa2xx-lib.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <mach/sram.h>
#include <sound/dmaengine_pcm.h> #include <sound/dmaengine_pcm.h>
struct mmp_dma_data { struct mmp_dma_data {
......
...@@ -212,7 +212,7 @@ static struct snd_soc_dai_link bells_dai_wm5102[] = { ...@@ -212,7 +212,7 @@ static struct snd_soc_dai_link bells_dai_wm5102[] = {
{ {
.name = "Sub", .name = "Sub",
.stream_name = "Sub", .stream_name = "Sub",
.cpu_dai_name = "wm5102-aif3", .cpu_dai_name = "wm5110-aif3",
.codec_dai_name = "wm9081-hifi", .codec_dai_name = "wm9081-hifi",
.codec_name = "wm9081.1-006c", .codec_name = "wm9081.1-006c",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
...@@ -247,7 +247,7 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = { ...@@ -247,7 +247,7 @@ static struct snd_soc_dai_link bells_dai_wm5110[] = {
{ {
.name = "Sub", .name = "Sub",
.stream_name = "Sub", .stream_name = "Sub",
.cpu_dai_name = "wm5102-aif3", .cpu_dai_name = "wm5110-aif3",
.codec_dai_name = "wm9081-hifi", .codec_dai_name = "wm9081-hifi",
.codec_name = "wm9081.1-006c", .codec_name = "wm9081.1-006c",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/sh_dma.h> #include <linux/sh_dma.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/workqueue.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/sh_fsi.h> #include <sound/sh_fsi.h>
...@@ -223,7 +224,7 @@ struct fsi_stream { ...@@ -223,7 +224,7 @@ struct fsi_stream {
*/ */
struct dma_chan *chan; struct dma_chan *chan;
struct sh_dmae_slave slave; /* see fsi_handler_init() */ struct sh_dmae_slave slave; /* see fsi_handler_init() */
struct tasklet_struct tasklet; struct work_struct work;
dma_addr_t dma; dma_addr_t dma;
}; };
...@@ -1085,9 +1086,9 @@ static void fsi_dma_complete(void *data) ...@@ -1085,9 +1086,9 @@ static void fsi_dma_complete(void *data)
snd_pcm_period_elapsed(io->substream); snd_pcm_period_elapsed(io->substream);
} }
static void fsi_dma_do_tasklet(unsigned long data) static void fsi_dma_do_work(struct work_struct *work)
{ {
struct fsi_stream *io = (struct fsi_stream *)data; struct fsi_stream *io = container_of(work, struct fsi_stream, work);
struct fsi_priv *fsi = fsi_stream_to_priv(io); struct fsi_priv *fsi = fsi_stream_to_priv(io);
struct snd_soc_dai *dai; struct snd_soc_dai *dai;
struct dma_async_tx_descriptor *desc; struct dma_async_tx_descriptor *desc;
...@@ -1129,7 +1130,7 @@ static void fsi_dma_do_tasklet(unsigned long data) ...@@ -1129,7 +1130,7 @@ static void fsi_dma_do_tasklet(unsigned long data)
* FIXME * FIXME
* *
* In DMAEngine case, codec and FSI cannot be started simultaneously * In DMAEngine case, codec and FSI cannot be started simultaneously
* since FSI is using tasklet. * since FSI is using the scheduler work queue.
* Therefore, in capture case, probably FSI FIFO will have got * Therefore, in capture case, probably FSI FIFO will have got
* overflow error in this point. * overflow error in this point.
* in that case, DMA cannot start transfer until error was cleared. * in that case, DMA cannot start transfer until error was cleared.
...@@ -1153,7 +1154,7 @@ static bool fsi_dma_filter(struct dma_chan *chan, void *param) ...@@ -1153,7 +1154,7 @@ static bool fsi_dma_filter(struct dma_chan *chan, void *param)
static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io) static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io)
{ {
tasklet_schedule(&io->tasklet); schedule_work(&io->work);
return 0; return 0;
} }
...@@ -1195,14 +1196,14 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev ...@@ -1195,14 +1196,14 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev
return fsi_stream_probe(fsi, dev); return fsi_stream_probe(fsi, dev);
} }
tasklet_init(&io->tasklet, fsi_dma_do_tasklet, (unsigned long)io); INIT_WORK(&io->work, fsi_dma_do_work);
return 0; return 0;
} }
static int fsi_dma_remove(struct fsi_priv *fsi, struct fsi_stream *io) static int fsi_dma_remove(struct fsi_priv *fsi, struct fsi_stream *io)
{ {
tasklet_kill(&io->tasklet); cancel_work_sync(&io->work);
fsi_stream_stop(fsi, io); fsi_stream_stop(fsi, io);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/** /**
* snd_soc_jack_new - Create a new jack * snd_soc_jack_new - Create a new jack
* @card: ASoC card * @codec: ASoC codec
* @id: an identifying string for this jack * @id: an identifying string for this jack
* @type: a bitmask of enum snd_jack_type values that can be detected by * @type: a bitmask of enum snd_jack_type values that can be detected by
* this jack * this jack
...@@ -133,12 +133,13 @@ EXPORT_SYMBOL_GPL(snd_soc_jack_add_zones); ...@@ -133,12 +133,13 @@ EXPORT_SYMBOL_GPL(snd_soc_jack_add_zones);
/** /**
* snd_soc_jack_get_type - Based on the mic bias value, this function returns * snd_soc_jack_get_type - Based on the mic bias value, this function returns
* the type of jack from the zones delcared in the jack type * the type of jack from the zones declared in the jack type
* *
* @jack: ASoC jack
* @micbias_voltage: mic bias voltage at adc channel when jack is plugged in * @micbias_voltage: mic bias voltage at adc channel when jack is plugged in
* *
* Based on the mic bias value passed, this function helps identify * Based on the mic bias value passed, this function helps identify
* the type of jack from the already delcared jack zones * the type of jack from the already declared jack zones
*/ */
int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage) int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage)
{ {
......
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