aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_realtek.c21
-rw-r--r--sound/soc/codecs/tlv320dac33.c32
-rw-r--r--sound/soc/codecs/twl6040.c4
3 files changed, 41 insertions, 16 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 0ef0035fe99f..12c6f4508c54 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9863,7 +9863,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = {
9863 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD), 9863 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC883_LAPTOP_EAPD),
9864 SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL), 9864 SND_PCI_QUIRK(0x10f1, 0x2350, "TYAN-S2350", ALC888_6ST_DELL),
9865 SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch), 9865 SND_PCI_QUIRK(0x108e, 0x534d, NULL, ALC883_3ST_6ch),
9866 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte P35 DS3R", ALC882_6ST_DIG),
9867 9866
9868 SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG), 9867 SND_PCI_QUIRK(0x1462, 0x0349, "MSI", ALC883_TARGA_2ch_DIG),
9869 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG), 9868 SND_PCI_QUIRK(0x1462, 0x040d, "MSI", ALC883_TARGA_2ch_DIG),
@@ -10700,6 +10699,7 @@ enum {
10700 PINFIX_LENOVO_Y530, 10699 PINFIX_LENOVO_Y530,
10701 PINFIX_PB_M5210, 10700 PINFIX_PB_M5210,
10702 PINFIX_ACER_ASPIRE_7736, 10701 PINFIX_ACER_ASPIRE_7736,
10702 PINFIX_GIGABYTE_880GM,
10703}; 10703};
10704 10704
10705static const struct alc_fixup alc882_fixups[] = { 10705static const struct alc_fixup alc882_fixups[] = {
@@ -10731,6 +10731,13 @@ static const struct alc_fixup alc882_fixups[] = {
10731 .type = ALC_FIXUP_SKU, 10731 .type = ALC_FIXUP_SKU,
10732 .v.sku = ALC_FIXUP_SKU_IGNORE, 10732 .v.sku = ALC_FIXUP_SKU_IGNORE,
10733 }, 10733 },
10734 [PINFIX_GIGABYTE_880GM] = {
10735 .type = ALC_FIXUP_PINS,
10736 .v.pins = (const struct alc_pincfg[]) {
10737 { 0x14, 0x1114410 }, /* set as speaker */
10738 { }
10739 }
10740 },
10734}; 10741};
10735 10742
10736static struct snd_pci_quirk alc882_fixup_tbl[] = { 10743static struct snd_pci_quirk alc882_fixup_tbl[] = {
@@ -10738,6 +10745,7 @@ static struct snd_pci_quirk alc882_fixup_tbl[] = {
10738 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", PINFIX_LENOVO_Y530), 10745 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", PINFIX_LENOVO_Y530),
10739 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX), 10746 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
10740 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", PINFIX_ACER_ASPIRE_7736), 10747 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", PINFIX_ACER_ASPIRE_7736),
10748 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte", PINFIX_GIGABYTE_880GM),
10741 {} 10749 {}
10742}; 10750};
10743 10751
@@ -18774,8 +18782,6 @@ static struct snd_pci_quirk alc662_cfg_tbl[] = {
18774 ALC662_3ST_6ch_DIG), 18782 ALC662_3ST_6ch_DIG),
18775 SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO), 18783 SND_PCI_QUIRK(0x1179, 0xff6e, "Toshiba NB20x", ALC662_AUTO),
18776 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10), 18784 SND_PCI_QUIRK(0x144d, 0xca00, "Samsung NC10", ALC272_SAMSUNG_NC10),
18777 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte 945GCM-S2L",
18778 ALC662_3ST_6ch_DIG),
18779 SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13), 18785 SND_PCI_QUIRK(0x152d, 0x2304, "Quanta WH1", ALC663_ASUS_H13),
18780 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG), 18786 SND_PCI_QUIRK(0x1565, 0x820f, "Biostar TA780G M2+", ALC662_3ST_6ch_DIG),
18781 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA), 18787 SND_PCI_QUIRK(0x1631, 0xc10c, "PB RS65", ALC663_ASUS_M51VA),
@@ -19449,6 +19455,7 @@ enum {
19449 ALC662_FIXUP_IDEAPAD, 19455 ALC662_FIXUP_IDEAPAD,
19450 ALC272_FIXUP_MARIO, 19456 ALC272_FIXUP_MARIO,
19451 ALC662_FIXUP_CZC_P10T, 19457 ALC662_FIXUP_CZC_P10T,
19458 ALC662_FIXUP_GIGABYTE,
19452}; 19459};
19453 19460
19454static const struct alc_fixup alc662_fixups[] = { 19461static const struct alc_fixup alc662_fixups[] = {
@@ -19477,12 +19484,20 @@ static const struct alc_fixup alc662_fixups[] = {
19477 {} 19484 {}
19478 } 19485 }
19479 }, 19486 },
19487 [ALC662_FIXUP_GIGABYTE] = {
19488 .type = ALC_FIXUP_PINS,
19489 .v.pins = (const struct alc_pincfg[]) {
19490 { 0x14, 0x1114410 }, /* set as speaker */
19491 { }
19492 }
19493 },
19480}; 19494};
19481 19495
19482static struct snd_pci_quirk alc662_fixup_tbl[] = { 19496static struct snd_pci_quirk alc662_fixup_tbl[] = {
19483 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE), 19497 SND_PCI_QUIRK(0x1025, 0x0308, "Acer Aspire 8942G", ALC662_FIXUP_ASPIRE),
19484 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 19498 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
19485 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), 19499 SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD),
19500 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte", ALC662_FIXUP_GIGABYTE),
19486 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), 19501 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD),
19487 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), 19502 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
19488 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T), 19503 SND_PCI_QUIRK(0x1b35, 0x2206, "CZC P10T", ALC662_FIXUP_CZC_P10T),
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index 00b6d87e7bdb..eb1a0b4e09b6 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -324,6 +324,10 @@ static void dac33_init_chip(struct snd_soc_codec *codec)
324 dac33_write(codec, DAC33_OUT_AMP_CTRL, 324 dac33_write(codec, DAC33_OUT_AMP_CTRL,
325 dac33_read_reg_cache(codec, DAC33_OUT_AMP_CTRL)); 325 dac33_read_reg_cache(codec, DAC33_OUT_AMP_CTRL));
326 326
327 dac33_write(codec, DAC33_LDAC_PWR_CTRL,
328 dac33_read_reg_cache(codec, DAC33_LDAC_PWR_CTRL));
329 dac33_write(codec, DAC33_RDAC_PWR_CTRL,
330 dac33_read_reg_cache(codec, DAC33_RDAC_PWR_CTRL));
327} 331}
328 332
329static inline int dac33_read_id(struct snd_soc_codec *codec) 333static 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{ 674{
671 struct snd_soc_codec *codec = dac33->codec; 675 struct snd_soc_codec *codec = dac33->codec;
672 unsigned int delay; 676 unsigned int delay;
677 unsigned long flags;
673 678
674 switch (dac33->fifo_mode) { 679 switch (dac33->fifo_mode) {
675 case DAC33_FIFO_MODE1: 680 case DAC33_FIFO_MODE1:
@@ -677,10 +682,10 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
677 DAC33_THRREG(dac33->nsample)); 682 DAC33_THRREG(dac33->nsample));
678 683
679 /* Take the timestamps */ 684 /* Take the timestamps */
680 spin_lock_irq(&dac33->lock); 685 spin_lock_irqsave(&dac33->lock, flags);
681 dac33->t_stamp2 = ktime_to_us(ktime_get()); 686 dac33->t_stamp2 = ktime_to_us(ktime_get());
682 dac33->t_stamp1 = dac33->t_stamp2; 687 dac33->t_stamp1 = dac33->t_stamp2;
683 spin_unlock_irq(&dac33->lock); 688 spin_unlock_irqrestore(&dac33->lock, flags);
684 689
685 dac33_write16(codec, DAC33_PREFILL_MSB, 690 dac33_write16(codec, DAC33_PREFILL_MSB,
686 DAC33_THRREG(dac33->alarm_threshold)); 691 DAC33_THRREG(dac33->alarm_threshold));
@@ -692,11 +697,11 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
692 break; 697 break;
693 case DAC33_FIFO_MODE7: 698 case DAC33_FIFO_MODE7:
694 /* Take the timestamp */ 699 /* Take the timestamp */
695 spin_lock_irq(&dac33->lock); 700 spin_lock_irqsave(&dac33->lock, flags);
696 dac33->t_stamp1 = ktime_to_us(ktime_get()); 701 dac33->t_stamp1 = ktime_to_us(ktime_get());
697 /* Move back the timestamp with drain time */ 702 /* Move back the timestamp with drain time */
698 dac33->t_stamp1 -= dac33->mode7_us_to_lthr; 703 dac33->t_stamp1 -= dac33->mode7_us_to_lthr;
699 spin_unlock_irq(&dac33->lock); 704 spin_unlock_irqrestore(&dac33->lock, flags);
700 705
701 dac33_write16(codec, DAC33_PREFILL_MSB, 706 dac33_write16(codec, DAC33_PREFILL_MSB,
702 DAC33_THRREG(DAC33_MODE7_MARGIN)); 707 DAC33_THRREG(DAC33_MODE7_MARGIN));
@@ -714,13 +719,14 @@ static inline void dac33_prefill_handler(struct tlv320dac33_priv *dac33)
714static inline void dac33_playback_handler(struct tlv320dac33_priv *dac33) 719static inline void dac33_playback_handler(struct tlv320dac33_priv *dac33)
715{ 720{
716 struct snd_soc_codec *codec = dac33->codec; 721 struct snd_soc_codec *codec = dac33->codec;
722 unsigned long flags;
717 723
718 switch (dac33->fifo_mode) { 724 switch (dac33->fifo_mode) {
719 case DAC33_FIFO_MODE1: 725 case DAC33_FIFO_MODE1:
720 /* Take the timestamp */ 726 /* Take the timestamp */
721 spin_lock_irq(&dac33->lock); 727 spin_lock_irqsave(&dac33->lock, flags);
722 dac33->t_stamp2 = ktime_to_us(ktime_get()); 728 dac33->t_stamp2 = ktime_to_us(ktime_get());
723 spin_unlock_irq(&dac33->lock); 729 spin_unlock_irqrestore(&dac33->lock, flags);
724 730
725 dac33_write16(codec, DAC33_NSAMPLE_MSB, 731 dac33_write16(codec, DAC33_NSAMPLE_MSB,
726 DAC33_THRREG(dac33->nsample)); 732 DAC33_THRREG(dac33->nsample));
@@ -773,10 +779,11 @@ static irqreturn_t dac33_interrupt_handler(int irq, void *dev)
773{ 779{
774 struct snd_soc_codec *codec = dev; 780 struct snd_soc_codec *codec = dev;
775 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec); 781 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);
782 unsigned long flags;
776 783
777 spin_lock(&dac33->lock); 784 spin_lock_irqsave(&dac33->lock, flags);
778 dac33->t_stamp1 = ktime_to_us(ktime_get()); 785 dac33->t_stamp1 = ktime_to_us(ktime_get());
779 spin_unlock(&dac33->lock); 786 spin_unlock_irqrestore(&dac33->lock, flags);
780 787
781 /* Do not schedule the workqueue in Mode7 */ 788 /* Do not schedule the workqueue in Mode7 */
782 if (dac33->fifo_mode != DAC33_FIFO_MODE7) 789 if (dac33->fifo_mode != DAC33_FIFO_MODE7)
@@ -1173,15 +1180,16 @@ static snd_pcm_sframes_t dac33_dai_delay(
1173 unsigned int time_delta, uthr; 1180 unsigned int time_delta, uthr;
1174 int samples_out, samples_in, samples; 1181 int samples_out, samples_in, samples;
1175 snd_pcm_sframes_t delay = 0; 1182 snd_pcm_sframes_t delay = 0;
1183 unsigned long flags;
1176 1184
1177 switch (dac33->fifo_mode) { 1185 switch (dac33->fifo_mode) {
1178 case DAC33_FIFO_BYPASS: 1186 case DAC33_FIFO_BYPASS:
1179 break; 1187 break;
1180 case DAC33_FIFO_MODE1: 1188 case DAC33_FIFO_MODE1:
1181 spin_lock(&dac33->lock); 1189 spin_lock_irqsave(&dac33->lock, flags);
1182 t0 = dac33->t_stamp1; 1190 t0 = dac33->t_stamp1;
1183 t1 = dac33->t_stamp2; 1191 t1 = dac33->t_stamp2;
1184 spin_unlock(&dac33->lock); 1192 spin_unlock_irqrestore(&dac33->lock, flags);
1185 t_now = ktime_to_us(ktime_get()); 1193 t_now = ktime_to_us(ktime_get());
1186 1194
1187 /* We have not started to fill the FIFO yet, delay is 0 */ 1195 /* 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 } 1254 }
1247 break; 1255 break;
1248 case DAC33_FIFO_MODE7: 1256 case DAC33_FIFO_MODE7:
1249 spin_lock(&dac33->lock); 1257 spin_lock_irqsave(&dac33->lock, flags);
1250 t0 = dac33->t_stamp1; 1258 t0 = dac33->t_stamp1;
1251 uthr = dac33->uthr; 1259 uthr = dac33->uthr;
1252 spin_unlock(&dac33->lock); 1260 spin_unlock_irqrestore(&dac33->lock, flags);
1253 t_now = ktime_to_us(ktime_get()); 1261 t_now = ktime_to_us(ktime_get());
1254 1262
1255 /* We have not started to fill the FIFO yet, delay is 0 */ 1263 /* We have not started to fill the FIFO yet, delay is 0 */
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 482fcdb59bfa..255901c4460d 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1629,8 +1629,10 @@ static int twl6040_probe(struct snd_soc_codec *codec)
1629 priv->naudint = naudint; 1629 priv->naudint = naudint;
1630 priv->workqueue = create_singlethread_workqueue("twl6040-codec"); 1630 priv->workqueue = create_singlethread_workqueue("twl6040-codec");
1631 1631
1632 if (!priv->workqueue) 1632 if (!priv->workqueue) {
1633 ret = -ENOMEM;
1633 goto work_err; 1634 goto work_err;
1635 }
1634 1636
1635 INIT_DELAYED_WORK(&priv->delayed_work, twl6040_accessory_work); 1637 INIT_DELAYED_WORK(&priv->delayed_work, twl6040_accessory_work);
1636 1638