1
0
Fork 0
Commit Graph

7858 Commits (270373f14f0fc55c3326eeab10e5468184a27ff1)

Author SHA1 Message Date
Takashi Sakamoto 51cdc8b6a6 ALSA: hda: use position offset macro of TLV data
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>
2018-05-14 17:47:57 +02:00
Jeremy Soller 2f0d520a1a ALSA: hda/realtek - Clevo P950ER ALC1220 Fixup
This adds support for the P950ER, which has the same required fixup as
the P950HR, but has a different PCI ID.

Signed-off-by: Jeremy Soller <jeremy@system76.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 18:55:46 +02:00
Hans de Goede c8beccc19b ALSA: hda: Add Lenovo C50 All in one to the power_save blacklist
Power-saving is causing loud plops on the Lenovo C50 All in one, add it
to the blacklist.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1572975
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-13 16:44:35 +02:00
Connor McAdams 47cdf76e44 ALSA: hda/ca0132: Add new control changes for SBZ + R3Di
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>
2018-05-13 09:29:32 +02:00
Connor McAdams e0026d0394 ALSA: hda/ca0132: add ca0132_alt_set_vipsource
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>
2018-05-13 09:29:32 +02:00
Connor McAdams 017310fbe7 ALSA: hda/ca0132: Add DSP Volume set and New mixers for SBZ + R3Di
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>
2018-05-13 09:29:31 +02:00
Connor McAdams 7cb9d94c05 ALSA: hda/ca0132: add alt_select_in/out for R3Di + SBZ
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>
2018-05-13 09:29:31 +02:00
Connor McAdams 447fd8e9a8 ALSA: hda/ca0132: add the ability to set src_id on scp commands
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>
2018-05-13 09:29:30 +02:00
Connor McAdams 7e6ed62ebe ALSA: hda/ca0132: Add dsp setup + gpio functions for r3di
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>
2018-05-13 09:29:30 +02:00
Connor McAdams 38ba69ffce ALSA: hda/ca0132: add dsp setup related commands for the sbz
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>
2018-05-13 09:29:29 +02:00
Connor McAdams 009b8f979b ALSA: hda/ca0132: update core functions for sbz + r3di
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>
2018-05-13 09:29:28 +02:00
Connor McAdams e93ac30a32 ALSA: hda/ca0132: add extra init functions for r3di + sbz
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>
2018-05-13 09:29:28 +02:00
Connor McAdams 2e48b2b7a2 ALSA: hda/ca0132: Add extra exit functions for R3Di and SBZ
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>
2018-05-13 09:29:27 +02:00
Connor McAdams aa31704fd8 ALSA: hda/ca0132: Add PCI region2 iomap for SBZ
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>
2018-05-13 09:29:27 +02:00
Connor McAdams 63177afc98 ALSA: hda/ca0132: Add pincfg for SBZ + R3Di, add fp hp auto-detect
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>
2018-05-13 09:29:26 +02:00
Connor McAdams 8a19bceef6 ALSA: hda/ca0132: R3Di and SBZ quirk entires + alt firmware loading
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>
2018-05-13 09:29:26 +02:00
Takashi Sakamoto 8e142e9e62 ALSA: hda/ca0132: fix build failure when a local macro is defined
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 46e860f768 ("ALSA: rename
TLV-related macros so that they're friendly to user applications")

Reported-by: Connor McAdams <conmanx360@gmail.com>
Fixes: 44f0c9782c ('ALSA: hda/ca0132: Add tuning controls')
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-05-02 15:57:58 +02:00
Takashi Iwai f4a414aa6e ALSA: hda - Enforce CONFIG_SND_DYNAMIC_MINORS for HDMI/DP codec
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>
2018-05-02 09:08:16 +02:00
Colin Ian King dfd9944f7c ALSA: cs46xx: fix spelling mistake: "amplifer" -> "amplifier"
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>
2018-04-27 21:26:19 +02:00
Takashi Iwai 6a30abaa40 ALSA: hda - Fix incorrect usage of IS_REACHABLE()
The commit c469652bb5 ("ALSA: hda - Use IS_REACHABLE() for
dependency on input") simplified the dependencies with IS_REACHABLE()
macro, but it broke due to its incorrect usage: it should have been
IS_REACHABLE(CONFIG_INPUT) instead of IS_REACHABLE(INPUT).

Fixes: c469652bb5 ("ALSA: hda - Use IS_REACHABLE() for dependency on input")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-27 17:17:35 +02:00
Takashi Iwai 4d31c6e41e Merge branch 'for-linus' into for-next
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>
2018-04-25 16:44:36 +02:00
Takashi Iwai 8a7d6003df ALSA: hda - Skip jack and others for non-existing PCM streams
When CONFIG_SND_DYNAMIC_MINORS isn't set, there are only limited
number of devices available, and HD-audio, especially with HDMI/DP
codec, will fail to create more than two devices.

The driver warns about the lack of such devices and skips the PCM
device creations, but the HDMI driver still tries to create the
corresponding JACK, SPDIF and ELD controls even for the non-existing
PCM substreams.  This results in confusion on user-space, and even may
break the operation.

Similarly, Intel HDMI/DP codec builds the ELD notification from i915
graphics driver, and this may be broken if a notification is sent for
the non-existing PCM stream.

This patch adds the check of the existence of the assigned PCM
substream in the both scenarios above, and skips the further operation
if the PCM substream is not assigned.

Fixes: 9152085def ("ALSA: hda - add DP MST audio support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 16:37:19 +02:00
Kailang Yang 65811834ba ALSA: hda/realtek - change the location for one of two front mics
On this Lenovo ThinkCentre machine. There are two front mics,
we change the location for one of them.

Relation: f33f79f3d0 ("ALSA: hda/realtek - change the location for
one of two front microphones")

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 11:35:50 +02:00
Takashi Iwai f526afcd8f ALSA: rme9652: Hardening for potential Spectre v1
As recently Smatch suggested, one place in RME9652 driver may expand
the array directly from the user-space value with speculation:
  sound/pci/rme9652/rme9652.c:2074 snd_rme9652_channel_info() warn: potential spectre issue 'rme9652->channel_map' (local cap)

This patch puts array_index_nospec() for hardening against it.

BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 10:37:48 +02:00
Takashi Iwai 10513142a7 ALSA: hdspm: Hardening for potential Spectre v1
As recently Smatch suggested, a couple of places in HDSP MADI driver
may expand the array directly from the user-space value with
speculation:
  sound/pci/rme9652/hdspm.c:5717 snd_hdspm_channel_info() warn: potential spectre issue 'hdspm->channel_map_out' (local cap)
  sound/pci/rme9652/hdspm.c:5734 snd_hdspm_channel_info() warn: potential spectre issue 'hdspm->channel_map_in' (local cap)

This patch puts array_index_nospec() for hardening against them.

BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 10:37:48 +02:00
Takashi Iwai f9d94b57e3 ALSA: asihpi: Hardening for potential Spectre v1
As recently Smatch suggested, a couple of places in ASIHPI driver may
expand the array directly from the user-space value with speculation:
  sound/pci/asihpi/hpimsginit.c:70 hpi_init_response() warn: potential spectre issue 'res_size' (local cap)
  sound/pci/asihpi/hpioctl.c:189 asihpi_hpi_ioctl() warn: potential spectre issue 'adapters'

This patch puts array_index_nospec() for hardening against them.

BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 10:37:47 +02:00
Takashi Iwai 69fa6f19b9 ALSA: hda: Hardening for potential Spectre v1
As recently Smatch suggested, one place in HD-audio hwdep ioctl codes
may expand the array directly from the user-space value with
speculation:
  sound/pci/hda/hda_local.h:467 get_wcaps() warn: potential spectre issue 'codec->wcaps'

As get_wcaps() itself is a fairly frequently called inline function,
and there is only one single call with a user-space value, we replace
only the latter one to open-code locally with array_index_nospec()
hardening in this patch.

BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 10:37:46 +02:00
Kailang Yang ab3b8e5159 ALSA: hda/realtek - Update ALC255 depop optimize
Add ALC255 its own depop functions for alc_init and alc_shutup.
Assign it to ALC256 usage.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 10:37:16 +02:00
Kailang Yang ea04a1dbf8 ALSA: hda/realtek - Add some fixes for ALC233
Fill COEF to change EAPD to verb control.
Assigned codec type.

This is an additional fix over 92f974df34 ("ALSA: hda/realtek - New
vendor ID for ALC233").

[ More notes:
  according to Kailang, the chip is 10ec:0235 bonding for ALC233b,
  which is equivalent with ALC255.  It's only used for Lenovo.
  The chip needs no alc_process_coef_fw() for headset unlike ALC255. ]

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-25 10:22:03 +02:00
Takashi Iwai 08605068df ALSA: hda - Sanity check of access to SPDIF controls array
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>
2018-04-24 17:18:59 +02:00
Takashi Iwai a9c2dfc852 ALSA: hda - Use a macro for snd_array iteration loops
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>
2018-04-24 13:41:53 +02:00
Linus Torvalds 5e7c780611 sound fixes for 4.17-rc2
A few small fixes:
 - A fix for the NULL-dereference in rawmidi compat ioctls, triggered
   by fuzzer
 - HD-audio Realtek codec quirks, a VIA controller fixup
 - A long-standing bug fix in LINE6 MIDI
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAlrZq6YOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE+jhRAA0cUbR2PWgeFURaw2jntFSUafNxVefuquR+MD
 /Y43swY+q5ufKKtvEKG3u2u9R5gp/u/Oo95P5uDGg6FwftNJQphi6xEYNkaZAPH2
 4maEZjWCerNDOgpuhczBSzW7CmQa4nQoKVj/kjtoTHuhMBtsNJyIZ3PyGdYi/2Ya
 pGOSoivGk+S/PFDxYmZobMxkTJ85FnPyH9vE30kVQaqMXjpZ/ZH5KpN2aTPa0UiD
 K1CcgoDZoJqWm0jp621X3O396y3Pby9qkUoeQM0mzcypufbDq91mik/ZfJXAOUDy
 LKsol+luKerXmqRbKamP2C0lfSJiMntedd4QowUTMbJ6oWtyLP9gQ7QXsAKqMmZ4
 rtPlLSD7qMTlYCcqFHXnMHwicUjiL8SRF969FmH2iULuyWUcvuqCxw+or3x5H8hb
 aJzftV1pRnqNBFeAKhfFUxWLO5s8q+e8PMRya6UNcJw9ZDQr3wu2Gd8hW8d4XADu
 KusEuZZNMkxasdirs980OKFvCxR+kLgqmpzbTAyqgDVWyU4QAfBcjyKEXLVW53oY
 LkEhwe9i/hEpW/lObkJOqrlpG/Xv/yoiD0Bydlr6fW5GV16jtyXLsGVQ5+jhZa+E
 Db6WHu972c7AICL0hYT7bBx62pLfVjgfD7PrIkREzrHZnKeoheSRDveg6ISHzJd7
 ZhGWfoI=
 =fb42
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "A few small fixes:

   - a fix for the NULL-dereference in rawmidi compat ioctls, triggered
     by fuzzer

   - HD-audio Realtek codec quirks, a VIA controller fixup

   - a long-standing bug fix in LINE6 MIDI"

* tag 'sound-4.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: rawmidi: Fix missing input substream checks in compat ioctls
  ALSA: hda/realtek - adjust the location of one mic
  ALSA: hda/realtek - set PINCFG_HEADSET_MIC to parse_flags
  ALSA: hda - New VIA controller suppor no-snoop path
  ALSA: line6: Use correct endpoint type for midi output
2018-04-21 10:32:16 -07:00
Hui Wang a3dafb2200 ALSA: hda/realtek - adjust the location of one mic
There are two front mics on this machine, if we don't adjust the
location for one of them, they will have the same mixer name,
pulseaudio can't handle this situation.

After applying this FIXUP, they will have different mixer name,
then pulseaudio can handle them correctly.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-19 11:44:01 +02:00
Hui Wang 3ce0d5aa26 ALSA: hda/realtek - set PINCFG_HEADSET_MIC to parse_flags
Otherwise, the pin will be regarded as microphone, and the jack name
is "Mic Phantom", it is always on in the pulseaudio even nothing is
plugged into the jack. So the UI is confusing to users since the
microphone always shows up in the UI even there is no microphone
plugged.

After adding this flag, the jack name is "Headset Mic Phantom", then
the pulseaudio can handle its detection correctly.

Fixes: f0ba9d699e ("ALSA: hda/realtek - Fix Dell headset Mic can't record")
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-19 11:43:16 +02:00
Takashi Iwai 057666b69b ALSA: emu10k1: Reduce GFP_ATOMIC allocation
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>
2018-04-16 14:01:53 +02:00
Takashi Iwai 0be5168047 ALSA: cmipci: Allocate with GFP_KERNEL instead of GFP_ATOMIC
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>
2018-04-16 14:01:31 +02:00
David Wang af52f9982e ALSA: hda - New VIA controller suppor no-snoop path
This patch is used to tell kernel that new VIA HDAC controller also
support no-snoop path.

[ minor coding style fix by tiwai ]

Signed-off-by: David Wang <davidwang@zhaoxin.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-04-16 13:56:48 +02:00
Jia-Ju Bai 1fa350b6e1 ALSA: ad1889: Replace mdelay with usleep_range in snd_ad1889_ac97_ready
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>
2018-04-16 13:49:09 +02:00
Jia-Ju Bai 621fdf60ab ALSA: ad1889: Replace mdelay with usleep_range in snd_ad1889_init
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>
2018-04-16 13:49:07 +02:00
Linus Torvalds 16e205cf42 amdgpu, omap and snd regression fix
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJaz/QFAAoJEAx081l5xIa+rlAQAImeYZMp5e8V1NjPORwUmp+N
 VxHNErPc01vjTYqq2CNL+koJ1Rlq+cLbJZzHy3MT32U4jWVGykehMNmLah5fK55+
 nhgV5Ho/0OXqjWeI+trGpmg1BiEmoCP2dJOyugP9J9lo55k9mvzj5RoSDGAuAaiH
 jSrT2d4vnhvVFqNywBoqT5nGPgv0lqyp4o79jNykj9b8bGIU85K+KEhFzK7OXmtT
 suHJE7tfSriC5nsez/TNpQf2tvfbQM6cHOdmd6pk6NllxJWLq0YSUWIKJr7DolPh
 9s7FMHd1uwyEVMfoXVU8+5M0KirW8VwgUaWC6AwC75BMONH74OAlXFv9YnFiysSf
 mRsjtI1iJMn5Ri4I3VEghyc9/34ejaSxq9mfe5rc5AUpRt7QhPV16I/sm0E82/88
 bVymPJUpPnWERfs9p4VngNsV7hDCuXgrQWUCED0GRtEVcElKHIip/9RR6G4tB8HH
 qS2QZwaFZLpAncXldqirx8MO8xqZi2amab9O+GDpTMkyqT2+S66bnAw4LCmRbqTj
 Jw9JTY4Hb3P1pgYKCjJyLZzJXYw3+DvLMnwWdMe8g0Ms9sr2sqHuNBg4IeJt13qy
 DIyfks43eJtT8H5YEvyTFtBYNck26u3h2VBpMcXacadeNM5HeWA1lBwCVURC7Cwu
 MkeLcYcTVlQFjehkV0mL
 =WE2n
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-for-v4.17-rc1' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "One omap, and one alsa pm fix (we merged the breaking patch via drm
  tree).

  Otherwise it's two bunches of amdgpu fixes, removing an unneeded file,
  some DC fixes, HDMI audio regression fix, and some vega12 fixes"

* tag 'drm-fixes-for-v4.17-rc1' of git://people.freedesktop.org/~airlied/linux: (27 commits)
  Revert "drm/amd/display: disable CRTCs with NULL FB on their primary plane (V2)"
  Revert "drm/amd/display: fix dereferencing possible ERR_PTR()"
  drm/amd/display: Fix regamma not affecting full-intensity color values
  drm/amd/display: Fix FBC text console corruption
  drm/amd/display: Only register backlight device if embedded panel connected
  drm/amd/display: fix brightness level after resume from suspend
  drm/amd/display: HDMI has no sound after Panel power off/on
  drm/amdgpu: add MP1 and THM hw ip base reg offset
  drm/amdgpu: fix null pointer panic with direct fw loading on gpu reset
  drm/radeon: add PX quirk for Asus K73TK
  drm/omap: fix crash if there's no video PLL
  drm/amdgpu: Fix memory leaks at amdgpu_init() error path
  drm/amdgpu: Fix PCIe lane width calculation
  drm/radeon: Fix PCIe lane width calculation
  drm/amdgpu/si: implement get/set pcie_lanes asic callback
  drm/amdgpu: Add support for SRBM selection v3
  Revert "drm/amdgpu: Don't change preferred domian when fallback GTT v5"
  drm/amd/powerply: fix power reading on Fiji
  drm/amd/powerplay: Enable ACG SS feature
  drm/amdgpu/sdma: fix mask in emit_pipeline_sync
  ...
2018-04-12 20:56:10 -07:00
Dave Airlie c975f17d70 hda_intel: Don't declare azx PM ops if VGA_SWITCHEROO configured (Lukas)
Cc: Lukas Wunner <lukas@wunner.de>
 Cc: Takashi Iwai <tiwai@suse.de>
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEfxcpfMSgdnQMs+QqlvcN/ahKBwoFAlrFI58ACgkQlvcN/ahK
 BwrWzAf+J/tz5aj+e69HF2J7nypt4GY9owspk2SCLuvTfdzQIbzfl477DXCL7IFp
 Oc1qcCEbS6OjRXb8yN/xGClvWI8fDlRapnOYBsKvjZ1WNq89mwgl2FQgPKAfjNnT
 Lg1Z9AzzTyVJcWgk9jGlswNV+Uyi2QR9Zlelg+yrTidEi4ybwLlFMV9CkmT9q9ph
 yP+uApTqe8NA5SZrpwhtvlPj8kRcJgF9Z7FCARcVq3ZXh2qZ+Uujzay+QcnP4AZK
 MSfU/TXh4xeVDc4ttYenZNus0koJugTSpZ3hELZga4mGfj4W1nkSjLh3qRTxudD0
 WpxxSjFKkKUqcsB1YXKgRehmO+AGIA==
 =acWn
 -----END PGP SIGNATURE-----

Merge tag 'drm-misc-next-fixes-2018-04-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

hda_intel: Don't declare azx PM ops if VGA_SWITCHEROO configured (Lukas)

Cc: Lukas Wunner <lukas@wunner.de>
Cc: Takashi Iwai <tiwai@suse.de>

* tag 'drm-misc-next-fixes-2018-04-04' of git://anongit.freedesktop.org/drm/drm-misc:
  ALSA: hda - Silence PM ops build warning
2018-04-11 08:35:18 +10:00
Linus Torvalds e02d37bf55 sound updates for 4.17-rc1
This became a large update.  The changes are scattered widely,
 and majority of them are attributed to ASoC componentization.
 The gitk output made me dizzy, but it's slightly better than
 London tube.
 
 OK, below are some highlights:
 
 - Continued hardening works in ALSA PCM core; most of the
   existing syzkaller reports should have been covered.
 
 - USB-audio got the initial USB Audio Class 3 support, as well
   as UAC2 jack detection support and more DSD-device support.
 
 - ASoC componentization: finally each individual driver was
   converted to components framework, which is more future-proof
   for further works.  Most of conversations were systematic.
 
 - Lots of fixes for Intel Baytrail / Cherrytrail devices with
   Realtek codecs, typically tablets and small PCs.
 
 - Fixes / cleanups for Samsung Odroid systems
 
 - Cleanups in Freescale SSI driver
 
 - New ASoC drivers:
   * AKM AK4458 and AK5558 codecs
   * A few AMD based machine drivers
   * Intel Kabylake machine drivers
   * Maxim MAX9759 codec
   * Motorola CPCAP codec
   * Socionext Uniphier SoCs
   * TI PCM1789 and TDA7419 codecs
 
 - Retirement of Blackfin drivers along with architecture removal.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEEIXTw5fNLNI7mMiVaLtJE4w1nLE8FAlrF2gUOHHRpd2FpQHN1
 c2UuZGUACgkQLtJE4w1nLE/ZLhAAvUgpOkpHRmvyXoqhWdG/FWWFWtoFrQaDZE5y
 NPcGHy/ZLuCXGL3Zpsm9lZqXd1sxRdsxF3hiWT0JqqC7oxs/oSOhSzf7w6P9ppW7
 nxZKo4SCSQpmy0Y58QhwpXUkuGzRAOXcug39BNiAqxjtWPPNT8bUj/br3ApH9+90
 Dtittl26Z1Eek1KwNJDMdJt8l5P4P5Ls44g/9Xwhgxk/P0nHmErNuUftlNc/65/b
 HdVgLSXVJbfJ9dLRjQC0yg7jPzSgSp5xssAkWGfPv8AMnM6ql7LWGO+6zOdVcOUo
 0ipKJpZHUI/k1Uv4yBxI32GueOl/gH78M3iGv1CVe/jaC8g8XXA5GScnG41U1ZUO
 p9f78q8jk+O4uCDvbCvigw+iqb7Lm7ME0jNaQ6gZzZX2sDDBUBIYMS6W658pQfgT
 w00c73gm7J+MPv4FsVyyzZsmqyO/xE/1x9F2eGut67DbCKVcfQnyheYJq3Gt96qo
 tzvJ+cy3JxCfGn7Ngl2/i8jtHD6sGf1Pl3gOPk5DEN2qfuBy/vQ4W4TlJ1pOqGFG
 JjpUhEpvYhP/XPrFo970g2yYQq5VsjumQiHGxbD56qu4hrkPU3w92gYKNc0F689j
 QQRc8gyAvUp78ZletF4WYLf6H1yNmkP3ufhsuP1MQWuxRmTcxVtIRDU1PLAq5J8w
 10mGs6s=
 =F3q1
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "This became a large update. The changes are scattered widely, and the
  majority of them are attributed to ASoC componentization. The gitk
  output made me dizzy, but it's slightly better than London tube.

  OK, below are some highlights:

   - Continued hardening works in ALSA PCM core; most of the existing
     syzkaller reports should have been covered.

   - USB-audio got the initial USB Audio Class 3 support, as well as
     UAC2 jack detection support and more DSD-device support.

   - ASoC componentization: finally each individual driver was converted
     to components framework, which is more future-proof for further
     works. Most of conversations were systematic.

   - Lots of fixes for Intel Baytrail / Cherrytrail devices with Realtek
     codecs, typically tablets and small PCs.

   - Fixes / cleanups for Samsung Odroid systems

   - Cleanups in Freescale SSI driver

   - New ASoC drivers:
      * AKM AK4458 and AK5558 codecs
      * A few AMD based machine drivers
      * Intel Kabylake machine drivers
      * Maxim MAX9759 codec
      * Motorola CPCAP codec
      * Socionext Uniphier SoCs
      * TI PCM1789 and TDA7419 codecs

   - Retirement of Blackfin drivers along with architecture removal"

* tag 'sound-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (497 commits)
  ALSA: pcm: Fix UAF at PCM release via PCM timer access
  ALSA: usb-audio: silence a static checker warning
  ASoC: tscs42xx: Remove owner assignment from i2c_driver
  ASoC: mediatek: remove "simple-mfd" in the example
  ASoC: cpcap: replace codec to component
  ASoC: Intel: bytcr_rt5651: don't use codec anymore
  ASoC: amd: don't use codec anymore
  ALSA: usb-audio: fix memory leak on cval
  ALSA: pcm: Fix mutex unbalance in OSS emulation ioctls
  ASoC: topology: Fix kcontrol name string handling
  ALSA: aloop: Mark paused device as inactive
  ALSA: usb-audio: update clock valid control
  ALSA: usb-audio: UAC2 jack detection
  ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams
  ALSA: pcm: Avoid potential races between OSS ioctls and read/write
  ALSA: usb-audio: Integrate native DSD support for ITF-USB based DACs.
  ALSA: usb-audio: FIX native DSD support for TEAC UD-501 DAC
  ALSA: usb-audio: Add native DSD support for Luxman DA-06
  ALSA: usb-audio: fix uac control query argument
  ASoC: nau8824: recover system clock when device changes
  ...
2018-04-05 10:42:07 -07:00
Lukas Wunner 8cd1b5bd70 ALSA: hda - Silence PM ops build warning
The system sleep PM ops azx_suspend() and azx_resume() were previously
called by vga_switcheroo, but commit 07f4f97d7b ("vga_switcheroo: Use
device link for HDA controller") removed their invocation.

Unfortunately the commit neglected to update the #ifdef surrounding the
two functions, so if CONFIG_PM_SLEEP is *not* enabled but all three of
CONFIG_PM, CONFIG_VGA_SWITCHEROO and CONFIG_SND_HDA_CODEC_HDMI *are*
enabled, the compiler now emits the following warning:

sound/pci/hda/hda_intel.c:1024:12: warning: 'azx_resume' defined but not used [-Wunused-function]
 static int azx_resume(struct device *dev)
            ^~~~~~~~~~
sound/pci/hda/hda_intel.c:989:12: warning: 'azx_suspend' defined but not used [-Wunused-function]
 static int azx_suspend(struct device *dev)
            ^~~~~~~~~~~

Silence by updating the #ifdef.  Because the #ifdef block now uses the
same condition as the one immediately succeeding it, the two blocks can
be collapsed together, shaving off another two lines.

Fixes: 07f4f97d7b ("vga_switcheroo: Use device link for HDA controller")
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://patchwork.kernel.org/patch/10313441/
Link: https://patchwork.freedesktop.org/patch/msgid/b8e70e34a9acbd4f0a1a6c7673cea96888ae9503.1522323444.git.lukas@wunner.de
2018-03-29 21:47:53 +02:00
Dave Airlie 2b4f44eec2 Linux 4.16-rc7
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJauCZfAAoJEHm+PkMAQRiGWGUH/2rhdQDkoJpYWnjaQkolECG8
 MxpGE7nmIIHxQcbSDdHTGJ8IhVm6Z5wZ7ym/PwCDTT043Y1y341sJrIwL2/nTG6d
 HVidk8hFvgN6QzlzVAHT3ZZMII/V9Zt+VV5SUYLGnPAVuJNHo/6uzWlTU5g+NTFo
 IquFDdQUaGBlkKqby+NoAFnkV1UAIkW0g22cfvPnlO5GMer0gusGyVNvVp7TNj3C
 sqj4Hvt3RMDLMNe9RZ2pFTiOD096n8FWpYftZneUTxFImhRV3Jg5MaaYZm9SI3HW
 tXrv/LChT/F1mi5Pkx6tkT5Hr8WvcrwDMJ4It1kom10RqWAgjxIR3CMm448ileY=
 =YKUG
 -----END PGP SIGNATURE-----

Backmerge tag 'v4.16-rc7' into drm-next

Linux 4.16-rc7

This was requested by Daniel, and things were getting
a bit hard to reconcile, most of the conflicts were
trivial though.
2018-03-28 14:30:41 +10:00
Takashi Iwai 3446b1e962 Merge branch 'for-linus' into for-next
Back-merge for applying more series of fixes for USB DSD support.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-23 22:03:29 +01:00
Kailang Yang 88d42b2b45 ALSA: hda/realtek - Fix speaker no sound after system resume
It will have a chance speaker no sound after system resume.
To toggle NID 0x53 index 0x2 bit 15 will solve this issue.
This usage will also suitable with ALC256.

Fixes: 4a219ef8f3 ("ALSA: hda/realtek - Add ALC256 HP depop function")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-22 09:43:28 +01:00
Kailang Yang f0ba9d699e ALSA: hda/realtek - Fix Dell headset Mic can't record
This platform was hardware fixed type for CTIA type for headset port.
Assigned 0x19 verb will fix can't record issue.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-22 09:07:30 +01:00
Takashi Iwai a8d7bde23e ALSA: hda - Force polling mode on CFL for fixing codec communication
We've observed too long probe time with Coffee Lake (CFL) machines,
and the likely cause is some communication problem between the
HD-audio controller and the codec chips.  While the controller expects
an IRQ wakeup for each codec response, it seems sometimes missing, and
it takes one second for the controller driver to time out and read the
response in the polling mode.

Although we aren't sure about the real culprit yet, in this patch, we
put a workaround by forcing the polling mode as default for CFL
machines; the polling mode itself isn't too heavy, and much better
than other workarounds initially suggested (e.g. disabling
power-save), at least.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199007
Fixes: e79b0006c4 ("ALSA: hda - Add Coffelake PCI ID")
Reported-and-tested-by: Hui Wang <hui.wang@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-21 10:23:07 +01:00
Takashi Iwai 4654eba8cb Merge branch 'for-linus' into for-next
Back-merge of for-linus branch for applying the further UAC3 patches.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-19 17:00:01 +01:00
Takashi Iwai e40bdb03d3 ALSA: hda/realtek - Always immediately update mute LED with pin VREF
Some HP laptops have a mute mute LED controlled by a pin VREF.  The
Realtek codec driver updates the VREF via vmaster hook by calling
snd_hda_set_pin_ctl_cache().

This works fine as long as the driver is running in a normal mode.
However, when the VREF change happens during the codec being in
runtime PM suspend, the regmap access will skip and postpone the
actual register change.  This ends up with the unchanged LED status
until the next runtime PM resume even if you change the Master mute
switch.  (Interestingly, the machine keeps the LED status even after
the codec goes into D3 -- but it's another story.)

For improving this usability, let the driver temporarily powering up /
down only during the pin VREF change.  This can be achieved easily by
wrapping the call with snd_hda_power_up_pm() / *_down_pm().

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199073
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-17 22:51:39 +01:00
Lukas Wunner 07f4f97d7b vga_switcheroo: Use device link for HDA controller
Back in 2013, runtime PM for GPUs with integrated HDA controller was
introduced with commits 0d69704ae3 ("gpu/vga_switcheroo: add driver
control power feature. (v3)") and 246efa4a07 ("snd/hda: add runtime
suspend/resume on optimus support (v4)").

Briefly, the idea was that the HDA controller is forced on and off in
unison with the GPU.

The original code is mostly still in place even though it was never a
100% perfect solution:  E.g. on access to the HDA controller, the GPU
is powered up via vga_switcheroo_runtime_resume_hdmi_audio() but there
are no provisions to keep it resumed until access to the HDA controller
has ceased:  The GPU autosuspends after 5 seconds, rendering the HDA
controller inaccessible.

Additionally, a kludge is required when hda_intel.c probes:  It has to
check whether the GPU is powered down (check_hdmi_disabled()) and defer
probing if so.

However in the meantime (in v4.10) the driver core has gained a feature
called device links which promises to solve such issues in a clean way:
It allows us to declare a dependency from the HDA controller (consumer)
to the GPU (supplier).  The PM core then automagically ensures that the
GPU is runtime resumed as long as the HDA controller's ->probe hook is
executed and whenever the HDA controller is accessed.

By default, the HDA controller has a dependency on its parent, a PCIe
Root Port.  Adding a device link creates another dependency on its
sibling:

                            PCIe Root Port
                             ^          ^
                             |          |
                             |          |
                            HDA  ===>  GPU

The device link is not only used for runtime PM, it also guarantees that
on system sleep, the HDA controller suspends before the GPU and resumes
after the GPU, and on system shutdown the HDA controller's ->shutdown
hook is executed before the one of the GPU.  It is a complete solution.

Using this functionality is as simple as calling device_link_add(),
which results in a dmesg entry like this:

        pci 0000:01:00.1: Linked as a consumer to 0000:01:00.0

The code for the GPU-governed audio power management can thus be removed
(except where it's still needed for legacy manual power control).

The device link is added in a PCI quirk rather than in hda_intel.c.
It is therefore legal for the GPU to runtime suspend to D3cold even if
the HDA controller is not bound to a driver or if CONFIG_SND_HDA_INTEL
is not enabled, for accesses to the HDA controller will cause the GPU to
wake up regardless if they're occurring outside of hda_intel.c (think
config space readout via sysfs).

Contrary to the previous implementation, the HDA controller's power
state is now self-governed, rather than GPU-governed, whereas the GPU's
power state is no longer fully self-governed.  (The HDA controller needs
to runtime suspend before the GPU can.)

It is thus crucial that runtime PM is always activated on the HDA
controller even if CONFIG_SND_HDA_POWER_SAVE_DEFAULT is set to 0 (which
is the default), lest the GPU stays awake.  This is achieved by setting
the auto_runtime_pm flag on every codec and the AZX_DCAPS_PM_RUNTIME
flag on the HDA controller.

A side effect is that power consumption might be reduced if the GPU is
in use but the HDA controller is not, because the HDA controller is now
allowed to go to D3hot.  Before, it was forced to stay in D0 as long as
the GPU was in use.  (There is no reduction in power consumption on my
Nvidia GK107, but there might be on other chips.)

The code paths for legacy manual power control are adjusted such that
runtime PM is disabled during power off, thereby preventing the PM core
from resuming the HDA controller.

Note that the device link is not only added on vga_switcheroo capable
systems, but for *any* GPU with integrated HDA controller.  The idea is
that the HDA controller streams audio via connectors located on the GPU,
so the GPU needs to be on for the HDA controller to do anything useful.

This commit implicitly fixes an unbalanced runtime PM ref upon unbind of
hda_intel.c:  On ->probe, a runtime PM ref was previously released under
the condition "azx_has_pm_runtime(chip) || hda->use_vga_switcheroo", but
on ->remove a runtime PM ref was only acquired under the first of those
conditions.  Thus, binding and unbinding the driver twice on a
vga_switcheroo capable system caused the runtime PM refcount to drop
below zero.  The issue is resolved because the AZX_DCAPS_PM_RUNTIME flag
is now always set if use_vga_switcheroo is true.

For more information on device links please refer to:
https://www.kernel.org/doc/html/latest/driver-api/device_link.html
Documentation/driver-api/device_link.rst

Cc: Dave Airlie <airlied@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Kai Heng Feng <kai.heng.feng@canonical.com> # AMD PowerXpress
Tested-by: Mike Lothian <mike@fireburn.co.uk>          # AMD PowerXpress
Tested-by: Denis Lisov <dennis.lissov@gmail.com>       # Nvidia Optimus
Tested-by: Peter Wu <peter@lekensteyn.nl>              # Nvidia Optimus
Tested-by: Lukas Wunner <lukas@wunner.de>              # MacBook Pro
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://patchwork.freedesktop.org/patch/msgid/51bd38360ff502a8c42b1ebf4405ee1d3f27118d.1520068884.git.lukas@wunner.de
2018-03-13 22:58:09 +01:00
Guneshwor Singh 491f833134 ALSA: hda: Add Icelake PCI ID
Icelake is a next generation Intel platform. Add PCI ID for
it.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-13 12:23:47 +01:00
Colin Ian King 0bc66fd3b6 ALSA: echoaudio: remove redundant initialization of pointer 'pipe'
The pointer 'pipe' is being initialized with a value that is never
read and it is re-assigned later, hence the initialization is redundant
and can be removed. Also remove pointer 'runtime' as it is no longer
required.

Cleans up clang warning:
sound/pci/echoaudio/echoaudio.c:740:20: warning: Value stored to 'pipe'
during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-12 16:05:11 +01:00
Takashi Iwai 40088dc4e1 ALSA: hda - Revert power_save option default value
With the commit 1ba8f9d308 ("ALSA: hda: Add a power_save
blacklist"), we changed the default value of power_save option to -1
for processing the power-save blacklist.
Unfortunately, this seems breaking user-space applications that
actually read the power_save parameter value via sysfs and judge /
adjust the power-saving status.  They see the value -1 as if the
power-save is turned off, although the actual value is taken from
CONFIG_SND_HDA_POWER_SAVE_DEFAULT and it can be a positive.

So, overall, passing -1 there was no good idea.  Let's partially
revert it -- at least for power_save option default value is restored
again to CONFIG_SND_HDA_POWER_SAVE_DEFAULT.  Meanwhile, in this patch,
we keep the blacklist behavior and make is adjustable via the new
option, pm_blacklist.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199073
Fixes: 1ba8f9d308 ("ALSA: hda: Add a power_save blacklist")
Acked-by: Hans de Goede <hdegoede@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-12 14:16:08 +01:00
Dennis Wassenberg 099fd6ca0a ALSA: hda: add dock and led support for HP ProBook 640 G2
This patch adds missing initialisation for HP 2013 UltraSlim Dock
Line-In/Out PINs and activates keyboard mute/micmute leds
for HP ProBook 640 G2

Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-08 17:37:10 +01:00
Dennis Wassenberg aea8081720 ALSA: hda: add dock and led support for HP EliteBook 820 G3
This patch adds missing initialisation for HP 2013 UltraSlim Dock
Line-In/Out PINs and activates keyboard mute/micmute leds
for HP EliteBook 820 G3

Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-08 17:36:51 +01:00
Dennis Wassenberg e4c07b3b66 ALSA: hda/realtek - Make dock sound work on ThinkPad L570
One version of Lenovo Thinkpad T570 did not use ALC298
(like other Kaby Lake devices). Instead it uses ALC292.
In order to make the Lenovo dock working with that codec
the dock quirk for ALC292 will be used.

Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-08 14:22:34 +01:00
Takashi Iwai e312a869cd ALSA: hda/realtek - Fix dock line-out volume on Dell Precision 7520
The dock line-out pin (NID 0x17 of ALC3254 codec) on Dell Precision
7520 may route to three different DACs, 0x02, 0x03 and 0x06.  The
first two DACS have the volume amp controls while the last one
doesn't.  And unfortunately, the auto-parser assigns this pin to DAC3,
resulting in the non-working volume control for the line out.

Fix it by disabling the routing to DAC3 on the corresponding pin.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199029
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-06 14:49:22 +01:00
Benjamin Berg 85981dfd6b ALSA: hda/realtek: Limit mic boost on T480
The internal mic boost on the T480 is too high. Fix this by applying the
ALC269_FIXUP_LIMIT_INT_MIC_BOOST fixup to the machine to limit the gain.

Signed-off-by: Benjamin Berg <bberg@redhat.com>
Tested-by: Benjamin Berg <bberg@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-06 11:55:08 +01:00
Kailang Yang ae104a21e5 ALSA: hda/realtek - Add headset mode support for Dell laptop
This platform was only one phone Jack.
Add dummy lineout verb to fix automute mode disable.
This just the workaround.

[ More background information:
  since the platform has only a headphone jack without speaker, the
  driver doesn't create the auto-mute control.  Meanwhile we do update
  the headset mode via the automute hook in the driver, thus with this
  setup, the headset won't be updated any longer.

  By adding a dummy line-out pin here, the auto-mute is added by the
  driver, and the headset update is triggered properly.

  Note that this is different from the other
  ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, which has the real line-out pin,
  while this quirk adds a dummy line-out pin.  -- tiwai ]

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-06 10:34:53 +01:00
Kailang Yang 5f36413526 ALSA: hda/realtek - Add support headset mode for DELL WYSE
Enable headset mode support for WYSE platform.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-06 09:52:42 +01:00
Hui Wang d5078193e5 ALSA: hda - Fix a wrong FIXUP for alc289 on Dell machines
With the alc289, the Pin 0x1b is Headphone-Mic, so we should assign
ALC269_FIXUP_DELL4_MIC_NO_PRESENCE rather than
ALC225_FIXUP_DELL1_MIC_NO_PRESENCE to it. And this change is suggested
by Kailang of Realtek and is verified on the machine.

Fixes: 3f2f7c553d ("ALSA: hda - Fix headset mic detection problem for two Dell machines")
Cc: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-02 09:59:15 +01:00
Joey Pabalinas 338e17d3f5 ALSA: ice1712: replace strcpy() with strlcpy()
Replace unsafe usages of strcpy() to copy the name
argument into the sid.name buffer with strlcpy()
to guard against possible buffer overflows.

Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-03-01 16:13:13 +01:00
Takashi Iwai 3b8bd500c9 Merge branch 'for-linus' into for-next
Back-merge for applying a cleanup to core/control

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-28 08:17:54 +01:00
Takashi Iwai 71db96ddfa ALSA: hda - Fix pincfg at resume on Lenovo T470 dock
We've added a quirk to enable the recent Lenovo dock support, where it
overwrites the pin configs of NID 0x17 and 19, not only updating the
pin config cache.  It works right after the boot, but the problem is
that the pin configs are occasionally cleared when the machine goes to
PM.  Meanwhile the quirk writes the pin configs only at the pre-probe,
so this won't be applied any longer.

For addressing that issue, this patch moves the code to overwrite the
pin configs into HDA_FIXUP_ACT_INIT section so that it's always
applied at both probe and resume time.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195161
Fixes: 61fcf8ece9 ("ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-26 15:36:38 +01:00
Hans de Goede 1ba8f9d308 ALSA: hda: Add a power_save blacklist
On some boards setting power_save to a non 0 value leads to clicking /
popping sounds when ever we enter/leave powersaving mode. Ideally we would
figure out how to avoid these sounds, but that is not always feasible.

This commit adds a blacklist for devices where powersaving is known to
cause problems and disables it on these devices.

Note I tried to put this blacklist in userspace first:
https://github.com/systemd/systemd/pull/8128

But the systemd maintainers rightfully pointed out that it would be
impossible to then later remove entries once we actually find a way to
make power-saving work on listed boards without issues. Having this list
in the kernel will allow removal of the blacklist entry in the same commit
which fixes the clicks / plops.

The blacklist only applies to the default power_save module-option value,
if a user explicitly sets the module-option then the blacklist is not
used.

[ added an ifdef CONFIG_PM for the build error -- tiwai]

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1525104
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198611
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-24 11:27:31 +01:00
Matt Ranostay 248a380a3c ALSA: hda-beep: add SPDX identifiers
Add SPDX GPLv2.0+ identifiers and update authors email

Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-20 16:49:59 +01:00
Jan-Marek Glogowski fdcc968a3b ALSA: hda/realtek: PCI quirk for Fujitsu U7x7
These laptops have a combined jack to attach headsets, the U727 on
the left, the U757 on the right, but a headsets microphone doesn't
work. Using hdajacksensetest I found that pin 0x19 changed the
present state when plugging the headset, in addition to 0x21, but
didn't have the correct configuration (shown as "Not connected").

So this sets the configuration to the same values as the headphone
pin 0x21 except for the device type microphone, which makes it
work correctly. With the patch the configured pins for U727 are

Pin 0x12 (Internal Mic, Mobile-In): present = No
Pin 0x14 (Internal Speaker): present = No
Pin 0x19 (Black Mic, Left side): present = No
Pin 0x1d (Internal Aux): present = No
Pin 0x21 (Black Headphone, Left side): present = No

Signed-off-by: Jan-Marek Glogowski <glogow@fbihome.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-14 12:02:26 +01:00
Maciej S. Szmigiero 04f8773a3e ALSA: emu10k1: add a IOMMU workaround
The Audigy 2 CA0102 chip (but most likely others from the emu10k1 family,
too) has a problem that from time to time it likes to do few DMA reads a
bit beyond its normal allocation and gets very confused if these reads get
blocked by a IOMMU.

For the first (reserved) page this happens multiple times at every
playback, for various synth pages it happens randomly, rarely for PCM
playback buffers and the page table memory itself.
All these reads seem to follow a similar pattern, observed read offsets
beyond the allocation end were 0x00, 0x40, 0x80 and 0xc0 (PCI cache line
multiples), so it looks like the device tries to accesses up to 256 extra
bytes.

As a workaround let's widen these DMA allocations by an extra page if we
detect that the device is behind a non-passthrough IOMMU (the DMA memory
should be relatively plenty on IOMMU systems).

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-14 07:46:55 +01:00
Maciej S. Szmigiero 055e0ae10f ALSA: emu10k1: make sure synth DMA pages are allocated with DMA functions
Commit a5003fc041 ("[ALSA] emu10k1 - simplify page allocation for synth")
switched from using the DMA allocator for synth DMA pages to manually
calling alloc_page().
However, this usage has an implicit assumption that the DMA address space
for the emu10k1-family chip is the same as the CPU physical address space
which is not true for a system with a IOMMU.

Since this made the synth part of the driver non-functional on such systems
let's effectively revert that commit (while keeping the
__synth_free_pages() simplification).

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-14 07:46:54 +01:00
Maciej S. Szmigiero 541b9bad16 ALSA: emu10k1: add optional debug printouts with DMA addresses
When we get a IOMMU page fault for a emu10k1 device it is very hard to
discover which of chip many DMA allocations triggered it (since on a IOMMU
system the DMA address space is often very different from the CPU one).
Let's add optional debug printouts providing this information.

These debug printouts are only enabled on an explicit request via the
kernel dynamic debug mechanism.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-14 07:46:52 +01:00
Maciej S. Szmigiero 70d0bc7dca ALSA: emu10k1: use dma_set_mask_and_coherent()
We have been calling dma_set_mask() and then dma_set_coherent_mask() with
the same value, but there is a dma_set_mask_and_coherent() function that
does exactly that so let's use it instead.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-14 07:46:51 +01:00
Maciej S. Szmigiero a4463c92db ALSA: emu10k1: remove reserved_page
The emu10k1-family chips need the first page (index 0) reserved in their
page tables for some reason (every emu10k1 driver I've checked does this
without much of an explanation).
Using the first page for normal samples results in a broken playback.

However, we already have a dummy page allocated - so called "silent page"
and, in fact, had always been setting it as the first page in the chip page
table because an initialization of every entry of the page table to point
to a silent page happens after and overwrites the reserved_page allocation.

So the only thing remaining to remove the reserved_page allocation is a
trivial change to the page allocation logic to ignore the first page entry
and start its allocations from the second entry (index 1).

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-14 07:46:50 +01:00
Takashi Iwai bafeca673f Merge branch 'topic/hda-sync-power' into for-next
Pull the HD-audio power sync fix.  This is shared with ASoC.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-12 14:01:23 +01:00
Abhijeet Kumar 3b5b899ca6 ALSA: hda: Make use of core codec functions to sync power state
Since sync_power_state is moved to core it's better to use the helper
function to ensure the actual power state reaches target instead of
using the local helper functions already exsisting in hda code.

Signed-off-by: Abhijeet Kumar <abhijeet.kumar@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-12 13:59:48 +01:00
Kailang Yang 61fcf8ece9 ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform
Thinkpad Dock device support for ALC298 platform.
It need to use SSID for the quirk table.
Because IdeaPad also has ALC298 platform.
Use verb for the quirk table will confuse.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-07 06:24:17 +01:00
Kailang Yang 40e2c4e5a7 ALSA: hda/realtek - Add headset mode support for Dell laptop
This platform had two Dmic and single Dmic.
This update was for single Dmic.

This commit was for two Dmic.

Fixes: 75ee94b20b ("ALSA: hda - fix headset mic problem for Dell machines...")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-07 06:23:23 +01:00
Hui Wang 3f2f7c553d ALSA: hda - Fix headset mic detection problem for two Dell machines
One of them has the codec of alc256 and the other one has the codec
of alc289.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-02-07 06:18:19 +01:00
Takashi Iwai 1c9609e3a8 ALSA: hda - Reduce the suspend time consumption for ALC256
ALC256 has its own quirk to override the shutup call, and it contains
the COEF update for pulling down the headset jack control.  Currently,
the COEF update is called after clearing the headphone pin, and this
seems triggering a stall of the codec communication, and results in a
long delay over a second at suspend.

A quick resolution is to swap the calls: at first with the COEF
update, then clear the headphone pin.

Fixes: 4a219ef8f3 ("ALSA: hda/realtek - Add ALC256 HP depop function")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=198503
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-19 14:18:34 +01:00
Kailang Yang 1b6832be1b ALSA: hda/realtek - update ALC215 depop optimize
Add ALC215 its own depop functions for alc_init and alc_shutup.
Assign it to ALC225 usage.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-17 12:14:35 +01:00
Kailang Yang c2b691ee35 ALSA: hda/realtek - Support headset mode for ALC215/ALC285/ALC289
This patch will enable headset mode for ALC215/ALC285/ALC289 platform.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-17 12:14:21 +01:00
Takashi Iwai c469652bb5 ALSA: hda - Use IS_REACHABLE() for dependency on input
The commit ffcd28d88e ("ALSA: hda - Select INPUT for Realtek
HD-audio codec") introduced the reverse-selection of CONFIG_INPUT for
Realtek codec in order to avoid the mess with dependency between
built-in and modules.  Later on, we obtained IS_REACHABLE() macro
exactly for this kind of problems, and now we can remove th INPUT
selection in Kconfig and put IS_REACHABLE(INPUT) to the appropriate
places in the code, so that the driver doesn't need to select other
subsystem forcibly.

Fixes: ffcd28d88e ("ALSA: hda - Select INPUT for Realtek HD-audio codec")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # and build-tested
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-15 20:16:54 +01:00
Takashi Iwai 4ea5553a51 Merge branch 'for-linus' into for-next
Back-merge to the development branch for further fixes of sequencer
stuff.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-15 16:45:15 +01:00
Takashi Iwai 031f335cda ALSA: hda - Apply the existing quirk to iMac 14,1
iMac 14,1 requires the same quirk as iMac 12,2, using GPIO 2 and 3 for
headphone and speaker output amps.  Add the codec SSID quirk entry
(106b:0600) accordingly.

BugLink: http://lkml.kernel.org/r/CAEw6Zyteav09VGHRfD5QwsfuWv5a43r0tFBNbfcHXoNrxVz7ew@mail.gmail.com
Reported-by: Freaky <freaky2000@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-10 11:11:54 +01:00
Takashi Iwai e4c9fd10eb ALSA: hda - Apply headphone noise quirk for another Dell XPS 13 variant
There is another Dell XPS 13 variant (SSID 1028:082a) that requires
the existing fixup for reducing the headphone noise.
This patch adds the quirk entry for that.

BugLink: http://lkml.kernel.org/r/CAHXyb9ZCZJzVisuBARa+UORcjRERV8yokez=DP1_5O5isTz0ZA@mail.gmail.com
Reported-and-tested-by: Francisco G. <frangio.1@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-10 11:07:18 +01:00
Kailang Yang da911b1f5e ALSA: hda/realtek - update ALC225 depop optimize
Add ALC225 its own depop functions for alc_init and alc_shutup.
Add depop optimize step for headset mode functions.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-01-08 10:42:13 +01:00
Takashi Iwai c1350bff69 ALSA: hda - Clean up ALC299 init code
ALC299 is compatible with ALC225/295, thus it doesn't have to assign
its own model.  Merge together with ALC225/295 code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-27 09:03:45 +01:00
Takashi Iwai 7ad3423ebb Merge branch 'for-linus' into for-next
Back-merge the upstream branch for applying further cleanup patches
for HD-Audio.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-27 09:02:02 +01:00
Takashi Iwai 44be77c590 ALSA: hda - Fix missing COEF init for ALC225/295/299
There was a long-standing problem on HP Spectre X360 with Kabylake
where it lacks of the front speaker output in some situations.  Also
there are other products showing the similar behavior.  The culprit
seems to be the missing COEF setup on ALC codecs, ALC225/295/299,
which are all compatible.

This patch adds the proper COEF setup (to initialize idx 0x67 / bits
0x3000) for addressing the issue.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195457
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-27 08:53:59 +01:00
Hui Wang 8da5bbfc7c ALSA: hda - change the location for one mic on a Lenovo machine
There are two front mics on this machine, and current driver assign
the same name Mic to both of them, but pulseaudio can't handle them.
As a workaround, we change the location for one of them, then the
driver will assign "Front Mic" and "Mic" for them.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-22 10:27:10 +01:00
Hui Wang 285d5ddcff ALSA: hda - fix headset mic detection issue on a Dell machine
It has the codec alc256, and add its pin definition to pin quirk
table to let it apply ALC255_FIXUP_DELL1_MIC_NO_PRESENCE.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-22 10:26:55 +01:00
Hui Wang 322f74ede9 ALSA: hda - Add MIC_NO_PRESENCE fixup for 2 HP machines
There is a headset jack on the front panel, when we plug a headset
into it, the headset mic can't trigger unsol events, and
read_pin_sense() can't detect its presence too. So add this fixup
to fix this issue.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-22 10:25:00 +01:00
Takashi Iwai 50947fb04f Merge branch 'for-linus' into for-next
Back-merge of 4.15-rc development branch for further development of
USB-audio stuff.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-19 12:40:45 +01:00
Kailang Yang 9226665159 ALSA: hda/realtek - Fix Dell AIO LineOut issue
Dell AIO had LineOut jack.
Add LineOut verb into this patch.

[ Additional notes:
  the ALC274 codec seems requiring the fixed pin / DAC connections for
  HP / line-out pins for enabling EQ for speakers; i.e. the HP / LO
  pins expect to be connected with NID 0x03 while keeping the speaker
  with NID 0x02.  However, by adding a new line-out pin, the
  auto-parser assigns the NID 0x02 for HP/LO pins as primary outputs.
  As an easy workaround, we provide the preferred_pairs[] to map
  forcibly for these pins. -- tiwai ]

Fixes: 75ee94b20b ("ALSA: hda - fix headset mic problem for Dell machines with alc274")
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-18 11:09:05 +01:00
Guneshwor Singh 2b4584d00a ALSA: hda - Add vendor id for Cannonlake HDMI codec
Cannonlake HDMI codec has the same nid as Geminilake. This adds the
codec entry for it.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-07 13:42:28 +01:00
Kailang Yang f429e7e494 ALSA: hda/realtek - New codec support for ALC257
Add new support for ALC257 codec.

[ It's supposed to be almost equivalent with other ALC25x variants,
  just adding another type and id -- tiwai ]

Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-05 10:54:10 +01:00
Takashi Iwai 886cd11f7b Merge branch 'topic/trivial' into for-next
Pull various trivial fixes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-29 09:30:43 +01:00
Yussuf Khalil 6dbc6caf66 ALSA: ice1724: Fix resume issues with Prodigy 7.1 HiFi
There are two issues after resuming from suspend on the
Audiotrak Prodigy 7.1 HiFi:
 - the output volume is set to 100%
 - microphone input isn't working anymore

This patch fixes these issues by reinitializing both codecs of the device
and restoring the previous volumes during resume.

Signed-off-by: Yussuf Khalil <dev@pp3345.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-29 09:30:11 +01:00
Markus Elfring cf576fe5fd ALSA: korg1212: Delete a duplicate function call "release_firmware" in snd_korg1212_create()
The function "release_firmware" is called in the current implementation of
the function "_request_firmware" after a failure was detected.
Link: https://elixir.free-electrons.com/linux/v4.14-rc8/source/drivers/base/firmware_class.c#L1196

Such a call should therefore not be repeated directly after the
corresponding error information was received in the local variable "err"
of the function "snd_korg1212_create".
Thus remove a misplaced function call.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-29 09:29:41 +01:00
Vijendar Mukunda 9ceace3c9c ALSA: hda: Add Raven PCI ID
This commit adds PCI ID for Raven platform

Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-23 10:17:59 +01:00