Commit 720e87ef authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: pcm: fix infinite loop in snd_pcm_update_hw_ptr0()
  ALSA: HDA: Add dock mic quirk for Lenovo Thinkpad X220
  ALSA: ens1371: fix Creative Ectiva support
  ALSA: firewire-speakers: fix hang when unplugging a running device
  ASoC: Fix CODEC device name for Corgi
  ALSA: hda - Fix pin-config of Gigabyte mobo
  ASoC: imx: fix burstsize for DMA
  ASoC: imx: set watermarks for mx2-dma
  ASoC: twl6040: Return -ENOMEM if create_singlethread_workqueue fails
  ASoC: tlv320dac33: Restore L/R DAC power control register
  ASoC: Explicitly say registerless widgets have no register
  ASoC: tlv320dac33: Fix inconsistent spinlock usage
parents ccd00d10 a0334c50
...@@ -45,25 +45,25 @@ ...@@ -45,25 +45,25 @@
/* platform domain */ /* platform domain */
#define SND_SOC_DAPM_INPUT(wname) \ #define SND_SOC_DAPM_INPUT(wname) \
{ .id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \ { .id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \
.num_kcontrols = 0} .num_kcontrols = 0, .reg = SND_SOC_NOPM }
#define SND_SOC_DAPM_OUTPUT(wname) \ #define SND_SOC_DAPM_OUTPUT(wname) \
{ .id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \ { .id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \
.num_kcontrols = 0} .num_kcontrols = 0, .reg = SND_SOC_NOPM }
#define SND_SOC_DAPM_MIC(wname, wevent) \ #define SND_SOC_DAPM_MIC(wname, wevent) \
{ .id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \ { .id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \
.num_kcontrols = 0, .event = wevent, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
.event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
#define SND_SOC_DAPM_HP(wname, wevent) \ #define SND_SOC_DAPM_HP(wname, wevent) \
{ .id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \ { .id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \
.num_kcontrols = 0, .event = wevent, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
.event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
#define SND_SOC_DAPM_SPK(wname, wevent) \ #define SND_SOC_DAPM_SPK(wname, wevent) \
{ .id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \ { .id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \
.num_kcontrols = 0, .event = wevent, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
.event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
#define SND_SOC_DAPM_LINE(wname, wevent) \ #define SND_SOC_DAPM_LINE(wname, wevent) \
{ .id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \ { .id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \
.num_kcontrols = 0, .event = wevent, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
.event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
/* path domain */ /* path domain */
...@@ -189,11 +189,11 @@ ...@@ -189,11 +189,11 @@
/* events that are pre and post DAPM */ /* events that are pre and post DAPM */
#define SND_SOC_DAPM_PRE(wname, wevent) \ #define SND_SOC_DAPM_PRE(wname, wevent) \
{ .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ { .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \
.num_kcontrols = 0, .event = wevent, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
.event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD} .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD}
#define SND_SOC_DAPM_POST(wname, wevent) \ #define SND_SOC_DAPM_POST(wname, wevent) \
{ .id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \ { .id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \
.num_kcontrols = 0, .event = wevent, \ .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
.event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD}
/* stream domain */ /* stream domain */
......
...@@ -375,6 +375,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, ...@@ -375,6 +375,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
} }
if (runtime->no_period_wakeup) { if (runtime->no_period_wakeup) {
snd_pcm_sframes_t xrun_threshold;
/* /*
* Without regular period interrupts, we have to check * Without regular period interrupts, we have to check
* the elapsed time to detect xruns. * the elapsed time to detect xruns.
...@@ -383,7 +384,8 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, ...@@ -383,7 +384,8 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
if (jdelta < runtime->hw_ptr_buffer_jiffies / 2) if (jdelta < runtime->hw_ptr_buffer_jiffies / 2)
goto no_delta_check; goto no_delta_check;
hdelta = jdelta - delta * HZ / runtime->rate; hdelta = jdelta - delta * HZ / runtime->rate;
while (hdelta > runtime->hw_ptr_buffer_jiffies / 2 + 1) { xrun_threshold = runtime->hw_ptr_buffer_jiffies / 2 + 1;
while (hdelta > xrun_threshold) {
delta += runtime->buffer_size; delta += runtime->buffer_size;
hw_base += runtime->buffer_size; hw_base += runtime->buffer_size;
if (hw_base >= runtime->boundary) if (hw_base >= runtime->boundary)
......
...@@ -778,10 +778,9 @@ static int __devexit fwspk_remove(struct device *dev) ...@@ -778,10 +778,9 @@ static int __devexit fwspk_remove(struct device *dev)
{ {
struct fwspk *fwspk = dev_get_drvdata(dev); struct fwspk *fwspk = dev_get_drvdata(dev);
snd_card_disconnect(fwspk->card);
mutex_lock(&fwspk->mutex); mutex_lock(&fwspk->mutex);
amdtp_out_stream_pcm_abort(&fwspk->stream); amdtp_out_stream_pcm_abort(&fwspk->stream);
snd_card_disconnect(fwspk->card);
fwspk_stop_stream(fwspk); fwspk_stop_stream(fwspk);
mutex_unlock(&fwspk->mutex); mutex_unlock(&fwspk->mutex);
......
...@@ -229,6 +229,7 @@ MODULE_PARM_DESC(lineio, "Line In to Rear Out (0 = auto, 1 = force)."); ...@@ -229,6 +229,7 @@ MODULE_PARM_DESC(lineio, "Line In to Rear Out (0 = auto, 1 = force).");
#define ES_REG_1371_CODEC 0x14 /* W/R: Codec Read/Write register address */ #define ES_REG_1371_CODEC 0x14 /* W/R: Codec Read/Write register address */
#define ES_1371_CODEC_RDY (1<<31) /* codec ready */ #define ES_1371_CODEC_RDY (1<<31) /* codec ready */
#define ES_1371_CODEC_WIP (1<<30) /* codec register access in progress */ #define ES_1371_CODEC_WIP (1<<30) /* codec register access in progress */
#define EV_1938_CODEC_MAGIC (1<<26)
#define ES_1371_CODEC_PIRD (1<<23) /* codec read/write select register */ #define ES_1371_CODEC_PIRD (1<<23) /* codec read/write select register */
#define ES_1371_CODEC_WRITE(a,d) ((((a)&0x7f)<<16)|(((d)&0xffff)<<0)) #define ES_1371_CODEC_WRITE(a,d) ((((a)&0x7f)<<16)|(((d)&0xffff)<<0))
#define ES_1371_CODEC_READS(a) ((((a)&0x7f)<<16)|ES_1371_CODEC_PIRD) #define ES_1371_CODEC_READS(a) ((((a)&0x7f)<<16)|ES_1371_CODEC_PIRD)
...@@ -603,12 +604,18 @@ static void snd_es1370_codec_write(struct snd_ak4531 *ak4531, ...@@ -603,12 +604,18 @@ static void snd_es1370_codec_write(struct snd_ak4531 *ak4531,
#ifdef CHIP1371 #ifdef CHIP1371
static inline bool is_ev1938(struct ensoniq *ensoniq)
{
return ensoniq->pci->device == 0x8938;
}
static void snd_es1371_codec_write(struct snd_ac97 *ac97, static void snd_es1371_codec_write(struct snd_ac97 *ac97,
unsigned short reg, unsigned short val) unsigned short reg, unsigned short val)
{ {
struct ensoniq *ensoniq = ac97->private_data; struct ensoniq *ensoniq = ac97->private_data;
unsigned int t, x; unsigned int t, x, flag;
flag = is_ev1938(ensoniq) ? EV_1938_CODEC_MAGIC : 0;
mutex_lock(&ensoniq->src_mutex); mutex_lock(&ensoniq->src_mutex);
for (t = 0; t < POLL_COUNT; t++) { for (t = 0; t < POLL_COUNT; t++) {
if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) { if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
...@@ -630,7 +637,8 @@ static void snd_es1371_codec_write(struct snd_ac97 *ac97, ...@@ -630,7 +637,8 @@ static void snd_es1371_codec_write(struct snd_ac97 *ac97,
0x00010000) 0x00010000)
break; break;
} }
outl(ES_1371_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1371_CODEC)); outl(ES_1371_CODEC_WRITE(reg, val) | flag,
ES_REG(ensoniq, 1371_CODEC));
/* restore SRC reg */ /* restore SRC reg */
snd_es1371_wait_src_ready(ensoniq); snd_es1371_wait_src_ready(ensoniq);
outl(x, ES_REG(ensoniq, 1371_SMPRATE)); outl(x, ES_REG(ensoniq, 1371_SMPRATE));
...@@ -647,8 +655,9 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97, ...@@ -647,8 +655,9 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97,
unsigned short reg) unsigned short reg)
{ {
struct ensoniq *ensoniq = ac97->private_data; struct ensoniq *ensoniq = ac97->private_data;
unsigned int t, x, fail = 0; unsigned int t, x, flag, fail = 0;
flag = is_ev1938(ensoniq) ? EV_1938_CODEC_MAGIC : 0;
__again: __again:
mutex_lock(&ensoniq->src_mutex); mutex_lock(&ensoniq->src_mutex);
for (t = 0; t < POLL_COUNT; t++) { for (t = 0; t < POLL_COUNT; t++) {
...@@ -671,7 +680,8 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97, ...@@ -671,7 +680,8 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97,
0x00010000) 0x00010000)
break; break;
} }
outl(ES_1371_CODEC_READS(reg), ES_REG(ensoniq, 1371_CODEC)); outl(ES_1371_CODEC_READS(reg) | flag,
ES_REG(ensoniq, 1371_CODEC));
/* restore SRC reg */ /* restore SRC reg */
snd_es1371_wait_src_ready(ensoniq); snd_es1371_wait_src_ready(ensoniq);
outl(x, ES_REG(ensoniq, 1371_SMPRATE)); outl(x, ES_REG(ensoniq, 1371_SMPRATE));
...@@ -683,6 +693,11 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97, ...@@ -683,6 +693,11 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97,
/* now wait for the stinkin' data (RDY) */ /* now wait for the stinkin' data (RDY) */
for (t = 0; t < POLL_COUNT; t++) { for (t = 0; t < POLL_COUNT; t++) {
if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) { if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) {
if (is_ev1938(ensoniq)) {
for (t = 0; t < 100; t++)
inl(ES_REG(ensoniq, CONTROL));
x = inl(ES_REG(ensoniq, 1371_CODEC));
}
mutex_unlock(&ensoniq->src_mutex); mutex_unlock(&ensoniq->src_mutex);
return ES_1371_CODEC_READ(x); return ES_1371_CODEC_READ(x);
} }
......
...@@ -3034,6 +3034,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { ...@@ -3034,6 +3034,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS), SND_PCI_QUIRK(0x17aa, 0x21c6, "Thinkpad Edge 13", CXT5066_ASUS),
SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD), SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo Thinkpad", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x21da, "Lenovo X220", CXT5066_THINKPAD),
SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS), SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
{} {}
......
...@@ -9863,7 +9863,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = { ...@@ -9863,7 +9863,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL), SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL),
SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch), SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch),
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG),
SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG), SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG),
SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG), SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG),
...@@ -10700,6 +10699,7 @@ enum { ...@@ -10700,6 +10699,7 @@ enum {
PINFIX_LENOVO_Y530, PINFIX_LENOVO_Y530,
PINFIX_PB_M5210, PINFIX_PB_M5210,
PINFIX_ACER_ASPIRE_7736, PINFIX_ACER_ASPIRE_7736,
PINFIX_GIGABYTE_880GM,
}; };
static const struct alc_fixup alc882_fixups[] = { static const struct alc_fixup alc882_fixups[] = {
...@@ -10731,6 +10731,13 @@ static const struct alc_fixup alc882_fixups[] = { ...@@ -10731,6 +10731,13 @@ static const struct alc_fixup alc882_fixups[] = {
.type = ALC_FIXUP_SKU, .type = ALC_FIXUP_SKU,
.v.sku = ALC_FIXUP_SKU_IGNORE, .v.sku = ALC_FIXUP_SKU_IGNORE,
}, },
[PINFIX_GIGABYTE_880GM] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x14, 0x1114410 }, /* set as speaker */
{ }
}
},
}; };
static struct snd_pci_quirk alc882_fixup_tbl[] = { static struct snd_pci_quirk alc882_fixup_tbl[] = {
...@@ -10738,6 +10745,7 @@ static struct snd_pci_quirk alc882_fixup_tbl[] = { ...@@ -10738,6 +10745,7 @@ static struct snd_pci_quirk alc882_fixup_tbl[] = {
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", PINFIX_LENOVO_Y530), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", PINFIX_LENOVO_Y530),
SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX), SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", PINFIX_ACER_ASPIRE_7736), SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", PINFIX_ACER_ASPIRE_7736),
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte", PINFIX_GIGABYTE_880GM),
{} {}
}; };
...@@ -18774,8 +18782,6 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = { ...@@ -18774,8 +18782,6 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
ALC662_3ST_6ch_DIG), ALC662_3ST_6ch_DIG),
SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO), SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO),
SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10),
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
ALC662_3ST_6ch_DIG),
SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13), SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13),
SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG), SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG),
SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA), SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA),
...@@ -19449,6 +19455,7 @@ enum { ...@@ -19449,6 +19455,7 @@ enum {
ALC662_FIXUP_IDEAPAD, ALC662_FIXUP_IDEAPAD,
ALC272_FIXUP_MARIO, ALC272_FIXUP_MARIO,
ALC662_FIXUP_CZC_P10T, ALC662_FIXUP_CZC_P10T,
ALC662_FIXUP_GIGABYTE,
}; };
static const struct alc_fixup alc662_fixups[] = { static const struct alc_fixup alc662_fixups[] = {
...@@ -19477,12 +19484,20 @@ static const struct alc_fixup alc662_fixups[] = { ...@@ -19477,12 +19484,20 @@ static const struct alc_fixup alc662_fixups[] = {
{} {}
} }
}, },
[ALC662_FIXUP_GIGABYTE] = {
.type = ALC_FIXUP_PINS,
.v.pins = (const struct alc_pincfg[]) {
{ 0x14, 0x1114410 }, /* set as speaker */
{ }
}
},
}; };
static struct snd_pci_quirk alc662_fixup_tbl[] = { static struct snd_pci_quirk alc662_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte", ALC662_FIXUP_GIGABYTE),
SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
......
...@@ -324,6 +324,10 @@ static void dac33_init_chip(struct snd_soc_codec *codec) ...@@ -324,6 +324,10 @@ static void dac33_init_chip(struct snd_soc_codec *codec)
dac33_write(codec, DAC33_OUT_AMP_CTRL, dac33_write(codec, DAC33_OUT_AMP_CTRL,
dac33_read_reg_cache(codec, DAC33_OUT_AMP_CTRL)); dac33_read_reg_cache(codec, DAC33_OUT_AMP_CTRL));
dac33_write(codec, DAC33_LDAC_PWR_CTRL,
dac33_read_reg_cache(codec, DAC33_LDAC_PWR_CTRL));
dac33_write(codec, DAC33_RDAC_PWR_CTRL,
dac33_read_reg_cache(codec, DAC33_RDAC_PWR_CTRL));
} }
static inline int dac33_read_id(struct snd_soc_codec *codec) static inline int dac33_read_id(struct snd_soc_codec *codec)
...@@ -670,6 +674,7 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) ...@@ -670,6 +674,7 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
{ {
struct snd_soc_codec *codec = dac33->codec; struct snd_soc_codec *codec = dac33->codec;
unsigned int delay; unsigned int delay;
unsigned long flags;
switch (dac33->fifo_mode) { switch (dac33->fifo_mode) {
case DAC33_FIFO_MODE1: case DAC33_FIFO_MODE1:
...@@ -677,10 +682,10 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) ...@@ -677,10 +682,10 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
DAC33_THRREG(dac33->nsample)); DAC33_THRREG(dac33->nsample));
/* Take the timestamps */ /* Take the timestamps */
spin_lock_irq(&dac33->lock); spin_lock_irqsave(&dac33->lock, flags);
dac33->t_stamp2 = ktime_to_us(ktime_get()); dac33->t_stamp2 = ktime_to_us(ktime_get());
dac33->t_stamp1 = dac33->t_stamp2; dac33->t_stamp1 = dac33->t_stamp2;
spin_unlock_irq(&dac33->lock); spin_unlock_irqrestore(&dac33->lock, flags);
dac33_write16(codec, DAC33_PREFILL_MSB, dac33_write16(codec, DAC33_PREFILL_MSB,
DAC33_THRREG(dac33->alarm_threshold)); DAC33_THRREG(dac33->alarm_threshold));
...@@ -692,11 +697,11 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) ...@@ -692,11 +697,11 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
break; break;
case DAC33_FIFO_MODE7: case DAC33_FIFO_MODE7:
/* Take the timestamp */ /* Take the timestamp */
spin_lock_irq(&dac33->lock); spin_lock_irqsave(&dac33->lock, flags);
dac33->t_stamp1 = ktime_to_us(ktime_get()); dac33->t_stamp1 = ktime_to_us(ktime_get());
/* Move back the timestamp with drain time */ /* Move back the timestamp with drain time */
dac33->t_stamp1 -= dac33->mode7_us_to_lthr; dac33->t_stamp1 -= dac33->mode7_us_to_lthr;
spin_unlock_irq(&dac33->lock); spin_unlock_irqrestore(&dac33->lock, flags);
dac33_write16(codec, DAC33_PREFILL_MSB, dac33_write16(codec, DAC33_PREFILL_MSB,
DAC33_THRREG(DAC33_MODE7_MARGIN)); DAC33_THRREG(DAC33_MODE7_MARGIN));
...@@ -714,13 +719,14 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33) ...@@ -714,13 +719,14 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
static inline void dac33_playback_handler(struct tlv320dac33_priv *dac33) static inline void dac33_playback_handler(struct tlv320dac33_priv *dac33)
{ {
struct snd_soc_codec *codec = dac33->codec; struct snd_soc_codec *codec = dac33->codec;
unsigned long flags;
switch (dac33->fifo_mode) { switch (dac33->fifo_mode) {
case DAC33_FIFO_MODE1: case DAC33_FIFO_MODE1:
/* Take the timestamp */ /* Take the timestamp */
spin_lock_irq(&dac33->lock); spin_lock_irqsave(&dac33->lock, flags);
dac33->t_stamp2 = ktime_to_us(ktime_get()); dac33->t_stamp2 = ktime_to_us(ktime_get());
spin_unlock_irq(&dac33->lock); spin_unlock_irqrestore(&dac33->lock, flags);
dac33_write16(codec, DAC33_NSAMPLE_MSB, dac33_write16(codec, DAC33_NSAMPLE_MSB,
DAC33_THRREG(dac33->nsample)); DAC33_THRREG(dac33->nsample));
...@@ -773,10 +779,11 @@ static irqreturn_t dac33_interrupt_handler(int irq, void *dev) ...@@ -773,10 +779,11 @@ static irqreturn_t dac33_interrupt_handler(int irq, void *dev)
{ {
struct snd_soc_codec *codec = dev; struct snd_soc_codec *codec = dev;
struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
unsigned long flags;
spin_lock(&dac33->lock); spin_lock_irqsave(&dac33->lock, flags);
dac33->t_stamp1 = ktime_to_us(ktime_get()); dac33->t_stamp1 = ktime_to_us(ktime_get());
spin_unlock(&dac33->lock); spin_unlock_irqrestore(&dac33->lock, flags);
/* Do not schedule the workqueue in Mode7 */ /* Do not schedule the workqueue in Mode7 */
if (dac33->fifo_mode != DAC33_FIFO_MODE7) if (dac33->fifo_mode != DAC33_FIFO_MODE7)
...@@ -1173,15 +1180,16 @@ static snd_pcm_sframes_t dac33_dai_delay( ...@@ -1173,15 +1180,16 @@ static snd_pcm_sframes_t dac33_dai_delay(
unsigned int time_delta, uthr; unsigned int time_delta, uthr;
int samples_out, samples_in, samples; int samples_out, samples_in, samples;
snd_pcm_sframes_t delay = 0; snd_pcm_sframes_t delay = 0;
unsigned long flags;
switch (dac33->fifo_mode) { switch (dac33->fifo_mode) {
case DAC33_FIFO_BYPASS: case DAC33_FIFO_BYPASS:
break; break;
case DAC33_FIFO_MODE1: case DAC33_FIFO_MODE1:
spin_lock(&dac33->lock); spin_lock_irqsave(&dac33->lock, flags);
t0 = dac33->t_stamp1; t0 = dac33->t_stamp1;
t1 = dac33->t_stamp2; t1 = dac33->t_stamp2;
spin_unlock(&dac33->lock); spin_unlock_irqrestore(&dac33->lock, flags);
t_now = ktime_to_us(ktime_get()); t_now = ktime_to_us(ktime_get());
/* We have not started to fill the FIFO yet, delay is 0 */ /* We have not started to fill the FIFO yet, delay is 0 */
...@@ -1246,10 +1254,10 @@ static snd_pcm_sframes_t dac33_dai_delay( ...@@ -1246,10 +1254,10 @@ static snd_pcm_sframes_t dac33_dai_delay(
} }
break; break;
case DAC33_FIFO_MODE7: case DAC33_FIFO_MODE7:
spin_lock(&dac33->lock); spin_lock_irqsave(&dac33->lock, flags);
t0 = dac33->t_stamp1; t0 = dac33->t_stamp1;
uthr = dac33->uthr; uthr = dac33->uthr;
spin_unlock(&dac33->lock); spin_unlock_irqrestore(&dac33->lock, flags);
t_now = ktime_to_us(ktime_get()); t_now = ktime_to_us(ktime_get());
/* We have not started to fill the FIFO yet, delay is 0 */ /* We have not started to fill the FIFO yet, delay is 0 */
......
...@@ -1629,8 +1629,10 @@ static int twl6040_probe(struct snd_soc_codec *codec) ...@@ -1629,8 +1629,10 @@ static int twl6040_probe(struct snd_soc_codec *codec)
priv->naudint = naudint; priv->naudint = naudint;
priv->workqueue = create_singlethread_workqueue("twl6040-codec"); priv->workqueue = create_singlethread_workqueue("twl6040-codec");
if (!priv->workqueue) if (!priv->workqueue) {
ret = -ENOMEM;
goto work_err; goto work_err;
}
INIT_DELAYED_WORK(&priv->delayed_work, twl6040_accessory_work); INIT_DELAYED_WORK(&priv->delayed_work, twl6040_accessory_work);
......
...@@ -110,12 +110,12 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, ...@@ -110,12 +110,12 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream,
slave_config.direction = DMA_TO_DEVICE; slave_config.direction = DMA_TO_DEVICE;
slave_config.dst_addr = dma_params->dma_addr; slave_config.dst_addr = dma_params->dma_addr;
slave_config.dst_addr_width = buswidth; slave_config.dst_addr_width = buswidth;
slave_config.dst_maxburst = dma_params->burstsize; slave_config.dst_maxburst = dma_params->burstsize * buswidth;
} else { } else {
slave_config.direction = DMA_FROM_DEVICE; slave_config.direction = DMA_FROM_DEVICE;
slave_config.src_addr = dma_params->dma_addr; slave_config.src_addr = dma_params->dma_addr;
slave_config.src_addr_width = buswidth; slave_config.src_addr_width = buswidth;
slave_config.src_maxburst = dma_params->burstsize; slave_config.src_maxburst = dma_params->burstsize * buswidth;
} }
ret = dmaengine_slave_config(iprtd->dma_chan, &slave_config); ret = dmaengine_slave_config(iprtd->dma_chan, &slave_config);
...@@ -303,6 +303,11 @@ static struct snd_soc_platform_driver imx_soc_platform_mx2 = { ...@@ -303,6 +303,11 @@ static struct snd_soc_platform_driver imx_soc_platform_mx2 = {
static int __devinit imx_soc_platform_probe(struct platform_device *pdev) static int __devinit imx_soc_platform_probe(struct platform_device *pdev)
{ {
struct imx_ssi *ssi = platform_get_drvdata(pdev);
ssi->dma_params_tx.burstsize = 6;
ssi->dma_params_rx.burstsize = 4;
return snd_soc_register_platform(&pdev->dev, &imx_soc_platform_mx2); return snd_soc_register_platform(&pdev->dev, &imx_soc_platform_mx2);
} }
......
...@@ -234,7 +234,4 @@ void imx_pcm_free(struct snd_pcm *pcm); ...@@ -234,7 +234,4 @@ void imx_pcm_free(struct snd_pcm *pcm);
*/ */
#define IMX_SSI_DMABUF_SIZE (64 * 1024) #define IMX_SSI_DMABUF_SIZE (64 * 1024)
#define DMA_RXFIFO_BURST 0x4
#define DMA_TXFIFO_BURST 0x6
#endif /* _IMX_SSI_H */ #endif /* _IMX_SSI_H */
...@@ -310,7 +310,7 @@ static struct snd_soc_dai_link corgi_dai = { ...@@ -310,7 +310,7 @@ static struct snd_soc_dai_link corgi_dai = {
.cpu_dai_name = "pxa2xx-i2s", .cpu_dai_name = "pxa2xx-i2s",
.codec_dai_name = "wm8731-hifi", .codec_dai_name = "wm8731-hifi",
.platform_name = "pxa-pcm-audio", .platform_name = "pxa-pcm-audio",
.codec_name = "wm8731-codec-0.001b", .codec_name = "wm8731-codec.0-001b",
.init = corgi_wm8731_init, .init = corgi_wm8731_init,
.ops = &corgi_ops, .ops = &corgi_ops,
}; };
......
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