From fe4cb86cdea781e969f37b9aa9db95577ff485f2 Mon Sep 17 00:00:00 2001 From: Jérémy Lefaure Date: Fri, 16 Dec 2016 19:25:27 -0500 Subject: ALSA: cs5535audio: fix unused warnings on resume/suspend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When CONFIG_PM_SLEEP is disabled, SIMPLE_DEV_PM_OPS does not use snd_cs5535audio_resume and snd_cs5535audio_suspend functions: sound/pci/cs5535audio/cs5535audio_pm.c:77:12: warning: ‘snd_cs5535audio_resume’ defined but not used [-Wunused-function] static int snd_cs5535audio_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~ sound/pci/cs5535audio/cs5535audio_pm.c:58:12: warning: ‘snd_cs5535audio_suspend’ defined but not used [-Wunused-function] static int snd_cs5535audio_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~~ Adding __maybe_unused to the declaration of these functions removes the warnings. Signed-off-by: Jérémy Lefaure Signed-off-by: Takashi Iwai --- sound/pci/cs5535audio/cs5535audio_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c index 06ac5d8da362..82bd10b68a77 100644 --- a/sound/pci/cs5535audio/cs5535audio_pm.c +++ b/sound/pci/cs5535audio/cs5535audio_pm.c @@ -55,7 +55,7 @@ static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au) } -static int snd_cs5535audio_suspend(struct device *dev) +static int __maybe_unused snd_cs5535audio_suspend(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); struct cs5535audio *cs5535au = card->private_data; @@ -74,7 +74,7 @@ static int snd_cs5535audio_suspend(struct device *dev) return 0; } -static int snd_cs5535audio_resume(struct device *dev) +static int __maybe_unused snd_cs5535audio_resume(struct device *dev) { struct snd_card *card = dev_get_drvdata(dev); struct cs5535audio *cs5535au = card->private_data; -- cgit v1.2.3 From f93a1c9e5e6a8ce05391708157af5bfd71fe6c21 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Fri, 16 Dec 2016 16:59:44 -0800 Subject: ALSA: synth: use designated initializers Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity. Signed-off-by: Kees Cook Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/synth/emux/emux_seq.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c index a0209204ae48..55579f6b8cb2 100644 --- a/sound/synth/emux/emux_seq.c +++ b/sound/synth/emux/emux_seq.c @@ -33,13 +33,13 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf * MIDI emulation operators */ static struct snd_midi_op emux_ops = { - snd_emux_note_on, - snd_emux_note_off, - snd_emux_key_press, - snd_emux_terminate_note, - snd_emux_control, - snd_emux_nrpn, - snd_emux_sysex, + .note_on = snd_emux_note_on, + .note_off = snd_emux_note_off, + .key_press = snd_emux_key_press, + .note_terminate = snd_emux_terminate_note, + .control = snd_emux_control, + .nrpn = snd_emux_nrpn, + .sysex = snd_emux_sysex, }; -- cgit v1.2.3 From 3eff682d765b496ce2f9727bb1e001ec77b21453 Mon Sep 17 00:00:00 2001 From: Jussi Laako Date: Sat, 17 Dec 2016 23:51:41 +0200 Subject: ALSA: usb-audio: Support both DSD LE/BE Amanero firmware versions Add DSD support for both little endian (DSD_U32_LE) and big endian (DSD_U32_BE) version of the Amanero firmware. Signed-off-by: Jussi Laako Signed-off-by: Takashi Iwai --- sound/usb/quirks.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index b3fd2382fdd9..f5c68ea0468e 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1359,6 +1359,21 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, if (fp->altsetting == 3) return SNDRV_PCM_FMTBIT_DSD_U32_BE; break; + + /* Amanero Combo384 USB interface with native DSD support */ + case USB_ID(0x16d0, 0x071a): + if (fp->altsetting == 2) { + switch (chip->dev->descriptor.bcdDevice) { + case 0x199: + return SNDRV_PCM_FMTBIT_DSD_U32_LE; + case 0x19b: + return SNDRV_PCM_FMTBIT_DSD_U32_BE; + default: + break; + } + } + break; + default: break; } -- cgit v1.2.3 From 1c623c2409b105c3960d60f450ccc0b37d8cb89a Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Sat, 24 Dec 2016 23:28:34 +0800 Subject: ALSA: mixart: fix a comment typo Fix a comment typo in mixart.h. Signed-off-by: Geliang Tang Signed-off-by: Takashi Iwai --- sound/pci/mixart/mixart.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/mixart/mixart.h b/sound/pci/mixart/mixart.h index 0cc17e0ea34a..426743871540 100644 --- a/sound/pci/mixart/mixart.h +++ b/sound/pci/mixart/mixart.h @@ -86,7 +86,7 @@ struct mixart_mgr { u32 msg_fifo[MSG_FIFO_SIZE]; int msg_fifo_readptr; int msg_fifo_writeptr; - atomic_t msg_processed; /* number of messages to be processed in takslet */ + atomic_t msg_processed; /* number of messages to be processed in tasklet */ struct mutex lock; /* interrupt lock */ struct mutex msg_lock; /* mailbox lock */ -- cgit v1.2.3 From 972aa2c708703c21f14eb958b37e82aae2530e44 Mon Sep 17 00:00:00 2001 From: Gabriele Mazzotta Date: Sat, 24 Dec 2016 19:50:00 +0100 Subject: ALSA: hda - Apply ALC269_FIXUP_NO_SHUTUP on HDA_FIXUP_ACT_PROBE Setting shutup when the action is HDA_FIXUP_ACT_PRE_PROBE might not have the desired effect since it could be overridden by another more generic shutup function. Prevent this by setting the more specific shutup function on HDA_FIXUP_ACT_PROBE. Signed-off-by: Gabriele Mazzotta Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 9448daff9d8b..937c2bbe8b50 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4400,7 +4400,7 @@ static void alc_no_shutup(struct hda_codec *codec) static void alc_fixup_no_shutup(struct hda_codec *codec, const struct hda_fixup *fix, int action) { - if (action == HDA_FIXUP_ACT_PRE_PROBE) { + if (action == HDA_FIXUP_ACT_PROBE) { struct alc_spec *spec = codec->spec; spec->shutup = alc_no_shutup; } -- cgit v1.2.3 From 823ff161fe51179cc9ad1a3f6c7e4532901e0444 Mon Sep 17 00:00:00 2001 From: Gabriele Mazzotta Date: Sat, 24 Dec 2016 19:50:01 +0100 Subject: ALSA: hda - Fix click noises on Samsung Ativ Book 8 The Samsung Ativ Book 8 makes a loud click noise on boot, shutdown and when the audio card enters or exits power saving states. All these noises disappear applying ALC269_FIXUP_NO_SHUTUP. In addition to that, fix the loud click noise that the laptop makes when inserting or removing the headphone jack by automuting via amp instead of pinctl. Signed-off-by: Gabriele Mazzotta Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 937c2bbe8b50..1ae29fd7a78b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4856,6 +4856,7 @@ enum { ALC292_FIXUP_TPT460, ALC298_FIXUP_SPK_VOLUME, ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, + ALC269_FIXUP_ATIV_BOOK_8, }; static const struct hda_fixup alc269_fixups[] = { @@ -5528,6 +5529,12 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE }, + [ALC269_FIXUP_ATIV_BOOK_8] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc_fixup_auto_mute_via_amp, + .chained = true, + .chain_id = ALC269_FIXUP_NO_SHUTUP + }, }; static const struct snd_pci_quirk alc269_fixup_tbl[] = { @@ -5664,6 +5671,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x10cf, 0x1757, "Lifebook E752", ALC269_FIXUP_LIFEBOOK_HP_PIN), SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), + SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), -- cgit v1.2.3 From 03abd33a11e3598dffbc821b2826ffc5fb6e980f Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Tue, 3 Jan 2017 11:36:08 +0900 Subject: ALSA: oxfw: add support for Mackie Onyx 1640i As of kernel 4.10, ALSA OXFW driver has no entry for Onyx 1640i produced by Mackie (Loud Technologies). This commit supplement it. I note that there're two models produced by Mackie (Loud Technologies), which have the same name 'Onyx 1640i'. The former model based on OXFW970, the latter model based on Dice. This is probably due to low quality of communication of OXFW series. Additionally, the tester reports his or her experiences to get unexpected result at higher sampling transmission frequency as 88.2/96.0 kHz. We didn't have further investigation yet[0]. $ ./linux-firewire-utils/src/crpp < config_rom ROM header and bus information block ----------------------------------------------------------------- 400 042525ce bus_info_length 4, crc_length 37, crc 9678 404 31333934 bus_name "1394" 408 20ff5003 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 255, max_rec 5 (64) 40c 000ff205 company_id 000ff2 | 410 00000fcf device_id 0500000fcf | EUI-64 000ff20500000fcf root directory ----------------------------------------------------------------- 414 0006c1b7 directory_length 6, crc 49591 418 03000ff2 vendor 41c 8100000a --> descriptor leaf at 444 420 17001640 model 424 81000011 --> descriptor leaf at 468 428 0c0083c0 node capabilities per IEEE 1394 42c d1000001 --> unit directory at 430 unit directory at 430 ----------------------------------------------------------------- 430 00040b97 directory_length 4, crc 2967 434 1200a02d specifier id: 1394 TA 438 13010001 version: AV/C 43c 17001640 model 440 81000010 --> descriptor leaf at 480 descriptor leaf at 444 ----------------------------------------------------------------- 444 0008a886 leaf_length 8, crc 43142 448 00000000 textual descriptor 44c 00000000 minimal ASCII 450 4c6f7564 "Loud" 454 20546563 " Tec" 458 686e6f6c "hnol" 45c 6f676965 "ogie" 460 7320496e "s In" 464 632e0000 "c." descriptor leaf at 468 ----------------------------------------------------------------- 468 00059fcf leaf_length 5, crc 40911 46c 00000000 textual descriptor 470 00000000 minimal ASCII 474 4f6e7978 "Onyx" 478 20313634 " 164" 47c 30690000 "0i" descriptor leaf at 480 ----------------------------------------------------------------- 480 00059fcf leaf_length 5, crc 40911 484 00000000 textual descriptor 488 00000000 minimal ASCII 48c 4f6e7978 "Onyx" 490 20313634 " 164" 494 30690000 "0i" [0]: [FFADO-user] Mackie 1640i issues (finer details) https://sourceforge.net/p/ffado/mailman/message/35229260/ Tested-by: Seth O'Bannion Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/Kconfig | 1 + sound/firewire/oxfw/oxfw.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sound/firewire/Kconfig b/sound/firewire/Kconfig index ab894ed1ff67..9f00696c4e4a 100644 --- a/sound/firewire/Kconfig +++ b/sound/firewire/Kconfig @@ -34,6 +34,7 @@ config SND_OXFW * LaCie Firewire Speakers * Behringer F-Control Audio 202 * Mackie(Loud) Onyx-i series (former models) + * Mackie(Loud) Onyx 1640i (former model) * Mackie(Loud) Onyx Satellite * Mackie(Loud) Tapco Link.Firewire * Mackie(Loud) d.2 pro/d.4 pro diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index e629b88f7d93..74d7fb6efce6 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -43,6 +43,7 @@ static bool detect_loud_models(struct fw_unit *unit) const char *const models[] = { "Onyxi", "Onyx-i", + "Onyx 1640i", "d.Pro", "Mackie Onyx Satellite", "Tapco LINK.firewire 4x6", -- cgit v1.2.3 From b0e159fe34f76abf4ae23a6c799f43b8c520695b Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Tue, 3 Jan 2017 12:44:43 +0900 Subject: ALSA: dice: ensure transmission speed for transmitted packets As of kernel 4.10, ALSA dice driver is expected to be used in default speed. In most cases, it's S400. While, IEEE 1394 specification describes the other speed such as S800. According to 'TCD30XX User Guide', its link layer controller supports several transmission speed up to S800[0]. In Dice software interface, transmission speed in output direction can be configured by asynchronous transaction to 'TX_SPEED' offset in its address space. S800 may be available. This commit improves configuration of transmission unit before starting packet streaming for this purpose. The value of 'max_speed' in 'fw_device' data structure has available maximum speed decided in bus arbitration, thus it's within capacity of the unit. [0] TCD3xx User Guide - TCAT 1394 LLC, Revision 0.9.0-41360 (TC Applied Technologies, May 6 2015) http://www.tctechnologies.tc/index.php/support/support-hardware/dice-iii-detailed-documentation Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/dice/dice-interface.h | 1 + sound/firewire/dice/dice-stream.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sound/firewire/dice/dice-interface.h b/sound/firewire/dice/dice-interface.h index 27b044f84c81..47f2c0a6f5d9 100644 --- a/sound/firewire/dice/dice-interface.h +++ b/sound/firewire/dice/dice-interface.h @@ -251,6 +251,7 @@ /* * The speed at which the packets are sent, SCODE_100-_400; read/write. + * SCODE_800 is only available in Dice III. */ #define TX_SPEED 0x014 diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c index ec4db3a514fc..8573289c381e 100644 --- a/sound/firewire/dice/dice-stream.c +++ b/sound/firewire/dice/dice-stream.c @@ -195,6 +195,7 @@ static int start_streams(struct snd_dice *dice, enum amdtp_stream_direction dir, unsigned int i, pcm_chs, midi_ports; struct amdtp_stream *streams; struct fw_iso_resources *resources; + struct fw_device *fw_dev = fw_parent_device(dice->unit); int err = 0; if (dir == AMDTP_IN_STREAM) { @@ -237,8 +238,17 @@ static int start_streams(struct snd_dice *dice, enum amdtp_stream_direction dir, if (err < 0) return err; + if (dir == AMDTP_IN_STREAM) { + reg[0] = cpu_to_be32(fw_dev->max_speed); + err = snd_dice_transaction_write_tx(dice, + params->size * i + TX_SPEED, + reg, sizeof(reg[0])); + if (err < 0) + return err; + } + err = amdtp_stream_start(&streams[i], resources[i].channel, - fw_parent_device(dice->unit)->max_speed); + fw_dev->max_speed); if (err < 0) return err; } -- cgit v1.2.3 From 28f1f9b26cee161ddd3985b3eb78e3ffada08dda Mon Sep 17 00:00:00 2001 From: Kailang Yang Date: Wed, 4 Jan 2017 14:49:07 +0800 Subject: ALSA: hda/realtek - Add new codec ID ALC299 ALC299 was similar as ALC225. Add headset support for ALC299. ALC3271 was for Dell rename. Signed-off-by: Kailang Yang Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 1ae29fd7a78b..3c6964793206 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -337,6 +337,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec) case 0x10ec0288: case 0x10ec0295: case 0x10ec0298: + case 0x10ec0299: alc_update_coef_idx(codec, 0x10, 1<<9, 0); break; case 0x10ec0285: @@ -912,6 +913,7 @@ static struct alc_codec_rename_pci_table rename_pci_tbl[] = { { 0x10ec0256, 0x1028, 0, "ALC3246" }, { 0x10ec0225, 0x1028, 0, "ALC3253" }, { 0x10ec0295, 0x1028, 0, "ALC3254" }, + { 0x10ec0299, 0x1028, 0, "ALC3271" }, { 0x10ec0670, 0x1025, 0, "ALC669X" }, { 0x10ec0676, 0x1025, 0, "ALC679X" }, { 0x10ec0282, 0x1043, 0, "ALC3229" }, @@ -3716,6 +3718,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) break; case 0x10ec0225: case 0x10ec0295: + case 0x10ec0299: alc_process_coef_fw(codec, coef0225); break; case 0x10ec0867: @@ -3823,6 +3826,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, break; case 0x10ec0225: case 0x10ec0295: + case 0x10ec0299: alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); alc_process_coef_fw(codec, coef0225); @@ -3881,6 +3885,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) switch (codec->core.vendor_id) { case 0x10ec0225: case 0x10ec0295: + case 0x10ec0299: alc_process_coef_fw(codec, coef0225); break; case 0x10ec0255: @@ -3996,6 +4001,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) break; case 0x10ec0225: case 0x10ec0295: + case 0x10ec0299: alc_process_coef_fw(codec, coef0225); break; case 0x10ec0867: @@ -4089,6 +4095,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) break; case 0x10ec0225: case 0x10ec0295: + case 0x10ec0299: alc_process_coef_fw(codec, coef0225); break; } @@ -4173,6 +4180,7 @@ static void alc_determine_headset_type(struct hda_codec *codec) break; case 0x10ec0225: case 0x10ec0295: + case 0x10ec0299: alc_process_coef_fw(codec, coef0225); msleep(800); val = alc_read_coef_idx(codec, 0x46); @@ -6219,6 +6227,7 @@ static int patch_alc269(struct hda_codec *codec) break; case 0x10ec0225: case 0x10ec0295: + case 0x10ec0299: spec->codec_variant = ALC269_TYPE_ALC225; break; case 0x10ec0234: @@ -7256,6 +7265,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), + HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), -- cgit v1.2.3 From ab949d519601880fd46e8bc1445d6a453bf2dc09 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 2 Jan 2017 11:37:04 +0100 Subject: ALSA: hda - Fix deadlock of controller device lock at unbinding Imre Deak reported a deadlock of HD-audio driver at unbinding while it's still in probing. Since we probe the codecs asynchronously in a work, the codec driver probe may still be kicked off while the controller itself is being unbound. And, azx_remove() tries to process all pending tasks via cancel_work_sync() for fixing the other races (see commit [0b8c82190c12: ALSA: hda - Cancel probe work instead of flush at remove]), now we may meet a bizarre deadlock: Unbind snd_hda_intel via sysfs: device_release_driver() -> device_lock(snd_hda_intel) -> azx_remove() -> cancel_work_sync(azx_probe_work) azx_probe_work(): codec driver probe() -> __driver_attach() -> device_lock(snd_hda_intel) This deadlock is caused by the fact that both device_release_driver() and driver_probe_device() take both the device and its parent locks at the same time. The codec device sets the controller device as its parent, and this lock is taken before the probe() callback is called, while the controller remove() callback gets called also with the same lock. In this patch, as an ugly workaround, we unlock the controller device temporarily during cancel_work_sync() call. The race against another bind call should be still suppressed by the parent's device lock. Reported-by: Imre Deak Fixes: 0b8c82190c12 ("ALSA: hda - Cancel probe work instead of flush at remove") Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_intel.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index c64d986009a9..2587c197e353 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2155,7 +2155,20 @@ static void azx_remove(struct pci_dev *pci) /* cancel the pending probing work */ chip = card->private_data; hda = container_of(chip, struct hda_intel, chip); + /* FIXME: below is an ugly workaround. + * Both device_release_driver() and driver_probe_device() + * take *both* the device's and its parent's lock before + * calling the remove() and probe() callbacks. The codec + * probe takes the locks of both the codec itself and its + * parent, i.e. the PCI controller dev. Meanwhile, when + * the PCI controller is unbound, it takes its lock, too + * ==> ouch, a deadlock! + * As a workaround, we unlock temporarily here the controller + * device during cancel_work_sync() call. + */ + device_unlock(&pci->dev); cancel_work_sync(&hda->probe_work); + device_lock(&pci->dev); snd_card_free(card); } -- cgit v1.2.3 From 874e1f6fad9a5184b67f4cee37c1335cd2cc5677 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 4 Jan 2017 12:19:15 +0100 Subject: ALSA: vx: Fix possible transfer overflow The pseudo DMA transfer codes in VX222 and VX-pocket driver have a slight bug where they check the buffer boundary wrongly, and may overflow. Also, the zero sample count might be handled badly for the playback (although it shouldn't happen in theory). This patch addresses these issues. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=141541 Signed-off-by: Takashi Iwai --- sound/drivers/vx/vx_pcm.c | 6 ++++-- sound/pci/vx222/vx222_ops.c | 12 ++++++------ sound/pcmcia/vx/vxp_ops.c | 12 ++++++------ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 11467272089e..41a617886cc7 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -1048,8 +1048,10 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream /* ok, let's accelerate! */ int align = pipe->align * 3; space = (count / align) * align; - vx_pseudo_dma_read(chip, runtime, pipe, space); - count -= space; + if (space > 0) { + vx_pseudo_dma_read(chip, runtime, pipe, space); + count -= space; + } } /* read the rest of bytes */ while (count > 0) { diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index af83b3b38052..8e457ea27f89 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c @@ -269,12 +269,12 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, /* Transfer using pseudo-dma. */ - if (offset + count > pipe->buffer_bytes) { + if (offset + count >= pipe->buffer_bytes) { int length = pipe->buffer_bytes - offset; count -= length; length >>= 2; /* in 32bit words */ /* Transfer using pseudo-dma. */ - while (length-- > 0) { + for (; length > 0; length--) { outl(cpu_to_le32(*addr), port); addr++; } @@ -284,7 +284,7 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, pipe->hw_ptr += count; count >>= 2; /* in 32bit words */ /* Transfer using pseudo-dma. */ - while (count-- > 0) { + for (; count > 0; count--) { outl(cpu_to_le32(*addr), port); addr++; } @@ -307,12 +307,12 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, vx2_setup_pseudo_dma(chip, 0); /* Transfer using pseudo-dma. */ - if (offset + count > pipe->buffer_bytes) { + if (offset + count >= pipe->buffer_bytes) { int length = pipe->buffer_bytes - offset; count -= length; length >>= 2; /* in 32bit words */ /* Transfer using pseudo-dma. */ - while (length-- > 0) + for (; length > 0; length--) *addr++ = le32_to_cpu(inl(port)); addr = (u32 *)runtime->dma_area; pipe->hw_ptr = 0; @@ -320,7 +320,7 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, pipe->hw_ptr += count; count >>= 2; /* in 32bit words */ /* Transfer using pseudo-dma. */ - while (count-- > 0) + for (; count > 0; count--) *addr++ = le32_to_cpu(inl(port)); vx2_release_pseudo_dma(chip); diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c index 281972913c32..56aa1ba73ccc 100644 --- a/sound/pcmcia/vx/vxp_ops.c +++ b/sound/pcmcia/vx/vxp_ops.c @@ -369,12 +369,12 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, unsigned short *addr = (unsigned short *)(runtime->dma_area + offset); vx_setup_pseudo_dma(chip, 1); - if (offset + count > pipe->buffer_bytes) { + if (offset + count >= pipe->buffer_bytes) { int length = pipe->buffer_bytes - offset; count -= length; length >>= 1; /* in 16bit words */ /* Transfer using pseudo-dma. */ - while (length-- > 0) { + for (; length > 0; length--) { outw(cpu_to_le16(*addr), port); addr++; } @@ -384,7 +384,7 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, pipe->hw_ptr += count; count >>= 1; /* in 16bit words */ /* Transfer using pseudo-dma. */ - while (count-- > 0) { + for (; count > 0; count--) { outw(cpu_to_le16(*addr), port); addr++; } @@ -411,12 +411,12 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, if (snd_BUG_ON(count % 2)) return; vx_setup_pseudo_dma(chip, 0); - if (offset + count > pipe->buffer_bytes) { + if (offset + count >= pipe->buffer_bytes) { int length = pipe->buffer_bytes - offset; count -= length; length >>= 1; /* in 16bit words */ /* Transfer using pseudo-dma. */ - while (length-- > 0) + for (; length > 0; length--) *addr++ = le16_to_cpu(inw(port)); addr = (unsigned short *)runtime->dma_area; pipe->hw_ptr = 0; @@ -424,7 +424,7 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, pipe->hw_ptr += count; count >>= 1; /* in 16bit words */ /* Transfer using pseudo-dma. */ - while (count-- > 1) + for (; count > 1; count--) *addr++ = le16_to_cpu(inw(port)); /* Disable DMA */ pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK; -- cgit v1.2.3 From ed3c177d960bb5881b945ca6f784868126bb90db Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 4 Jan 2017 12:34:14 +0100 Subject: ALSA: vx: Don't try to update capture stream before running The update of stream costs significantly, and we should avoid it unless the stream really has started. Check pipe->running flag instead of pipe->prepared. Signed-off-by: Takashi Iwai --- sound/drivers/vx/vx_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index 41a617886cc7..ea7b377f0378 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream int size, space, count; struct snd_pcm_runtime *runtime = subs->runtime; - if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) + if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE)) return; size = runtime->buffer_size - snd_pcm_capture_avail(runtime); -- cgit v1.2.3 From 4780f774f99129f1650d250e346d5bfba98d9f4f Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Thu, 5 Jan 2017 21:48:07 +0900 Subject: ALSA: bebob: enclose identifiers referred by single function Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/bebob/bebob_hwdep.c | 17 ++++++------- sound/firewire/bebob/bebob_midi.c | 26 +++++++++---------- sound/firewire/bebob/bebob_pcm.c | 51 +++++++++++++++++++------------------- 3 files changed, 45 insertions(+), 49 deletions(-) diff --git a/sound/firewire/bebob/bebob_hwdep.c b/sound/firewire/bebob/bebob_hwdep.c index ce731f4d8b4f..2b367c21b80c 100644 --- a/sound/firewire/bebob/bebob_hwdep.c +++ b/sound/firewire/bebob/bebob_hwdep.c @@ -172,16 +172,15 @@ hwdep_compat_ioctl(struct snd_hwdep *hwdep, struct file *file, #define hwdep_compat_ioctl NULL #endif -static const struct snd_hwdep_ops hwdep_ops = { - .read = hwdep_read, - .release = hwdep_release, - .poll = hwdep_poll, - .ioctl = hwdep_ioctl, - .ioctl_compat = hwdep_compat_ioctl, -}; - int snd_bebob_create_hwdep_device(struct snd_bebob *bebob) { + static const struct snd_hwdep_ops ops = { + .read = hwdep_read, + .release = hwdep_release, + .poll = hwdep_poll, + .ioctl = hwdep_ioctl, + .ioctl_compat = hwdep_compat_ioctl, + }; struct snd_hwdep *hwdep; int err; @@ -190,7 +189,7 @@ int snd_bebob_create_hwdep_device(struct snd_bebob *bebob) goto end; strcpy(hwdep->name, "BeBoB"); hwdep->iface = SNDRV_HWDEP_IFACE_FW_BEBOB; - hwdep->ops = hwdep_ops; + hwdep->ops = ops; hwdep->private_data = bebob; hwdep->exclusive = true; end: diff --git a/sound/firewire/bebob/bebob_midi.c b/sound/firewire/bebob/bebob_midi.c index 868eb0decbec..7e5fb4b990bd 100644 --- a/sound/firewire/bebob/bebob_midi.c +++ b/sound/firewire/bebob/bebob_midi.c @@ -106,18 +106,6 @@ static void midi_playback_trigger(struct snd_rawmidi_substream *substrm, int up) spin_unlock_irqrestore(&bebob->lock, flags); } -static struct snd_rawmidi_ops midi_capture_ops = { - .open = midi_capture_open, - .close = midi_capture_close, - .trigger = midi_capture_trigger, -}; - -static struct snd_rawmidi_ops midi_playback_ops = { - .open = midi_playback_open, - .close = midi_playback_close, - .trigger = midi_playback_trigger, -}; - static void set_midi_substream_names(struct snd_bebob *bebob, struct snd_rawmidi_str *str) { @@ -132,6 +120,16 @@ static void set_midi_substream_names(struct snd_bebob *bebob, int snd_bebob_create_midi_devices(struct snd_bebob *bebob) { + static struct snd_rawmidi_ops capture_ops = { + .open = midi_capture_open, + .close = midi_capture_close, + .trigger = midi_capture_trigger, + }; + static struct snd_rawmidi_ops playback_ops = { + .open = midi_playback_open, + .close = midi_playback_close, + .trigger = midi_playback_trigger, + }; struct snd_rawmidi *rmidi; struct snd_rawmidi_str *str; int err; @@ -151,7 +149,7 @@ int snd_bebob_create_midi_devices(struct snd_bebob *bebob) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT; snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, - &midi_capture_ops); + &capture_ops); str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]; @@ -162,7 +160,7 @@ int snd_bebob_create_midi_devices(struct snd_bebob *bebob) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT; snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, - &midi_playback_ops); + &playback_ops); str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT]; diff --git a/sound/firewire/bebob/bebob_pcm.c b/sound/firewire/bebob/bebob_pcm.c index 5d7b9343fa85..9e27eb8e1dd4 100644 --- a/sound/firewire/bebob/bebob_pcm.c +++ b/sound/firewire/bebob/bebob_pcm.c @@ -359,32 +359,31 @@ pcm_playback_pointer(struct snd_pcm_substream *sbstrm) return amdtp_stream_pcm_pointer(&bebob->rx_stream); } -static const struct snd_pcm_ops pcm_capture_ops = { - .open = pcm_open, - .close = pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = pcm_capture_hw_params, - .hw_free = pcm_capture_hw_free, - .prepare = pcm_capture_prepare, - .trigger = pcm_capture_trigger, - .pointer = pcm_capture_pointer, - .page = snd_pcm_lib_get_vmalloc_page, -}; -static const struct snd_pcm_ops pcm_playback_ops = { - .open = pcm_open, - .close = pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = pcm_playback_hw_params, - .hw_free = pcm_playback_hw_free, - .prepare = pcm_playback_prepare, - .trigger = pcm_playback_trigger, - .pointer = pcm_playback_pointer, - .page = snd_pcm_lib_get_vmalloc_page, - .mmap = snd_pcm_lib_mmap_vmalloc, -}; - int snd_bebob_create_pcm_devices(struct snd_bebob *bebob) { + static const struct snd_pcm_ops capture_ops = { + .open = pcm_open, + .close = pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = pcm_capture_hw_params, + .hw_free = pcm_capture_hw_free, + .prepare = pcm_capture_prepare, + .trigger = pcm_capture_trigger, + .pointer = pcm_capture_pointer, + .page = snd_pcm_lib_get_vmalloc_page, + }; + static const struct snd_pcm_ops playback_ops = { + .open = pcm_open, + .close = pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = pcm_playback_hw_params, + .hw_free = pcm_playback_hw_free, + .prepare = pcm_playback_prepare, + .trigger = pcm_playback_trigger, + .pointer = pcm_playback_pointer, + .page = snd_pcm_lib_get_vmalloc_page, + .mmap = snd_pcm_lib_mmap_vmalloc, + }; struct snd_pcm *pcm; int err; @@ -395,8 +394,8 @@ int snd_bebob_create_pcm_devices(struct snd_bebob *bebob) pcm->private_data = bebob; snprintf(pcm->name, sizeof(pcm->name), "%s PCM", bebob->card->shortname); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_playback_ops); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &playback_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &capture_ops); end: return err; } -- cgit v1.2.3 From 7cdc887a00d79a1553009eb7afd308882e4b74d5 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Thu, 5 Jan 2017 21:48:08 +0900 Subject: ALSA: fireworks: enclose identifiers referred by single function Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/fireworks/fireworks_hwdep.c | 19 ++++++----- sound/firewire/fireworks/fireworks_midi.c | 26 +++++++-------- sound/firewire/fireworks/fireworks_pcm.c | 52 ++++++++++++++---------------- 3 files changed, 46 insertions(+), 51 deletions(-) diff --git a/sound/firewire/fireworks/fireworks_hwdep.c b/sound/firewire/fireworks/fireworks_hwdep.c index 2e1d9a23920c..a3a3a16f5e08 100644 --- a/sound/firewire/fireworks/fireworks_hwdep.c +++ b/sound/firewire/fireworks/fireworks_hwdep.c @@ -303,17 +303,16 @@ hwdep_compat_ioctl(struct snd_hwdep *hwdep, struct file *file, #define hwdep_compat_ioctl NULL #endif -static const struct snd_hwdep_ops hwdep_ops = { - .read = hwdep_read, - .write = hwdep_write, - .release = hwdep_release, - .poll = hwdep_poll, - .ioctl = hwdep_ioctl, - .ioctl_compat = hwdep_compat_ioctl, -}; - int snd_efw_create_hwdep_device(struct snd_efw *efw) { + static const struct snd_hwdep_ops ops = { + .read = hwdep_read, + .write = hwdep_write, + .release = hwdep_release, + .poll = hwdep_poll, + .ioctl = hwdep_ioctl, + .ioctl_compat = hwdep_compat_ioctl, + }; struct snd_hwdep *hwdep; int err; @@ -322,7 +321,7 @@ int snd_efw_create_hwdep_device(struct snd_efw *efw) goto end; strcpy(hwdep->name, "Fireworks"); hwdep->iface = SNDRV_HWDEP_IFACE_FW_FIREWORKS; - hwdep->ops = hwdep_ops; + hwdep->ops = ops; hwdep->private_data = efw; hwdep->exclusive = true; end: diff --git a/sound/firewire/fireworks/fireworks_midi.c b/sound/firewire/fireworks/fireworks_midi.c index 3e8c4cf9fe1e..2873eca22bfc 100644 --- a/sound/firewire/fireworks/fireworks_midi.c +++ b/sound/firewire/fireworks/fireworks_midi.c @@ -107,18 +107,6 @@ static void midi_playback_trigger(struct snd_rawmidi_substream *substrm, int up) spin_unlock_irqrestore(&efw->lock, flags); } -static struct snd_rawmidi_ops midi_capture_ops = { - .open = midi_capture_open, - .close = midi_capture_close, - .trigger = midi_capture_trigger, -}; - -static struct snd_rawmidi_ops midi_playback_ops = { - .open = midi_playback_open, - .close = midi_playback_close, - .trigger = midi_playback_trigger, -}; - static void set_midi_substream_names(struct snd_efw *efw, struct snd_rawmidi_str *str) { @@ -132,6 +120,16 @@ static void set_midi_substream_names(struct snd_efw *efw, int snd_efw_create_midi_devices(struct snd_efw *efw) { + static struct snd_rawmidi_ops capture_ops = { + .open = midi_capture_open, + .close = midi_capture_close, + .trigger = midi_capture_trigger, + }; + static struct snd_rawmidi_ops playback_ops = { + .open = midi_playback_open, + .close = midi_playback_close, + .trigger = midi_playback_trigger, + }; struct snd_rawmidi *rmidi; struct snd_rawmidi_str *str; int err; @@ -151,7 +149,7 @@ int snd_efw_create_midi_devices(struct snd_efw *efw) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT; snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, - &midi_capture_ops); + &capture_ops); str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]; @@ -162,7 +160,7 @@ int snd_efw_create_midi_devices(struct snd_efw *efw) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT; snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, - &midi_playback_ops); + &playback_ops); str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT]; diff --git a/sound/firewire/fireworks/fireworks_pcm.c b/sound/firewire/fireworks/fireworks_pcm.c index f4fbf75ed198..9171702f7d0b 100644 --- a/sound/firewire/fireworks/fireworks_pcm.c +++ b/sound/firewire/fireworks/fireworks_pcm.c @@ -383,33 +383,31 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstrm) return amdtp_stream_pcm_pointer(&efw->rx_stream); } -static const struct snd_pcm_ops pcm_capture_ops = { - .open = pcm_open, - .close = pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = pcm_capture_hw_params, - .hw_free = pcm_capture_hw_free, - .prepare = pcm_capture_prepare, - .trigger = pcm_capture_trigger, - .pointer = pcm_capture_pointer, - .page = snd_pcm_lib_get_vmalloc_page, -}; - -static const struct snd_pcm_ops pcm_playback_ops = { - .open = pcm_open, - .close = pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = pcm_playback_hw_params, - .hw_free = pcm_playback_hw_free, - .prepare = pcm_playback_prepare, - .trigger = pcm_playback_trigger, - .pointer = pcm_playback_pointer, - .page = snd_pcm_lib_get_vmalloc_page, - .mmap = snd_pcm_lib_mmap_vmalloc, -}; - int snd_efw_create_pcm_devices(struct snd_efw *efw) { + static const struct snd_pcm_ops capture_ops = { + .open = pcm_open, + .close = pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = pcm_capture_hw_params, + .hw_free = pcm_capture_hw_free, + .prepare = pcm_capture_prepare, + .trigger = pcm_capture_trigger, + .pointer = pcm_capture_pointer, + .page = snd_pcm_lib_get_vmalloc_page, + }; + static const struct snd_pcm_ops playback_ops = { + .open = pcm_open, + .close = pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = pcm_playback_hw_params, + .hw_free = pcm_playback_hw_free, + .prepare = pcm_playback_prepare, + .trigger = pcm_playback_trigger, + .pointer = pcm_playback_pointer, + .page = snd_pcm_lib_get_vmalloc_page, + .mmap = snd_pcm_lib_mmap_vmalloc, + }; struct snd_pcm *pcm; int err; @@ -419,8 +417,8 @@ int snd_efw_create_pcm_devices(struct snd_efw *efw) pcm->private_data = efw; snprintf(pcm->name, sizeof(pcm->name), "%s PCM", efw->card->shortname); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_playback_ops); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &playback_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &capture_ops); end: return err; } -- cgit v1.2.3 From 39feaf2d0a2e1844a7d4c26ac1fac66176a15515 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Thu, 5 Jan 2017 21:48:09 +0900 Subject: ALSA: oxfw: enclose identifiers referred by single function Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/oxfw/oxfw-midi.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sound/firewire/oxfw/oxfw-midi.c b/sound/firewire/oxfw/oxfw-midi.c index 8665e1043d41..076a1a977275 100644 --- a/sound/firewire/oxfw/oxfw-midi.c +++ b/sound/firewire/oxfw/oxfw-midi.c @@ -116,18 +116,6 @@ static void midi_playback_trigger(struct snd_rawmidi_substream *substrm, int up) spin_unlock_irqrestore(&oxfw->lock, flags); } -static struct snd_rawmidi_ops midi_capture_ops = { - .open = midi_capture_open, - .close = midi_capture_close, - .trigger = midi_capture_trigger, -}; - -static struct snd_rawmidi_ops midi_playback_ops = { - .open = midi_playback_open, - .close = midi_playback_close, - .trigger = midi_playback_trigger, -}; - static void set_midi_substream_names(struct snd_oxfw *oxfw, struct snd_rawmidi_str *str) { @@ -142,6 +130,16 @@ static void set_midi_substream_names(struct snd_oxfw *oxfw, int snd_oxfw_create_midi(struct snd_oxfw *oxfw) { + static struct snd_rawmidi_ops capture_ops = { + .open = midi_capture_open, + .close = midi_capture_close, + .trigger = midi_capture_trigger, + }; + static struct snd_rawmidi_ops playback_ops = { + .open = midi_playback_open, + .close = midi_playback_close, + .trigger = midi_playback_trigger, + }; struct snd_rawmidi *rmidi; struct snd_rawmidi_str *str; int err; @@ -164,7 +162,7 @@ int snd_oxfw_create_midi(struct snd_oxfw *oxfw) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT; snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, - &midi_capture_ops); + &capture_ops); str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]; @@ -175,7 +173,7 @@ int snd_oxfw_create_midi(struct snd_oxfw *oxfw) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT; snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, - &midi_playback_ops); + &playback_ops); str = &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT]; -- cgit v1.2.3 From fcbe08d469bd3778e691e3b0f156d51f8b1ba2e4 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Thu, 5 Jan 2017 21:48:10 +0900 Subject: ALSA: dice: enclose identifiers referred by single function Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/dice/dice-midi.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sound/firewire/dice/dice-midi.c b/sound/firewire/dice/dice-midi.c index a040617505a7..cdf71c211342 100644 --- a/sound/firewire/dice/dice-midi.c +++ b/sound/firewire/dice/dice-midi.c @@ -78,18 +78,6 @@ static void midi_playback_trigger(struct snd_rawmidi_substream *substrm, int up) spin_unlock_irqrestore(&dice->lock, flags); } -static struct snd_rawmidi_ops capture_ops = { - .open = midi_open, - .close = midi_close, - .trigger = midi_capture_trigger, -}; - -static struct snd_rawmidi_ops playback_ops = { - .open = midi_open, - .close = midi_close, - .trigger = midi_playback_trigger, -}; - static void set_midi_substream_names(struct snd_dice *dice, struct snd_rawmidi_str *str) { @@ -103,6 +91,16 @@ static void set_midi_substream_names(struct snd_dice *dice, int snd_dice_create_midi(struct snd_dice *dice) { + static struct snd_rawmidi_ops capture_ops = { + .open = midi_open, + .close = midi_close, + .trigger = midi_capture_trigger, + }; + static struct snd_rawmidi_ops playback_ops = { + .open = midi_open, + .close = midi_close, + .trigger = midi_playback_trigger, + }; __be32 reg; struct snd_rawmidi *rmidi; struct snd_rawmidi_str *str; -- cgit v1.2.3 From a4e86cba09c9e2bb64af018544a7aed4a6a1b538 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Thu, 5 Jan 2017 21:48:11 +0900 Subject: ALSA: firewire-digi00x: enclose identifiers referred by single function Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/digi00x/digi00x-hwdep.c | 17 ++++++----- sound/firewire/digi00x/digi00x-midi.c | 52 ++++++++++++++++------------------ sound/firewire/digi00x/digi00x-pcm.c | 52 ++++++++++++++++------------------ 3 files changed, 57 insertions(+), 64 deletions(-) diff --git a/sound/firewire/digi00x/digi00x-hwdep.c b/sound/firewire/digi00x/digi00x-hwdep.c index f188e4758fd2..463c6b8e864d 100644 --- a/sound/firewire/digi00x/digi00x-hwdep.c +++ b/sound/firewire/digi00x/digi00x-hwdep.c @@ -173,16 +173,15 @@ static int hwdep_compat_ioctl(struct snd_hwdep *hwdep, struct file *file, #define hwdep_compat_ioctl NULL #endif -static const struct snd_hwdep_ops hwdep_ops = { - .read = hwdep_read, - .release = hwdep_release, - .poll = hwdep_poll, - .ioctl = hwdep_ioctl, - .ioctl_compat = hwdep_compat_ioctl, -}; - int snd_dg00x_create_hwdep_device(struct snd_dg00x *dg00x) { + static const struct snd_hwdep_ops ops = { + .read = hwdep_read, + .release = hwdep_release, + .poll = hwdep_poll, + .ioctl = hwdep_ioctl, + .ioctl_compat = hwdep_compat_ioctl, + }; struct snd_hwdep *hwdep; int err; @@ -192,7 +191,7 @@ int snd_dg00x_create_hwdep_device(struct snd_dg00x *dg00x) strcpy(hwdep->name, "Digi00x"); hwdep->iface = SNDRV_HWDEP_IFACE_FW_DIGI00X; - hwdep->ops = hwdep_ops; + hwdep->ops = ops; hwdep->private_data = dg00x; hwdep->exclusive = true; diff --git a/sound/firewire/digi00x/digi00x-midi.c b/sound/firewire/digi00x/digi00x-midi.c index 1a72a382b384..8689c3bb4c6a 100644 --- a/sound/firewire/digi00x/digi00x-midi.c +++ b/sound/firewire/digi00x/digi00x-midi.c @@ -76,18 +76,6 @@ static void midi_phys_playback_trigger(struct snd_rawmidi_substream *substream, spin_unlock_irqrestore(&dg00x->lock, flags); } -static struct snd_rawmidi_ops midi_phys_capture_ops = { - .open = midi_phys_open, - .close = midi_phys_close, - .trigger = midi_phys_capture_trigger, -}; - -static struct snd_rawmidi_ops midi_phys_playback_ops = { - .open = midi_phys_open, - .close = midi_phys_close, - .trigger = midi_phys_playback_trigger, -}; - static int midi_ctl_open(struct snd_rawmidi_substream *substream) { /* Do nothing. */ @@ -139,18 +127,6 @@ static void midi_ctl_playback_trigger(struct snd_rawmidi_substream *substream, spin_unlock_irqrestore(&dg00x->lock, flags); } -static struct snd_rawmidi_ops midi_ctl_capture_ops = { - .open = midi_ctl_open, - .close = midi_ctl_capture_close, - .trigger = midi_ctl_capture_trigger, -}; - -static struct snd_rawmidi_ops midi_ctl_playback_ops = { - .open = midi_ctl_open, - .close = midi_ctl_playback_close, - .trigger = midi_ctl_playback_trigger, -}; - static void set_midi_substream_names(struct snd_dg00x *dg00x, struct snd_rawmidi_str *str, bool is_ctl) @@ -172,6 +148,26 @@ static void set_midi_substream_names(struct snd_dg00x *dg00x, int snd_dg00x_create_midi_devices(struct snd_dg00x *dg00x) { + static struct snd_rawmidi_ops phys_capture_ops = { + .open = midi_phys_open, + .close = midi_phys_close, + .trigger = midi_phys_capture_trigger, + }; + static struct snd_rawmidi_ops phys_playback_ops = { + .open = midi_phys_open, + .close = midi_phys_close, + .trigger = midi_phys_playback_trigger, + }; + static struct snd_rawmidi_ops ctl_capture_ops = { + .open = midi_ctl_open, + .close = midi_ctl_capture_close, + .trigger = midi_ctl_capture_trigger, + }; + static struct snd_rawmidi_ops ctl_playback_ops = { + .open = midi_ctl_open, + .close = midi_ctl_playback_close, + .trigger = midi_ctl_playback_trigger, + }; struct snd_rawmidi *rmidi[2]; struct snd_rawmidi_str *str; unsigned int i; @@ -187,9 +183,9 @@ int snd_dg00x_create_midi_devices(struct snd_dg00x *dg00x) "%s MIDI", dg00x->card->shortname); snd_rawmidi_set_ops(rmidi[0], SNDRV_RAWMIDI_STREAM_INPUT, - &midi_phys_capture_ops); + &phys_capture_ops); snd_rawmidi_set_ops(rmidi[0], SNDRV_RAWMIDI_STREAM_OUTPUT, - &midi_phys_playback_ops); + &phys_playback_ops); /* Add a pair of control midi ports. */ err = snd_rawmidi_new(dg00x->card, dg00x->card->driver, 1, @@ -201,9 +197,9 @@ int snd_dg00x_create_midi_devices(struct snd_dg00x *dg00x) "%s control", dg00x->card->shortname); snd_rawmidi_set_ops(rmidi[1], SNDRV_RAWMIDI_STREAM_INPUT, - &midi_ctl_capture_ops); + &ctl_capture_ops); snd_rawmidi_set_ops(rmidi[1], SNDRV_RAWMIDI_STREAM_OUTPUT, - &midi_ctl_playback_ops); + &ctl_playback_ops); for (i = 0; i < ARRAY_SIZE(rmidi); i++) { rmidi[i]->private_data = dg00x; diff --git a/sound/firewire/digi00x/digi00x-pcm.c b/sound/firewire/digi00x/digi00x-pcm.c index 613f05872770..68d1c52db051 100644 --- a/sound/firewire/digi00x/digi00x-pcm.c +++ b/sound/firewire/digi00x/digi00x-pcm.c @@ -329,33 +329,31 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstrm) return amdtp_stream_pcm_pointer(&dg00x->rx_stream); } -static const struct snd_pcm_ops pcm_capture_ops = { - .open = pcm_open, - .close = pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = pcm_capture_hw_params, - .hw_free = pcm_capture_hw_free, - .prepare = pcm_capture_prepare, - .trigger = pcm_capture_trigger, - .pointer = pcm_capture_pointer, - .page = snd_pcm_lib_get_vmalloc_page, -}; - -static const struct snd_pcm_ops pcm_playback_ops = { - .open = pcm_open, - .close = pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = pcm_playback_hw_params, - .hw_free = pcm_playback_hw_free, - .prepare = pcm_playback_prepare, - .trigger = pcm_playback_trigger, - .pointer = pcm_playback_pointer, - .page = snd_pcm_lib_get_vmalloc_page, - .mmap = snd_pcm_lib_mmap_vmalloc, -}; - int snd_dg00x_create_pcm_devices(struct snd_dg00x *dg00x) { + static const struct snd_pcm_ops capture_ops = { + .open = pcm_open, + .close = pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = pcm_capture_hw_params, + .hw_free = pcm_capture_hw_free, + .prepare = pcm_capture_prepare, + .trigger = pcm_capture_trigger, + .pointer = pcm_capture_pointer, + .page = snd_pcm_lib_get_vmalloc_page, + }; + static const struct snd_pcm_ops playback_ops = { + .open = pcm_open, + .close = pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = pcm_playback_hw_params, + .hw_free = pcm_playback_hw_free, + .prepare = pcm_playback_prepare, + .trigger = pcm_playback_trigger, + .pointer = pcm_playback_pointer, + .page = snd_pcm_lib_get_vmalloc_page, + .mmap = snd_pcm_lib_mmap_vmalloc, + }; struct snd_pcm *pcm; int err; @@ -366,8 +364,8 @@ int snd_dg00x_create_pcm_devices(struct snd_dg00x *dg00x) pcm->private_data = dg00x; snprintf(pcm->name, sizeof(pcm->name), "%s PCM", dg00x->card->shortname); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_playback_ops); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &playback_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &capture_ops); return 0; } -- cgit v1.2.3 From 921282360b9c9bf34c75cd18bb90f298c4f4ebc8 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Thu, 5 Jan 2017 21:48:12 +0900 Subject: ALSA: firewire-tascam: enclose identifiers referred by single function Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/tascam/tascam-hwdep.c | 17 ++++++------ sound/firewire/tascam/tascam-midi.c | 26 +++++++++--------- sound/firewire/tascam/tascam-pcm.c | 52 +++++++++++++++++------------------- 3 files changed, 45 insertions(+), 50 deletions(-) diff --git a/sound/firewire/tascam/tascam-hwdep.c b/sound/firewire/tascam/tascam-hwdep.c index 106406cbfaa3..8c4437d0051d 100644 --- a/sound/firewire/tascam/tascam-hwdep.c +++ b/sound/firewire/tascam/tascam-hwdep.c @@ -163,16 +163,15 @@ static int hwdep_compat_ioctl(struct snd_hwdep *hwdep, struct file *file, #define hwdep_compat_ioctl NULL #endif -static const struct snd_hwdep_ops hwdep_ops = { - .read = hwdep_read, - .release = hwdep_release, - .poll = hwdep_poll, - .ioctl = hwdep_ioctl, - .ioctl_compat = hwdep_compat_ioctl, -}; - int snd_tscm_create_hwdep_device(struct snd_tscm *tscm) { + static const struct snd_hwdep_ops ops = { + .read = hwdep_read, + .release = hwdep_release, + .poll = hwdep_poll, + .ioctl = hwdep_ioctl, + .ioctl_compat = hwdep_compat_ioctl, + }; struct snd_hwdep *hwdep; int err; @@ -182,7 +181,7 @@ int snd_tscm_create_hwdep_device(struct snd_tscm *tscm) strcpy(hwdep->name, "Tascam"); hwdep->iface = SNDRV_HWDEP_IFACE_FW_TASCAM; - hwdep->ops = hwdep_ops; + hwdep->ops = ops; hwdep->private_data = tscm; hwdep->exclusive = true; diff --git a/sound/firewire/tascam/tascam-midi.c b/sound/firewire/tascam/tascam-midi.c index 41f842079d9d..7fdc71e4763e 100644 --- a/sound/firewire/tascam/tascam-midi.c +++ b/sound/firewire/tascam/tascam-midi.c @@ -68,20 +68,18 @@ static void midi_playback_trigger(struct snd_rawmidi_substream *substrm, int up) spin_unlock_irqrestore(&tscm->lock, flags); } -static struct snd_rawmidi_ops midi_capture_ops = { - .open = midi_capture_open, - .close = midi_capture_close, - .trigger = midi_capture_trigger, -}; - -static struct snd_rawmidi_ops midi_playback_ops = { - .open = midi_playback_open, - .close = midi_playback_close, - .trigger = midi_playback_trigger, -}; - int snd_tscm_create_midi_devices(struct snd_tscm *tscm) { + static struct snd_rawmidi_ops capture_ops = { + .open = midi_capture_open, + .close = midi_capture_close, + .trigger = midi_capture_trigger, + }; + static struct snd_rawmidi_ops playback_ops = { + .open = midi_playback_open, + .close = midi_playback_close, + .trigger = midi_playback_trigger, + }; struct snd_rawmidi *rmidi; struct snd_rawmidi_str *stream; struct snd_rawmidi_substream *subs; @@ -100,7 +98,7 @@ int snd_tscm_create_midi_devices(struct snd_tscm *tscm) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT; snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, - &midi_capture_ops); + &capture_ops); stream = &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]; /* Set port names for MIDI input. */ @@ -116,7 +114,7 @@ int snd_tscm_create_midi_devices(struct snd_tscm *tscm) rmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT; snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, - &midi_playback_ops); + &playback_ops); stream = &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT]; /* Set port names for MIDI ourput. */ diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c index 79db1b651f5c..f5dd6ce6b6f1 100644 --- a/sound/firewire/tascam/tascam-pcm.c +++ b/sound/firewire/tascam/tascam-pcm.c @@ -268,33 +268,31 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstrm) return amdtp_stream_pcm_pointer(&tscm->rx_stream); } -static const struct snd_pcm_ops pcm_capture_ops = { - .open = pcm_open, - .close = pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = pcm_capture_hw_params, - .hw_free = pcm_capture_hw_free, - .prepare = pcm_capture_prepare, - .trigger = pcm_capture_trigger, - .pointer = pcm_capture_pointer, - .page = snd_pcm_lib_get_vmalloc_page, -}; - -static const struct snd_pcm_ops pcm_playback_ops = { - .open = pcm_open, - .close = pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = pcm_playback_hw_params, - .hw_free = pcm_playback_hw_free, - .prepare = pcm_playback_prepare, - .trigger = pcm_playback_trigger, - .pointer = pcm_playback_pointer, - .page = snd_pcm_lib_get_vmalloc_page, - .mmap = snd_pcm_lib_mmap_vmalloc, -}; - int snd_tscm_create_pcm_devices(struct snd_tscm *tscm) { + static const struct snd_pcm_ops capture_ops = { + .open = pcm_open, + .close = pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = pcm_capture_hw_params, + .hw_free = pcm_capture_hw_free, + .prepare = pcm_capture_prepare, + .trigger = pcm_capture_trigger, + .pointer = pcm_capture_pointer, + .page = snd_pcm_lib_get_vmalloc_page, + }; + static const struct snd_pcm_ops playback_ops = { + .open = pcm_open, + .close = pcm_close, + .ioctl = snd_pcm_lib_ioctl, + .hw_params = pcm_playback_hw_params, + .hw_free = pcm_playback_hw_free, + .prepare = pcm_playback_prepare, + .trigger = pcm_playback_trigger, + .pointer = pcm_playback_pointer, + .page = snd_pcm_lib_get_vmalloc_page, + .mmap = snd_pcm_lib_mmap_vmalloc, + }; struct snd_pcm *pcm; int err; @@ -305,8 +303,8 @@ int snd_tscm_create_pcm_devices(struct snd_tscm *tscm) pcm->private_data = tscm; snprintf(pcm->name, sizeof(pcm->name), "%s PCM", tscm->card->shortname); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_playback_ops); - snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &playback_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &capture_ops); return 0; } -- cgit v1.2.3 From 46a049dae771b95e77ac6c823330f4a60f600236 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 11 Jan 2017 14:39:44 +0100 Subject: ALSA: hda/ca0132 - fix possible NULL pointer use gcc-7 caught what it considers a NULL pointer dereference: sound/pci/hda/patch_ca0132.c: In function 'dspio_scp.constprop': sound/pci/hda/patch_ca0132.c:1487:4: error: argument 1 null where non-null expected [-Werror=nonnull] This is plausible from looking at the function, as we compare 'reply' to NULL earlier in it. I have not tried to analyze if there are constraints that make it impossible to hit the bug, but adding another NULL check in the end kills the warning and makes the function more robust. Signed-off-by: Arnd Bergmann Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_ca0132.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 11b9b2f17a2e..9ec4dba8a793 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -1482,6 +1482,9 @@ static int dspio_scp(struct hda_codec *codec, } else if (ret_size != reply_data_size) { codec_dbg(codec, "RetLen and HdrLen .NE.\n"); return -EINVAL; + } else if (!reply) { + codec_dbg(codec, "NULL reply\n"); + return -EINVAL; } else { *reply_len = ret_size*sizeof(unsigned int); memcpy(reply, scp_reply.data, *reply_len); -- cgit v1.2.3 From 6ba79b853289289052b4c4c2c68de4418cd8c57d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 5 Jan 2017 17:01:14 +0100 Subject: ALSA: rawmidi: Add const to snd_rawmidi_ops Make snd_rawmidi_substream.ops to be a const pointer to be safer and allow more optimization. The patches to constify each rawmidi ops will follow. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- include/sound/rawmidi.h | 4 ++-- sound/core/rawmidi.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index f730b91e472f..492a3ca7f17b 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h @@ -103,7 +103,7 @@ struct snd_rawmidi_substream { struct snd_rawmidi_runtime *runtime; struct pid *pid; /* hardware layer */ - struct snd_rawmidi_ops *ops; + const struct snd_rawmidi_ops *ops; }; struct snd_rawmidi_file { @@ -155,7 +155,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device, int output_count, int input_count, struct snd_rawmidi **rmidi); void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream, - struct snd_rawmidi_ops *ops); + const struct snd_rawmidi_ops *ops); /* callbacks */ diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 2096bb0835c8..8da9cb245d01 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -1749,7 +1749,7 @@ static int snd_rawmidi_dev_disconnect(struct snd_device *device) * Sets the rawmidi operators for the given stream direction. */ void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream, - struct snd_rawmidi_ops *ops) + const struct snd_rawmidi_ops *ops) { struct snd_rawmidi_substream *substream; -- cgit v1.2.3 From c62a57004abd819d93772377ea6b4b4fe8412770 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 5 Jan 2017 17:27:17 +0100 Subject: ALSA: seq: Constify snd_rawmidi_ops Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi, we can constify the definitions. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/core/seq/seq_virmidi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/core/seq/seq_virmidi.c b/sound/core/seq/seq_virmidi.c index c82ed3e70506..52f31f1498f9 100644 --- a/sound/core/seq/seq_virmidi.c +++ b/sound/core/seq/seq_virmidi.c @@ -349,13 +349,13 @@ static int snd_virmidi_unuse(void *private_data, * Register functions */ -static struct snd_rawmidi_ops snd_virmidi_input_ops = { +static const struct snd_rawmidi_ops snd_virmidi_input_ops = { .open = snd_virmidi_input_open, .close = snd_virmidi_input_close, .trigger = snd_virmidi_input_trigger, }; -static struct snd_rawmidi_ops snd_virmidi_output_ops = { +static const struct snd_rawmidi_ops snd_virmidi_output_ops = { .open = snd_virmidi_output_open, .close = snd_virmidi_output_close, .trigger = snd_virmidi_output_trigger, -- cgit v1.2.3 From c36f486d7bc71d41ec6b9521574136a280c17803 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 5 Jan 2017 17:28:39 +0100 Subject: ALSA: drivers: Constify snd_rawmidi_ops Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi, we can constify the definitions. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/drivers/mpu401/mpu401_uart.c | 4 ++-- sound/drivers/mtpav.c | 4 ++-- sound/drivers/mts64.c | 4 ++-- sound/drivers/portman2x4.c | 4 ++-- sound/drivers/serial-u16550.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c index 776596b5ee05..3a7c317ae012 100644 --- a/sound/drivers/mpu401/mpu401_uart.c +++ b/sound/drivers/mpu401/mpu401_uart.c @@ -481,14 +481,14 @@ snd_mpu401_uart_output_trigger(struct snd_rawmidi_substream *substream, int up) */ -static struct snd_rawmidi_ops snd_mpu401_uart_output = +static const struct snd_rawmidi_ops snd_mpu401_uart_output = { .open = snd_mpu401_uart_output_open, .close = snd_mpu401_uart_output_close, .trigger = snd_mpu401_uart_output_trigger, }; -static struct snd_rawmidi_ops snd_mpu401_uart_input = +static const struct snd_rawmidi_ops snd_mpu401_uart_input = { .open = snd_mpu401_uart_input_open, .close = snd_mpu401_uart_input_close, diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c index 30e8a1d5bc87..00b31f92c504 100644 --- a/sound/drivers/mtpav.c +++ b/sound/drivers/mtpav.c @@ -600,13 +600,13 @@ static int snd_mtpav_get_ISA(struct mtpav *mcard) /* */ -static struct snd_rawmidi_ops snd_mtpav_output = { +static const struct snd_rawmidi_ops snd_mtpav_output = { .open = snd_mtpav_output_open, .close = snd_mtpav_output_close, .trigger = snd_mtpav_output_trigger, }; -static struct snd_rawmidi_ops snd_mtpav_input = { +static const struct snd_rawmidi_ops snd_mtpav_input = { .open = snd_mtpav_input_open, .close = snd_mtpav_input_close, .trigger = snd_mtpav_input_trigger, diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index fd4d18df84d3..f32e81342247 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -749,13 +749,13 @@ static void snd_mts64_rawmidi_input_trigger(struct snd_rawmidi_substream *substr spin_unlock_irqrestore(&mts->lock, flags); } -static struct snd_rawmidi_ops snd_mts64_rawmidi_output_ops = { +static const struct snd_rawmidi_ops snd_mts64_rawmidi_output_ops = { .open = snd_mts64_rawmidi_open, .close = snd_mts64_rawmidi_close, .trigger = snd_mts64_rawmidi_output_trigger }; -static struct snd_rawmidi_ops snd_mts64_rawmidi_input_ops = { +static const struct snd_rawmidi_ops snd_mts64_rawmidi_input_ops = { .open = snd_mts64_rawmidi_open, .close = snd_mts64_rawmidi_close, .trigger = snd_mts64_rawmidi_input_trigger diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index 189e3e7028af..ec8a94325ef6 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -546,13 +546,13 @@ static void snd_portman_midi_output_trigger(struct snd_rawmidi_substream *substr spin_unlock_irqrestore(&pm->reg_lock, flags); } -static struct snd_rawmidi_ops snd_portman_midi_output = { +static const struct snd_rawmidi_ops snd_portman_midi_output = { .open = snd_portman_midi_open, .close = snd_portman_midi_close, .trigger = snd_portman_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_portman_midi_input = { +static const struct snd_rawmidi_ops snd_portman_midi_input = { .open = snd_portman_midi_open, .close = snd_portman_midi_close, .trigger = snd_portman_midi_input_trigger, diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 1927b89e1d1f..60d51ac4ccfe 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -752,14 +752,14 @@ static void snd_uart16550_output_trigger(struct snd_rawmidi_substream *substream snd_uart16550_output_write(substream); } -static struct snd_rawmidi_ops snd_uart16550_output = +static const struct snd_rawmidi_ops snd_uart16550_output = { .open = snd_uart16550_output_open, .close = snd_uart16550_output_close, .trigger = snd_uart16550_output_trigger, }; -static struct snd_rawmidi_ops snd_uart16550_input = +static const struct snd_rawmidi_ops snd_uart16550_input = { .open = snd_uart16550_input_open, .close = snd_uart16550_input_close, -- cgit v1.2.3 From 9021b2b8fd8f352abfc9470249eca9b36356a155 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 5 Jan 2017 17:29:07 +0100 Subject: ALSA: isa: Constify snd_rawmidi_ops Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi, we can constify the definitions. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- include/sound/snd_wavefront.h | 4 ++-- sound/isa/gus/gus_uart.c | 4 ++-- sound/isa/msnd/msnd_midi.c | 2 +- sound/isa/sb/sb8_midi.c | 4 ++-- sound/isa/wavefront/wavefront_midi.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/sound/snd_wavefront.h b/include/sound/snd_wavefront.h index 35e94b3d1ec7..cd0bab1ef6f1 100644 --- a/include/sound/snd_wavefront.h +++ b/include/sound/snd_wavefront.h @@ -37,8 +37,8 @@ struct _snd_wavefront_midi { #define MPU_ACK 0xFE #define UART_MODE_ON 0x3F -extern struct snd_rawmidi_ops snd_wavefront_midi_output; -extern struct snd_rawmidi_ops snd_wavefront_midi_input; +extern const struct snd_rawmidi_ops snd_wavefront_midi_output; +extern const struct snd_rawmidi_ops snd_wavefront_midi_input; extern void snd_wavefront_midi_enable_virtual (snd_wavefront_card_t *); extern void snd_wavefront_midi_disable_virtual (snd_wavefront_card_t *); diff --git a/sound/isa/gus/gus_uart.c b/sound/isa/gus/gus_uart.c index 3992912743f5..ac5f5687d1a3 100644 --- a/sound/isa/gus/gus_uart.c +++ b/sound/isa/gus/gus_uart.c @@ -227,14 +227,14 @@ static void snd_gf1_uart_output_trigger(struct snd_rawmidi_substream *substream, spin_unlock_irqrestore(&gus->uart_cmd_lock, flags); } -static struct snd_rawmidi_ops snd_gf1_uart_output = +static const struct snd_rawmidi_ops snd_gf1_uart_output = { .open = snd_gf1_uart_output_open, .close = snd_gf1_uart_output_close, .trigger = snd_gf1_uart_output_trigger, }; -static struct snd_rawmidi_ops snd_gf1_uart_input = +static const struct snd_rawmidi_ops snd_gf1_uart_input = { .open = snd_gf1_uart_input_open, .close = snd_gf1_uart_input_close, diff --git a/sound/isa/msnd/msnd_midi.c b/sound/isa/msnd/msnd_midi.c index ffc67fd80c23..912b5a9ccbab 100644 --- a/sound/isa/msnd/msnd_midi.c +++ b/sound/isa/msnd/msnd_midi.c @@ -142,7 +142,7 @@ void snd_msndmidi_input_read(void *mpuv) } EXPORT_SYMBOL(snd_msndmidi_input_read); -static struct snd_rawmidi_ops snd_msndmidi_input = { +static const struct snd_rawmidi_ops snd_msndmidi_input = { .open = snd_msndmidi_input_open, .close = snd_msndmidi_input_close, .trigger = snd_msndmidi_input_trigger, diff --git a/sound/isa/sb/sb8_midi.c b/sound/isa/sb/sb8_midi.c index d551c50e549f..bd672abb4854 100644 --- a/sound/isa/sb/sb8_midi.c +++ b/sound/isa/sb/sb8_midi.c @@ -247,14 +247,14 @@ static void snd_sb8dsp_midi_output_trigger(struct snd_rawmidi_substream *substre snd_sb8dsp_midi_output_write(substream); } -static struct snd_rawmidi_ops snd_sb8dsp_midi_output = +static const struct snd_rawmidi_ops snd_sb8dsp_midi_output = { .open = snd_sb8dsp_midi_output_open, .close = snd_sb8dsp_midi_output_close, .trigger = snd_sb8dsp_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_sb8dsp_midi_input = +static const struct snd_rawmidi_ops snd_sb8dsp_midi_input = { .open = snd_sb8dsp_midi_input_open, .close = snd_sb8dsp_midi_input_close, diff --git a/sound/isa/wavefront/wavefront_midi.c b/sound/isa/wavefront/wavefront_midi.c index 8a80fc6a616b..2aa05f3aaa38 100644 --- a/sound/isa/wavefront/wavefront_midi.c +++ b/sound/isa/wavefront/wavefront_midi.c @@ -559,14 +559,14 @@ snd_wavefront_midi_start (snd_wavefront_card_t *card) return 0; } -struct snd_rawmidi_ops snd_wavefront_midi_output = +const struct snd_rawmidi_ops snd_wavefront_midi_output = { .open = snd_wavefront_midi_output_open, .close = snd_wavefront_midi_output_close, .trigger = snd_wavefront_midi_output_trigger, }; -struct snd_rawmidi_ops snd_wavefront_midi_input = +const struct snd_rawmidi_ops snd_wavefront_midi_input = { .open = snd_wavefront_midi_input_open, .close = snd_wavefront_midi_input_close, -- cgit v1.2.3 From 485885b9d0474ac374297e637f479c22930bb593 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 5 Jan 2017 17:29:31 +0100 Subject: ALSA: pci: Constify snd_rawmidi_ops Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi, we can constify the definitions. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/pci/ca0106/ca_midi.c | 4 ++-- sound/pci/cs4281.c | 4 ++-- sound/pci/cs46xx/cs46xx_lib.c | 4 ++-- sound/pci/echoaudio/midi.c | 4 ++-- sound/pci/emu10k1/emu10k1x.c | 4 ++-- sound/pci/emu10k1/emumpu401.c | 4 ++-- sound/pci/ens1370.c | 4 ++-- sound/pci/ice1712/ice1724.c | 4 ++-- sound/pci/rme9652/hdsp.c | 4 ++-- sound/pci/rme9652/hdspm.c | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sound/pci/ca0106/ca_midi.c b/sound/pci/ca0106/ca_midi.c index b91c7f6d19f9..4d4d385205eb 100644 --- a/sound/pci/ca0106/ca_midi.c +++ b/sound/pci/ca0106/ca_midi.c @@ -255,14 +255,14 @@ static void ca_midi_output_trigger(struct snd_rawmidi_substream *substream, int } } -static struct snd_rawmidi_ops ca_midi_output = +static const struct snd_rawmidi_ops ca_midi_output = { .open = ca_midi_output_open, .close = ca_midi_output_close, .trigger = ca_midi_output_trigger, }; -static struct snd_rawmidi_ops ca_midi_input = +static const struct snd_rawmidi_ops ca_midi_input = { .open = ca_midi_input_open, .close = ca_midi_input_close, diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index 8f0f5f24e40e..fa7c51684dd2 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -1767,14 +1767,14 @@ static void snd_cs4281_midi_output_trigger(struct snd_rawmidi_substream *substre spin_unlock_irqrestore(&chip->reg_lock, flags); } -static struct snd_rawmidi_ops snd_cs4281_midi_output = +static const struct snd_rawmidi_ops snd_cs4281_midi_output = { .open = snd_cs4281_midi_output_open, .close = snd_cs4281_midi_output_close, .trigger = snd_cs4281_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_cs4281_midi_input = +static const struct snd_rawmidi_ops snd_cs4281_midi_input = { .open = snd_cs4281_midi_input_open, .close = snd_cs4281_midi_input_close, diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index fde3cd48258c..e561fd536f5b 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -2683,14 +2683,14 @@ static void snd_cs46xx_midi_output_trigger(struct snd_rawmidi_substream *substre spin_unlock_irqrestore(&chip->reg_lock, flags); } -static struct snd_rawmidi_ops snd_cs46xx_midi_output = +static const struct snd_rawmidi_ops snd_cs46xx_midi_output = { .open = snd_cs46xx_midi_output_open, .close = snd_cs46xx_midi_output_close, .trigger = snd_cs46xx_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_cs46xx_midi_input = +static const struct snd_rawmidi_ops snd_cs46xx_midi_input = { .open = snd_cs46xx_midi_input_open, .close = snd_cs46xx_midi_input_close, diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c index a8fe58335ddc..8c685ddb1a41 100644 --- a/sound/pci/echoaudio/midi.c +++ b/sound/pci/echoaudio/midi.c @@ -288,13 +288,13 @@ static int snd_echo_midi_output_close(struct snd_rawmidi_substream *substream) -static struct snd_rawmidi_ops snd_echo_midi_input = { +static const struct snd_rawmidi_ops snd_echo_midi_input = { .open = snd_echo_midi_input_open, .close = snd_echo_midi_input_close, .trigger = snd_echo_midi_input_trigger, }; -static struct snd_rawmidi_ops snd_echo_midi_output = { +static const struct snd_rawmidi_ops snd_echo_midi_output = { .open = snd_echo_midi_output_open, .close = snd_echo_midi_output_close, .trigger = snd_echo_midi_output_trigger, diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 921037ed8468..32842734ada6 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -1486,14 +1486,14 @@ static void snd_emu10k1x_midi_output_trigger(struct snd_rawmidi_substream *subst */ -static struct snd_rawmidi_ops snd_emu10k1x_midi_output = +static const struct snd_rawmidi_ops snd_emu10k1x_midi_output = { .open = snd_emu10k1x_midi_output_open, .close = snd_emu10k1x_midi_output_close, .trigger = snd_emu10k1x_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_emu10k1x_midi_input = +static const struct snd_rawmidi_ops snd_emu10k1x_midi_input = { .open = snd_emu10k1x_midi_input_open, .close = snd_emu10k1x_midi_input_close, diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c index fdf2b0ada489..b6650f5c1621 100644 --- a/sound/pci/emu10k1/emumpu401.c +++ b/sound/pci/emu10k1/emumpu401.c @@ -308,14 +308,14 @@ static void snd_emu10k1_midi_output_trigger(struct snd_rawmidi_substream *substr */ -static struct snd_rawmidi_ops snd_emu10k1_midi_output = +static const struct snd_rawmidi_ops snd_emu10k1_midi_output = { .open = snd_emu10k1_midi_output_open, .close = snd_emu10k1_midi_output_close, .trigger = snd_emu10k1_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_emu10k1_midi_input = +static const struct snd_rawmidi_ops snd_emu10k1_midi_input = { .open = snd_emu10k1_midi_input_open, .close = snd_emu10k1_midi_input_close, diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 51736c2b5a00..164adad91650 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -2317,14 +2317,14 @@ static void snd_ensoniq_midi_output_trigger(struct snd_rawmidi_substream *substr spin_unlock_irqrestore(&ensoniq->reg_lock, flags); } -static struct snd_rawmidi_ops snd_ensoniq_midi_output = +static const struct snd_rawmidi_ops snd_ensoniq_midi_output = { .open = snd_ensoniq_midi_output_open, .close = snd_ensoniq_midi_output_close, .trigger = snd_ensoniq_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_ensoniq_midi_input = +static const struct snd_rawmidi_ops snd_ensoniq_midi_input = { .open = snd_ensoniq_midi_input_open, .close = snd_ensoniq_midi_input_close, diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index e5c52ed9b674..842744e7a139 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -367,7 +367,7 @@ static void vt1724_midi_output_drain(struct snd_rawmidi_substream *s) } while (time_after(timeout, jiffies)); } -static struct snd_rawmidi_ops vt1724_midi_output_ops = { +static const struct snd_rawmidi_ops vt1724_midi_output_ops = { .open = vt1724_midi_output_open, .close = vt1724_midi_output_close, .trigger = vt1724_midi_output_trigger, @@ -402,7 +402,7 @@ static void vt1724_midi_input_trigger(struct snd_rawmidi_substream *s, int up) spin_unlock_irqrestore(&ice->reg_lock, flags); } -static struct snd_rawmidi_ops vt1724_midi_input_ops = { +static const struct snd_rawmidi_ops vt1724_midi_input_ops = { .open = vt1724_midi_input_open, .close = vt1724_midi_input_close, .trigger = vt1724_midi_input_trigger, diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index b94fc6357139..fc0face6cdc6 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -1510,14 +1510,14 @@ static int snd_hdsp_midi_output_close(struct snd_rawmidi_substream *substream) return 0; } -static struct snd_rawmidi_ops snd_hdsp_midi_output = +static const struct snd_rawmidi_ops snd_hdsp_midi_output = { .open = snd_hdsp_midi_output_open, .close = snd_hdsp_midi_output_close, .trigger = snd_hdsp_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_hdsp_midi_input = +static const struct snd_rawmidi_ops snd_hdsp_midi_input = { .open = snd_hdsp_midi_input_open, .close = snd_hdsp_midi_input_close, diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 14bbf55c1ef9..c48acdb0e186 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -2043,14 +2043,14 @@ static int snd_hdspm_midi_output_close(struct snd_rawmidi_substream *substream) return 0; } -static struct snd_rawmidi_ops snd_hdspm_midi_output = +static const struct snd_rawmidi_ops snd_hdspm_midi_output = { .open = snd_hdspm_midi_output_open, .close = snd_hdspm_midi_output_close, .trigger = snd_hdspm_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_hdspm_midi_input = +static const struct snd_rawmidi_ops snd_hdspm_midi_input = { .open = snd_hdspm_midi_input_open, .close = snd_hdspm_midi_input_close, -- cgit v1.2.3 From 57eb67994a9d117ea81d1580a9163733e26a1fc3 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 5 Jan 2017 17:29:54 +0100 Subject: ALSA: firewire: Constify snd_rawmidi_ops Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi, we can constify the definitions. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/bebob/bebob_midi.c | 4 ++-- sound/firewire/dice/dice-midi.c | 4 ++-- sound/firewire/digi00x/digi00x-midi.c | 8 ++++---- sound/firewire/fireworks/fireworks_midi.c | 4 ++-- sound/firewire/oxfw/oxfw-midi.c | 4 ++-- sound/firewire/oxfw/oxfw-scs1x.c | 4 ++-- sound/firewire/tascam/tascam-midi.c | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/firewire/bebob/bebob_midi.c b/sound/firewire/bebob/bebob_midi.c index 7e5fb4b990bd..3befa3eca6ef 100644 --- a/sound/firewire/bebob/bebob_midi.c +++ b/sound/firewire/bebob/bebob_midi.c @@ -120,12 +120,12 @@ static void set_midi_substream_names(struct snd_bebob *bebob, int snd_bebob_create_midi_devices(struct snd_bebob *bebob) { - static struct snd_rawmidi_ops capture_ops = { + static const struct snd_rawmidi_ops capture_ops = { .open = midi_capture_open, .close = midi_capture_close, .trigger = midi_capture_trigger, }; - static struct snd_rawmidi_ops playback_ops = { + static const struct snd_rawmidi_ops playback_ops = { .open = midi_playback_open, .close = midi_playback_close, .trigger = midi_playback_trigger, diff --git a/sound/firewire/dice/dice-midi.c b/sound/firewire/dice/dice-midi.c index cdf71c211342..8ff6da3c51f7 100644 --- a/sound/firewire/dice/dice-midi.c +++ b/sound/firewire/dice/dice-midi.c @@ -91,12 +91,12 @@ static void set_midi_substream_names(struct snd_dice *dice, int snd_dice_create_midi(struct snd_dice *dice) { - static struct snd_rawmidi_ops capture_ops = { + static const struct snd_rawmidi_ops capture_ops = { .open = midi_open, .close = midi_close, .trigger = midi_capture_trigger, }; - static struct snd_rawmidi_ops playback_ops = { + static const struct snd_rawmidi_ops playback_ops = { .open = midi_open, .close = midi_close, .trigger = midi_playback_trigger, diff --git a/sound/firewire/digi00x/digi00x-midi.c b/sound/firewire/digi00x/digi00x-midi.c index 8689c3bb4c6a..915d2a21223e 100644 --- a/sound/firewire/digi00x/digi00x-midi.c +++ b/sound/firewire/digi00x/digi00x-midi.c @@ -148,22 +148,22 @@ static void set_midi_substream_names(struct snd_dg00x *dg00x, int snd_dg00x_create_midi_devices(struct snd_dg00x *dg00x) { - static struct snd_rawmidi_ops phys_capture_ops = { + static const struct snd_rawmidi_ops phys_capture_ops = { .open = midi_phys_open, .close = midi_phys_close, .trigger = midi_phys_capture_trigger, }; - static struct snd_rawmidi_ops phys_playback_ops = { + static const struct snd_rawmidi_ops phys_playback_ops = { .open = midi_phys_open, .close = midi_phys_close, .trigger = midi_phys_playback_trigger, }; - static struct snd_rawmidi_ops ctl_capture_ops = { + static const struct snd_rawmidi_ops ctl_capture_ops = { .open = midi_ctl_open, .close = midi_ctl_capture_close, .trigger = midi_ctl_capture_trigger, }; - static struct snd_rawmidi_ops ctl_playback_ops = { + static const struct snd_rawmidi_ops ctl_playback_ops = { .open = midi_ctl_open, .close = midi_ctl_playback_close, .trigger = midi_ctl_playback_trigger, diff --git a/sound/firewire/fireworks/fireworks_midi.c b/sound/firewire/fireworks/fireworks_midi.c index 2873eca22bfc..f5da2cd4ce42 100644 --- a/sound/firewire/fireworks/fireworks_midi.c +++ b/sound/firewire/fireworks/fireworks_midi.c @@ -120,12 +120,12 @@ static void set_midi_substream_names(struct snd_efw *efw, int snd_efw_create_midi_devices(struct snd_efw *efw) { - static struct snd_rawmidi_ops capture_ops = { + static const struct snd_rawmidi_ops capture_ops = { .open = midi_capture_open, .close = midi_capture_close, .trigger = midi_capture_trigger, }; - static struct snd_rawmidi_ops playback_ops = { + static const struct snd_rawmidi_ops playback_ops = { .open = midi_playback_open, .close = midi_playback_close, .trigger = midi_playback_trigger, diff --git a/sound/firewire/oxfw/oxfw-midi.c b/sound/firewire/oxfw/oxfw-midi.c index 076a1a977275..b7bbd77dfff1 100644 --- a/sound/firewire/oxfw/oxfw-midi.c +++ b/sound/firewire/oxfw/oxfw-midi.c @@ -130,12 +130,12 @@ static void set_midi_substream_names(struct snd_oxfw *oxfw, int snd_oxfw_create_midi(struct snd_oxfw *oxfw) { - static struct snd_rawmidi_ops capture_ops = { + static const struct snd_rawmidi_ops capture_ops = { .open = midi_capture_open, .close = midi_capture_close, .trigger = midi_capture_trigger, }; - static struct snd_rawmidi_ops playback_ops = { + static const struct snd_rawmidi_ops playback_ops = { .open = midi_playback_open, .close = midi_playback_close, .trigger = midi_playback_trigger, diff --git a/sound/firewire/oxfw/oxfw-scs1x.c b/sound/firewire/oxfw/oxfw-scs1x.c index f897c9831077..79400586b7ac 100644 --- a/sound/firewire/oxfw/oxfw-scs1x.c +++ b/sound/firewire/oxfw/oxfw-scs1x.c @@ -297,7 +297,7 @@ static void midi_capture_trigger(struct snd_rawmidi_substream *stream, int up) } } -static struct snd_rawmidi_ops midi_capture_ops = { +static const struct snd_rawmidi_ops midi_capture_ops = { .open = midi_capture_open, .close = midi_capture_close, .trigger = midi_capture_trigger, @@ -338,7 +338,7 @@ static void midi_playback_drain(struct snd_rawmidi_substream *stream) wait_event(scs->idle_wait, scs->output_idle); } -static struct snd_rawmidi_ops midi_playback_ops = { +static const struct snd_rawmidi_ops midi_playback_ops = { .open = midi_playback_open, .close = midi_playback_close, .trigger = midi_playback_trigger, diff --git a/sound/firewire/tascam/tascam-midi.c b/sound/firewire/tascam/tascam-midi.c index 7fdc71e4763e..df4f95d65925 100644 --- a/sound/firewire/tascam/tascam-midi.c +++ b/sound/firewire/tascam/tascam-midi.c @@ -70,12 +70,12 @@ static void midi_playback_trigger(struct snd_rawmidi_substream *substrm, int up) int snd_tscm_create_midi_devices(struct snd_tscm *tscm) { - static struct snd_rawmidi_ops capture_ops = { + static const struct snd_rawmidi_ops capture_ops = { .open = midi_capture_open, .close = midi_capture_close, .trigger = midi_capture_trigger, }; - static struct snd_rawmidi_ops playback_ops = { + static const struct snd_rawmidi_ops playback_ops = { .open = midi_playback_open, .close = midi_playback_close, .trigger = midi_playback_trigger, -- cgit v1.2.3 From f43e5407e4184ef0e5a31272f80ca893cb5ee24c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 5 Jan 2017 17:30:12 +0100 Subject: ALSA: usb: Constify snd_rawmidi_ops Now snd_rawmidi_ops is maintained as a const pointer in snd_rawmidi, we can constify the definitions. Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/usb/6fire/midi.c | 4 ++-- sound/usb/bcd2000/bcd2000.c | 4 ++-- sound/usb/caiaq/midi.c | 4 ++-- sound/usb/line6/midi.c | 4 ++-- sound/usb/midi.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/usb/6fire/midi.c b/sound/usb/6fire/midi.c index 3d410969553e..aa5adbb6eb5d 100644 --- a/sound/usb/6fire/midi.c +++ b/sound/usb/6fire/midi.c @@ -139,14 +139,14 @@ static void usb6fire_midi_in_trigger( spin_unlock_irqrestore(&rt->in_lock, flags); } -static struct snd_rawmidi_ops out_ops = { +static const struct snd_rawmidi_ops out_ops = { .open = usb6fire_midi_out_open, .close = usb6fire_midi_out_close, .trigger = usb6fire_midi_out_trigger, .drain = usb6fire_midi_out_drain }; -static struct snd_rawmidi_ops in_ops = { +static const struct snd_rawmidi_ops in_ops = { .open = usb6fire_midi_in_open, .close = usb6fire_midi_in_close, .trigger = usb6fire_midi_in_trigger diff --git a/sound/usb/bcd2000/bcd2000.c b/sound/usb/bcd2000/bcd2000.c index d060dddcc52d..2ff9d578753a 100644 --- a/sound/usb/bcd2000/bcd2000.c +++ b/sound/usb/bcd2000/bcd2000.c @@ -252,13 +252,13 @@ static void bcd2000_input_complete(struct urb *urb) __func__, ret); } -static struct snd_rawmidi_ops bcd2000_midi_output = { +static const struct snd_rawmidi_ops bcd2000_midi_output = { .open = bcd2000_midi_output_open, .close = bcd2000_midi_output_close, .trigger = bcd2000_midi_output_trigger, }; -static struct snd_rawmidi_ops bcd2000_midi_input = { +static const struct snd_rawmidi_ops bcd2000_midi_input = { .open = bcd2000_midi_input_open, .close = bcd2000_midi_input_close, .trigger = bcd2000_midi_input_trigger, diff --git a/sound/usb/caiaq/midi.c b/sound/usb/caiaq/midi.c index 2d7588461b33..f8e5b1b57c4f 100644 --- a/sound/usb/caiaq/midi.c +++ b/sound/usb/caiaq/midi.c @@ -102,14 +102,14 @@ static void snd_usb_caiaq_midi_output_trigger(struct snd_rawmidi_substream *subs } -static struct snd_rawmidi_ops snd_usb_caiaq_midi_output = +static const struct snd_rawmidi_ops snd_usb_caiaq_midi_output = { .open = snd_usb_caiaq_midi_output_open, .close = snd_usb_caiaq_midi_output_close, .trigger = snd_usb_caiaq_midi_output_trigger, }; -static struct snd_rawmidi_ops snd_usb_caiaq_midi_input = +static const struct snd_rawmidi_ops snd_usb_caiaq_midi_input = { .open = snd_usb_caiaq_midi_input_open, .close = snd_usb_caiaq_midi_input_close, diff --git a/sound/usb/line6/midi.c b/sound/usb/line6/midi.c index d0fb2f205bd9..1d3a23b02d68 100644 --- a/sound/usb/line6/midi.c +++ b/sound/usb/line6/midi.c @@ -200,14 +200,14 @@ static void line6_midi_input_trigger(struct snd_rawmidi_substream *substream, line6->line6midi->substream_receive = NULL; } -static struct snd_rawmidi_ops line6_midi_output_ops = { +static const struct snd_rawmidi_ops line6_midi_output_ops = { .open = line6_midi_output_open, .close = line6_midi_output_close, .trigger = line6_midi_output_trigger, .drain = line6_midi_output_drain, }; -static struct snd_rawmidi_ops line6_midi_input_ops = { +static const struct snd_rawmidi_ops line6_midi_input_ops = { .open = line6_midi_input_open, .close = line6_midi_input_close, .trigger = line6_midi_input_trigger, diff --git a/sound/usb/midi.c b/sound/usb/midi.c index 7ba92921bf28..6e763bc8d7db 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -1234,14 +1234,14 @@ static void snd_usbmidi_input_trigger(struct snd_rawmidi_substream *substream, clear_bit(substream->number, &umidi->input_triggered); } -static struct snd_rawmidi_ops snd_usbmidi_output_ops = { +static const struct snd_rawmidi_ops snd_usbmidi_output_ops = { .open = snd_usbmidi_output_open, .close = snd_usbmidi_output_close, .trigger = snd_usbmidi_output_trigger, .drain = snd_usbmidi_output_drain, }; -static struct snd_rawmidi_ops snd_usbmidi_input_ops = { +static const struct snd_rawmidi_ops snd_usbmidi_input_ops = { .open = snd_usbmidi_input_open, .close = snd_usbmidi_input_close, .trigger = snd_usbmidi_input_trigger -- cgit v1.2.3 From 1753187e288aacabfa8d61e4465f234fd80599fe Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Fri, 13 Jan 2017 20:30:22 +0900 Subject: ALSA: oxfw: enclose identifiers referred by single function for scs1x feature Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/oxfw/oxfw-scs1x.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/firewire/oxfw/oxfw-scs1x.c b/sound/firewire/oxfw/oxfw-scs1x.c index 79400586b7ac..93209ebd9121 100644 --- a/sound/firewire/oxfw/oxfw-scs1x.c +++ b/sound/firewire/oxfw/oxfw-scs1x.c @@ -338,12 +338,6 @@ static void midi_playback_drain(struct snd_rawmidi_substream *stream) wait_event(scs->idle_wait, scs->output_idle); } -static const struct snd_rawmidi_ops midi_playback_ops = { - .open = midi_playback_open, - .close = midi_playback_close, - .trigger = midi_playback_trigger, - .drain = midi_playback_drain, -}; static int register_address(struct snd_oxfw *oxfw) { struct fw_scs1x *scs = oxfw->spec; @@ -369,6 +363,12 @@ void snd_oxfw_scs1x_update(struct snd_oxfw *oxfw) int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw) { + static const struct snd_rawmidi_ops midi_playback_ops = { + .open = midi_playback_open, + .close = midi_playback_close, + .trigger = midi_playback_trigger, + .drain = midi_playback_drain, + }; struct snd_rawmidi *rmidi; struct fw_scs1x *scs; int err; -- cgit v1.2.3 From 41438f1314b0f6f4d94edc56bb5bc77138445bb3 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 12 Jan 2017 17:13:21 +0100 Subject: ALSA: hda - Make single_cmd option to stop the fallback mechanism HD-audio driver has a mechanism to fall back to the single cmd mode as a last resort if the CORB/RIRB communication goes wrong even after switching to the polling mode. The switching has worked in the past well, but Enrico Mioso reported that his system crashes when this happens. Although the actual cause of the crash isn't still fully analyzed yet, it'd be in anyway good to provide an option to turn off the fallback mode. Now this patch extends the behavior of the existing single_cmd option for that. Namely, - The option is changed from bool to bint. - As default, it is the mode allowing the fallback to single cmd. - Once when either true/false value is given to the option, the driver explicitly turns on/off the single cmd mode, but without the fallback. That is, if you want to disable the fallback, just pass single_cmd=0 option. Passing single_cmd=1 will keep working like before. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_controller.c | 4 ++++ sound/pci/hda/hda_controller.h | 1 + sound/pci/hda/hda_intel.c | 10 +++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 500878556578..3715a5725613 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -861,6 +861,10 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr, return -EIO; } + /* no fallback mechanism? */ + if (!chip->fallback_to_single_cmd) + return -EIO; + /* a fatal communication error; need either to reset or to fallback * to the single_cmd mode */ diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h index a50e0532622a..35a9ab2cac46 100644 --- a/sound/pci/hda/hda_controller.h +++ b/sound/pci/hda/hda_controller.h @@ -150,6 +150,7 @@ struct azx { int bdl_pos_adj; int poll_count; unsigned int running:1; + unsigned int fallback_to_single_cmd:1; unsigned int single_cmd:1; unsigned int polling_mode:1; unsigned int msi:1; diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 2587c197e353..faf99cc71277 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -128,7 +128,7 @@ static int bdl_pos_adj[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; static int probe_mask[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = -1}; static int probe_only[SNDRV_CARDS]; static int jackpoll_ms[SNDRV_CARDS]; -static bool single_cmd; +static int single_cmd = -1; static int enable_msi = -1; #ifdef CONFIG_SND_HDA_PATCH_LOADER static char *patch[SNDRV_CARDS]; @@ -157,7 +157,7 @@ module_param_array(probe_only, int, NULL, 0444); MODULE_PARM_DESC(probe_only, "Only probing and no codec initialization."); module_param_array(jackpoll_ms, int, NULL, 0444); MODULE_PARM_DESC(jackpoll_ms, "Ms between polling for jack events (default = 0, using unsol events only)"); -module_param(single_cmd, bool, 0444); +module_param(single_cmd, bint, 0444); MODULE_PARM_DESC(single_cmd, "Use single command to communicate with codecs " "(for debugging only)."); module_param(enable_msi, bint, 0444); @@ -1596,7 +1596,11 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, check_probe_mask(chip, dev); - chip->single_cmd = single_cmd; + if (single_cmd < 0) /* allow fallback to single_cmd at errors */ + chip->fallback_to_single_cmd = 1; + else /* explicitly set to single_cmd or not */ + chip->single_cmd = single_cmd; + azx_check_snoop_available(chip); if (bdl_pos_adj[dev] < 0) -- cgit v1.2.3 From a535ad57d0e6b959cd79914a1127caade36a9459 Mon Sep 17 00:00:00 2001 From: Kailang Yang Date: Mon, 16 Jan 2017 16:59:26 +0800 Subject: ALSA: hda/realtek - New codec support of ALC1220 Add support for new codec of ALC1220. It's compatible with ALC882 & co. Signed-off-by: Kailang Yang Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3c6964793206..1c88da8a5cf4 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -380,6 +380,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec) break; case 0x10ec0899: case 0x10ec0900: + case 0x10ec1220: alc_update_coef_idx(codec, 0x7, 1<<1, 0); break; } @@ -2310,6 +2311,7 @@ static int patch_alc882(struct hda_codec *codec) case 0x10ec0882: case 0x10ec0885: case 0x10ec0900: + case 0x10ec1220: break; default: /* ALC883 and variants */ @@ -7297,6 +7299,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662), HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882), HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882), + HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), {} /* terminator */ }; MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); -- cgit v1.2.3 From 8b169cb27c8267cd344fd71c2067ea864dd4c2e7 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 16 Jan 2017 14:27:57 +0100 Subject: ALSA: mips: avoid potential uninitialized variable use MIPS allmodconfig results in this warning: sound/mips/hal2.c: In function 'hal2_gain_get': sound/mips/hal2.c:224:35: error: 'r' may be used uninitialized in this function [-Werror=maybe-uninitialized] sound/mips/hal2.c:223:35: error: 'l' may be used uninitialized in this function [-Werror=maybe-uninitialized] sound/mips/hal2.c: In function 'hal2_gain_put': sound/mips/hal2.c:260:13: error: 'new' may be used uninitialized in this function [-Werror=maybe-uninitialized] sound/mips/hal2.c:260:13: error: 'old' may be used uninitialized in this function [-Werror=maybe-uninitialized] Returning an error for all unexpected cases shuts up the warning Signed-off-by: Arnd Bergmann Signed-off-by: Takashi Iwai --- sound/mips/hal2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c index ede449f0b50d..00fc9241d266 100644 --- a/sound/mips/hal2.c +++ b/sound/mips/hal2.c @@ -219,6 +219,8 @@ static int hal2_gain_get(struct snd_kcontrol *kcontrol, l = (tmp >> H2I_C2_L_GAIN_SHIFT) & 15; r = (tmp >> H2I_C2_R_GAIN_SHIFT) & 15; break; + default: + return -EINVAL; } ucontrol->value.integer.value[0] = l; ucontrol->value.integer.value[1] = r; @@ -256,6 +258,8 @@ static int hal2_gain_put(struct snd_kcontrol *kcontrol, new |= (r << H2I_C2_R_GAIN_SHIFT); hal2_i_write32(hal2, H2I_ADC_C2, new); break; + default: + return -EINVAL; } return old != new; } -- cgit v1.2.3 From 9eb5d0e635ebe2f227d591e531d48c6f01c0dd78 Mon Sep 17 00:00:00 2001 From: Kailang Yang Date: Tue, 17 Jan 2017 15:40:25 +0800 Subject: ALSA: hda/realtek - Add support headphone Mic for ALC221 of HP platform ALC221 HP platform need to support Headphone Mic. This patch will turn on headphone Mic supported. Signed-off-by: Kailang Yang Signed-off-by: Takashi Iwai --- sound/pci/hda/patch_realtek.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 1c88da8a5cf4..06b5a480db8d 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3816,6 +3816,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, case 0x10ec0867: alc_update_coefex_idx(codec, 0x57, 0x5, 0, 1<<14); /* fallthru */ + case 0x10ec0221: case 0x10ec0662: snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50); @@ -4867,6 +4868,7 @@ enum { ALC298_FIXUP_SPK_VOLUME, ALC256_FIXUP_DELL_INSPIRON_7559_SUBWOOFER, ALC269_FIXUP_ATIV_BOOK_8, + ALC221_FIXUP_HP_MIC_NO_PRESENCE, }; static const struct hda_fixup alc269_fixups[] = { @@ -5545,6 +5547,16 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id = ALC269_FIXUP_NO_SHUTUP }, + [ALC221_FIXUP_HP_MIC_NO_PRESENCE] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */ + { 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */ + { } + }, + .chained = true, + .chain_id = ALC269_FIXUP_HEADSET_MODE + }, }; static const struct snd_pci_quirk alc269_fixup_tbl[] = { @@ -5655,6 +5667,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), + SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), -- cgit v1.2.3