summaryrefslogtreecommitdiff
path: root/sound/pci/hda
AgeCommit message (Collapse)Author
2016-04-09ACPI / utils: Rename acpi_dev_present()Lukas Wunner
acpi_dev_present() was originally named after pci_dev_present() to signify the similarity of the two functions. However Rafael J. Wysocki pointed out that the exported function acpi_dev_present() is easily confused with the non-exported acpi_device_is_present(). Additionally in ACPI parlance the term "present" usually refers to the "device is present" bit returned by the _STA control method, yet acpi_dev_present() merely checks presence in the namespace. It does not invoke _STA at all, let alone check the "device is present" bit. As suggested by Rafael, rename the function to acpi_dev_found() and adjust all existing call sites. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-01ALSA: hda - fix front mic problem for a HP desktopHui Wang
The front mic jack (pink color) can't detect any plug or unplug. After applying this fix, both detecting function and recording function work well. BugLink: https://bugs.launchpad.net/bugs/1564712 Cc: stable@vger.kernel.org Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-31ALSA: hda: add AMD Polaris-10/11 AZ PCI IDs with proper driver capsMaruthi Srinivas Bayyavarapu
This commit fixes garbled audio on Polaris-10/11 variants Signed-off-by: Maruthi Bayyavarapu <maruthi.bayyavarapu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-23ALSA: hda - Apply fix for white noise on Asus N550JV, tooBobi Mihalca
Apply the new fixup that is used for ASUS N750JV to another similar model, N500JV, too, for reducing the headphone noise. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 Signed-off-by: Bobi Mihalca <bobbymihalca@touchtech.ro> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-23ALSA: hda - Fix white noise on Asus N750JV headphoneBobi Mihalca
For reducing the noise from the headphone output on ASUS N750JV, call the existing fixup, alc_fixup_auto_mute_via_amp(), additionally. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 Signed-off-by: Bobi Mihalca <bobbymihalca@touchtech.ro> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-23ALSA: hda - Asus N750JV external subwoofer fixupBobi Mihalca
ASUS N750JV needs the same fixup as N550 for enabling its subwoofer. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115181 Signed-off-by: Bobi Mihalca <bobbymihalca@touchtech.ro> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-21ALSA: hda - Fix missing ELD update at unpluggingTakashi Iwai
i915 get_eld ops may return an error when no encoder is connected, and currently we regard the error as fatal and skip the whole ELD handling. This ended up with the missing ELD update at unplugging. This patch fixes the issue by treating the error as the unplugged state, instead of skipping the rest. Reported-by: Libin Yang <libin.yang@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.5 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-20ALSA: hda - Workaround for unbalanced i915 power refcount by concurrent probeTakashi Iwai
The recent addition of on-demand i915 audio component binding in the codec driver seems leading to the unbalanced i915 power refcount, according to Intel CI tests. Typically, it gets a kernel WARNING like: WARNING: CPU: 3 PID: 173 at sound/hda/hdac_i915.c:91 snd_hdac_display_power+0xf1/0x110 [snd_hda_core]() Call Trace: [<ffffffff813fef15>] dump_stack+0x67/0x92 [<ffffffff81078a21>] warn_slowpath_common+0x81/0xc0 [<ffffffff81078b15>] warn_slowpath_null+0x15/0x20 [<ffffffffa00f77e1>] snd_hdac_display_power+0xf1/0x110 [snd_hda_core] [<ffffffffa015039d>] azx_intel_link_power+0xd/0x10 [snd_hda_intel] [<ffffffffa011e32a>] azx_link_power+0x1a/0x30 [snd_hda_codec] [<ffffffffa00f21f9>] snd_hdac_link_power+0x29/0x40 [snd_hda_core] [<ffffffffa01192a6>] hda_codec_runtime_suspend+0x76/0xa0 [snd_hda_codec] ..... The scenario is like below: - HD-audio driver and i915 driver are probed concurrently at the (almost) same time; HDA bus tries to bind with i915, but it fails because i915 initialization is still being processed. - Later on, HD-audio probes the HDMI codec, where it again tries to bind with i915. At this time, it succeeds. - At finishing the probe of HDA, it decreases the refcount as if it were already bound at the bus probe, since the component is bound now. This triggers a kernel WARNING due to the unbalance. As a workaround, in this patch, we just disable the on-demand i915 component binding in the codec driver. This essentially reverts back to the state of 4.4 kernel. We know that this is no real solution, but it's a minimalistic simple change that can be applied to 4.5.x kernel as stable. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94566 Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.5 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-18ALSA: hda - Fix spurious kernel WARNING on Baytrail HDMITakashi Iwai
snd_hdac_sync_audio_rate() call is mandatory only for HSW and later models, but we call the function unconditionally blindly assuming that the function doesn't do anything harmful. But since recently, the function checks the validity of the passed pin NID, and eventually spews the warning if an unexpected pin is passed. This is seen on old chips like Baytrail. The fix is to limit the call of this function again only for the chips with the proper binding. This can be identified by the same flag as the eld notifier. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.5 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-18ALSA: hda - Fix forgotten HDMI monitor_present updateTakashi Iwai
We forgot to copy monitor_present value when updating the ELD information. This won't change the ELD retrieval and the jack notification behavior, but appears only in the proc output. In that sense, it's no fatal error, but a bug is a bug is a bug. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-18ALSA: hda - Really restrict i915 notifier to HSW+Takashi Iwai
The commit [b62232d429fa: ALSA: hda - Limit i915 HDMI binding only for HSW and later] tried to limit the usage of i915 audio notifier to the recent Intel models and switch to the old method on pre-Haswell models. However, it assumed that the i915 component binding hasn't been done on such models, and the assumption was wrong: namely, Baytrail had already the i915 component binding due to powerwell control. Thus, the workaround wasn't applied to Baytrail. For fixing this properly, this patch introduces a new flag indicating the usage of audio notifier and codec_has_acomp() refers to this flag instead of checking the existence of audio component. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.5 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-17ALSA: hda - Fix mutex deadlock at HDMI/DP hotplugTakashi Iwai
The recent change in HD-audio HDMI/DP codec driver for allowing the dynamic PCM binding introduced a new spec->pcm_mutex. One of the protected area by this mutex is hdmi_present_sense(). As reported by Intel CI tests, unfortunately, the new mutex causes a deadlock when the hotplug/unplug is triggered during the codec is in runtime suspend. The buggy code path is like the following: hdmi_unsol_event() -> ... -> hdmi_present_sense() ==> ** here taking pcm_mutex -> hdmi_present_sense_via_verbs() -> snd_hda_power_up_pm() -> ... (runtime resume calls) -> generic_hdmi_resume() -> hdmi_present_sense() ==> ** here taking pcm_mutex again! As we can see here, the problem is that the mutex is taken before snd_hda_power_up_pm() call that triggers the runtime resume. That is, the obvious solution is to move the power up/down call outside the mutex; it is exactly what this patch provides. The patch also clarifies why this bug wasn't caught beforehand. We used to have the i915 audio component for hotplug for all Intel chips, and in that code path, there is no power up required but the information is taken directly from the graphics side. However, we recently switched back to the old method for some old Intel chips due to regressions, and now the deadlock issue is surfaced. Fixes: a76056f2e57e ('ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug') Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-15ALSA: hda - Limit i915 HDMI binding only for HSW and laterTakashi Iwai
It turned out that the pre-HSW Intel chips are incompatible with the naive assumption we had -- the fixed mapping between the port and the HD-audio widget. This may result in the bad access, as captured by the recent patch to add a WARN_ON() for the port mapping check. As a quick workaround, disable the i915 audio component binding for all pre-Haswell models. Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.5 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-15ALSA: hda - Fix unconditional GPIO toggle via automuteTakashi Iwai
Cirrus HD-audio driver may adjust GPIO pins for EAPD dynamically depending on the jack plug state. This works fine for the auto-mute mode where the speaker gets muted upon the HP jack plug. OTOH, when the auto-mute mode is off, this turns off the EAPD unexpectedly depending on the jack state, which results in the silent speaker output. This patch fixes the silent speaker output issue by setting GPIO bits constantly when the auto-mute mode is off. Reported-and-tested-by: moosotc@gmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-14ALSA: hda - Fixes double fault in nvhdmi_chmap_cea_alloc_validate_get_typeSubhransu S. Prusty
nvhdmi_chmap_cea_alloc_validate_get_type calls itself recursively using chmap ops causing the double fault. Fixed by adding the default validate_get_type handling inside nvdia validate_get_type handler. Link: https://bugzilla.kernel.org/show_bug.cgi?id=114311 Fixes: 67b90cb ("ALSA: hda - Create common chmap object") Reported-by: Andreas Reis <andreas.reis@gmail.com> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Tested-by: Andreas Reis <andreas.reis@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-14ALSA: hda - Add new GPU codec ID 0x10de0082 to snd-hdaAaron Plattner
Vendor ID 0x10de0082 is used by a yet-to-be-named GPU chip. This chip also has the 2-ch audio swapping bug, so patch_nvhdmi is appropriate here. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-14Merge branch 'for-linus' into for-nextTakashi Iwai
2016-03-11ALSA: hda - fix the mic mute button and led problem for a Lenovo AIOHui Wang
This Lenovo ThinkCentre AIO also uses Line2 as mic mute button and uses GPIO2 to control the mic mute led, so applying this quirk can make both the button and led work. Cc: stable@vger.kernel.org BugLink: https://bugs.launchpad.net/bugs/1555912 Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-10ALSA: hda - Don't handle ELD notify from invalid portTakashi Iwai
The current Intel HDMI codec driver supports only three fixed ports from port B to port D. However, i915 driver may assign a DP on other ports, e.g. port A, when no eDP is used. This incompatibility is caught later at pin_nid_to_pin_index() and results in a warning message like "HDMI: pin nid 4 not registered" at each time. This patch filters out such invalid events beforehand, so that the kernel won't be too grumbling. Reported-by: Stefan Assmann <sassmann@kpanic.de> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-10ALSA: hda - Apply reboot D3 fix for CX20724 codec, tooTakashi Iwai
Just like CX20722, CX7024 codec also requires the power down at reboot in order to reduce the noise at reboot/shutdown. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=113511 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-07ALSA: hda - Use snd_hdac namespace prefix for chmap exported APIsSubhransu S. Prusty
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-07ALSA: hda - Move chmap support helpers/ops to coreSubhransu S. Prusty
Chmap helpers, ops, controls are moved to core. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-07ALSA: hda - chmap helper args modified to use generic hdac objs.Subhransu S. Prusty
Chmap helper arguments are modified to use either hdac_device object or hdac_chmap object instead of codec specific object. With this moving these APIs to core will be easier. Helper added to access a specific channel_allocation object instead of directly accessing. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-07ALSA: hda - Add hdmi chmap verb programming ops to chmap objectSubhransu S. Prusty
Add slot and channel count programming to hdmi_chmap object and move the chmap_ops to core. Use register_chmap_ops API to register for default ops. Override specific chmap ops in the driver. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-07ALSA: hda - Use hdac name space for CEA spk alloc structureSubhransu S. Prusty
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-07ALSA: hda - Register chmap obj as priv data instead of codecSubhransu S. Prusty
With this chmap object is added as private data and new ops are added to access driver specific chmap. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-07ALSA: hda - Create common chmap objectSubhransu S. Prusty
chmap object represents multichannel capability and contains chmap ops. Legacy driver is updated to use this. With next set of patches chmap object is moved to common to be reused by other drivers (ex: skylake ASoC hdmi driver). Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-04Merge branch 'for-linus' into for-nextTakashi Iwai
Resolved the conflicts with the latest HDA HDMI fixes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-04ALSA: hda - hdmi defer to register acomp eld notifierLibin Yang
Defer to register acomp eld notifier until hdmi audio driver is fully ready. After registering eld notifier, gfx driver can use this callback function to notify audio driver the monitor connection event. However this action may happen when audio driver is adding the pins or doing other initialization. This is not always safe, however. For example, using per_pin->lock before the lock is initialized. Let's register the eld notifier after the initialization is done. Signed-off-by: Libin Yang <libin.yang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-04ALSA: hda - hdmi add wmb barrier for audio componentLibin Yang
To make sure audio_ptr is set before intel_audio_codec_enable() or intel_audio_codec_disable() calling pin_eld_notify(), this patch adds wmb barrier to prevent optimizing. Signed-off-by: Libin Yang <libin.yang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-03ALSA: hda - Fix mic issues on Acer Aspire E1-472Simon South
This patch applies the microphone-related fix created for the Acer Aspire E1-572 to the E1-472 as well, as it uses the same Realtek ALC282 CODEC and demonstrates the same issues. This patch allows an external, headset microphone to be used and limits the gain on the (quite noisy) internal microphone. Signed-off-by: Simon South <simon@simonsouth.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-03-01ALSA: hda - hdmi_find_pcm_slot return value bug fixLibin Yang
hdmi_find_pcm_slot return -EBUSY when not no pcm slot found, not -ENODEV. So the caller should compare with -EBUSY. Fixes: a76056f2e57e ('ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug') Signed-off-by: Libin Yang <libin.yang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-26Merge branch 'for-linus' into for-nextTakashi Iwai
2016-02-26ALSA: hda - Autosuspend controller after probe even if codecs are already ↵Ville Syrjälä
suspended azx_probe_continue() uses pm_runtime_put_noidle() to drop the rpm usage_count, which means that if it's the last reference the autosuspend of the controller won't actually happen. So if the codecs autosuspend before the azx_probe_continue() drops the last reference we'll fail to autosuspend the controller. This does happen in practice, but not every time. As can be seen in [1] the controller autosuspend attempt fails due to the usage_count when suspending the codecs. A bit later we see the the contoller usage_count dropping to zero without further attempts at autosuspend. Fix the problem by using pm_runtime_put_autosuspend() instead, which will kick off the autosuspend of the controller even if the codecs are already asleep. As can be seen in [2] the controller autosuspend still fails while suspending the codecs, but later on we see another autosuspend attempt after dropping the usage_count to 0. I was also a bit worried that there might still be a race between the controller autosuspend and the rest of the code in azx_probe_continue(). So I also tried replacing the the put_noidle() with put_sync_suspend(). No explosions occurred, so I'm somewhat satisfied that there are no serious problems in this area. [1] kworker/1:2-122 [001] .... 63.661310: __pm_runtime_suspend: hdaudioC0D0 usage_count 0 kworker/1:2-122 [001] d..2 63.661316: rpm_suspend: hdaudioC0D0 flags-d cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/1:2-122 [001] d..1 63.661317: rpm_check_suspend_allowed: hdaudioC0D0 retval 0 kworker/1:2-122 [001] d..2 63.661332: rpm_return_int: rpm_suspend+0x406/0x5e8:hdaudioC0D0 ret=0 kworker/1:1-72 [001] d..2 63.661543: rpm_suspend: hdaudioC0D0 flags-a cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/1:1-72 [001] d..1 63.661544: rpm_check_suspend_allowed: hdaudioC0D0 retval 0 kworker/1:1-72 [001] .... 63.661545: hda_codec_runtime_suspend: hdaudioC0D0 suspend kworker/1:1-72 [001] d..2 63.661614: rpm_idle: 0000:00:03.0 flags-1 cnt-1 dep-0 auto-1 p-0 irq-0 child-0 kworker/1:1-72 [001] d..1 63.661615: rpm_check_suspend_allowed: 0000:00:03.0 usage_count 1 kworker/1:1-72 [001] d..1 63.661615: rpm_check_suspend_allowed: 0000:00:03.0 retval -11 kworker/1:1-72 [001] d..2 63.661616: rpm_return_int: rpm_idle+0x249/0x487:0000:00:03.0 ret=-11 kworker/1:1-72 [001] d..2 63.661616: rpm_return_int: rpm_suspend+0x406/0x5e8:hdaudioC0D0 ret=0 kworker/1:2-122 [001] d..2 63.664834: rpm_idle: hdaudioC0D0 flags-8 cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/1:2-122 [001] d..1 63.664835: rpm_check_suspend_allowed: hdaudioC0D0 retval 1 kworker/1:2-122 [001] d..2 63.664836: rpm_return_int: rpm_idle+0x249/0x487:hdaudioC0D0 ret=-11 kworker/1:2-122 [001] d..2 63.664841: rpm_idle: hdaudioC0D0 flags-8 cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/1:2-122 [001] d..1 63.664841: rpm_check_suspend_allowed: hdaudioC0D0 retval 1 kworker/1:2-122 [001] d..2 63.664841: rpm_return_int: rpm_idle+0x249/0x487:hdaudioC0D0 ret=-11 kworker/1:2-122 [001] .... 63.664842: azx_probe_continue: 0000:00:03.0 usage_count=0 [2] kworker/0:0-4 [000] .... 50.354567: __pm_runtime_suspend: hdaudioC0D0 usage_count 0 kworker/0:0-4 [000] d..2 50.354574: rpm_suspend: hdaudioC0D0 flags-d cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/0:0-4 [000] d..1 50.354575: rpm_check_suspend_allowed: hdaudioC0D0 retval 0 kworker/0:0-4 [000] d..2 50.354589: rpm_return_int: rpm_suspend+0x406/0x5e8:hdaudioC0D0 ret=0 kworker/0:2-135 [000] d..2 50.354809: rpm_suspend: hdaudioC0D0 flags-a cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/0:2-135 [000] d..1 50.354810: rpm_check_suspend_allowed: hdaudioC0D0 retval 0 kworker/0:2-135 [000] .... 50.354816: hda_codec_runtime_suspend: hdaudioC0D0 suspend kworker/0:2-135 [000] d..2 50.354908: rpm_idle: 0000:00:03.0 flags-1 cnt-1 dep-0 auto-1 p-0 irq-0 child-0 kworker/0:2-135 [000] d..1 50.354909: rpm_check_suspend_allowed: 0000:00:03.0 usage_count 1 kworker/0:2-135 [000] d..1 50.354909: rpm_check_suspend_allowed: 0000:00:03.0 retval -11 kworker/0:2-135 [000] d..2 50.354909: rpm_return_int: rpm_idle+0x249/0x487:0000:00:03.0 ret=-11 kworker/0:2-135 [000] d..2 50.354910: rpm_return_int: rpm_suspend+0x406/0x5e8:hdaudioC0D0 ret=0 kworker/0:0-4 [000] d..2 50.373791: rpm_idle: hdaudioC0D0 flags-8 cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/0:0-4 [000] d..1 50.373792: rpm_check_suspend_allowed: hdaudioC0D0 retval 1 kworker/0:0-4 [000] d..2 50.373793: rpm_return_int: rpm_idle+0x249/0x487:hdaudioC0D0 ret=-11 kworker/0:0-4 [000] d..2 50.373797: rpm_idle: hdaudioC0D0 flags-8 cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/0:0-4 [000] d..1 50.373798: rpm_check_suspend_allowed: hdaudioC0D0 retval 1 kworker/0:0-4 [000] d..2 50.373798: rpm_return_int: rpm_idle+0x249/0x487:hdaudioC0D0 ret=-11 kworker/0:0-4 [000] .... 50.373799: __pm_runtime_suspend: 0000:00:03.0 usage_count 0 kworker/0:0-4 [000] d..2 50.373800: rpm_suspend: 0000:00:03.0 flags-d cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/0:0-4 [000] d..1 50.373800: rpm_check_suspend_allowed: 0000:00:03.0 retval 0 kworker/0:0-4 [000] d..2 50.373803: rpm_return_int: rpm_suspend+0x406/0x5e8:0000:00:03.0 ret=0 kworker/0:0-4 [000] d..2 50.385164: rpm_suspend: 0000:00:03.0 flags-a cnt-0 dep-0 auto-1 p-0 irq-0 child-0 kworker/0:0-4 [000] d..1 50.385165: rpm_check_suspend_allowed: 0000:00:03.0 retval 0 kworker/0:0-4 [000] .... 50.385174: azx_runtime_suspend: 0000:00:03.0 azx suspend releaseing power well kworker/0:0-4 [000] .... 50.385179: azx_runtime_suspend: 0000:00:03.0 azx suspend kworker/0:0-4 [000] d..2 50.386872: rpm_return_int: rpm_suspend+0x406/0x5e8:0000:00:03.0 ret=0 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-26ALSA: hda - Loop interrupt handling until really clearedTakashi Iwai
Currently the interrupt handler of HD-audio driver assumes that no irq update is needed while processing the irq. But in reality, it has been confirmed that the HW irq is issued even during the irq handling. Since we clear the irq status at the beginning, process the interrupt, then exits from the handler, the lately issued interrupt is left untouched without being properly processed. This patch changes the interrupt handler code to loop over the check-and-process. The handler tries repeatedly as long as the IRQ status are turned on, and either stream or CORB/RIRB is handled. For checking the stream handling, snd_hdac_bus_handle_stream_irq() returns a value indicating the stream indices bits. Other than that, the change is only in the irq handler itself. Reported-by: Libin Yang <libin.yang@linux.intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-25ALSA: hda - Fix headset support and noise on HP EliteBook 755 G2Takashi Iwai
HP EliteBook 755 G2 with ALC3228 (ALC280) codec [103c:221c] requires the known fixup (ALC269_FIXUP_HEADSET_MIC) for making the headset mic working. Also, it suffers from the loopback noise problem, so we should disable aamix path as well. Reported-by: Derick Eddington <derick.eddington@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-25ALSA: hda - Fixup speaker pass-through control for nid 0x14 on ALC225David Henningsson
On one of the machines we enable, we found that the actual speaker volume did not always correspond to the volume set in alsamixer. This patch fixes that problem. This patch was orginally written by Kailang @ Realtek, I've rebased it to fit sound git master. Cc: stable@vger.kernel.org BugLink: https://bugs.launchpad.net/bugs/1549660 Co-Authored-By: Kailang <kailang@realtek.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-25ALSA: hda - Fixing background noise on Dell Inspiron 3162Kai-Heng Feng
After login to the desktop on Dell Inspiron 3162, there's a very loud background noise comes from the builtin speaker. The noise does not go away even if the speaker is muted. The noise disappears after using the aamix fixup. Codec: Realtek ALC3234 Address: 0 AFG Function Id: 0x1 (unsol 1) Vendor Id: 0x10ec0255 Subsystem Id: 0x10280725 Revision Id: 0x100002 No Modem Function Group found BugLink: http://bugs.launchpad.net/bugs/1549620 Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-23ALSA: hda - hdmi eld control created based on pcmLibin Yang
eld control is created based on pcm now. When monitor is connected, eld control will be bound to pin automatically. Signed-off-by: Libin Yang <libin.yang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-23ALSA: jack: Allow building the jack layer without input deviceTakashi Iwai
Since the recent integration of kctl jack and input jack layers, we can basically build the jack layer even without input devices. That is, the jack layer itself can be built with conditional to enable the input device support or not, while the users may enable always CONFIG_SND_JACK unconditionally. For achieving it, this patch changes the following: - A new Kconfig, CONFIG_SND_JACK_INPUT_DEV, was introduced to indicate whether the jack layer supports the input device, - A few items in snd_jack struct and relevant codes are conditionally built upon CONFIG_SND_JACK_INPUT_DEV, - The users of CONFIG_SND_JACK drop the messy dependency on CONFIG_INPUT. This change also automagically fixes a potential bug in HD-audio driver Arnd reported, where the NULL or uninitialized jack instance is dereferenced. Reported-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-22ALSA: hda - Apply clock gate workaround to Skylake, tooTakashi Iwai
Some Skylake machines show the codec probe errors in certain situations, e.g. HP Z240 desktop fails to probe the onboard Realtek codec at reloading the snd-hda-intel module like: snd_hda_intel 0000:00:1f.3: spurious response 0x200:0x2, last cmd=0x000000 snd_hda_intel 0000:00:1f.3: azx_get_response timeout, switching to polling mode: lastcmd=0x000f0000 snd_hda_intel 0000:00:1f.3: No response from codec, disabling MSI: last cmd=0x000f0000 snd_hda_intel 0000:00:1f.3: Codec #0 probe error; disabling it... hdaudio hdaudioC0D2: no AFG or MFG node found snd_hda_intel 0000:00:1f.3: no codecs initialized Also, HP G470 G3 suffers from the similar problem, as reported in bugzilla below. On this machine, the codec probe error appears even at a fresh boot. As Libin suggested, the same workaround used for Broxton in the commit [6639484ddaf6: ALSA: hda - disable dynamic clock gating on Broxton before reset] can be applied for Skylake in order to fix this problem. The Intel HW team also confirmed that this is needed for SKL. This patch makes the workaround applied to both SKL and BXT platforms. The referred macros are moved and one superfluous macro (IS_BROXTON()) is another one (IS_BXT()) as well. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=112731 Suggested-by: Libin Yang <libin.yang@linux.intel.com> Cc: <stable@vger.kernel.org> # v4.4+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-21ALSA: hda - Use acpi_dev_present()Lukas Wunner
Use shiny new acpi_dev_present() and remove all the boilerplate to search for a particular ACPI device. No functional change. Cf. 2d12b6b381ba ("ACPI / utils: Add acpi_dev_present()"). Signed-off-by: Lukas Wunner <lukas@wunner.de> Acked-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-19ALSA: hda - hdmi get jack from hda_jack_tbl when not dyn_pcm_assignLibin Yang
On Intel platform, if !dyn_pcm_assign, spec->pcm_rec[].jack is not NULL even after snd_hda_jack_tbl_clear() is called to free snd_jack. This may cause access invalid memory when calling snd_jack_report. Fixes: 25e4abb33df3 ('ALSA: hda - hdmi jack created based on pcm') Signed-off-by: Libin Yang <libin.yang@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-15ALSA: hda - Cancel probe work instead of flush at removeTakashi Iwai
The commit [991f86d7ae4e: ALSA: hda - Flush the pending probe work at remove] introduced the sync of async probe work at remove for fixing the race. However, this may lead to another hangup when the module removal is performed quickly before starting the probe work, because it issues flush_work() and it's blocked forever. The workaround is to use cancel_work_sync() instead of flush_work() there. Fixes: 991f86d7ae4e ('ALSA: hda - Flush the pending probe work at remove') Cc: <stable@vger.kernel.org> # v3.17+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-10Merge branch 'topic/hda-mst' into for-nextTakashi Iwai
2016-02-09ALSA: hda - Fix bad dereference of jack objectTakashi Iwai
The hda_jack_tbl entries are managed by snd_array for allowing multiple jacks. It's good per se, but the problem is that struct hda_jack_callback keeps the hda_jack_tbl pointer. Since snd_array doesn't preserve each pointer at resizing the array, we can't keep the original pointer but have to deduce the pointer at each time via snd_array_entry() instead. Actually, this resulted in the deference to the wrong pointer on codecs that have many pins such as CS4208. This patch replaces the pointer to the NID value as the search key. As an unexpected good side effect, this even simplifies the code, as only NID is needed in most cases. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-07ALSA: hda - Fix speaker output from VAIO AiO machinesTakashi Iwai
Some Sony VAIO AiO models (VGC-JS4EF and VGC-JS25G, both with PCI SSID 104d:9044) need the same quirk to make the speaker working properly. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=112031 Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-05Revert "ALSA: hda - Fix noise on Gigabyte Z170X mobo"Takashi Iwai
This reverts commit 0c25ad80408e95e0a4fbaf0056950206e95f726f. The original commit disabled the aamixer path due to the noise problem, but it turned out that some mobo with the same PCI SSID doesn't suffer from the issue, and the disabled function (analog loopback) is still demanded by users. Since the recent commit [e7fdd52779a6: ALSA: hda - Implement loopback control switch for Realtek and other codecs], we have the dynamic mixer switch to enable/disable the aamix path, and we don't have to disable the path statically any longer. So, let's revert the disablement, so that only the user suffering from the noise problem can turn off the aamix on the fly. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=108301 Reported-by: <mutedbytes@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-05ALSA: hda - Fix static checker warning in patch_hdmi.cDavid Henningsson
The static checker warning is: sound/pci/hda/patch_hdmi.c:460 hdmi_eld_ctl_get() error: __memcpy() 'eld->eld_buffer' too small (256 vs 512) I have a hard time figuring out if this can ever cause an information leak (I don't think so), but nonetheless it does not hurt to increase the robustness of the code. Fixes: 68e03de98507 ('ALSA: hda - hdmi: Do not expose eld data when eld is invalid') Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Cc: <stable@vger.kernel.org> # v3.9+ Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-02-03ALSA: hda - Add fixup for Mac Mini 7,1 modelTakashi Iwai
Mac Mini 7,1 model with CS4208 codec reports the headphone jack detection wrongly in an inverted way. Moreover, the advertised pins for the audio input and SPDIF output have actually no jack detection. This patch addresses these issues. The inv_jack_detect flag is set for fixing the headphone jack detection, and the pin configs for audio input and SPDIF output are marked as non-detectable. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=105161 Report-and-tested-by: moosotc@gmail.com Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>