aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-07-08ALSA: hda - fix a typo by changing mute_led_nid to cap_mute_led_nidHui Wang1-1/+1
BugLink: https://bugs.launchpad.net/bugs/1329580 Cc: David Henningsson <[email protected]> Cc: Kailang Yang <[email protected]> Signed-off-by: Hui Wang <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-07ALSA: hda - Add several entries for enabling HP mute ledHui Wang1-0/+4
BugLink: https://bugs.launchpad.net/bugs/1329580 Signed-off-by: Hui Wang <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-07ALSA: hda - Fix and neaten print_nid_path/debug_badnessJoe Perches1-9/+11
print_nid_path has a possible buffer overflow if struct nid_path.path values are > 256. Avoid this and neaten the output to remove the leading ':' Neaten debug_badness to always verify arguments. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-04ALSA: ice1712: Correcting/completing #defines for REGSKonstantinos Tsimpoukas1-6/+9
This small patch completes #defines for Control/Status Register, adds comments for the missing ones there and on the Interrupt Mask Register and additionally corrects "#define ICE1712_SERR_LEVEL 0x04 -> 0x08", according to documentation. Signed-off-by: Konstantinos Tsimpoukas <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-04Merge branch 'for-linus' into for-nextTakashi Iwai6-41/+101
Conflicts: sound/pci/hda/hda_intel.c
2014-07-04ALSA: hda - restore BCLK M/N value as per CDCLK for HSW/BDW display HDA ↵Mengdong Lin3-41/+66
controller For HSW/BDW display HD-A controller, hda_set_bclk() is defined to set BCLK by programming the M/N values as per the core display clock (CDCLK) queried from i915 display driver. And the audio driver will also set BCLK in azx_first_init() since the display driver can turn off the shared power in boot phase if only eDP is connected and M/N values will be lost and must be reprogrammed. Signed-off-by: Mengdong Lin <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-04drm/i915: provide interface for audio driver to query cdclkJani Nikula2-0/+22
For Haswell and Broadwell, if the display power well has been disabled, the display audio controller divider values EM4 M VALUE and EM5 N VALUE will have been lost. The CDCLK frequency is required for reprogramming them to generate 24MHz HD-A link BCLK. So provide a private interface for the audio driver to query CDCLK. This is a stopgap solution until a more generic interface between audio and display drivers has been implemented. Signed-off-by: Jani Nikula <[email protected]> Reviewed-by: Damien Lespiau <[email protected]> Signed-off-by: Mengdong Lin <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-01ALSA: hda: Remove unused variableSachin Kamat1-4/+0
'status' is not used in the function. Remove it. Signed-off-by: Sachin Kamat <[email protected]> Tested-by: Dylan Reid <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-01ALSA: mixart: Remove unused variableSachin Kamat1-3/+1
'err' is not used in the function. Remove it. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-01ALSA: echoaudio: Remove unused variableSachin Kamat1-6/+0
'chip' is not used in the function. Remove it. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-01ALSA: hda - Fix build error in hda_tegra.cTakashi Iwai1-1/+0
The "list" field has been omitted from struct azx, but its initialization remained mistakenly in hda_tegra.c, which leads to a compile error: sound/pci/hda/hda_tegra.c: In function 'hda_tegra_create': sound/pci/hda/hda_tegra.c:481:22: error: 'struct azx' has no member named 'list' Reported-by: kbuild test robot <[email protected]> Fixes: 9a34af4a3327 ('ALSA: hda - Move more PCI-controller-specific stuff from generic code') Signed-off-by: Takashi Iwai <[email protected]>
2014-07-01ALSA: trident: Remove unused variable in trident_memory.cSachin Kamat1-2/+1
'prev' is not used in the function. Remove it. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-01ALSA: trident: Remove unused variable in trident_main.cSachin Kamat1-2/+0
'private_data' is not used in the function. Remove it. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-07-01Merge branch 'topic/hda-cleanup' into for-nextTakashi Iwai6-394/+422
2014-06-30ALSA: hda - Fix invalid function call in snd_hda_add_vmaster()Takashi Iwai1-2/+7
The recent commit [6194b99d: ALSA: hda - Kill the rest of snd_print*() usages] changed the callback map_slaves(), but one call was forgotten to be replaced due to the cast, which leads to kernel Oops due to invalid function. This patch replaces it with a proper function. Fixes: 6194b99de9f5 ('ALSA: hda - Kill the rest of snd_print*() usages') Signed-off-by: Takashi Iwai <[email protected]>
2014-06-27ALSA: hda - Add a fixup for Thinkpad T540pTakashi Iwai1-0/+1
The similar fixup as T440 is needed for supporting the dock on T540. Reported-by: Jim Minter <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-27ALSA: hda - Add another headset pin quirk for some Dell machinesDavid Henningsson1-0/+12
Another quirk to make the headset mic work on some new Dell machines. Cc: Hui Wang <[email protected]> BugLink: https://bugs.launchpad.net/bugs/1297581 Signed-off-by: David Henningsson <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26ALSA: hda - Replace ICH6_ prefixTakashi Iwai3-116/+115
ICH6_ prefix doesn't mean that it's specific to ICH6 chipset but rather its generic for all HD-audio (or "Azalia") devices. Use AZX_ prefix instead to align with other constants. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26ALSA: hda - Remove obsoleted SFX definitionsTakashi Iwai2-8/+0
It's no longer referred by anyone after standardizing with dev_*() macros. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26ALSA: hda - Move SD nums definitions to hda_intel.cTakashi Iwai2-17/+17
The defined numbers of SDs are specific to hda-intel, so move them to there. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26ALSA: hda - Use common reboot notifierTakashi Iwai4-51/+31
The very same notifier code is used in both hda_intel.c and hda_tegra.c. Move it to the generic code. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26ALSA: hda - Move more PCI-controller-specific stuff from generic codeTakashi Iwai2-70/+85
Just move struct fields between struct azx and struct hda_intel, and move some definitions from hda_priv.h to hda_intel.c. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26ALSA: hda - Make position_fix as generic callbackTakashi Iwai5-129/+174
... and move most parts into hda_intel.c from the generic controller code. This is a clean up, and there should be no functional change by this patch. Now, struct azx obtains the generic callbacks for getting the position and the delay. As default NULL, posbuf is read. These replace the old position_fix[], and each is implemented as a callback. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26ALSA: hda - Remove superfluous MAX_AZX_DEVTakashi Iwai1-3/+0
MAX_AZX_DEV is no longer referred anywhere, let's kill it. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26Merge branch 'for-linus' into for-nextTakashi Iwai12-335/+365
2014-06-26ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controllerMengdong Lin1-7/+58
For Intel Haswell/Broadwell display HD-A controller, the 24MHz HD-A link BCLK is converted from Core Display Clock (CDCLK): BCLK = CDCLK * M / N And there are two registers EM4 and EM5 to program M, N value respectively. The EM4/EM5 values will be lost and when the display power well is disabled. BIOS programs CDCLK selected by OEM and EM4/EM5, but BIOS has no idea about display power well on/off at runtime. So the M/N can be wrong if non-default CDCLK is used when the audio controller resumes, which results in an invalid BCLK and abnormal audio playback rate. So this patch saves and restores valid M/N values on controller suspend/resume. And 'struct hda_intel' is defined to contain standard HD-A 'struct azx' and Intel specific fields, as Takashi suggested. Signed-off-by: Mengdong Lin <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26ALSA: usb-audio: Fix races at disconnection and PCM closingTakashi Iwai3-6/+25
When a USB-audio device is disconnected while PCM is still running, we still see some race: the disconnect callback calls snd_usb_endpoint_free() that calls release_urbs() and then kfree() while a PCM stream would be closed at the same time and calls stop_endpoints() that leads to wait_clear_urbs(). That is, the EP object might be deallocated while a PCM stream is syncing with wait_clear_urbs() with the same EP. Basically calling multiple wait_clear_urbs() would work fine, also calling wait_clear_urbs() and release_urbs() would work, too, as wait_clear_urbs() just reads some fields in ep. The problem is the succeeding kfree() in snd_pcm_endpoint_free(). This patch moves out the EP deallocation into the later point, the destructor callback. At this stage, all PCMs must have been already closed, so it's safe to free the objects. Reported-by: Alan Stern <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-25ALSA: hda - Adjust speaker HPF and add LED support for HP Spectre 13Takashi Iwai2-1/+62
HP Spectre 13 has the IDT 92HD95 codec, and BIOS seems to set the default high-pass filter in some "safer" range, which results in the very soft tone from the built-in speakers in contrast to Windows. Also, the mute LED control is missing, since 92HD95 codec still has no HP-specific fixups for GPIO setups. This patch adds these missing features: the HPF is adjusted by the vendor-specific verb, and the LED is set up from a DMI string (but with the default polarity = 0 assumption due to the incomplete BIOS on the given machine). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=74841 Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-25ALSA: hda - Remove the obsoleted static quirk codes from patch_cmedia.cTakashi Iwai1-615/+9
The static quirk code has been disabled for a while and it seems working fine, so it's time to actually get rid of it. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-25ALSA: hda - Remove the obsoleted static quirk codes from patch_conexant.cTakashi Iwai1-2622/+9
The static quirk code has been disabled for a while and it seems working fine, so it's time to actually get rid of it. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-25ALSA: hda - Kill the rest of snd_print*() usagesTakashi Iwai7-22/+32
Pass the codec object so that we can replace all the rest of snd_print*() usages with the proper device-specific print helpers. Signed-off-by: Takashi Iwai <[email protected]>
2014-06-25ALSA: hda - Kill snd_printd*() in HDMI debug / info printsTakashi Iwai3-31/+30
Pass codec instance to each function that still prints info and debug outputs via snd_printd*(). Signed-off-by: Takashi Iwai <[email protected]>
2014-06-25sound: oss: mpu401.c: Cleaning up variable is set more than onceRickard Strandqvist1-1/+0
A struct member variable is set to the same value more than once This was found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-24ALSA: hda - Make the pin quirk tables use the SND_HDA_PIN_QUIRK macroDavid Henningsson1-327/+183
This is cosmetical - it makes the pin quirk table look better. Signed-off-by: David Henningsson <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-24ALSA: hda - Make a SND_HDA_PIN_QUIRK macroDavid Henningsson1-0/+21
This is cosmetical - it makes the new pin quirk table look better. Signed-off-by: David Henningsson <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-24sound: oss: mpu401.c: Cleaning up missing break in a caseRickard Strandqvist1-0/+1
Added a missed break in a case statement This was found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-24ALSA: hda - Add pin quirk for Dell XPS 15David Henningsson1-0/+21
Two bug reporters with Dell XPS 15 report that they need to use the dell-headset-multi model to get the headset mic working. The two bug reporters have different PCI SSID (1028:05fd and 1028:05fe) but this pin quirk matches both. BugLink: https://bugs.launchpad.net/bugs/1331915 Signed-off-by: David Henningsson <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-23ALSA: seq: seq_memory.c: Fix closing brace followed by ifRasmus Villemoes1-2/+2
Add a newline and, while at it, remove a space and redundant braces. Signed-off-by: Rasmus Villemoes <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-23ALSA: hda - hdmi: call overridden init on resumePierre Ossman1-1/+1
We need to call the proper init function in case it has been overridden, as it might restore things that the generic routing doesn't know anything about. E.g. AMD cards have special verbs that need resetting. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=77901 Fixes: 5a61358433b1 ('ALSA: hda - hdmi: Add ATI/AMD multi-channel audio support') Signed-off-by: Pierre Ossman <[email protected]> Cc: <[email protected]> [v3.13+] Signed-off-by: Takashi Iwai <[email protected]>
2014-06-23ALSA: hda - Fix usage of "model" module parameterDavid Henningsson1-0/+1
A recent refactoring broke the possibility to manually specify model name as a module parameter. This patch restores the desired functionality. Fixes: c21c8cf77f47 ('ALSA: hda - Add fixup_forced flag') Reported-by: Kent Baxley <[email protected]> Signed-off-by: David Henningsson <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-23ALSA: compress: fix the struct alignment to 4 bytesVinod Koul2-14/+14
In 64bit systems the compiler can default align to 8bytes causing mis-match with 32bit usermode. Avoid this is future by ensuring all the structures shared with usermode are packed and aligned to 4 bytes irrespective of arch used [coding style fixes by tiwai] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-23ALSA: hda/realtek - Support HP mute led for output and inputKailang Yang1-0/+114
HP mute led support output mute led and input mute led. ALC280: GPIO3 to control output mute led. Mic1 vref to control input mute led. ALC282: Line1 vref to control output mute led. Mic1 vref to control input mute led. Signed-off-by: Kailang Yang <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-23Merge branch 'for-linus' into for-nextTakashi Iwai14-116/+189
2014-06-18Merge branch 'topic/core-vuln-fixes' into for-linusTakashi Iwai3-27/+54
2014-06-18Merge tag 'asoc-v3.16-rc1' of ↵Takashi Iwai11-89/+135
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v3.16 Quite a few build coverage fixes in here among the usual small driver fixes includling the sigmadsp change from Lars - moving the driver to separate modules per bus (which is basically just code motion) avoids issues with some combinations of buses being enabled.
2014-06-18ALSA: control: Make sure that id->index does not overflowLars-Peter Clausen1-0/+3
The ALSA control code expects that the range of assigned indices to a control is continuous and does not overflow. Currently there are no checks to enforce this. If a control with a overflowing index range is created that control becomes effectively inaccessible and unremovable since snd_ctl_find_id() will not be able to find it. This patch adds a check that makes sure that controls with a overflowing index range can not be created. Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-18ALSA: control: Handle numid overflowLars-Peter Clausen1-0/+4
Each control gets automatically assigned its numids when the control is created. The allocation is done by incrementing the numid by the amount of allocated numids per allocation. This means that excessive creation and destruction of controls (e.g. via SNDRV_CTL_IOCTL_ELEM_ADD/REMOVE) can cause the id to eventually overflow. Currently when this happens for the control that caused the overflow kctl->id.numid + kctl->count will also over flow causing it to be smaller than kctl->id.numid. Most of the code assumes that this is something that can not happen, so we need to make sure that it won't happen Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-18ALSA: control: Don't access controls outside of protected regionsLars-Peter Clausen1-5/+10
A control that is visible on the card->controls list can be freed at any time. This means we must not access any of its memory while not holding the controls_rw_lock. Otherwise we risk a use after free access. Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-18ALSA: control: Fix replacing user controlsLars-Peter Clausen1-16/+9
There are two issues with the current implementation for replacing user controls. The first is that the code does not check if the control is actually a user control and neither does it check if the control is owned by the process that tries to remove it. That allows userspace applications to remove arbitrary controls, which can cause a user after free if a for example a driver does not expect a control to be removed from under its feed. The second issue is that on one hand when a control is replaced the user_ctl_count limit is not checked and on the other hand the user_ctl_count is increased (even though the number of user controls does not change). This allows userspace, once the user_ctl_count limit as been reached, to repeatedly replace a control until user_ctl_count overflows. Once that happens new controls can be added effectively bypassing the user_ctl_count limit. Both issues can be fixed by instead of open-coding the removal of the control that is to be replaced to use snd_ctl_remove_user_ctl(). This function does proper permission checks as well as decrements user_ctl_count after the control has been removed. Note that by using snd_ctl_remove_user_ctl() the check which returns -EBUSY at beginning of the function if the control already exists is removed. This is not a problem though since the check is quite useless, because the lock that is protecting the control list is released between the check and before adding the new control to the list, which means that it is possible that a different control with the same settings is added to the list after the check. Luckily there is another check that is done while holding the lock in snd_ctl_add(), so we'll rely on that to make sure that the same control is not added twice. Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-18ALSA: control: Protect user controls against concurrent accessLars-Peter Clausen3-6/+28
The user-control put and get handlers as well as the tlv do not protect against concurrent access from multiple threads. Since the state of the control is not updated atomically it is possible that either two write operations or a write and a read operation race against each other. Both can lead to arbitrary memory disclosure. This patch introduces a new lock that protects user-controls from concurrent access. Since applications typically access controls sequentially than in parallel a single lock per card should be fine. Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>