summaryrefslogtreecommitdiffstats
path: root/sound/pci
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next' into for-linusTakashi Iwai2018-06-0437-277/+3200
|\ | | | | | | | | | | 4.18-rc1 merge material. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: pci/hda: Remove unused, broken, header fileBen Hutchings2018-06-011-40/+0
| | | | | | | | | | | | | | | | | | | | sound/pci/hda/local.h seems to be an earlier version of sound/hda/local.h; it was added at the same time but doesn't seem to have ever been used (within the git history). Most of its macros depend on a hdac_read_parm() function which is not defined anywhere. Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream()Bo Chen2018-06-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When 'kzalloc()' fails in 'snd_hda_attach_pcm_stream()', a new pcm instance is created without setting its operators via 'snd_pcm_set_ops()'. Following operations on the new pcm instance can trigger kernel null pointer dereferences and cause kernel oops. This bug was found with my work on building a gray-box fault-injection tool for linux-kernel-module binaries. A kernel null pointer dereference was confirmed from line 'substream->ops->open()' in function 'snd_pcm_open_substream()' in file 'sound/core/pcm_native.c'. This patch fixes the bug by calling 'snd_device_free()' in the error handling path of 'kzalloc()', which removes the new pcm instance from the snd card before returns with an error code. Signed-off-by: Bo Chen <chenbo@pdx.edu> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: oxygen: use match_string() helperYisheng Xie2018-05-311-7/+7
| | | | | | | | | | | | | | | | match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/realtek - Enable mic-mute hotkey for several Lenovo AIOsHui Wang2018-05-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | We have several Lenovo AIOs like M810z, M820z and M920z, they have the same design for mic-mute hotkey and led and they use the same codec with the same pin configuration, so use the pin conf table to apply fix to all of them. Fixes: 29693efcea0f ("ALSA: hda - Fix micmute hotkey problem for a lenovo AIO machine") Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/realtek - Fixup for HP x360 laptops with B&O speakersTom Briden2018-05-292-1/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new helper file for these fixups due to requiring a huge number of coefs being set to get the top speakers to work, as well as setting pin 0x17 for the top speakers and the correct input source of 0x17 for volume control [ Note: this is a revised work based on Tom's fixup patch with the replacement of the full COEF tables provided by Realtek. Also, the fixup function has a proper HDA_FIXUP_ACT_* handling now. The credit for the new COEF table goes to Kailang -- tiwai ] Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189331 Cc: Kailang Yang <kailang@realtek.com> Signed-off-by: Tom Briden <tom@decompile.me.uk> Tested-by: Tom Briden <tom@decompile.me.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/realtek - Refactor alc269_fixup_hp_mute_led_mic*()Takashi Iwai2018-05-291-19/+13
| | | | | | | | | | | | | | Just a code refactoring to use the common helper for the all three functions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/realtek - Fixup mute led on HP Spectre x360Tom Briden2018-05-291-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the mute LED control for HP Spectre x360 Kabylake model. The mute LED is controlled via VREF bits on NID 0x1b, so we need a new fixup function. Note that this doesn't fix the other issues like the missing speaker output on the machine. They will be addressed by later patches. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189331 Signed-off-by: Tom Briden <tom@decompile.me.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda: Add Intel NUC5i7RY to the power_save blacklistHans de Goede2018-05-291-0/+2
| | | | | | | | | | | | | | | | | | Power-saving is causing a humming sound when active on the Intel NUC5i7RY, add it to the blacklist. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199607 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * sound: Use octal not symbolic permissionsJoe Perches2018-05-2816-42/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the S_<FOO> symbolic permissions to their octal equivalents as using octal and not symbolic permissions is preferred by many as more readable. see: https://lkml.org/lkml/2016/8/2/1945 Done with automated conversion via: $ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace <files...> Miscellanea: o Wrapped one multi-line call to a single line Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: echoaudio: Drop superfluous macroTakashi Iwai2018-05-242-7/+1
| | | | | | | | | | | | | | | | | | Drop pci_device() macro that just leads to chip->pci->dev, and pass it directly to request_firmware(). It was introduced for allowing the external alsa-driver kernel module builds. Since it was discontinued years ago, we should clean it up now. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda: Add ASRock H81M-HDS to the power_save blacklistHans de Goede2018-05-231-0/+2
| | | | | | | | | | | | | | | | | | Power-saving is causing plops on audio start/stop on ASRock H81M-HDS machines, add these to the power_save blacklist. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda: Add Gigabyte P55A-UD3 and Z87-D3HP to the power_save blacklistHans de Goede2018-05-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Power-saving is causing plops on audio start/stop on Gigabyte P55A-UD3 and Gigabyte Z87-D3HP machines, add these to the power_save blacklist. Note these 2 boards both use 1458:a002 as subsystem ids, so they share a single entry. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda: Add Clevo W35xSS_370SS to the power_save blacklistHans de Goede2018-05-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Power-saving is causing a plop and silences the first 2 seconds (give or take) of audio, silencing notifications sounds on Medion / Clevo W35xSS_370SS laptops. Add the Clevo W35xSS_370SS to the power_save blacklist. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1581607 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda: Add Intel NUC7i3BNB to the power_save blacklistHans de Goede2018-05-231-0/+2
| | | | | | | | | | | | | | | | | | Power-saving is causing a humming sound when active on the Intel NUC7i3BNB, add it to the blacklist. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1520902 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/conexant - Add hp-mic-fix model stringTakashi Iwai2018-05-221-0/+1
| | | | | | | | | | | | | | Add "hp-mic-fix" model string for Conexant codecs so that user can test the quirk without recompiling. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/conexant - Add fixup for HP Z2 G4 workstationTakashi Iwai2018-05-221-0/+1
| | | | | | | | | | | | | | | | HP Z2 G4 requires the same workaround as other HP machines that have no mic-pin detection. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: emu10k1: Rate-limit error messages about page errorsTakashi Iwai2018-05-171-3/+3
| | | | | | | | | | | | | | | | | | | | The error messages at sanity checks of memory pages tend to repeat too many times once when it hits, and without the rate limit, it may flood and become unreadable. Replace such messages with the *_ratelimited() variant. Bugzilla: http://bugzilla.opensuse.org/show_bug.cgi?id=1093027 Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: emu10k1: fix spelling mistake: "Caputre" -> "Capture"Colin Ian King2018-05-172-2/+2
| | | | | | | | | | | | | | Trivial fix to spelling mistakes in audigy_outs arrays. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/ca0132: constify parameter table for effectsTakashi Sakamoto2018-05-151-7/+7
| | | | | | | | | | | | | | | | | | | | This module has a table for parameters of each effects. This table is read-only and can have 'const' qualifier. This commit adds this optimization. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/ca0132: merge strings just for printkTakashi Sakamoto2018-05-151-4/+2
| | | | | | | | | | | | | | | | | | | | This module has some function-local strings just for printk therefore it can be merged into format string. This commit applies this optimization. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/ca0132: constify read-only members of string arrayTakashi Sakamoto2018-05-151-3/+3
| | | | | | | | | | | | | | | | | | | | This module has some strings just for printk therefore they can be read-only. This commit applies this optimization. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: hda/ca0132: constify templates for control element setTakashi Sakamoto2018-05-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | An array of templates for control element set is passed as an argument for snd_hda_add_new_ctls(). This argument has 'const' qualifier therefore the passed array can have the qualifier. This commit adds this optimization. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * Merge branch 'for-linus' into for-nextTakashi Iwai2018-05-152-1/+4
| |\ | | | | | | | | | | | | | | | Back-merge of UAC3 fixes for applying further enhancements. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: fix array_size.cocci warningsFengguang Wu2018-05-141-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sound/pci/hda/patch_ca0132.c:5062:50-51: WARNING: Use ARRAY_SIZE sound/pci/hda/patch_ca0132.c:5092:50-51: WARNING: Use ARRAY_SIZE Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element Semantic patch information: This makes an effort to find cases where ARRAY_SIZE can be used such as where there is a division of sizeof the array by the sizeof its first element or by any indexed element or the element type. It replaces the division of the two sizeofs by ARRAY_SIZE. Generated by: scripts/coccinelle/misc/array_size.cocci Fixes: 47cdf76e44e8 ("ALSA: hda/ca0132: Add new control changes for SBZ + R3Di") CC: Connor McAdams <conmanx360@gmail.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda: use position offset macro of TLV dataTakashi Sakamoto2018-05-142-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | A series of SNDRV_CTL_TLVO_XXX macro was introduced for position offset of TLV data. This commit applies a code optimization. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: Add new control changes for SBZ + R3DiConnor McAdams2018-05-131-10/+748
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds new controls to set the effect levels on the R3Di and SBZ. It also adds vmaster controls to control all surround sound channels. So that Surround effect switch doesn't conflict with Surround volume, FX: prefix added to all effect related switches. Tested-by: Mariusz Ceier <mceier+kernel@gmail.com> Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: add ca0132_alt_set_vipsourceConnor McAdams2018-05-131-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add function to set vipsource on cards that use_alt_controls. Different sequence. Also, add cvoice_switch_set at end of ca0132_select_in so that when switching between inputs cvoice state is maintained. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: Add DSP Volume set and New mixers for SBZ + R3DiConnor McAdams2018-05-131-1/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds lookup table for floating point decibel volume, and new functions to allow for setting the decibel level on the DSP. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: add alt_select_in/out for R3Di + SBZConnor McAdams2018-05-131-18/+607
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add functions ca0132_alt_select_out and ca0132_alt_select_in for switching outputs and inputs for r3di and sbz. Also, add enumerated controls for selecting output and input source. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: add the ability to set src_id on scp commandsConnor McAdams2018-05-131-12/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the ability to change the src_id on scp commands, which is used in the dsp setup of the Recon3Di and the Sound Blaster Z. It also makes sure to maintain backwards compatibility with the older dspio_set_uint_param function, and sets it's src to the default 0x20. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: Add dsp setup + gpio functions for r3diConnor McAdams2018-05-131-1/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds dsp setup functions for Recon3Di as well as the GPIO functions specific to it. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: add dsp setup related commands for the sbzConnor McAdams2018-05-131-6/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dsp setup related functions for the Sound Blaster Z, along with other helper functions. Also, add sbz_dsp_startup_check, which fixes a bug where the card sometimes starts up and has no sound. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: update core functions for sbz + r3diConnor McAdams2018-05-131-23/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates core functions to accommodate the Sound Blaster Z and Recon3Di by changing which functions they use. It also adds the ability to enable/disable streams. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: add extra init functions for r3di + sbzConnor McAdams2018-05-131-8/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds extra init functions for the Sound Blaster Z and Recon3Di. It also adds more checks to make sure that the DSP isn't downloaded twice on startup, by checking if the dsp_state is already set to DSP_DOWNLOADED. It also adds the ability to re-download the DSP on a resume. It also changes the init verbs table to apply to all codecs, and takes the two specific end verbs and puts them into a separate function in ca0132_init instead. GPIO functions are also added. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: Add extra exit functions for R3Di and SBZConnor McAdams2018-05-131-2/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds extra functions for shutdown on the Sound Blaster Z and Recon3Di. The Recon3Di only has one specific functions, which sets the GPIO data pins to 0 to prevent a popping noise. The Sound Blaster Z exit sequence was taken from Windows. Without this exit function, the card will not reload properly unless the PC has been shutdown to clear the onboard memory. There are commented out functions currently in the sbz_exit_chip function that are added in a later patch. Also, a reboot notify function has been added, to make sure these functions are ran before a reboot. This helps when using the card through VFIO in a virtual machine, to make sure the card reloads the DSP properly. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: Add PCI region2 iomap for SBZConnor McAdams2018-05-131-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds iomapping for the region2 section of memory on the SBZ. This memory region is used in later patches for setting inputs and outputs. If the mapping fails, the quirk is changed back to QUIRK_NONE to avoid attempts to write to uninitialized memory. It also adds a new exit sequence to unmap the iomem for the SBZ. [ Reordered linux/*.h inclusion in the patch by tiwai ] Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: Add pincfg for SBZ + R3Di, add fp hp auto-detectConnor McAdams2018-05-131-3/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an unsolicited response tag for the front headphone panel which uses the same hp_callback as the rear headphone detection. This patch also adds pincfgs for the R3Di and SBZ which were taken from the Windows driver. The pins are also defined in the function ca0132_config. Both the R3Di and SBZ are also given a max out channel value of 6 to handle 5.1 surround sound in later patches. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: R3Di and SBZ quirk entires + alt firmware loadingConnor McAdams2018-05-131-6/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds PCI quirk ID's for the Sound Blaster Z and Recon3Di. Only the currently tested ID's have been added. This patch also adds the ability to load alternative firmwares for each card, the firmwares can be obtained from within the Windows driver. The Recon3Di uses "ctefx-r3di.bin" and the Sound Blaster Z uses "ctefx-sbz.bin". If the alternative firmware for the given quirk is not found, the original ctefx.bin will be used. This has been confirmed to work for both the R3Di and the SBZ. This patch also makes the character array *dirstr a const. Signed-off-by: Connor McAdams <conmanx360@gmail.com> Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda/ca0132: fix build failure when a local macro is definedTakashi Sakamoto2018-05-021-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DECLARE_TLV_DB_SCALE (alias of SNDRV_CTL_TLVD_DECLARE_DB_SCALE) is used but tlv.h is not included. This causes build failure when local macro is defined by comment-out. This commit fixes the bug. At the same time, the alias macro is replaced with a destination macro added at a commit 46e860f76804 ("ALSA: rename TLV-related macros so that they're friendly to user applications") Reported-by: Connor McAdams <conmanx360@gmail.com> Fixes: 44f0c9782cc6 ('ALSA: hda/ca0132: Add tuning controls') Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: hda - Enforce CONFIG_SND_DYNAMIC_MINORS for HDMI/DP codecTakashi Iwai2018-05-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DP-MST support requires more PCM streams than usual, hence CONFIG_SND_DYNAMIC_MINORS is almost mandatory. Currently the driver just warns and continues even if streams are missing, but it doesn't seem to enough convince users to switch to the modern setup. This patch adds the enforced selection of CONFIG_SND_DYNAMIC_MINORS from CONFIG_SND_HDA_CODEC_HDMI for covering that. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | ALSA: cs46xx: fix spelling mistake: "amplifer" -> "amplifier"Colin Ian King2018-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | Trivial fix to spelling mistake in module parameter description text Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | Merge branch 'for-linus' into for-nextTakashi Iwai2018-04-258-20/+59
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Back-merge 4.17-rc3 fixes for further development. This will bump the base to 4.17-rc2, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: hda - Sanity check of access to SPDIF controls arrayTakashi Iwai2018-04-241-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Put WARN_ON() and bail out if the given index is over the allocated array of the given SPDIF controls. It's merely a sanity check to catch any potential issues (if any). Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: hda - Use a macro for snd_array iteration loopsTakashi Iwai2018-04-246-52/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new helper macro, snd_array_for_each(), to iterate for each snd_array element. It slightly improves the readability than lengthy open codes at each place. Along with it, add const prefix to some obvious places. There should be no functional changes by this. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: emu10k1: Reduce GFP_ATOMIC allocationTakashi Iwai2018-04-162-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The emu10k1 fx8010 code allocates each irq resource dynamically and links to the list at PCM trigger callback. Due to the nature of trigger callback, the allocation is done with GFP_ATOMIC, hence it may fail more often. Moreover, the irq resource isn't big at all, and using the kmalloc for this won't save many bytes, either. This patch removes the dynamic allocation and embeds the irq resource into struct snd_emu10k1_fx8010_pcm.irq field instead of keeping a pointer. As a result, it simplifies the code and removes the unnecessary GFP_ATOMIC usage. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: cmipci: Allocate with GFP_KERNEL instead of GFP_ATOMICTakashi Iwai2018-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | save_mixer_state() is called in a sleepable context, so it's safe to allocate with GFP_KERNEL instead of the current GFP_ATOMIC. The GFP_ATOMIC usage must have been based on an incorrect assumption in the very old code base. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: ad1889: Replace mdelay with usleep_range in snd_ad1889_ac97_readyJia-Ju Bai2018-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_ad1889_ac97_ready() is never called in atomic context. The call chain ending up at snd_ad1889_ac97_ready() is: [1] snd_ad1889_ac97_ready() <- snd_ad1889_ac97_xinit() <- snd_ad1889_ac97_init() <- snd_ad1889_probe() snd_ad1889_probe() is only set as ".probe" in struct pci_driver. This function is not called in atomic context. Despite never getting called from atomic context, snd_ad1889_ac97_ready() calls mdelay for busy wait. This is not necessary and can be replaced with usleep_range to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * | | ALSA: ad1889: Replace mdelay with usleep_range in snd_ad1889_initJia-Ju Bai2018-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_ad1889_init() is never called in atomic context. The call chain ending up at snd_ad1889_init() is: [1] snd_ad1889_init() <- snd_ad1889_create() <- snd_ad1889_probe() snd_ad1889_probe() is only set as ".probe" in struct pci_driver. This function is not called in atomic context. Despite never getting called from atomic context, snd_ad1889_init() calls mdelay for busy wait. This is not necessary and can be replaced with usleep_range to avoid busy waiting. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | | ALSA: hda - Fix runtime PMLukas Wunner2018-05-241-2/+4
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before commit 3b5b899ca67d ("ALSA: hda: Make use of core codec functions to sync power state"), hda_set_power_state() returned the response to the Get Power State verb, a 32-bit unsigned integer whose expected value is 0x233 after transitioning a codec to D3, and 0x0 after transitioning it to D0. The response value is significant because hda_codec_runtime_suspend() does not clear the codec's bit in the codec_powered bitmask unless the AC_PWRST_CLK_STOP_OK bit (0x200) is set in the response value. That in turn prevents the HDA controller from runtime suspending because azx_runtime_idle() checks that the codec_powered bitmask is zero. Since commit 3b5b899ca67d, hda_set_power_state() only returns 0x0 or 0x1, thereby breaking runtime PM for any HDA controller. That's because an inline function introduced by the commit returns a bool instead of a 32-bit unsigned int. The change was likely erroneous and resulted from copying and pasting snd_hda_check_power_state(), which is immediately preceding the newly introduced inline function. Fix it. Link: https://bugs.freedesktop.org/show_bug.cgi?id=106597 Fixes: 3b5b899ca67d ("ALSA: hda: Make use of core codec functions to sync power state") Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Abhijeet Kumar <abhijeet.kumar@intel.com> Reported-and-tested-by: Gunnar Krüger <taijian@posteo.de> Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
OpenPOWER on IntegriCloud