diff options
Diffstat (limited to 'sound')
31 files changed, 262 insertions, 149 deletions
diff --git a/sound/core/seq/Kconfig b/sound/core/seq/Kconfig index a536760a94c2..45c1336c6597 100644 --- a/sound/core/seq/Kconfig +++ b/sound/core/seq/Kconfig | |||
@@ -47,10 +47,10 @@ config SND_SEQ_HRTIMER_DEFAULT | |||
47 | timer. | 47 | timer. |
48 | 48 | ||
49 | config SND_SEQ_MIDI_EVENT | 49 | config SND_SEQ_MIDI_EVENT |
50 | def_tristate SND_RAWMIDI | 50 | tristate |
51 | 51 | ||
52 | config SND_SEQ_MIDI | 52 | config SND_SEQ_MIDI |
53 | tristate | 53 | def_tristate SND_RAWMIDI |
54 | select SND_SEQ_MIDI_EVENT | 54 | select SND_SEQ_MIDI_EVENT |
55 | 55 | ||
56 | config SND_SEQ_MIDI_EMUL | 56 | config SND_SEQ_MIDI_EMUL |
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 272c55fe17c8..ea2d0ae85bd3 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c | |||
@@ -1502,16 +1502,11 @@ static int snd_seq_ioctl_unsubscribe_port(struct snd_seq_client *client, | |||
1502 | static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg) | 1502 | static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg) |
1503 | { | 1503 | { |
1504 | struct snd_seq_queue_info *info = arg; | 1504 | struct snd_seq_queue_info *info = arg; |
1505 | int result; | ||
1506 | struct snd_seq_queue *q; | 1505 | struct snd_seq_queue *q; |
1507 | 1506 | ||
1508 | result = snd_seq_queue_alloc(client->number, info->locked, info->flags); | 1507 | q = snd_seq_queue_alloc(client->number, info->locked, info->flags); |
1509 | if (result < 0) | 1508 | if (IS_ERR(q)) |
1510 | return result; | 1509 | return PTR_ERR(q); |
1511 | |||
1512 | q = queueptr(result); | ||
1513 | if (q == NULL) | ||
1514 | return -EINVAL; | ||
1515 | 1510 | ||
1516 | info->queue = q->queue; | 1511 | info->queue = q->queue; |
1517 | info->locked = q->locked; | 1512 | info->locked = q->locked; |
@@ -1521,7 +1516,7 @@ static int snd_seq_ioctl_create_queue(struct snd_seq_client *client, void *arg) | |||
1521 | if (!info->name[0]) | 1516 | if (!info->name[0]) |
1522 | snprintf(info->name, sizeof(info->name), "Queue-%d", q->queue); | 1517 | snprintf(info->name, sizeof(info->name), "Queue-%d", q->queue); |
1523 | strlcpy(q->name, info->name, sizeof(q->name)); | 1518 | strlcpy(q->name, info->name, sizeof(q->name)); |
1524 | queuefree(q); | 1519 | snd_use_lock_free(&q->use_lock); |
1525 | 1520 | ||
1526 | return 0; | 1521 | return 0; |
1527 | } | 1522 | } |
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c index 450c5187eecb..79e0c5604ef8 100644 --- a/sound/core/seq/seq_queue.c +++ b/sound/core/seq/seq_queue.c | |||
@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void) | |||
184 | static void queue_use(struct snd_seq_queue *queue, int client, int use); | 184 | static void queue_use(struct snd_seq_queue *queue, int client, int use); |
185 | 185 | ||
186 | /* allocate a new queue - | 186 | /* allocate a new queue - |
187 | * return queue index value or negative value for error | 187 | * return pointer to new queue or ERR_PTR(-errno) for error |
188 | * The new queue's use_lock is set to 1. It is the caller's responsibility to | ||
189 | * call snd_use_lock_free(&q->use_lock). | ||
188 | */ | 190 | */ |
189 | int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) | 191 | struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) |
190 | { | 192 | { |
191 | struct snd_seq_queue *q; | 193 | struct snd_seq_queue *q; |
192 | 194 | ||
193 | q = queue_new(client, locked); | 195 | q = queue_new(client, locked); |
194 | if (q == NULL) | 196 | if (q == NULL) |
195 | return -ENOMEM; | 197 | return ERR_PTR(-ENOMEM); |
196 | q->info_flags = info_flags; | 198 | q->info_flags = info_flags; |
197 | queue_use(q, client, 1); | 199 | queue_use(q, client, 1); |
200 | snd_use_lock_use(&q->use_lock); | ||
198 | if (queue_list_add(q) < 0) { | 201 | if (queue_list_add(q) < 0) { |
202 | snd_use_lock_free(&q->use_lock); | ||
199 | queue_delete(q); | 203 | queue_delete(q); |
200 | return -ENOMEM; | 204 | return ERR_PTR(-ENOMEM); |
201 | } | 205 | } |
202 | return q->queue; | 206 | return q; |
203 | } | 207 | } |
204 | 208 | ||
205 | /* delete a queue - queue must be owned by the client */ | 209 | /* delete a queue - queue must be owned by the client */ |
diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h index 30c8111477f6..719093489a2c 100644 --- a/sound/core/seq/seq_queue.h +++ b/sound/core/seq/seq_queue.h | |||
@@ -71,7 +71,7 @@ void snd_seq_queues_delete(void); | |||
71 | 71 | ||
72 | 72 | ||
73 | /* create new queue (constructor) */ | 73 | /* create new queue (constructor) */ |
74 | int snd_seq_queue_alloc(int client, int locked, unsigned int flags); | 74 | struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int flags); |
75 | 75 | ||
76 | /* delete queue (destructor) */ | 76 | /* delete queue (destructor) */ |
77 | int snd_seq_queue_delete(int client, int queueid); | 77 | int snd_seq_queue_delete(int client, int queueid); |
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c index dc585959ca32..a2b56b188be4 100644 --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c | |||
@@ -698,10 +698,18 @@ static int copy_gctl(struct snd_emu10k1 *emu, | |||
698 | { | 698 | { |
699 | struct snd_emu10k1_fx8010_control_old_gpr __user *octl; | 699 | struct snd_emu10k1_fx8010_control_old_gpr __user *octl; |
700 | 700 | ||
701 | if (emu->support_tlv) | 701 | if (emu->support_tlv) { |
702 | return copy_from_user(gctl, &_gctl[idx], sizeof(*gctl)); | 702 | if (in_kernel) |
703 | memcpy(gctl, (void *)&_gctl[idx], sizeof(*gctl)); | ||
704 | else if (copy_from_user(gctl, &_gctl[idx], sizeof(*gctl))) | ||
705 | return -EFAULT; | ||
706 | return 0; | ||
707 | } | ||
708 | |||
703 | octl = (struct snd_emu10k1_fx8010_control_old_gpr __user *)_gctl; | 709 | octl = (struct snd_emu10k1_fx8010_control_old_gpr __user *)_gctl; |
704 | if (copy_from_user(gctl, &octl[idx], sizeof(*octl))) | 710 | if (in_kernel) |
711 | memcpy(gctl, (void *)&octl[idx], sizeof(*octl)); | ||
712 | else if (copy_from_user(gctl, &octl[idx], sizeof(*octl))) | ||
705 | return -EFAULT; | 713 | return -EFAULT; |
706 | gctl->tlv = NULL; | 714 | gctl->tlv = NULL; |
707 | return 0; | 715 | return 0; |
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 2e402ece4c86..8e6b04b39dcc 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1235,8 +1235,6 @@ static int snd_fm801_create(struct snd_card *card, | |||
1235 | } | 1235 | } |
1236 | } | 1236 | } |
1237 | 1237 | ||
1238 | snd_fm801_chip_init(chip); | ||
1239 | |||
1240 | if ((chip->tea575x_tuner & TUNER_ONLY) == 0) { | 1238 | if ((chip->tea575x_tuner & TUNER_ONLY) == 0) { |
1241 | if (devm_request_irq(&pci->dev, pci->irq, snd_fm801_interrupt, | 1239 | if (devm_request_irq(&pci->dev, pci->irq, snd_fm801_interrupt, |
1242 | IRQF_SHARED, KBUILD_MODNAME, chip)) { | 1240 | IRQF_SHARED, KBUILD_MODNAME, chip)) { |
@@ -1248,6 +1246,8 @@ static int snd_fm801_create(struct snd_card *card, | |||
1248 | pci_set_master(pci); | 1246 | pci_set_master(pci); |
1249 | } | 1247 | } |
1250 | 1248 | ||
1249 | snd_fm801_chip_init(chip); | ||
1250 | |||
1251 | if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { | 1251 | if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { |
1252 | snd_fm801_free(chip); | 1252 | snd_fm801_free(chip); |
1253 | return err; | 1253 | return err; |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 63bc894ddf5e..8c1289963c80 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -933,6 +933,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { | |||
933 | SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE), | 933 | SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE), |
934 | SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), | 934 | SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), |
935 | SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), | 935 | SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), |
936 | SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO), | ||
936 | SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), | 937 | SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), |
937 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), | 938 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), |
938 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), | 939 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index d549f35f39d3..53f9311370de 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -3733,11 +3733,15 @@ HDA_CODEC_ENTRY(0x1002aa01, "R6xx HDMI", patch_atihdmi), | |||
3733 | HDA_CODEC_ENTRY(0x10951390, "SiI1390 HDMI", patch_generic_hdmi), | 3733 | HDA_CODEC_ENTRY(0x10951390, "SiI1390 HDMI", patch_generic_hdmi), |
3734 | HDA_CODEC_ENTRY(0x10951392, "SiI1392 HDMI", patch_generic_hdmi), | 3734 | HDA_CODEC_ENTRY(0x10951392, "SiI1392 HDMI", patch_generic_hdmi), |
3735 | HDA_CODEC_ENTRY(0x17e80047, "Chrontel HDMI", patch_generic_hdmi), | 3735 | HDA_CODEC_ENTRY(0x17e80047, "Chrontel HDMI", patch_generic_hdmi), |
3736 | HDA_CODEC_ENTRY(0x10de0001, "MCP73 HDMI", patch_nvhdmi_2ch), | ||
3736 | HDA_CODEC_ENTRY(0x10de0002, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x), | 3737 | HDA_CODEC_ENTRY(0x10de0002, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x), |
3737 | HDA_CODEC_ENTRY(0x10de0003, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x), | 3738 | HDA_CODEC_ENTRY(0x10de0003, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x), |
3739 | HDA_CODEC_ENTRY(0x10de0004, "GPU 04 HDMI", patch_nvhdmi_8ch_7x), | ||
3738 | HDA_CODEC_ENTRY(0x10de0005, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x), | 3740 | HDA_CODEC_ENTRY(0x10de0005, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x), |
3739 | HDA_CODEC_ENTRY(0x10de0006, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x), | 3741 | HDA_CODEC_ENTRY(0x10de0006, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x), |
3740 | HDA_CODEC_ENTRY(0x10de0007, "MCP79/7A HDMI", patch_nvhdmi_8ch_7x), | 3742 | HDA_CODEC_ENTRY(0x10de0007, "MCP79/7A HDMI", patch_nvhdmi_8ch_7x), |
3743 | HDA_CODEC_ENTRY(0x10de0008, "GPU 08 HDMI/DP", patch_nvhdmi), | ||
3744 | HDA_CODEC_ENTRY(0x10de0009, "GPU 09 HDMI/DP", patch_nvhdmi), | ||
3741 | HDA_CODEC_ENTRY(0x10de000a, "GPU 0a HDMI/DP", patch_nvhdmi), | 3745 | HDA_CODEC_ENTRY(0x10de000a, "GPU 0a HDMI/DP", patch_nvhdmi), |
3742 | HDA_CODEC_ENTRY(0x10de000b, "GPU 0b HDMI/DP", patch_nvhdmi), | 3746 | HDA_CODEC_ENTRY(0x10de000b, "GPU 0b HDMI/DP", patch_nvhdmi), |
3743 | HDA_CODEC_ENTRY(0x10de000c, "MCP89 HDMI", patch_nvhdmi), | 3747 | HDA_CODEC_ENTRY(0x10de000c, "MCP89 HDMI", patch_nvhdmi), |
@@ -3764,17 +3768,40 @@ HDA_CODEC_ENTRY(0x10de0041, "GPU 41 HDMI/DP", patch_nvhdmi), | |||
3764 | HDA_CODEC_ENTRY(0x10de0042, "GPU 42 HDMI/DP", patch_nvhdmi), | 3768 | HDA_CODEC_ENTRY(0x10de0042, "GPU 42 HDMI/DP", patch_nvhdmi), |
3765 | HDA_CODEC_ENTRY(0x10de0043, "GPU 43 HDMI/DP", patch_nvhdmi), | 3769 | HDA_CODEC_ENTRY(0x10de0043, "GPU 43 HDMI/DP", patch_nvhdmi), |
3766 | HDA_CODEC_ENTRY(0x10de0044, "GPU 44 HDMI/DP", patch_nvhdmi), | 3770 | HDA_CODEC_ENTRY(0x10de0044, "GPU 44 HDMI/DP", patch_nvhdmi), |
3771 | HDA_CODEC_ENTRY(0x10de0045, "GPU 45 HDMI/DP", patch_nvhdmi), | ||
3772 | HDA_CODEC_ENTRY(0x10de0050, "GPU 50 HDMI/DP", patch_nvhdmi), | ||
3767 | HDA_CODEC_ENTRY(0x10de0051, "GPU 51 HDMI/DP", patch_nvhdmi), | 3773 | HDA_CODEC_ENTRY(0x10de0051, "GPU 51 HDMI/DP", patch_nvhdmi), |
3774 | HDA_CODEC_ENTRY(0x10de0052, "GPU 52 HDMI/DP", patch_nvhdmi), | ||
3768 | HDA_CODEC_ENTRY(0x10de0060, "GPU 60 HDMI/DP", patch_nvhdmi), | 3775 | HDA_CODEC_ENTRY(0x10de0060, "GPU 60 HDMI/DP", patch_nvhdmi), |
3776 | HDA_CODEC_ENTRY(0x10de0061, "GPU 61 HDMI/DP", patch_nvhdmi), | ||
3777 | HDA_CODEC_ENTRY(0x10de0062, "GPU 62 HDMI/DP", patch_nvhdmi), | ||
3769 | HDA_CODEC_ENTRY(0x10de0067, "MCP67 HDMI", patch_nvhdmi_2ch), | 3778 | HDA_CODEC_ENTRY(0x10de0067, "MCP67 HDMI", patch_nvhdmi_2ch), |
3770 | HDA_CODEC_ENTRY(0x10de0070, "GPU 70 HDMI/DP", patch_nvhdmi), | 3779 | HDA_CODEC_ENTRY(0x10de0070, "GPU 70 HDMI/DP", patch_nvhdmi), |
3771 | HDA_CODEC_ENTRY(0x10de0071, "GPU 71 HDMI/DP", patch_nvhdmi), | 3780 | HDA_CODEC_ENTRY(0x10de0071, "GPU 71 HDMI/DP", patch_nvhdmi), |
3772 | HDA_CODEC_ENTRY(0x10de0072, "GPU 72 HDMI/DP", patch_nvhdmi), | 3781 | HDA_CODEC_ENTRY(0x10de0072, "GPU 72 HDMI/DP", patch_nvhdmi), |
3782 | HDA_CODEC_ENTRY(0x10de0073, "GPU 73 HDMI/DP", patch_nvhdmi), | ||
3783 | HDA_CODEC_ENTRY(0x10de0074, "GPU 74 HDMI/DP", patch_nvhdmi), | ||
3784 | HDA_CODEC_ENTRY(0x10de0076, "GPU 76 HDMI/DP", patch_nvhdmi), | ||
3785 | HDA_CODEC_ENTRY(0x10de007b, "GPU 7b HDMI/DP", patch_nvhdmi), | ||
3786 | HDA_CODEC_ENTRY(0x10de007c, "GPU 7c HDMI/DP", patch_nvhdmi), | ||
3773 | HDA_CODEC_ENTRY(0x10de007d, "GPU 7d HDMI/DP", patch_nvhdmi), | 3787 | HDA_CODEC_ENTRY(0x10de007d, "GPU 7d HDMI/DP", patch_nvhdmi), |
3788 | HDA_CODEC_ENTRY(0x10de007e, "GPU 7e HDMI/DP", patch_nvhdmi), | ||
3774 | HDA_CODEC_ENTRY(0x10de0080, "GPU 80 HDMI/DP", patch_nvhdmi), | 3789 | HDA_CODEC_ENTRY(0x10de0080, "GPU 80 HDMI/DP", patch_nvhdmi), |
3790 | HDA_CODEC_ENTRY(0x10de0081, "GPU 81 HDMI/DP", patch_nvhdmi), | ||
3775 | HDA_CODEC_ENTRY(0x10de0082, "GPU 82 HDMI/DP", patch_nvhdmi), | 3791 | HDA_CODEC_ENTRY(0x10de0082, "GPU 82 HDMI/DP", patch_nvhdmi), |
3776 | HDA_CODEC_ENTRY(0x10de0083, "GPU 83 HDMI/DP", patch_nvhdmi), | 3792 | HDA_CODEC_ENTRY(0x10de0083, "GPU 83 HDMI/DP", patch_nvhdmi), |
3793 | HDA_CODEC_ENTRY(0x10de0084, "GPU 84 HDMI/DP", patch_nvhdmi), | ||
3794 | HDA_CODEC_ENTRY(0x10de0090, "GPU 90 HDMI/DP", patch_nvhdmi), | ||
3795 | HDA_CODEC_ENTRY(0x10de0091, "GPU 91 HDMI/DP", patch_nvhdmi), | ||
3796 | HDA_CODEC_ENTRY(0x10de0092, "GPU 92 HDMI/DP", patch_nvhdmi), | ||
3797 | HDA_CODEC_ENTRY(0x10de0093, "GPU 93 HDMI/DP", patch_nvhdmi), | ||
3798 | HDA_CODEC_ENTRY(0x10de0094, "GPU 94 HDMI/DP", patch_nvhdmi), | ||
3799 | HDA_CODEC_ENTRY(0x10de0095, "GPU 95 HDMI/DP", patch_nvhdmi), | ||
3800 | HDA_CODEC_ENTRY(0x10de0097, "GPU 97 HDMI/DP", patch_nvhdmi), | ||
3801 | HDA_CODEC_ENTRY(0x10de0098, "GPU 98 HDMI/DP", patch_nvhdmi), | ||
3802 | HDA_CODEC_ENTRY(0x10de0099, "GPU 99 HDMI/DP", patch_nvhdmi), | ||
3777 | HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI", patch_nvhdmi_2ch), | 3803 | HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI", patch_nvhdmi_2ch), |
3804 | HDA_CODEC_ENTRY(0x10de8067, "MCP67/68 HDMI", patch_nvhdmi_2ch), | ||
3778 | HDA_CODEC_ENTRY(0x11069f80, "VX900 HDMI/DP", patch_via_hdmi), | 3805 | HDA_CODEC_ENTRY(0x11069f80, "VX900 HDMI/DP", patch_via_hdmi), |
3779 | HDA_CODEC_ENTRY(0x11069f81, "VX900 HDMI/DP", patch_via_hdmi), | 3806 | HDA_CODEC_ENTRY(0x11069f81, "VX900 HDMI/DP", patch_via_hdmi), |
3780 | HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP", patch_generic_hdmi), | 3807 | HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP", patch_generic_hdmi), |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 45d58fc1df39..217bb582aff1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2296,6 +2296,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { | |||
2296 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), | 2296 | SND_PCI_QUIRK(0x1043, 0x8691, "ASUS ROG Ranger VIII", ALC882_FIXUP_GPIO3), |
2297 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), | 2297 | SND_PCI_QUIRK(0x104d, 0x9047, "Sony Vaio TT", ALC889_FIXUP_VAIO_TT), |
2298 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), | 2298 | SND_PCI_QUIRK(0x104d, 0x905a, "Sony Vaio Z", ALC882_FIXUP_NO_PRIMARY_HP), |
2299 | SND_PCI_QUIRK(0x104d, 0x9060, "Sony Vaio VPCL14M1R", ALC882_FIXUP_NO_PRIMARY_HP), | ||
2299 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), | 2300 | SND_PCI_QUIRK(0x104d, 0x9043, "Sony Vaio VGC-LN51JGB", ALC882_FIXUP_NO_PRIMARY_HP), |
2300 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), | 2301 | SND_PCI_QUIRK(0x104d, 0x9044, "Sony VAIO AiO", ALC882_FIXUP_NO_PRIMARY_HP), |
2301 | 2302 | ||
@@ -3838,6 +3839,17 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec, | |||
3838 | } | 3839 | } |
3839 | } | 3840 | } |
3840 | 3841 | ||
3842 | static struct coef_fw alc225_pre_hsmode[] = { | ||
3843 | UPDATE_COEF(0x4a, 1<<8, 0), | ||
3844 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), | ||
3845 | UPDATE_COEF(0x63, 3<<14, 3<<14), | ||
3846 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | ||
3847 | UPDATE_COEF(0x4a, 3<<10, 3<<10), | ||
3848 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), | ||
3849 | UPDATE_COEF(0x4a, 3<<10, 0), | ||
3850 | {} | ||
3851 | }; | ||
3852 | |||
3841 | static void alc_headset_mode_unplugged(struct hda_codec *codec) | 3853 | static void alc_headset_mode_unplugged(struct hda_codec *codec) |
3842 | { | 3854 | { |
3843 | static struct coef_fw coef0255[] = { | 3855 | static struct coef_fw coef0255[] = { |
@@ -3873,6 +3885,10 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) | |||
3873 | UPDATE_COEF(0x67, 0x2000, 0), | 3885 | UPDATE_COEF(0x67, 0x2000, 0), |
3874 | {} | 3886 | {} |
3875 | }; | 3887 | }; |
3888 | static struct coef_fw coef0298[] = { | ||
3889 | UPDATE_COEF(0x19, 0x1300, 0x0300), | ||
3890 | {} | ||
3891 | }; | ||
3876 | static struct coef_fw coef0292[] = { | 3892 | static struct coef_fw coef0292[] = { |
3877 | WRITE_COEF(0x76, 0x000e), | 3893 | WRITE_COEF(0x76, 0x000e), |
3878 | WRITE_COEF(0x6c, 0x2400), | 3894 | WRITE_COEF(0x6c, 0x2400), |
@@ -3895,13 +3911,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) | |||
3895 | {} | 3911 | {} |
3896 | }; | 3912 | }; |
3897 | static struct coef_fw coef0225[] = { | 3913 | static struct coef_fw coef0225[] = { |
3898 | UPDATE_COEF(0x4a, 1<<8, 0), | 3914 | UPDATE_COEF(0x63, 3<<14, 0), |
3899 | UPDATE_COEFEX(0x57, 0x05, 1<<14, 0), | ||
3900 | UPDATE_COEF(0x63, 3<<14, 3<<14), | ||
3901 | UPDATE_COEF(0x4a, 3<<4, 2<<4), | ||
3902 | UPDATE_COEF(0x4a, 3<<10, 3<<10), | ||
3903 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), | ||
3904 | UPDATE_COEF(0x4a, 3<<10, 0), | ||
3905 | {} | 3915 | {} |
3906 | }; | 3916 | }; |
3907 | static struct coef_fw coef0274[] = { | 3917 | static struct coef_fw coef0274[] = { |
@@ -3935,7 +3945,10 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) | |||
3935 | break; | 3945 | break; |
3936 | case 0x10ec0286: | 3946 | case 0x10ec0286: |
3937 | case 0x10ec0288: | 3947 | case 0x10ec0288: |
3948 | alc_process_coef_fw(codec, coef0288); | ||
3949 | break; | ||
3938 | case 0x10ec0298: | 3950 | case 0x10ec0298: |
3951 | alc_process_coef_fw(codec, coef0298); | ||
3939 | alc_process_coef_fw(codec, coef0288); | 3952 | alc_process_coef_fw(codec, coef0288); |
3940 | break; | 3953 | break; |
3941 | case 0x10ec0292: | 3954 | case 0x10ec0292: |
@@ -3976,6 +3989,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |||
3976 | {} | 3989 | {} |
3977 | }; | 3990 | }; |
3978 | static struct coef_fw coef0288[] = { | 3991 | static struct coef_fw coef0288[] = { |
3992 | UPDATE_COEF(0x4f, 0x00c0, 0), | ||
3979 | UPDATE_COEF(0x50, 0x2000, 0), | 3993 | UPDATE_COEF(0x50, 0x2000, 0), |
3980 | UPDATE_COEF(0x56, 0x0006, 0), | 3994 | UPDATE_COEF(0x56, 0x0006, 0), |
3981 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), | 3995 | UPDATE_COEF(0x4f, 0xfcc0, 0xc400), |
@@ -4039,7 +4053,6 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |||
4039 | case 0x10ec0286: | 4053 | case 0x10ec0286: |
4040 | case 0x10ec0288: | 4054 | case 0x10ec0288: |
4041 | case 0x10ec0298: | 4055 | case 0x10ec0298: |
4042 | alc_update_coef_idx(codec, 0x4f, 0x000c, 0); | ||
4043 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | 4056 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
4044 | alc_process_coef_fw(codec, coef0288); | 4057 | alc_process_coef_fw(codec, coef0288); |
4045 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); | 4058 | snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); |
@@ -4072,6 +4085,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |||
4072 | case 0x10ec0225: | 4085 | case 0x10ec0225: |
4073 | case 0x10ec0295: | 4086 | case 0x10ec0295: |
4074 | case 0x10ec0299: | 4087 | case 0x10ec0299: |
4088 | alc_process_coef_fw(codec, alc225_pre_hsmode); | ||
4075 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); | 4089 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
4076 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); | 4090 | snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
4077 | alc_process_coef_fw(codec, coef0225); | 4091 | alc_process_coef_fw(codec, coef0225); |
@@ -4084,7 +4098,12 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, | |||
4084 | static void alc_headset_mode_default(struct hda_codec *codec) | 4098 | static void alc_headset_mode_default(struct hda_codec *codec) |
4085 | { | 4099 | { |
4086 | static struct coef_fw coef0225[] = { | 4100 | static struct coef_fw coef0225[] = { |
4087 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), | 4101 | UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10), |
4102 | UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10), | ||
4103 | UPDATE_COEF(0x49, 3<<8, 0<<8), | ||
4104 | UPDATE_COEF(0x4a, 3<<4, 3<<4), | ||
4105 | UPDATE_COEF(0x63, 3<<14, 0), | ||
4106 | UPDATE_COEF(0x67, 0xf000, 0x3000), | ||
4088 | {} | 4107 | {} |
4089 | }; | 4108 | }; |
4090 | static struct coef_fw coef0255[] = { | 4109 | static struct coef_fw coef0255[] = { |
@@ -4138,6 +4157,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) | |||
4138 | case 0x10ec0225: | 4157 | case 0x10ec0225: |
4139 | case 0x10ec0295: | 4158 | case 0x10ec0295: |
4140 | case 0x10ec0299: | 4159 | case 0x10ec0299: |
4160 | alc_process_coef_fw(codec, alc225_pre_hsmode); | ||
4141 | alc_process_coef_fw(codec, coef0225); | 4161 | alc_process_coef_fw(codec, coef0225); |
4142 | break; | 4162 | break; |
4143 | case 0x10ec0255: | 4163 | case 0x10ec0255: |
@@ -4177,6 +4197,8 @@ static void alc_headset_mode_default(struct hda_codec *codec) | |||
4177 | /* Iphone type */ | 4197 | /* Iphone type */ |
4178 | static void alc_headset_mode_ctia(struct hda_codec *codec) | 4198 | static void alc_headset_mode_ctia(struct hda_codec *codec) |
4179 | { | 4199 | { |
4200 | int val; | ||
4201 | |||
4180 | static struct coef_fw coef0255[] = { | 4202 | static struct coef_fw coef0255[] = { |
4181 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ | 4203 | WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */ |
4182 | WRITE_COEF(0x1b, 0x0c2b), | 4204 | WRITE_COEF(0x1b, 0x0c2b), |
@@ -4219,11 +4241,14 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) | |||
4219 | WRITE_COEF(0xc3, 0x0000), | 4241 | WRITE_COEF(0xc3, 0x0000), |
4220 | {} | 4242 | {} |
4221 | }; | 4243 | }; |
4222 | static struct coef_fw coef0225[] = { | 4244 | static struct coef_fw coef0225_1[] = { |
4223 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), | 4245 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), |
4224 | UPDATE_COEF(0x49, 1<<8, 1<<8), | 4246 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
4225 | UPDATE_COEF(0x4a, 7<<6, 7<<6), | 4247 | {} |
4226 | UPDATE_COEF(0x4a, 3<<4, 3<<4), | 4248 | }; |
4249 | static struct coef_fw coef0225_2[] = { | ||
4250 | UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10), | ||
4251 | UPDATE_COEF(0x63, 3<<14, 1<<14), | ||
4227 | {} | 4252 | {} |
4228 | }; | 4253 | }; |
4229 | 4254 | ||
@@ -4244,8 +4269,17 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) | |||
4244 | alc_process_coef_fw(codec, coef0233); | 4269 | alc_process_coef_fw(codec, coef0233); |
4245 | break; | 4270 | break; |
4246 | case 0x10ec0298: | 4271 | case 0x10ec0298: |
4247 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);/* Headset output enable */ | 4272 | val = alc_read_coef_idx(codec, 0x50); |
4248 | /* ALC298 jack type setting is the same with ALC286/ALC288 */ | 4273 | if (val & (1 << 12)) { |
4274 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | ||
4275 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | ||
4276 | msleep(300); | ||
4277 | } else { | ||
4278 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | ||
4279 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | ||
4280 | msleep(300); | ||
4281 | } | ||
4282 | break; | ||
4249 | case 0x10ec0286: | 4283 | case 0x10ec0286: |
4250 | case 0x10ec0288: | 4284 | case 0x10ec0288: |
4251 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); | 4285 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400); |
@@ -4264,7 +4298,11 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) | |||
4264 | case 0x10ec0225: | 4298 | case 0x10ec0225: |
4265 | case 0x10ec0295: | 4299 | case 0x10ec0295: |
4266 | case 0x10ec0299: | 4300 | case 0x10ec0299: |
4267 | alc_process_coef_fw(codec, coef0225); | 4301 | val = alc_read_coef_idx(codec, 0x45); |
4302 | if (val & (1 << 9)) | ||
4303 | alc_process_coef_fw(codec, coef0225_2); | ||
4304 | else | ||
4305 | alc_process_coef_fw(codec, coef0225_1); | ||
4268 | break; | 4306 | break; |
4269 | case 0x10ec0867: | 4307 | case 0x10ec0867: |
4270 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); | 4308 | alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0); |
@@ -4320,9 +4358,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) | |||
4320 | }; | 4358 | }; |
4321 | static struct coef_fw coef0225[] = { | 4359 | static struct coef_fw coef0225[] = { |
4322 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), | 4360 | UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10), |
4323 | UPDATE_COEF(0x49, 1<<8, 1<<8), | 4361 | UPDATE_COEF(0x63, 3<<14, 2<<14), |
4324 | UPDATE_COEF(0x4a, 7<<6, 7<<6), | ||
4325 | UPDATE_COEF(0x4a, 3<<4, 3<<4), | ||
4326 | {} | 4362 | {} |
4327 | }; | 4363 | }; |
4328 | 4364 | ||
@@ -4344,7 +4380,9 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) | |||
4344 | break; | 4380 | break; |
4345 | case 0x10ec0298: | 4381 | case 0x10ec0298: |
4346 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ | 4382 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */ |
4347 | /* ALC298 jack type setting is the same with ALC286/ALC288 */ | 4383 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
4384 | msleep(300); | ||
4385 | break; | ||
4348 | case 0x10ec0286: | 4386 | case 0x10ec0286: |
4349 | case 0x10ec0288: | 4387 | case 0x10ec0288: |
4350 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); | 4388 | alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400); |
@@ -4384,6 +4422,14 @@ static void alc_determine_headset_type(struct hda_codec *codec) | |||
4384 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ | 4422 | UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */ |
4385 | {} | 4423 | {} |
4386 | }; | 4424 | }; |
4425 | static struct coef_fw coef0298[] = { | ||
4426 | UPDATE_COEF(0x50, 0x2000, 0x2000), | ||
4427 | UPDATE_COEF(0x56, 0x0006, 0x0006), | ||
4428 | UPDATE_COEF(0x66, 0x0008, 0), | ||
4429 | UPDATE_COEF(0x67, 0x2000, 0), | ||
4430 | UPDATE_COEF(0x19, 0x1300, 0x1300), | ||
4431 | {} | ||
4432 | }; | ||
4387 | static struct coef_fw coef0293[] = { | 4433 | static struct coef_fw coef0293[] = { |
4388 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ | 4434 | UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */ |
4389 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ | 4435 | WRITE_COEF(0x45, 0xD429), /* Set to ctia type */ |
@@ -4396,11 +4442,6 @@ static void alc_determine_headset_type(struct hda_codec *codec) | |||
4396 | WRITE_COEF(0xc3, 0x0c00), | 4442 | WRITE_COEF(0xc3, 0x0c00), |
4397 | {} | 4443 | {} |
4398 | }; | 4444 | }; |
4399 | static struct coef_fw coef0225[] = { | ||
4400 | UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10), | ||
4401 | UPDATE_COEF(0x49, 1<<8, 1<<8), | ||
4402 | {} | ||
4403 | }; | ||
4404 | static struct coef_fw coef0274[] = { | 4445 | static struct coef_fw coef0274[] = { |
4405 | UPDATE_COEF(0x4a, 0x0010, 0), | 4446 | UPDATE_COEF(0x4a, 0x0010, 0), |
4406 | UPDATE_COEF(0x4a, 0x8000, 0), | 4447 | UPDATE_COEF(0x4a, 0x8000, 0), |
@@ -4433,8 +4474,34 @@ static void alc_determine_headset_type(struct hda_codec *codec) | |||
4433 | is_ctia = (val & 0x0070) == 0x0070; | 4474 | is_ctia = (val & 0x0070) == 0x0070; |
4434 | break; | 4475 | break; |
4435 | case 0x10ec0298: | 4476 | case 0x10ec0298: |
4436 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); /* Headset output enable */ | 4477 | snd_hda_codec_write(codec, 0x21, 0, |
4437 | /* ALC298 check jack type is the same with ALC286/ALC288 */ | 4478 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |
4479 | msleep(100); | ||
4480 | snd_hda_codec_write(codec, 0x21, 0, | ||
4481 | AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0); | ||
4482 | msleep(200); | ||
4483 | |||
4484 | val = alc_read_coef_idx(codec, 0x50); | ||
4485 | if (val & (1 << 12)) { | ||
4486 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); | ||
4487 | alc_process_coef_fw(codec, coef0288); | ||
4488 | msleep(350); | ||
4489 | val = alc_read_coef_idx(codec, 0x50); | ||
4490 | is_ctia = (val & 0x0070) == 0x0070; | ||
4491 | } else { | ||
4492 | alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010); | ||
4493 | alc_process_coef_fw(codec, coef0288); | ||
4494 | msleep(350); | ||
4495 | val = alc_read_coef_idx(codec, 0x50); | ||
4496 | is_ctia = (val & 0x0070) == 0x0070; | ||
4497 | } | ||
4498 | alc_process_coef_fw(codec, coef0298); | ||
4499 | snd_hda_codec_write(codec, 0x21, 0, | ||
4500 | AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP); | ||
4501 | msleep(75); | ||
4502 | snd_hda_codec_write(codec, 0x21, 0, | ||
4503 | AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE); | ||
4504 | break; | ||
4438 | case 0x10ec0286: | 4505 | case 0x10ec0286: |
4439 | case 0x10ec0288: | 4506 | case 0x10ec0288: |
4440 | alc_process_coef_fw(codec, coef0288); | 4507 | alc_process_coef_fw(codec, coef0288); |
@@ -4463,10 +4530,25 @@ static void alc_determine_headset_type(struct hda_codec *codec) | |||
4463 | case 0x10ec0225: | 4530 | case 0x10ec0225: |
4464 | case 0x10ec0295: | 4531 | case 0x10ec0295: |
4465 | case 0x10ec0299: | 4532 | case 0x10ec0299: |
4466 | alc_process_coef_fw(codec, coef0225); | 4533 | alc_process_coef_fw(codec, alc225_pre_hsmode); |
4467 | msleep(800); | 4534 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000); |
4468 | val = alc_read_coef_idx(codec, 0x46); | 4535 | val = alc_read_coef_idx(codec, 0x45); |
4469 | is_ctia = (val & 0x00f0) == 0x00f0; | 4536 | if (val & (1 << 9)) { |
4537 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | ||
4538 | alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8); | ||
4539 | msleep(800); | ||
4540 | val = alc_read_coef_idx(codec, 0x46); | ||
4541 | is_ctia = (val & 0x00f0) == 0x00f0; | ||
4542 | } else { | ||
4543 | alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10); | ||
4544 | alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8); | ||
4545 | msleep(800); | ||
4546 | val = alc_read_coef_idx(codec, 0x46); | ||
4547 | is_ctia = (val & 0x00f0) == 0x00f0; | ||
4548 | } | ||
4549 | alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6); | ||
4550 | alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4); | ||
4551 | alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); | ||
4470 | break; | 4552 | break; |
4471 | case 0x10ec0867: | 4553 | case 0x10ec0867: |
4472 | is_ctia = true; | 4554 | is_ctia = true; |
@@ -6565,7 +6647,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | |||
6565 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, | 6647 | SND_HDA_PIN_QUIRK(0x10ec0299, 0x1028, "Dell", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, |
6566 | ALC225_STANDARD_PINS, | 6648 | ALC225_STANDARD_PINS, |
6567 | {0x12, 0xb7a60130}, | 6649 | {0x12, 0xb7a60130}, |
6568 | {0x13, 0xb8a61140}, | ||
6569 | {0x17, 0x90170110}), | 6650 | {0x17, 0x90170110}), |
6570 | {} | 6651 | {} |
6571 | }; | 6652 | }; |
@@ -6724,6 +6805,7 @@ static int patch_alc269(struct hda_codec *codec) | |||
6724 | case 0x10ec0225: | 6805 | case 0x10ec0225: |
6725 | case 0x10ec0295: | 6806 | case 0x10ec0295: |
6726 | spec->codec_variant = ALC269_TYPE_ALC225; | 6807 | spec->codec_variant = ALC269_TYPE_ALC225; |
6808 | spec->gen.mixer_nid = 0; /* no loopback on ALC225 ALC295 */ | ||
6727 | break; | 6809 | break; |
6728 | case 0x10ec0299: | 6810 | case 0x10ec0299: |
6729 | spec->codec_variant = ALC269_TYPE_ALC225; | 6811 | spec->codec_variant = ALC269_TYPE_ALC225; |
diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c index a78802920c3c..5710fd440bcd 100644 --- a/sound/soc/codecs/msm8916-wcd-analog.c +++ b/sound/soc/codecs/msm8916-wcd-analog.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #define CDC_D_CDC_DIG_CLK_CTL (0xf04A) | 36 | #define CDC_D_CDC_DIG_CLK_CTL (0xf04A) |
37 | #define DIG_CLK_CTL_RXD1_CLK_EN BIT(0) | 37 | #define DIG_CLK_CTL_RXD1_CLK_EN BIT(0) |
38 | #define DIG_CLK_CTL_RXD2_CLK_EN BIT(1) | 38 | #define DIG_CLK_CTL_RXD2_CLK_EN BIT(1) |
39 | #define DIG_CLK_CTL_RXD3_CLK_EN BIT(3) | 39 | #define DIG_CLK_CTL_RXD3_CLK_EN BIT(2) |
40 | #define DIG_CLK_CTL_TXD_CLK_EN BIT(4) | 40 | #define DIG_CLK_CTL_TXD_CLK_EN BIT(4) |
41 | #define DIG_CLK_CTL_NCP_CLK_EN_MASK BIT(6) | 41 | #define DIG_CLK_CTL_NCP_CLK_EN_MASK BIT(6) |
42 | #define DIG_CLK_CTL_NCP_CLK_EN BIT(6) | 42 | #define DIG_CLK_CTL_NCP_CLK_EN BIT(6) |
diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c index a33202affeb1..fa550e3c1332 100644 --- a/sound/soc/codecs/rt5663.c +++ b/sound/soc/codecs/rt5663.c | |||
@@ -466,7 +466,7 @@ static const struct reg_default rt5663_reg[] = { | |||
466 | { 0x0006, 0x1000 }, | 466 | { 0x0006, 0x1000 }, |
467 | { 0x000a, 0x0000 }, | 467 | { 0x000a, 0x0000 }, |
468 | { 0x0010, 0x000f }, | 468 | { 0x0010, 0x000f }, |
469 | { 0x0015, 0x42c1 }, | 469 | { 0x0015, 0x42f1 }, |
470 | { 0x0016, 0x0000 }, | 470 | { 0x0016, 0x0000 }, |
471 | { 0x0018, 0x000b }, | 471 | { 0x0018, 0x000b }, |
472 | { 0x0019, 0xafaf }, | 472 | { 0x0019, 0xafaf }, |
@@ -509,7 +509,7 @@ static const struct reg_default rt5663_reg[] = { | |||
509 | { 0x008a, 0x0000 }, | 509 | { 0x008a, 0x0000 }, |
510 | { 0x008b, 0x0000 }, | 510 | { 0x008b, 0x0000 }, |
511 | { 0x008c, 0x0003 }, | 511 | { 0x008c, 0x0003 }, |
512 | { 0x008e, 0x0004 }, | 512 | { 0x008e, 0x0008 }, |
513 | { 0x008f, 0x1000 }, | 513 | { 0x008f, 0x1000 }, |
514 | { 0x0090, 0x0646 }, | 514 | { 0x0090, 0x0646 }, |
515 | { 0x0091, 0x0e3e }, | 515 | { 0x0091, 0x0e3e }, |
@@ -520,7 +520,7 @@ static const struct reg_default rt5663_reg[] = { | |||
520 | { 0x0098, 0x0000 }, | 520 | { 0x0098, 0x0000 }, |
521 | { 0x009a, 0x0000 }, | 521 | { 0x009a, 0x0000 }, |
522 | { 0x009f, 0x0000 }, | 522 | { 0x009f, 0x0000 }, |
523 | { 0x00ae, 0x2000 }, | 523 | { 0x00ae, 0x6000 }, |
524 | { 0x00af, 0x0000 }, | 524 | { 0x00af, 0x0000 }, |
525 | { 0x00b6, 0x0000 }, | 525 | { 0x00b6, 0x0000 }, |
526 | { 0x00b7, 0x0000 }, | 526 | { 0x00b7, 0x0000 }, |
@@ -538,7 +538,7 @@ static const struct reg_default rt5663_reg[] = { | |||
538 | { 0x00d9, 0x08f9 }, | 538 | { 0x00d9, 0x08f9 }, |
539 | { 0x00db, 0x0008 }, | 539 | { 0x00db, 0x0008 }, |
540 | { 0x00dc, 0x00c0 }, | 540 | { 0x00dc, 0x00c0 }, |
541 | { 0x00dd, 0x6724 }, | 541 | { 0x00dd, 0x6729 }, |
542 | { 0x00de, 0x3131 }, | 542 | { 0x00de, 0x3131 }, |
543 | { 0x00df, 0x0008 }, | 543 | { 0x00df, 0x0008 }, |
544 | { 0x00e0, 0x4000 }, | 544 | { 0x00e0, 0x4000 }, |
@@ -578,7 +578,7 @@ static const struct reg_default rt5663_reg[] = { | |||
578 | { 0x0116, 0x0000 }, | 578 | { 0x0116, 0x0000 }, |
579 | { 0x0117, 0x0f00 }, | 579 | { 0x0117, 0x0f00 }, |
580 | { 0x0118, 0x0006 }, | 580 | { 0x0118, 0x0006 }, |
581 | { 0x0125, 0x2224 }, | 581 | { 0x0125, 0x2424 }, |
582 | { 0x0126, 0x5550 }, | 582 | { 0x0126, 0x5550 }, |
583 | { 0x0127, 0x0400 }, | 583 | { 0x0127, 0x0400 }, |
584 | { 0x0128, 0x7711 }, | 584 | { 0x0128, 0x7711 }, |
@@ -596,8 +596,8 @@ static const struct reg_default rt5663_reg[] = { | |||
596 | { 0x0145, 0x0002 }, | 596 | { 0x0145, 0x0002 }, |
597 | { 0x0146, 0x0000 }, | 597 | { 0x0146, 0x0000 }, |
598 | { 0x0160, 0x0e80 }, | 598 | { 0x0160, 0x0e80 }, |
599 | { 0x0161, 0x0020 }, | 599 | { 0x0161, 0x0080 }, |
600 | { 0x0162, 0x0080 }, | 600 | { 0x0162, 0x0200 }, |
601 | { 0x0163, 0x0800 }, | 601 | { 0x0163, 0x0800 }, |
602 | { 0x0164, 0x0000 }, | 602 | { 0x0164, 0x0000 }, |
603 | { 0x0165, 0x0000 }, | 603 | { 0x0165, 0x0000 }, |
@@ -676,8 +676,8 @@ static const struct reg_default rt5663_reg[] = { | |||
676 | { 0x0251, 0x0000 }, | 676 | { 0x0251, 0x0000 }, |
677 | { 0x0252, 0x028a }, | 677 | { 0x0252, 0x028a }, |
678 | { 0x02fa, 0x0000 }, | 678 | { 0x02fa, 0x0000 }, |
679 | { 0x02fb, 0x0000 }, | 679 | { 0x02fb, 0x00a4 }, |
680 | { 0x02fc, 0x0000 }, | 680 | { 0x02fc, 0x0300 }, |
681 | { 0x0300, 0x0000 }, | 681 | { 0x0300, 0x0000 }, |
682 | { 0x03d0, 0x0000 }, | 682 | { 0x03d0, 0x0000 }, |
683 | { 0x03d1, 0x0000 }, | 683 | { 0x03d1, 0x0000 }, |
diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c index 370ed54d1e15..e597c893536d 100644 --- a/sound/soc/codecs/rt5665.c +++ b/sound/soc/codecs/rt5665.c | |||
@@ -4368,12 +4368,12 @@ static int rt5665_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) | |||
4368 | switch (dai->id) { | 4368 | switch (dai->id) { |
4369 | case RT5665_AIF2_1: | 4369 | case RT5665_AIF2_1: |
4370 | case RT5665_AIF2_2: | 4370 | case RT5665_AIF2_2: |
4371 | snd_soc_update_bits(codec, RT5665_ADDA_CLK_1, | 4371 | snd_soc_update_bits(codec, RT5665_ADDA_CLK_2, |
4372 | RT5665_I2S_BCLK_MS2_MASK, | 4372 | RT5665_I2S_BCLK_MS2_MASK, |
4373 | RT5665_I2S_BCLK_MS2_64); | 4373 | RT5665_I2S_BCLK_MS2_64); |
4374 | break; | 4374 | break; |
4375 | case RT5665_AIF3: | 4375 | case RT5665_AIF3: |
4376 | snd_soc_update_bits(codec, RT5665_ADDA_CLK_1, | 4376 | snd_soc_update_bits(codec, RT5665_ADDA_CLK_2, |
4377 | RT5665_I2S_BCLK_MS3_MASK, | 4377 | RT5665_I2S_BCLK_MS3_MASK, |
4378 | RT5665_I2S_BCLK_MS3_64); | 4378 | RT5665_I2S_BCLK_MS3_64); |
4379 | break; | 4379 | break; |
diff --git a/sound/soc/codecs/rt5665.h b/sound/soc/codecs/rt5665.h index 1db5c6a62a8e..d95249c4c47b 100644 --- a/sound/soc/codecs/rt5665.h +++ b/sound/soc/codecs/rt5665.h | |||
@@ -1692,8 +1692,8 @@ | |||
1692 | #define RT5665_GP6_PIN_MASK (0x3 << 5) | 1692 | #define RT5665_GP6_PIN_MASK (0x3 << 5) |
1693 | #define RT5665_GP6_PIN_SFT 5 | 1693 | #define RT5665_GP6_PIN_SFT 5 |
1694 | #define RT5665_GP6_PIN_GPIO6 (0x0 << 5) | 1694 | #define RT5665_GP6_PIN_GPIO6 (0x0 << 5) |
1695 | #define RT5665_GP6_PIN_BCLK3 (0x0 << 5) | 1695 | #define RT5665_GP6_PIN_BCLK3 (0x1 << 5) |
1696 | #define RT5665_GP6_PIN_PDM_SCL (0x1 << 5) | 1696 | #define RT5665_GP6_PIN_PDM_SCL (0x2 << 5) |
1697 | #define RT5665_GP7_PIN_MASK (0x3 << 3) | 1697 | #define RT5665_GP7_PIN_MASK (0x3 << 3) |
1698 | #define RT5665_GP7_PIN_SFT 3 | 1698 | #define RT5665_GP7_PIN_SFT 3 |
1699 | #define RT5665_GP7_PIN_GPIO7 (0x0 << 3) | 1699 | #define RT5665_GP7_PIN_GPIO7 (0x0 << 3) |
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 8f6814c1eb6b..80f6d1da7095 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -409,7 +409,7 @@ static int dac_put_volsw(struct snd_kcontrol *kcontrol, | |||
409 | static int avc_get_threshold(struct snd_kcontrol *kcontrol, | 409 | static int avc_get_threshold(struct snd_kcontrol *kcontrol, |
410 | struct snd_ctl_elem_value *ucontrol) | 410 | struct snd_ctl_elem_value *ucontrol) |
411 | { | 411 | { |
412 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 412 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
413 | int db, i; | 413 | int db, i; |
414 | u16 reg = snd_soc_read(codec, SGTL5000_DAP_AVC_THRESHOLD); | 414 | u16 reg = snd_soc_read(codec, SGTL5000_DAP_AVC_THRESHOLD); |
415 | 415 | ||
@@ -442,7 +442,7 @@ static int avc_get_threshold(struct snd_kcontrol *kcontrol, | |||
442 | static int avc_put_threshold(struct snd_kcontrol *kcontrol, | 442 | static int avc_put_threshold(struct snd_kcontrol *kcontrol, |
443 | struct snd_ctl_elem_value *ucontrol) | 443 | struct snd_ctl_elem_value *ucontrol) |
444 | { | 444 | { |
445 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 445 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
446 | int db; | 446 | int db; |
447 | u16 reg; | 447 | u16 reg; |
448 | 448 | ||
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index b95132e2f9dc..06790615e04e 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c | |||
@@ -527,6 +527,10 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
527 | } | 527 | } |
528 | 528 | ||
529 | ssi->irq = platform_get_irq(pdev, 0); | 529 | ssi->irq = platform_get_irq(pdev, 0); |
530 | if (ssi->irq < 0) { | ||
531 | dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq); | ||
532 | return ssi->irq; | ||
533 | } | ||
530 | 534 | ||
531 | ssi->clk = devm_clk_get(&pdev->dev, NULL); | 535 | ssi->clk = devm_clk_get(&pdev->dev, NULL); |
532 | if (IS_ERR(ssi->clk)) { | 536 | if (IS_ERR(ssi->clk)) { |
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 105ec3a6e30d..de2550c7a96b 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c | |||
@@ -224,9 +224,11 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) | |||
224 | 224 | ||
225 | of_for_each_phandle(&it, rc, node, "dais", NULL, 0) { | 225 | of_for_each_phandle(&it, rc, node, "dais", NULL, 0) { |
226 | ret = asoc_graph_card_dai_link_of(it.node, priv, idx++); | 226 | ret = asoc_graph_card_dai_link_of(it.node, priv, idx++); |
227 | of_node_put(it.node); | 227 | if (ret < 0) { |
228 | if (ret < 0) | 228 | of_node_put(it.node); |
229 | |||
229 | return ret; | 230 | return ret; |
231 | } | ||
230 | } | 232 | } |
231 | 233 | ||
232 | return asoc_simple_card_parse_card_name(card, NULL); | 234 | return asoc_simple_card_parse_card_name(card, NULL); |
@@ -239,10 +241,8 @@ static int asoc_graph_get_dais_count(struct device *dev) | |||
239 | int count = 0; | 241 | int count = 0; |
240 | int rc; | 242 | int rc; |
241 | 243 | ||
242 | of_for_each_phandle(&it, rc, node, "dais", NULL, 0) { | 244 | of_for_each_phandle(&it, rc, node, "dais", NULL, 0) |
243 | count++; | 245 | count++; |
244 | of_node_put(it.node); | ||
245 | } | ||
246 | 246 | ||
247 | return count; | 247 | return count; |
248 | } | 248 | } |
diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c index dcd2df37bc3b..758ac06f3a99 100644 --- a/sound/soc/generic/audio-graph-scu-card.c +++ b/sound/soc/generic/audio-graph-scu-card.c | |||
@@ -215,7 +215,6 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) | |||
215 | codec_ep = of_graph_get_remote_endpoint(cpu_ep); | 215 | codec_ep = of_graph_get_remote_endpoint(cpu_ep); |
216 | rcpu_ep = of_graph_get_remote_endpoint(codec_ep); | 216 | rcpu_ep = of_graph_get_remote_endpoint(codec_ep); |
217 | 217 | ||
218 | of_node_put(cpu_port); | ||
219 | of_node_put(cpu_ep); | 218 | of_node_put(cpu_ep); |
220 | of_node_put(codec_ep); | 219 | of_node_put(codec_ep); |
221 | of_node_put(rcpu_ep); | 220 | of_node_put(rcpu_ep); |
@@ -232,8 +231,10 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) | |||
232 | 231 | ||
233 | ret = asoc_simple_card_parse_daifmt(dev, cpu_ep, codec_ep, | 232 | ret = asoc_simple_card_parse_daifmt(dev, cpu_ep, codec_ep, |
234 | NULL, &daifmt); | 233 | NULL, &daifmt); |
235 | if (ret < 0) | 234 | if (ret < 0) { |
235 | of_node_put(cpu_port); | ||
236 | goto parse_of_err; | 236 | goto parse_of_err; |
237 | } | ||
237 | } | 238 | } |
238 | 239 | ||
239 | dai_idx = 0; | 240 | dai_idx = 0; |
@@ -250,7 +251,6 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) | |||
250 | codec_ep = of_graph_get_remote_endpoint(cpu_ep); | 251 | codec_ep = of_graph_get_remote_endpoint(cpu_ep); |
251 | codec_port = of_graph_get_port_parent(codec_ep); | 252 | codec_port = of_graph_get_port_parent(codec_ep); |
252 | 253 | ||
253 | of_node_put(cpu_port); | ||
254 | of_node_put(cpu_ep); | 254 | of_node_put(cpu_ep); |
255 | of_node_put(codec_ep); | 255 | of_node_put(codec_ep); |
256 | of_node_put(codec_port); | 256 | of_node_put(codec_port); |
@@ -266,13 +266,17 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) | |||
266 | 266 | ||
267 | /* Back-End (= Codec) */ | 267 | /* Back-End (= Codec) */ |
268 | ret = asoc_graph_card_dai_link_of(codec_ep, priv, daifmt, dai_idx++, 0); | 268 | ret = asoc_graph_card_dai_link_of(codec_ep, priv, daifmt, dai_idx++, 0); |
269 | if (ret < 0) | 269 | if (ret < 0) { |
270 | of_node_put(cpu_port); | ||
270 | goto parse_of_err; | 271 | goto parse_of_err; |
272 | } | ||
271 | } else { | 273 | } else { |
272 | /* Front-End (= CPU) */ | 274 | /* Front-End (= CPU) */ |
273 | ret = asoc_graph_card_dai_link_of(cpu_ep, priv, daifmt, dai_idx++, 1); | 275 | ret = asoc_graph_card_dai_link_of(cpu_ep, priv, daifmt, dai_idx++, 1); |
274 | if (ret < 0) | 276 | if (ret < 0) { |
277 | of_node_put(cpu_port); | ||
275 | goto parse_of_err; | 278 | goto parse_of_err; |
279 | } | ||
276 | } | 280 | } |
277 | } | 281 | } |
278 | } | 282 | } |
@@ -306,7 +310,6 @@ static int asoc_graph_get_dais_count(struct device *dev) | |||
306 | codec_ep = of_graph_get_remote_endpoint(cpu_ep); | 310 | codec_ep = of_graph_get_remote_endpoint(cpu_ep); |
307 | codec_port = of_graph_get_port_parent(codec_ep); | 311 | codec_port = of_graph_get_port_parent(codec_ep); |
308 | 312 | ||
309 | of_node_put(cpu_port); | ||
310 | of_node_put(cpu_ep); | 313 | of_node_put(cpu_ep); |
311 | of_node_put(codec_ep); | 314 | of_node_put(codec_ep); |
312 | of_node_put(codec_port); | 315 | of_node_put(codec_port); |
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 26d64fa40c9c..7d7ab4aee42e 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c | |||
@@ -263,6 +263,9 @@ static int asoc_simple_card_get_dai_id(struct device_node *ep) | |||
263 | id = i; | 263 | id = i; |
264 | i++; | 264 | i++; |
265 | } | 265 | } |
266 | |||
267 | of_node_put(node); | ||
268 | |||
266 | if (id < 0) | 269 | if (id < 0) |
267 | return -ENODEV; | 270 | return -ENODEV; |
268 | 271 | ||
@@ -282,11 +285,6 @@ int asoc_simple_card_parse_graph_dai(struct device_node *ep, | |||
282 | if (!dai_name) | 285 | if (!dai_name) |
283 | return 0; | 286 | return 0; |
284 | 287 | ||
285 | /* | ||
286 | * of_graph_get_port_parent() will call | ||
287 | * of_node_put(). So, call of_node_get() here | ||
288 | */ | ||
289 | of_node_get(ep); | ||
290 | node = of_graph_get_port_parent(ep); | 288 | node = of_graph_get_port_parent(ep); |
291 | 289 | ||
292 | /* Get dai->name */ | 290 | /* Get dai->name */ |
diff --git a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c index 3fe4a0807095..cfd89ca6a18d 100644 --- a/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +++ b/sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | |||
@@ -319,7 +319,9 @@ static int kabylake_rt5663_hw_params(struct snd_pcm_substream *substream, | |||
319 | int ret; | 319 | int ret; |
320 | 320 | ||
321 | /* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */ | 321 | /* use ASRC for internal clocks, as PLL rate isn't multiple of BCLK */ |
322 | rt5663_sel_asrc_clk_src(codec_dai->codec, RT5663_DA_STEREO_FILTER, 1); | 322 | rt5663_sel_asrc_clk_src(codec_dai->codec, |
323 | RT5663_DA_STEREO_FILTER | RT5663_AD_STEREO_FILTER, | ||
324 | RT5663_CLK_SEL_I2S1_ASRC); | ||
323 | 325 | ||
324 | ret = snd_soc_dai_set_sysclk(codec_dai, | 326 | ret = snd_soc_dai_set_sysclk(codec_dai, |
325 | RT5663_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN); | 327 | RT5663_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN); |
@@ -349,19 +351,10 @@ static int kabylake_ssp0_hw_params(struct snd_pcm_substream *substream, | |||
349 | return ret; | 351 | return ret; |
350 | } | 352 | } |
351 | 353 | ||
352 | ret = snd_soc_dai_set_pll(codec_dai, 0, | ||
353 | RT5514_PLL1_S_BCLK, RT5514_AIF1_BCLK_FREQ, | ||
354 | RT5514_AIF1_SYSCLK_FREQ); | ||
355 | if (ret < 0) { | ||
356 | dev_err(rtd->dev, "set bclk err: %d\n", ret); | ||
357 | return ret; | ||
358 | } | ||
359 | |||
360 | ret = snd_soc_dai_set_sysclk(codec_dai, | 354 | ret = snd_soc_dai_set_sysclk(codec_dai, |
361 | RT5514_SCLK_S_PLL1, RT5514_AIF1_SYSCLK_FREQ, | 355 | RT5514_SCLK_S_MCLK, 24576000, SND_SOC_CLOCK_IN); |
362 | SND_SOC_CLOCK_IN); | ||
363 | if (ret < 0) { | 356 | if (ret < 0) { |
364 | dev_err(rtd->dev, "set sclk err: %d\n", ret); | 357 | dev_err(rtd->dev, "set sysclk err: %d\n", ret); |
365 | return ret; | 358 | return ret; |
366 | } | 359 | } |
367 | } | 360 | } |
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c index eca85827dbd2..fb2f1f603f3c 100644 --- a/sound/soc/intel/skylake/skl-messages.c +++ b/sound/soc/intel/skylake/skl-messages.c | |||
@@ -540,6 +540,14 @@ static void skl_setup_cpr_gateway_cfg(struct skl_sst *ctx, | |||
540 | cpr_mconfig->gtw_cfg.dma_buffer_size = | 540 | cpr_mconfig->gtw_cfg.dma_buffer_size = |
541 | mconfig->dma_buffer_size * dma_io_buf; | 541 | mconfig->dma_buffer_size * dma_io_buf; |
542 | 542 | ||
543 | /* fallback to 2ms default value */ | ||
544 | if (!cpr_mconfig->gtw_cfg.dma_buffer_size) { | ||
545 | if (mconfig->hw_conn_type == SKL_CONN_SOURCE) | ||
546 | cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->obs; | ||
547 | else | ||
548 | cpr_mconfig->gtw_cfg.dma_buffer_size = 2 * mconfig->ibs; | ||
549 | } | ||
550 | |||
543 | cpr_mconfig->cpr_feature_mask = 0; | 551 | cpr_mconfig->cpr_feature_mask = 0; |
544 | cpr_mconfig->gtw_cfg.config_length = 0; | 552 | cpr_mconfig->gtw_cfg.config_length = 0; |
545 | 553 | ||
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 334917ee41cf..9e3f8c04dd32 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c | |||
@@ -941,6 +941,7 @@ static struct sst_acpi_mach sst_bxtp_devdata[] = { | |||
941 | .machine_quirk = sst_acpi_codec_list, | 941 | .machine_quirk = sst_acpi_codec_list, |
942 | .quirk_data = &bxt_codecs, | 942 | .quirk_data = &bxt_codecs, |
943 | }, | 943 | }, |
944 | {} | ||
944 | }; | 945 | }; |
945 | 946 | ||
946 | static struct sst_acpi_mach sst_kbl_devdata[] = { | 947 | static struct sst_acpi_mach sst_kbl_devdata[] = { |
@@ -991,6 +992,7 @@ static struct sst_acpi_mach sst_glk_devdata[] = { | |||
991 | .drv_name = "glk_alc298s_i2s", | 992 | .drv_name = "glk_alc298s_i2s", |
992 | .fw_filename = "intel/dsp_fw_glk.bin", | 993 | .fw_filename = "intel/dsp_fw_glk.bin", |
993 | }, | 994 | }, |
995 | {} | ||
994 | }; | 996 | }; |
995 | 997 | ||
996 | /* PCI IDs */ | 998 | /* PCI IDs */ |
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 960744e46edc..484ab3c2ad67 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config SND_PXA2XX_SOC | 1 | config SND_PXA2XX_SOC |
2 | tristate "SoC Audio for the Intel PXA2xx chip" | 2 | tristate "SoC Audio for the Intel PXA2xx chip" |
3 | depends on ARCH_PXA || COMPILE_TEST | 3 | depends on ARCH_PXA || COMPILE_TEST |
4 | depends on HAS_DMA | ||
4 | select SND_PXA2XX_LIB | 5 | select SND_PXA2XX_LIB |
5 | help | 6 | help |
6 | Say Y or M if you want to add support for codecs attached to | 7 | Say Y or M if you want to add support for codecs attached to |
diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c index 0c0b00e40646..0834319ead42 100644 --- a/sound/soc/samsung/odroid.c +++ b/sound/soc/samsung/odroid.c | |||
@@ -42,17 +42,17 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream, | |||
42 | switch (params_rate(params)) { | 42 | switch (params_rate(params)) { |
43 | case 32000: | 43 | case 32000: |
44 | case 64000: | 44 | case 64000: |
45 | pll_freq = 131072000U; | 45 | pll_freq = 131072006U; |
46 | break; | 46 | break; |
47 | case 44100: | 47 | case 44100: |
48 | case 88200: | 48 | case 88200: |
49 | case 176400: | 49 | case 176400: |
50 | pll_freq = 180633600U; | 50 | pll_freq = 180633609U; |
51 | break; | 51 | break; |
52 | case 48000: | 52 | case 48000: |
53 | case 96000: | 53 | case 96000: |
54 | case 192000: | 54 | case 192000: |
55 | pll_freq = 196608000U; | 55 | pll_freq = 196608001U; |
56 | break; | 56 | break; |
57 | default: | 57 | default: |
58 | return -EINVAL; | 58 | return -EINVAL; |
diff --git a/sound/soc/sh/hac.c b/sound/soc/sh/hac.c index 84c51037a7d0..624aaf569fef 100644 --- a/sound/soc/sh/hac.c +++ b/sound/soc/sh/hac.c | |||
@@ -315,6 +315,8 @@ static const struct snd_soc_component_driver sh4_hac_component = { | |||
315 | 315 | ||
316 | static int hac_soc_platform_probe(struct platform_device *pdev) | 316 | static int hac_soc_platform_probe(struct platform_device *pdev) |
317 | { | 317 | { |
318 | int ret; | ||
319 | |||
318 | ret = snd_soc_set_ac97_ops(&hac_ac97_ops); | 320 | ret = snd_soc_set_ac97_ops(&hac_ac97_ops); |
319 | if (ret != 0) | 321 | if (ret != 0) |
320 | return ret; | 322 | return ret; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 921622a01944..13c875e2392a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -3171,8 +3171,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, | |||
3171 | component->remove = component->driver->remove; | 3171 | component->remove = component->driver->remove; |
3172 | component->suspend = component->driver->suspend; | 3172 | component->suspend = component->driver->suspend; |
3173 | component->resume = component->driver->resume; | 3173 | component->resume = component->driver->resume; |
3174 | component->pcm_new = component->driver->pcm_new; | ||
3175 | component->pcm_free = component->driver->pcm_free; | ||
3176 | 3174 | ||
3177 | dapm = &component->dapm; | 3175 | dapm = &component->dapm; |
3178 | dapm->dev = dev; | 3176 | dapm->dev = dev; |
@@ -3360,25 +3358,6 @@ static void snd_soc_platform_drv_remove(struct snd_soc_component *component) | |||
3360 | platform->driver->remove(platform); | 3358 | platform->driver->remove(platform); |
3361 | } | 3359 | } |
3362 | 3360 | ||
3363 | static int snd_soc_platform_drv_pcm_new(struct snd_soc_pcm_runtime *rtd) | ||
3364 | { | ||
3365 | struct snd_soc_platform *platform = rtd->platform; | ||
3366 | |||
3367 | if (platform->driver->pcm_new) | ||
3368 | return platform->driver->pcm_new(rtd); | ||
3369 | else | ||
3370 | return 0; | ||
3371 | } | ||
3372 | |||
3373 | static void snd_soc_platform_drv_pcm_free(struct snd_pcm *pcm) | ||
3374 | { | ||
3375 | struct snd_soc_pcm_runtime *rtd = pcm->private_data; | ||
3376 | struct snd_soc_platform *platform = rtd->platform; | ||
3377 | |||
3378 | if (platform->driver->pcm_free) | ||
3379 | platform->driver->pcm_free(pcm); | ||
3380 | } | ||
3381 | |||
3382 | /** | 3361 | /** |
3383 | * snd_soc_add_platform - Add a platform to the ASoC core | 3362 | * snd_soc_add_platform - Add a platform to the ASoC core |
3384 | * @dev: The parent device for the platform | 3363 | * @dev: The parent device for the platform |
@@ -3402,10 +3381,6 @@ int snd_soc_add_platform(struct device *dev, struct snd_soc_platform *platform, | |||
3402 | platform->component.probe = snd_soc_platform_drv_probe; | 3381 | platform->component.probe = snd_soc_platform_drv_probe; |
3403 | if (platform_drv->remove) | 3382 | if (platform_drv->remove) |
3404 | platform->component.remove = snd_soc_platform_drv_remove; | 3383 | platform->component.remove = snd_soc_platform_drv_remove; |
3405 | if (platform_drv->pcm_new) | ||
3406 | platform->component.pcm_new = snd_soc_platform_drv_pcm_new; | ||
3407 | if (platform_drv->pcm_free) | ||
3408 | platform->component.pcm_free = snd_soc_platform_drv_pcm_free; | ||
3409 | 3384 | ||
3410 | #ifdef CONFIG_DEBUG_FS | 3385 | #ifdef CONFIG_DEBUG_FS |
3411 | platform->component.debugfs_prefix = "platform"; | 3386 | platform->component.debugfs_prefix = "platform"; |
@@ -4113,6 +4088,8 @@ int snd_soc_get_dai_id(struct device_node *ep) | |||
4113 | } | 4088 | } |
4114 | mutex_unlock(&client_mutex); | 4089 | mutex_unlock(&client_mutex); |
4115 | 4090 | ||
4091 | of_node_put(node); | ||
4092 | |||
4116 | return ret; | 4093 | return ret; |
4117 | } | 4094 | } |
4118 | EXPORT_SYMBOL_GPL(snd_soc_get_dai_id); | 4095 | EXPORT_SYMBOL_GPL(snd_soc_get_dai_id); |
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index dcc5ece08668..7d3859e1a7b9 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -181,6 +181,10 @@ int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, | |||
181 | dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", | 181 | dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", |
182 | be->dai_link->name, event, dir); | 182 | be->dai_link->name, event, dir); |
183 | 183 | ||
184 | if ((event == SND_SOC_DAPM_STREAM_STOP) && | ||
185 | (be->dpcm[dir].users >= 1)) | ||
186 | continue; | ||
187 | |||
184 | snd_soc_dapm_stream_event(be, dir, event); | 188 | snd_soc_dapm_stream_event(be, dir, event); |
185 | } | 189 | } |
186 | 190 | ||
@@ -2628,25 +2632,12 @@ static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream) | |||
2628 | return ret; | 2632 | return ret; |
2629 | } | 2633 | } |
2630 | 2634 | ||
2631 | static void soc_pcm_free(struct snd_pcm *pcm) | ||
2632 | { | ||
2633 | struct snd_soc_pcm_runtime *rtd = pcm->private_data; | ||
2634 | struct snd_soc_component *component; | ||
2635 | |||
2636 | list_for_each_entry(component, &rtd->card->component_dev_list, | ||
2637 | card_list) { | ||
2638 | if (component->pcm_free) | ||
2639 | component->pcm_free(pcm); | ||
2640 | } | ||
2641 | } | ||
2642 | |||
2643 | /* create a new pcm */ | 2635 | /* create a new pcm */ |
2644 | int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) | 2636 | int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) |
2645 | { | 2637 | { |
2646 | struct snd_soc_platform *platform = rtd->platform; | 2638 | struct snd_soc_platform *platform = rtd->platform; |
2647 | struct snd_soc_dai *codec_dai; | 2639 | struct snd_soc_dai *codec_dai; |
2648 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 2640 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
2649 | struct snd_soc_component *component; | ||
2650 | struct snd_pcm *pcm; | 2641 | struct snd_pcm *pcm; |
2651 | char new_name[64]; | 2642 | char new_name[64]; |
2652 | int ret = 0, playback = 0, capture = 0; | 2643 | int ret = 0, playback = 0, capture = 0; |
@@ -2756,18 +2747,17 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) | |||
2756 | if (capture) | 2747 | if (capture) |
2757 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops); | 2748 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &rtd->ops); |
2758 | 2749 | ||
2759 | list_for_each_entry(component, &rtd->card->component_dev_list, card_list) { | 2750 | if (platform->driver->pcm_new) { |
2760 | if (component->pcm_new) { | 2751 | ret = platform->driver->pcm_new(rtd); |
2761 | ret = component->pcm_new(rtd); | 2752 | if (ret < 0) { |
2762 | if (ret < 0) { | 2753 | dev_err(platform->dev, |
2763 | dev_err(component->dev, | 2754 | "ASoC: pcm constructor failed: %d\n", |
2764 | "ASoC: pcm constructor failed: %d\n", | 2755 | ret); |
2765 | ret); | 2756 | return ret; |
2766 | return ret; | ||
2767 | } | ||
2768 | } | 2757 | } |
2769 | } | 2758 | } |
2770 | pcm->private_free = soc_pcm_free; | 2759 | |
2760 | pcm->private_free = platform->driver->pcm_free; | ||
2771 | out: | 2761 | out: |
2772 | dev_info(rtd->card->dev, "%s <-> %s mapping ok\n", | 2762 | dev_info(rtd->card->dev, "%s <-> %s mapping ok\n", |
2773 | (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name, | 2763 | (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name, |
diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c index b50f68a439ce..ba9fc099cf67 100644 --- a/sound/soc/ux500/mop500.c +++ b/sound/soc/ux500/mop500.c | |||
@@ -33,6 +33,7 @@ static struct snd_soc_dai_link mop500_dai_links[] = { | |||
33 | .stream_name = "ab8500_0", | 33 | .stream_name = "ab8500_0", |
34 | .cpu_dai_name = "ux500-msp-i2s.1", | 34 | .cpu_dai_name = "ux500-msp-i2s.1", |
35 | .codec_dai_name = "ab8500-codec-dai.0", | 35 | .codec_dai_name = "ab8500-codec-dai.0", |
36 | .platform_name = "ux500-msp-i2s.1", | ||
36 | .codec_name = "ab8500-codec.0", | 37 | .codec_name = "ab8500-codec.0", |
37 | .init = mop500_ab8500_machine_init, | 38 | .init = mop500_ab8500_machine_init, |
38 | .ops = mop500_ab8500_ops, | 39 | .ops = mop500_ab8500_ops, |
@@ -42,6 +43,7 @@ static struct snd_soc_dai_link mop500_dai_links[] = { | |||
42 | .stream_name = "ab8500_1", | 43 | .stream_name = "ab8500_1", |
43 | .cpu_dai_name = "ux500-msp-i2s.3", | 44 | .cpu_dai_name = "ux500-msp-i2s.3", |
44 | .codec_dai_name = "ab8500-codec-dai.1", | 45 | .codec_dai_name = "ab8500-codec-dai.1", |
46 | .platform_name = "ux500-msp-i2s.3", | ||
45 | .codec_name = "ab8500-codec.0", | 47 | .codec_name = "ab8500-codec.0", |
46 | .init = NULL, | 48 | .init = NULL, |
47 | .ops = mop500_ab8500_ops, | 49 | .ops = mop500_ab8500_ops, |
@@ -85,6 +87,8 @@ static int mop500_of_probe(struct platform_device *pdev, | |||
85 | for (i = 0; i < 2; i++) { | 87 | for (i = 0; i < 2; i++) { |
86 | mop500_dai_links[i].cpu_of_node = msp_np[i]; | 88 | mop500_dai_links[i].cpu_of_node = msp_np[i]; |
87 | mop500_dai_links[i].cpu_dai_name = NULL; | 89 | mop500_dai_links[i].cpu_dai_name = NULL; |
90 | mop500_dai_links[i].platform_of_node = msp_np[i]; | ||
91 | mop500_dai_links[i].platform_name = NULL; | ||
88 | mop500_dai_links[i].codec_of_node = codec_np; | 92 | mop500_dai_links[i].codec_of_node = codec_np; |
89 | mop500_dai_links[i].codec_name = NULL; | 93 | mop500_dai_links[i].codec_name = NULL; |
90 | } | 94 | } |
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 082736c539bc..e630813c5008 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -542,6 +542,8 @@ int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
542 | 542 | ||
543 | if (size < sizeof(scale)) | 543 | if (size < sizeof(scale)) |
544 | return -ENOMEM; | 544 | return -ENOMEM; |
545 | if (cval->min_mute) | ||
546 | scale[0] = SNDRV_CTL_TLVT_DB_MINMAX_MUTE; | ||
545 | scale[2] = cval->dBmin; | 547 | scale[2] = cval->dBmin; |
546 | scale[3] = cval->dBmax; | 548 | scale[3] = cval->dBmax; |
547 | if (copy_to_user(_tlv, scale, sizeof(scale))) | 549 | if (copy_to_user(_tlv, scale, sizeof(scale))) |
diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h index 3417ef347e40..2b4b067646ab 100644 --- a/sound/usb/mixer.h +++ b/sound/usb/mixer.h | |||
@@ -64,6 +64,7 @@ struct usb_mixer_elem_info { | |||
64 | int cached; | 64 | int cached; |
65 | int cache_val[MAX_CHANNELS]; | 65 | int cache_val[MAX_CHANNELS]; |
66 | u8 initialized; | 66 | u8 initialized; |
67 | u8 min_mute; | ||
67 | void *private_data; | 68 | void *private_data; |
68 | }; | 69 | }; |
69 | 70 | ||
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index e3d1dec48ee4..e1e7ce9ab217 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c | |||
@@ -1878,6 +1878,12 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, | |||
1878 | if (unitid == 7 && cval->control == UAC_FU_VOLUME) | 1878 | if (unitid == 7 && cval->control == UAC_FU_VOLUME) |
1879 | snd_dragonfly_quirk_db_scale(mixer, cval, kctl); | 1879 | snd_dragonfly_quirk_db_scale(mixer, cval, kctl); |
1880 | break; | 1880 | break; |
1881 | /* lowest playback value is muted on C-Media devices */ | ||
1882 | case USB_ID(0x0d8c, 0x000c): | ||
1883 | case USB_ID(0x0d8c, 0x0014): | ||
1884 | if (strstr(kctl->id.name, "Playback")) | ||
1885 | cval->min_mute = 1; | ||
1886 | break; | ||
1881 | } | 1887 | } |
1882 | } | 1888 | } |
1883 | 1889 | ||
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index d7b0b0a3a2db..6a03f9697039 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -1142,6 +1142,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) | |||
1142 | case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ | 1142 | case USB_ID(0x0556, 0x0014): /* Phoenix Audio TMX320VC */ |
1143 | case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ | 1143 | case USB_ID(0x05A3, 0x9420): /* ELP HD USB Camera */ |
1144 | case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ | 1144 | case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ |
1145 | case USB_ID(0x1395, 0x740a): /* Sennheiser DECT */ | ||
1145 | case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ | 1146 | case USB_ID(0x1901, 0x0191): /* GE B850V3 CP2114 audio interface */ |
1146 | case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ | 1147 | case USB_ID(0x1de7, 0x0013): /* Phoenix Audio MT202exe */ |
1147 | case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ | 1148 | case USB_ID(0x1de7, 0x0014): /* Phoenix Audio TMX320 */ |
@@ -1374,6 +1375,10 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, | |||
1374 | } | 1375 | } |
1375 | } | 1376 | } |
1376 | break; | 1377 | break; |
1378 | case USB_ID(0x16d0, 0x0a23): | ||
1379 | if (fp->altsetting == 2) | ||
1380 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; | ||
1381 | break; | ||
1377 | 1382 | ||
1378 | default: | 1383 | default: |
1379 | break; | 1384 | break; |