firefly-linux-kernel-4.4.55.git
9 years agoALSA: cs46xx: Fix old ifdef CONFIG_PROC_FS
Takashi Iwai [Fri, 29 May 2015 05:55:37 +0000 (07:55 +0200)]
ALSA: cs46xx: Fix old ifdef CONFIG_PROC_FS

Replaced with the new CONFIG_SND_PROC_FS.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ca0106: Fix/cleanup ifdef CONFIG_PROC_FS
Takashi Iwai [Fri, 29 May 2015 05:53:52 +0000 (07:53 +0200)]
ALSA: ca0106: Fix/cleanup ifdef CONFIG_PROC_FS

Build ca0106_proc.o conditionally to drop unneeded ifdef.
Some are replaced with the new CONFIG_SND_PROC_FS.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ac97: Fix ifdef CONFIG_PROC_FS
Takashi Iwai [Fri, 29 May 2015 05:52:43 +0000 (07:52 +0200)]
ALSA: ac97: Fix ifdef CONFIG_PROC_FS

Replaced with the new CONFIG_SND_PROC_FS.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ak4xxx-adda: Drop unnecessary ifdef CONFIG_PROC_FS
Takashi Iwai [Fri, 29 May 2015 05:51:23 +0000 (07:51 +0200)]
ALSA: ak4xxx-adda: Drop unnecessary ifdef CONFIG_PROC_FS

The compiler can optimize it away if not needed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: opl4: Fix / cleanup ifdef CONFIG_PROC_FS
Takashi Iwai [Fri, 29 May 2015 05:49:55 +0000 (07:49 +0200)]
ALSA: opl4: Fix / cleanup ifdef CONFIG_PROC_FS

Some are replaced with the new ifdef CONFIG_SND_PROC_FS.  Some are
removed by building opl4_proc.o conditionally.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: dummy: Replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS
Takashi Iwai [Fri, 29 May 2015 05:47:50 +0000 (07:47 +0200)]
ALSA: dummy: Replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS

Although there shouldn't be a problem in practice (the compiler should
handle well), it's better to follow to the new Kconfig.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: aloop: Drop unnecessary ifdef CONFIG_PROC_FS
Takashi Iwai [Fri, 29 May 2015 05:46:05 +0000 (07:46 +0200)]
ALSA: aloop: Drop unnecessary ifdef CONFIG_PROC_FS

Since the compiler can optimize away the unused code, we can reduce
the messy ifdef.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: core: Fix randconfig build wrt CONFIG_PROC_FS
Takashi Iwai [Fri, 29 May 2015 05:01:28 +0000 (07:01 +0200)]
ALSA: core: Fix randconfig build wrt CONFIG_PROC_FS

There are a few leftover CONFIG_PROC_FS forgotten to replace with
CONFIG_SND_PROC_FS.

Fixes: cd6a65036f0e ('ALSA: replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS')
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Drop unused fields from struct hda_codec_preset
Takashi Iwai [Thu, 28 May 2015 12:46:55 +0000 (14:46 +0200)]
ALSA: hda - Drop unused fields from struct hda_codec_preset

It's very unlikely that we'd need these fields out of sudden.
Let's drop them.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS
Jie Yang [Wed, 27 May 2015 11:45:45 +0000 (19:45 +0800)]
ALSA: replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS

We may disable proc fs only for sound part, to reduce ALSA
memory footprint. So add CONFIG_SND_PROC_FS and replace the
old CONFIG_PROC_FSs in alsa code.

With sound proc fs disabled, we can save about 9KB memory
size on X86_64 platform.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: Kconfig: add config item SND_PROC_FS for expert
Jie Yang [Wed, 27 May 2015 11:45:44 +0000 (19:45 +0800)]
ALSA: Kconfig: add config item SND_PROC_FS for expert

For some embedded devices, we need reduce code size and data
footprint as much as possible, e.g. disabling procfs, hw/sw
params refinement, mmap, dpcm, dapm, compressed API...

Here add SND_PROC_FS item for expert, we can unselect it to
disable sound proc FS and reduce memory footprint.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: fix buffer-over-run when detecting packet discontinuity
Takashi Sakamoto [Wed, 27 May 2015 15:02:59 +0000 (00:02 +0900)]
ALSA: firewire-lib: fix buffer-over-run when detecting packet discontinuity

When detecting packet discontinuity, handle_in_packet() returns minus value
and this value is assigned to unsigned int variable, then the variable has
huge value. As a result, the variable causes buffer-over-run in
handle_out_packet(). This brings invalid page request and system hangup.

This commit fixes the bug to add a new argument into handle_in_packet()
and the number of handled data blocks is assignd to it. The function
return value is just used to check error.

I also considered to change the type of local variable to 'int' in
in_stream_callback(). This idea is based on type-conversion in C standard,
while it may cause future problems when adding more works. Thus, I dropped
this idea.

Fixes: 6fc6b9ce41c6('ALSA: firewire-lib: pass the number of data blocks in incoming packets to outgoing packets')
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agosound: sound_firmware: Fix invalid use of vfs_read()
Takashi Iwai [Tue, 26 May 2015 10:57:56 +0000 (12:57 +0200)]
sound: sound_firmware: Fix invalid use of vfs_read()

It should use kernel_read() instead of vfs_read() to load a firmware
binary onto the kernel pages.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: bcd2000: Make local data static
Takashi Iwai [Tue, 26 May 2015 10:57:09 +0000 (12:57 +0200)]
ALSA: bcd2000: Make local data static

Spotted by sparse:
  sound/usb/bcd2000/bcd2000.c:73:1: warning: symbol 'devices_used' was not declared. Should it be static?

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: lx6464es: Use NULL for pointers
Takashi Iwai [Tue, 26 May 2015 10:56:21 +0000 (12:56 +0200)]
ALSA: lx6464es: Use NULL for pointers

Spotted by sparse:
  sound/pci/lx6464es/lx6464es.c:415:47: warning: Using plain integer as NULL pointer
  sound/pci/lx6464es/lx6464es.c:417:48: warning: Using plain integer as NULL pointer

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: lx6464es: Fix duplicated SSID entries
Takashi Iwai [Tue, 26 May 2015 10:52:54 +0000 (12:52 +0200)]
ALSA: lx6464es: Fix duplicated SSID entries

PCI_DEVICE() macro itself defines SSID entries while we override them
after that.  Replace with a more appropriate macro, PCI_DEVICE_SUB()
to define all ID values properly.

Spotted by sparse:
  sound/pci/lx6464es/lx6464es.c:60:11: warning: Initializer entry defined twice
  sound/pci/lx6464es/lx6464es.c:61:12:   also defined here
  sound/pci/lx6464es/lx6464es.c:64:11: warning: Initializer entry defined twice
  sound/pci/lx6464es/lx6464es.c:65:12:   also defined here

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: dummy: make local data static
Takashi Iwai [Tue, 26 May 2015 10:51:35 +0000 (12:51 +0200)]
ALSA: dummy: make local data static

Add missing prefix to make some local data static.

Spotted by sparse:
  sound/drivers/dummy.c:159:20: warning: symbol 'model_emu10k1' was not declared. Should it be static?
  sound/drivers/dummy.c:165:20: warning: symbol 'model_rme9652' was not declared. Should it be static?
  ....

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: bebob: add Digidesign Mbox 2 Pro support
Takashi Sakamoto [Sun, 24 May 2015 11:51:45 +0000 (20:51 +0900)]
ALSA: bebob: add Digidesign Mbox 2 Pro support

This device is based on DM1000E, and BeBoB version 1 firmware is
installed.

$ cat /proc/asound/cards
 0 [Pro            ]: BeBoB - Mbox 2 Pro
                      DIGIDESIGN Mbox 2 Pro (id:1, rev:1),
      GUID 00a07e0100a90000 at fw1.0, S400

$ cat /proc/asound/Pro/firewire/firmware
Manufacturer: bridgeCo
Protocol Ver: 1
Build Ver: 0
GUID: 0x00A07E0100A90000
Model ID: 0x01
Model Rev: 1
Firmware Date: 20071031
Firmware Time: 034402
Firmware ID: 0xA9
Firmware Ver: 16777215
Base Addr: 0x20080000
Max Size: 1572864
Loader Date: 20051207
Loader Time: 205554

With this patch, ALSA BeBoB driver can start packet streaming to/from
this model, while as a default, internal multiplexer of this model is
not initialized and generates no sound even if the driver transfers
any packets with PCM samples. To hear any sounds from this model,
userspace applications should be developed to set parameters to the
internal multiplexer. You can see raw information in FFADO website:
http://subversion.ffado.org/wiki/AvcModels/DigiDesignMboxPro2

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: use protocol error when detecting wrong value in CIP header
Takashi Sakamoto [Fri, 22 May 2015 14:21:14 +0000 (23:21 +0900)]
ALSA: firewire-lib: use protocol error when detecting wrong value in CIP header

When detecting zero in 'dbs' field of CIP header, this packet streaming
should be aborted because of avoiding division-by-zero. This is an error
in an aspect of IEC 61883-1, thus protocol error.

This commit use EPROTO instead of EIO. Actually, the returned value is
not used for userspace and this commit has no effect.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: use dev_err() when detecting incoming streaming error
Takashi Sakamoto [Fri, 22 May 2015 14:21:13 +0000 (23:21 +0900)]
ALSA: firewire-lib: use dev_err() when detecting incoming streaming error

When detecting invalid value in 'dbs' field of CIP header or packet
discontinuity, current implementation reports the status by err_info().
In most cases this state is caused by model-specific issue due to
vendor's customization and should be reported to developers.

This commit use dev_err() instead of dev_info() for this purpose.
In the cases, packet streaming is aborted, thus no message floading
occurs.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: macro arrangement for code cleanup
Takashi Sakamoto [Fri, 22 May 2015 14:21:12 +0000 (23:21 +0900)]
ALSA: firewire-lib: macro arrangement for code cleanup

Some macros include my misunderstanding for IEC 61883-1 or -6.
Additionally, some fixed values appear on codes.

This commit replaces these with macros with proper names.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: rename local functions for code cleanup
Takashi Sakamoto [Fri, 22 May 2015 14:21:11 +0000 (23:21 +0900)]
ALSA: firewire-lib: rename local functions for code cleanup

The naming rule for local functions was inconsistent. This commit
rename them with a consistent manner.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: remove restriction for non-blocking mode
Takashi Sakamoto [Fri, 22 May 2015 14:00:54 +0000 (23:00 +0900)]
ALSA: firewire-lib: remove restriction for non-blocking mode

Former patches allow non-blocking streams to synchronize with timestamp.
This patch removes the restriction.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: set streaming error outside of packetization
Takashi Sakamoto [Fri, 22 May 2015 14:00:53 +0000 (23:00 +0900)]
ALSA: firewire-lib: set streaming error outside of packetization

In previous commit, error handling for incoming packet processing is
outside of packetization. This is nice for reading the codes.

This commit applies this idea for outgoing packet processing, too.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: pass the number of data blocks in incoming packets to outgoing...
Takashi Sakamoto [Fri, 22 May 2015 14:00:52 +0000 (23:00 +0900)]
ALSA: firewire-lib: pass the number of data blocks in incoming packets to outgoing packets

Current implementation reuses the value of syt field in incoming packet to
outgoing packet for full duplex timestamp synchronization, while the number
of data blocks in outgoing packets refers to hard-coded table and the
synchronization cannot be applied to non-blocking stream.

This commit passes the number of data blocks from incoming packet
processing to outgoing packet processing for the synchronization. For
normal mode, isochronous callback handler is changed to generate the values
of syt and data blocks.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: simplify function to calculate the number of data blocks
Takashi Sakamoto [Fri, 22 May 2015 14:00:51 +0000 (23:00 +0900)]
ALSA: firewire-lib: simplify function to calculate the number of data blocks

This function is called according to conditions between the value of
syt and streaming mode(blocking or non-blocking).

To simplify caller's work, this commit push these conditions to the
function.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: firewire-lib: add buffer-over-run protection at receiving more data blocks...
Takashi Sakamoto [Fri, 22 May 2015 14:00:50 +0000 (23:00 +0900)]
ALSA: firewire-lib: add buffer-over-run protection at receiving more data blocks than expected

In IEC 61883-6, the number of data blocks in a packet is limited up to
the value of SYT_INTERVAL. Current implementation is compliant to the
limitation, while it can cause buffer-over-run when the value of dbs
field in received packet is illegally large.

This commit adds a validator to detect such illegal packets to prevent
the buffer-over-run. Actually, the buffer is aligned to the size of memory
 page, thus this issue hardly causes system errors due to the room to page
alignment, as long as a few packets includes such jumbo payload; i.e.
a packet to several received packets.

Here, Behringer F-Control Audio 202 (based on OXFW 960) has a quirk to
postpone transferring isochronous packet till finish handling any
asynchronous packets. In this case, this model is lazy, transfers no
packets according to several cycle-start packets. After finishing, this
model pushes required data in next isochronous packet. As a result, the
packet include more data blocks than IEC 61883-6 defines.

To continue to support this model, this commit adds a new flag to extend
the length of calculated payload. This flag allows the size of payload
5 times as large as IEC 61883-6 defines. As a result, packets from this
model passed the validator successfully.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'topic/hdmi' into for-next
Takashi Iwai [Fri, 22 May 2015 14:04:45 +0000 (16:04 +0200)]
Merge branch 'topic/hdmi' into for-next

9 years agoALSA: pcm: add IEC958 channel status helper
Russell King [Sat, 9 May 2015 10:26:47 +0000 (11:26 +0100)]
ALSA: pcm: add IEC958 channel status helper

Add a helper to create the IEC958 channel status from an ALSA
snd_pcm_runtime structure, taking account of the sample rate and
sample size.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviwed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: pcm: add DRM ELD helper
Russell King [Sat, 9 May 2015 10:26:42 +0000 (11:26 +0100)]
ALSA: pcm: add DRM ELD helper

Add a helper for the EDID like data structure, which is typically passed
from a HDMI adapter to its associated audio driver.  This informs the
audio driver of the capabilities of the attached HDMI sink.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: jack: Remove MODULE_*() macros
Takashi Iwai [Thu, 21 May 2015 09:31:40 +0000 (11:31 +0200)]
ALSA: jack: Remove MODULE_*() macros

The jack interface is statically included in sound core.  Having
doubly module information is rather confusing.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Move hda_i915.c from sound/pci/hda to sound/hda
Mengdong Lin [Tue, 19 May 2015 14:29:30 +0000 (22:29 +0800)]
ALSA: hda - Move hda_i915.c from sound/pci/hda to sound/hda

The file is moved to hda core and renamed to hdac_i915.c, so can be used
by both legacy HDA driver and new Skylake audio driver.

- Add snd_hdac_ prefix to the public APIs.
- The i915 audio component is moved to core bus and dynamically allocated.
- A static pointer hdac_acomp is used to help bind/unbind callbacks to get
  this component, because the sound card's private_data is used by the azx
  chip pointer, which is a legacy structure. It could be removed if private
  _data changes to some core structure which can be extended to find the
  bus.
- snd_hdac_get_display_clk() is added to get the display core clock for
  HSW/BDW.
- haswell_set_bclk() is moved to hda_intel.c because it needs to write the
  controller registers EM4/EM5, and only legacy HD-A needs it for HSW/BDW.
- Move definition of HSW/BDW-specific registers EM4/EM5 to hda_register.h
  and rename them to HSW_EM4/HSW_EM5, because other HD-A controllers have
  different layout for the extended mode registers.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Fix NULL dereference from CA0132 DSP loader
Takashi Iwai [Tue, 19 May 2015 09:35:13 +0000 (11:35 +0200)]
ALSA: hda - Fix NULL dereference from CA0132 DSP loader

The CA0132 DSP loader leads to NULL deference since the recent
transition to HDA core code, as it unconditionally accesses
hdac_stream->substream->runtime.  For DSP loading, the substream
shouldn't be assigned.

This patch addresses the NULL dereference above in addition to assure
the substream is cleared while DSP loading.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=98151
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Sync HD-Audio-Models.txt for Realtek codecs
Takashi Iwai [Tue, 19 May 2015 08:21:57 +0000 (10:21 +0200)]
ALSA: hda - Sync HD-Audio-Models.txt for Realtek codecs

Added missing model entries and updated the codec names.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Add headset-mode* model options for ALC269 & co
Takashi Iwai [Tue, 19 May 2015 08:20:13 +0000 (10:20 +0200)]
ALSA: hda - Add headset-mode* model options for ALC269 & co

Modern machines tend to have only one headset jack nowadays, and they
often need these quirks.  Let's allow them applicable via model
option for ease of debugging.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/ca0132: support for Alienware 15 Creative Sound Core3D-EX
Gabriele Martino [Mon, 18 May 2015 19:15:13 +0000 (21:15 +0200)]
ALSA: hda/ca0132: support for Alienware 15 Creative Sound Core3D-EX

This patch adds quirks detection to the Creative CA0132 codec, and the
quirk for Alienware 15 (2015).
Some quirks may need different pin configuration, so the relevant
compile-time configuration has been removed.
The pin configuration and related initialization verbs are generated at
runtime instead, in ca0132_config() and ca0132_prepare_verbs().

Signed-off-by: Gabriele Martino <g.martino@gmx.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: ppc: keywest: drop using attach adapter
Wolfram Sang [Sat, 9 May 2015 17:42:22 +0000 (19:42 +0200)]
ALSA: ppc: keywest: drop using attach adapter

As we now have deferred probing, we can use a custom mechanism and
finally get rid of this legacy interface from the i2c core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Tested-by: Dan DeVoto <dand1972@yahoo.com>
Tested-by: Mark Elliott <txlitebeer@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agosound: oss: fix build warning
Sudip Mukherjee [Thu, 14 May 2015 11:12:59 +0000 (16:42 +0530)]
sound: oss: fix build warning

while building with allyesconfig it was giving a build warning about
unused variable. declare the variable only if the driver is built as a
module.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - add hda_intel_trace.h
Libin Yang [Tue, 12 May 2015 01:43:22 +0000 (09:43 +0800)]
ALSA: hda - add hda_intel_trace.h

This patch creates hda_intel_trace.h to add some pm trace functions
used in hda_intel.c

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - rename hda_intel_trace.h to hda_controller_trace.h
Libin Yang [Tue, 12 May 2015 01:43:21 +0000 (09:43 +0800)]
ALSA: hda - rename hda_intel_trace.h to hda_controller_trace.h

This patch does:

1. Rename the hda_intel_trace.h to hda_controller_trace.h as
this trace is used in hda_controller.c

2. Add some trace function for pcm flow.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - add hdac stream trace
Libin Yang [Tue, 12 May 2015 01:43:20 +0000 (09:43 +0800)]
ALSA: hda - add hdac stream trace

Add the trace of snd_hdac_stream_start and snd_hdac_stream_stop.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/hdmi - Add Tegra210 support
Thierry Reding [Tue, 5 May 2015 12:56:24 +0000 (14:56 +0200)]
ALSA: hda/hdmi - Add Tegra210 support

Tegra210 contains a similar codec as Tegra124 and can be supported using
the same patch function.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/hdmi - Add Tegra114 support
Thierry Reding [Tue, 5 May 2015 12:56:23 +0000 (14:56 +0200)]
ALSA: hda/hdmi - Add Tegra114 support

Tegra114 contains the same codec as Tegra124 and can be supported using
the same patch function.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/hdmi - Add Tegra30 support
Thierry Reding [Tue, 5 May 2015 12:56:22 +0000 (14:56 +0200)]
ALSA: hda/hdmi - Add Tegra30 support

Tegra30 contains the same codec as Tegra124 and can be supported using
the same patch function.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/tegra - Improve error reporting
Thierry Reding [Tue, 5 May 2015 12:56:21 +0000 (14:56 +0200)]
ALSA: hda/tegra - Improve error reporting

When probing, provide accurate error messages to help with debugging
failures.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/hdmi - Implement Tegra-specific patch
Thierry Reding [Tue, 5 May 2015 12:56:20 +0000 (14:56 +0200)]
ALSA: hda/hdmi - Implement Tegra-specific patch

The HDMI codec on NVIDIA Tegra SoCs has a feature that doesn't exist on
the MCP or GPU variants. The highest bit in the vendor-defined scratch
registers can be used to trigger an interrupt in the HDMI codec, which
is signalled to the HDMI driver. This can be used to pass information,
such as the HDA format, to the HDMI driver so that it can reconfigure
itself accordingly.

While at it, change the name of the codec to Tegra124 since there are no
other SoCs in the Tegra12x family. There isn't really a Tegra12x family.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/tegra - Set CORBRP self-clear flag
Thierry Reding [Tue, 5 May 2015 12:56:19 +0000 (14:56 +0200)]
ALSA: hda/tegra - Set CORBRP self-clear flag

This is set for the MCP variants of the NVIDIA HDA controller, which the
Tegra variant was derived from. This fixes the following warning at boot
time:

[    2.486610] tegra-hda 70030000.hda: CORB reset timeout#1, CORBRP = 0

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/realtek - Support Dell headset mode for ALC298
Kailang Yang [Mon, 18 May 2015 07:31:20 +0000 (15:31 +0800)]
ALSA: hda/realtek - Support Dell headset mode for ALC298

Dell create new platform with ALC298 codec.
This patch will enable headset mode for ALC298/ALC3266 platform.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: info: Drop kerneldoc comment from snd_info_create_entry()
Takashi Iwai [Mon, 18 May 2015 07:45:11 +0000 (09:45 +0200)]
ALSA: info: Drop kerneldoc comment from snd_info_create_entry()

It's no longer a part of API but merely a local function.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: info: Move list addition to snd_info_create_entry()
Takashi Iwai [Mon, 18 May 2015 07:43:30 +0000 (09:43 +0200)]
ALSA: info: Move list addition to snd_info_create_entry()

Just a minor refactoring, no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: info: Register proc entries recursively, too
Takashi Iwai [Mon, 18 May 2015 07:20:24 +0000 (09:20 +0200)]
ALSA: info: Register proc entries recursively, too

The commit [c560a6797e3b: ALSA: core: Remove child proc file elements
recursively] converted snd_card_proc_new() with the normal
snd_info_*() call and removed snd_device chain for such info
entries. However, it misses one point: the creation of the proc entry
was managed by snd_device chain in the former code, and now it's also
gone, which results in no proc files creation at all.  Mea culpa.

This patch makes snd_info_card_register() creating the all pending
child proc entries in a shot.  Also, since snd_card_register() might
be called multiple times, this function is also changed to be callable
multiple times.

Along with the changes above, now the linked list of snd_info_entry is
added at creation time instead of snd_info_register() for keeping eyes
of pending info entries.

Fixes: c560a6797e3b ('ALSA: core: Remove child proc file elements recursively')
Reported-by: "Lu, Han" <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: info: Fix leaks of child entries at snd_info_free_entry()
Takashi Iwai [Mon, 18 May 2015 06:59:12 +0000 (08:59 +0200)]
ALSA: info: Fix leaks of child entries at snd_info_free_entry()

snd_info_free_entry() releases the all children nodes as well, but due
to the wrong timing of releasing the link, the children nodes may be
disconnected but left unreleased.  This patch fixes it by moving the
link free at the right position.  Also it eases list_for_each_entry()
without _safe option in snd_info_disconnect() because it no longer
frees the children nodes there.

Fixes: c560a6797e3b ('ALSA: core: Remove child proc file elements recursively')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/realtek - Support headset mode for ALC298
Kailang Yang [Tue, 12 May 2015 09:11:10 +0000 (17:11 +0800)]
ALSA: hda/realtek - Support headset mode for ALC298

Support headset mode for ALC298 platform.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Remove unused call to "get_pin" in patch_hdmi.c
David Henningsson [Mon, 11 May 2015 08:23:57 +0000 (10:23 +0200)]
ALSA: hda - Remove unused call to "get_pin" in patch_hdmi.c

Janitorial patch (no functional change)

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda/tegra - Fix oops
Thierry Reding [Tue, 5 May 2015 12:45:57 +0000 (14:45 +0200)]
ALSA: hda/tegra - Fix oops

Commit a41d122449be ("ALSA: hda - Embed bus into controller object")
introduced a regression in the Tegra HDA driver that causes the
following oops during boot:

[    2.333458] Unable to handle kernel NULL pointer dereference at virtual address 000004c4
[    2.341537] pgd = c0004000
[    2.344312] [000004c4] *pgd=00000000
[    2.347898] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[    2.353200] Modules linked in:
[    2.356264] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W       4.1.0-rc2-next-20150505-00344-g8577890defbf #79
[    2.366682] Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
[    2.372939] task: ee0d8b40 ti: ee0da000 task.ti: ee0da000
[    2.378336] PC is at azx_bus_init+0x18/0xf4
[    2.382516] LR is at hda_tegra_probe+0x6c/0x478
[    2.387043] pc : [<c06156c4>]    lr : [<c061cf00>]    psr: 60000113
[    2.387043] sp : ee0dbe38  ip : 00000000  fp : 00000000
[    2.398501] r10: ed874c00  r9 : 000000fd  r8 : 00000000
[    2.403717] r7 : ed874c10  r6 : 00000000  r5 : 00000000  r4 : ed016810
[    2.410232] r3 : c08a2ad4  r2 : c08a1ea0  r1 : 00000000  r0 : ed016810
[    2.416750] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    2.424046] Control: 10c5387d  Table: 8000406a  DAC: 00000015
[    2.429783] Process swapper/0 (pid: 1, stack limit = 0xee0da210)
[    2.435778] Stack: (0xee0dbe38 to 0xee0dc000)
[    2.440129] be20:                                                       00000000 ed016810
[    2.448297] be40: 00000000 c061cf00 00000000 ee0dbe5c ed8735d0 c0a7bc48 ed02fd50 ed016000
[    2.456462] be60: c1250164 ed874c10 c0c66bf8 fffffdfb 00000000 000000fd c0b8dc98 c046664c
[    2.464628] be80: c0466608 c1250164 ed874c10 00000000 c0c66bf8 c0464eb4 ed874c10 c0c66bf8
[    2.472793] bea0: ed874c44 c0c43458 00000000 c04650d0 00000000 c0c66bf8 c046503c c04633b4
[    2.480959] bec0: ee11bea4 ed85f390 c0c66bf8 ed017ac0 00000000 c0464634 c0ab2b7c c0c66bf8
[    2.489125] bee0: c0bfde20 c0c66bf8 c0bfde20 ed01ce40 c0b7b414 c04656e8 c04665b0 c0bfde20
[    2.497291] bf00: c0bfde20 c0009770 ee0d8b40 c0c02488 60000113 00000000 00000000 00000003
[    2.505458] bf20: 00000000 c0c02488 60000113 00000000 c0b54598 c0b16a90 ef7fcc57 c0041228
[    2.513624] bf40: c0a9150c ef7fcc5f 00000006 00000006 00000000 c0bf1fa8 c0bf2354 00000006
[    2.521790] bf60: c0b8dc90 c0c7c000 c0c7c000 c0b8dc98 00000000 c0b54dd8 00000006 00000006
[    2.529956] bf80: c0b54598 00000000 00000000 c07ff08c 00000000 00000000 00000000 00000000
[    2.538122] bfa0: 00000000 c07ff094 00000000 c000f5a0 00000000 00000000 00000000 00000000
[    2.546286] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.554451] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 fffff7ff c013f264
[    2.562624] [<c06156c4>] (azx_bus_init) from [<c061cf00>] (hda_tegra_probe+0x6c/0x478)
[    2.570535] [<c061cf00>] (hda_tegra_probe) from [<c046664c>] (platform_drv_probe+0x44/0xa4)
[    2.578879] [<c046664c>] (platform_drv_probe) from [<c0464eb4>] (driver_probe_device+0x174/0x2b8)
[    2.587739] [<c0464eb4>] (driver_probe_device) from [<c04650d0>] (__driver_attach+0x94/0x98)
[    2.596172] [<c04650d0>] (__driver_attach) from [<c04633b4>] (bus_for_each_dev+0x6c/0xa0)
[    2.604342] [<c04633b4>] (bus_for_each_dev) from [<c0464634>] (bus_add_driver+0x148/0x1f0)
[    2.612597] [<c0464634>] (bus_add_driver) from [<c04656e8>] (driver_register+0x78/0xf8)
[    2.620593] [<c04656e8>] (driver_register) from [<c0009770>] (do_one_initcall+0x8c/0x1d4)
[    2.628765] [<c0009770>] (do_one_initcall) from [<c0b54dd8>] (kernel_init_freeable+0x144/0x1e4)
[    2.637459] [<c0b54dd8>] (kernel_init_freeable) from [<c07ff094>] (kernel_init+0x8/0xe8)
[    2.645543] [<c07ff094>] (kernel_init) from [<c000f5a0>] (ret_from_fork+0x14/0x34)

This is caused by azx_bus_init() trying to dereference chip->card, which
for the Tegra driver doesn't get initialized until sometime later during
the call to hda_tegra_create().

Fix this by mimicking the behaviour of the Intel driver and defer HDA
bus initialization until right before the call to snd_device_new().

Fixes: a41d122449be ('ALSA: hda - Embed bus into controller object')
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - reset display codec when power on
Lu, Han [Tue, 5 May 2015 01:05:48 +0000 (09:05 +0800)]
ALSA: hda - reset display codec when power on

In SKL, HDMI/DP codec and PCH HD Audio Controller are in different power wells,
so it's necessary to reset display audio codecs when power well on, otherwise
display audio codecs will disappear when resume from low power state.
Reset steps when power on:
    enable codec wakeup -> azx_init_chip() -> disable codec wakeup

The callback for codec wakeup enable/disable is in drivers/gpu/drm/i915/.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agodrm/i915/audio: add codec wakeup override enabled/disable callback
Lu, Han [Tue, 5 May 2015 01:05:47 +0000 (09:05 +0800)]
drm/i915/audio: add codec wakeup override enabled/disable callback

Add support for enabling codec wakeup override signal to allow
re-enumeration of the controller on SKL after resume from low power state.

In SKL, HDMI/DP codec and PCH HD Audio Controller are in different power
wells, so it's necessary to reset display audio codecs when power well on,
otherwise display audio codecs will disappear when resume from low power
state.
Reset steps when power on:
    enable codec wakeup -> azx_init_chip() -> disable codec wakeup

v3 by Jani: Simplify to only support toggling the appropriate chicken bit.

v4 by Han: add explanation and specify the hw swquence.

Signed-off-by: Lu, Han <han.lu@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'topic/jack' into for-next
Takashi Iwai [Sat, 2 May 2015 08:02:30 +0000 (10:02 +0200)]
Merge branch 'topic/jack' into for-next

9 years agoALSA: jack: fix a randconfig build issue
Jie Yang [Sat, 2 May 2015 07:28:07 +0000 (15:28 +0800)]
ALSA: jack: fix a randconfig build issue

Building errors reported such as below when 'CONFIG_INPUT=m':
    ...undefined reference to `input_xxx'...

Here change to enable SND_JACK selectively to fix the issue.

Also remove the config 'SND_HDA_INPUT_JACK' which won't be
used anymore.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'topic/jack' into for-next
Takashi Iwai [Thu, 30 Apr 2015 13:31:43 +0000 (15:31 +0200)]
Merge branch 'topic/jack' into for-next

9 years agoALSA: jack: Fix another NULL dereference due to empty input jack
Takashi Iwai [Thu, 30 Apr 2015 13:25:00 +0000 (15:25 +0200)]
ALSA: jack: Fix another NULL dereference due to empty input jack

Another fixes for NULL jack->input_dev in some places in jack.c.

Fixes: 2ba2dfa1fcc7 ('ALSA: hda - Update to use the new jack kctls method')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: jack: don't report input event for phantom jack
Jie Yang [Thu, 30 Apr 2015 12:22:46 +0000 (20:22 +0800)]
ALSA: jack: don't report input event for phantom jack

There is no input_dev for phantom jack, we should not report
input event for it, otherwise, NULL pointer dereference error
will occur.

Fixes: 2ba2dfa1fcc7 ('ALSA: hda - Update to use the new jack kctls method')
Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'topic/hda' into for-next
Takashi Iwai [Thu, 30 Apr 2015 06:27:18 +0000 (08:27 +0200)]
Merge branch 'topic/hda' into for-next

9 years agoALSA: hda - Reduce ifdef CONFIG_SND_HDA_I915
Takashi Iwai [Thu, 30 Apr 2015 06:22:41 +0000 (08:22 +0200)]
ALSA: hda - Reduce ifdef CONFIG_SND_HDA_I915

We're providing dummy functions for CONFIG_SND_HDA_i915=n, thus ifdef
can be reduced.  (But hda_i915_init() has to be fixed to return zero.)

This automatically fixes a compile warning:
  sound/pci/hda/hda_intel.c: In function 'azx_probe_continue':
  sound/pci/hda/hda_intel.c:1966:1: warning: label 'i915_power_fail' defined but not used [-Wunused-label]

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'topic/hda' into for-next
Takashi Iwai [Wed, 29 Apr 2015 10:28:52 +0000 (12:28 +0200)]
Merge branch 'topic/hda' into for-next

9 years agoALSA: hda - remove controller dependency on i915 power well for Baytrail/Braswell
Mengdong Lin [Wed, 29 Apr 2015 09:43:43 +0000 (17:43 +0800)]
ALSA: hda - remove controller dependency on i915 power well for Baytrail/Braswell

For Baytrail (Valleyview) and Braswell (Cherryview), only the HDMI codec is
in the display power well while the HD-A controller isn't. So the controller
flag 'need_i915_power' is not set to release the display power after probe,
and the codec flag 'link_power_control" is set to request/release the display
power via bus link_power ops.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - divide controller and codec dependency on i915 gfx power well
Mengdong Lin [Wed, 29 Apr 2015 09:43:36 +0000 (17:43 +0800)]
ALSA: hda - divide controller and codec dependency on i915 gfx power well

This patch can improve power saving for Intel platforms on which only the
display audio codec is in the shared i915 power well:

- Add a flag "need_i915_power" to indicate whether the controller needs the
  i915 power well.

- The driver will always request the i915 power when probing the controller
  and codecs if AZX_DCAPS_I915_POWERWELL is set (either the controller or a
  codec needs this power).

- If the controller needs the i915 power, the power will be held after probe
  until the controller is runtime suspended or S3. If the controller doesn't
  need the power, the power will be released the after probe, and a codec
  that needs the power can request/release the power via bus link_power ops.

Background:
- For Haswell/Broadwell, which has a separate HD-A controller for display audio,
  both the controller and the display codec are in the i915 power well.

- For Baytrail/Braswell, the display and analog audio share the same HDA
  controller and link, and only the display codec is in the i915 power well.

- For Skylake, the display and analog audio share the same HDA controller but
  use separate links. Only the display codec is in the i915 power well. And in
  legacy mode we take the two links as one. So it can follow Baytrail/Braswell.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - implement link_power ops for i915 display power control
Mengdong Lin [Wed, 29 Apr 2015 09:43:29 +0000 (17:43 +0800)]
ALSA: hda - implement link_power ops for i915 display power control

This patch implements the bus link_power ops to request/release i915 display
power well. It can be used by the display codec which shares this power well
with GPU on Intel platforms.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - allow a codec to control the link power
Mengdong Lin [Wed, 29 Apr 2015 09:43:20 +0000 (17:43 +0800)]
ALSA: hda - allow a codec to control the link power

A flag "link_power_control" is added to indicate whether a codec needs to
control the link power.  And a new bus ops link_power() is defined for the
codec to request to enable/disable the link power.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - implement a refcount for i915 power well switch
Mengdong Lin [Wed, 29 Apr 2015 09:43:12 +0000 (17:43 +0800)]
ALSA: hda - implement a refcount for i915 power well switch

This is to check the refcount of audio driver and reduce calling to i915.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'for-linus' into for-next
Takashi Iwai [Wed, 29 Apr 2015 05:28:29 +0000 (07:28 +0200)]
Merge branch 'for-linus' into for-next

Conflicts:
sound/pci/emu10k1/emu10k1_main.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: emu10k1: Emu10k2 32 bit DMA mode
Peter Zubaj [Tue, 28 Apr 2015 19:57:29 +0000 (21:57 +0200)]
ALSA: emu10k1: Emu10k2 32 bit DMA mode

Looks like audigy emu10k2 (probably emu10k1 - sb live too) support two
modes for DMA. Second mode is useful for 64 bit os with more then 2 GB
of ram (fixes problems with big soundfont loading)

1) 32MB from 2 GB address space using 8192 pages (used now as default)
2) 16MB from 4 GB address space using 4096 pages

Mode is set using HCFG_EXPANDED_MEM flag in HCFG register.
Also format of emu10k2 page table is then different.

Signed-off-by: Peter Zubaj <pzubaj@marticonet.sk>
Tested-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: emux: Fix mutex deadlock in OSS emulation
Takashi Iwai [Tue, 28 Apr 2015 15:11:44 +0000 (17:11 +0200)]
ALSA: emux: Fix mutex deadlock in OSS emulation

The OSS emulation in synth-emux helper has a potential AB/BA deadlock
at the simultaneous closing and opening:

  close ->
    snd_seq_release() ->
      sne_seq_free_client() ->
        snd_seq_delete_all_ports(): takes client->ports_mutex ->
  port_delete() ->
    snd_emux_unuse(): takes emux->register_mutex

  open ->
    snd_seq_oss_open() ->
      snd_emux_open_seq_oss(): takes emux->register_mutex ->
        snd_seq_event_port_attach() ->
  snd_seq_create_port(): takes client->ports_mutex

This patch addresses the deadlock by reducing the rance taking
emux->register_mutex in snd_emux_open_seq_oss().  The lock is needed
for the refcount handling, so move it locally.  The calls in
emux_seq.c are already with the mutex, thus they are replaced with the
version without mutex lock/unlock.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'topic/jack' into for-next
Takashi Iwai [Tue, 28 Apr 2015 06:31:31 +0000 (08:31 +0200)]
Merge branch 'topic/jack' into for-next

9 years agoALSA: Docs: Add documentation for Jack kcontrols
Jie Yang [Mon, 27 Apr 2015 13:21:02 +0000 (21:21 +0800)]
ALSA: Docs: Add documentation for Jack kcontrols

Add documentation describing Jack kcontrols and how to use them
with HD-Audio and ASoC.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: jack: remove exporting ctljack functions
Jie Yang [Mon, 27 Apr 2015 13:21:01 +0000 (21:21 +0800)]
ALSA: jack: remove exporting ctljack functions

snd_kctl_jack_new() and snd_kctl_jack_report() are internal only now
so make them static.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoASoC: jack: create kctls according to jack pins info
Jie Yang [Mon, 27 Apr 2015 13:21:00 +0000 (21:21 +0800)]
ASoC: jack: create kctls according to jack pins info

Jack kctls are now created according to the pin info.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Update to use the new jack kctls method
Jie Yang [Mon, 27 Apr 2015 13:20:59 +0000 (21:20 +0800)]
ALSA: hda - Update to use the new jack kctls method

Jack snd_kcontrols can now be created during snd_jack_new()
or by later calling snd_jack_add_new_kctls().

This patch creates the jacks during the initialisation stage
for both phantom and non phantom jacks.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: jack: extend snd_jack_new to support phantom jack
Jie Yang [Mon, 27 Apr 2015 13:20:58 +0000 (21:20 +0800)]
ALSA: jack: extend snd_jack_new to support phantom jack

Dont create input devices for phantom jacks.

Here, we extend snd_jack_new() to support phantom jack creating:
pass in a bool param for [non-]phantom flag, and a bool param
initial_jack to indicate whether we need to create a kctl at
this stage.

We can also add a kctl to the jack after its created meaning we
can now integrate the HDA and ASoC jacks.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: Jack: handle jack embedded kcontrol creating within ctljack
Jie Yang [Mon, 27 Apr 2015 13:20:57 +0000 (21:20 +0800)]
ALSA: Jack: handle jack embedded kcontrol creating within ctljack

This patch adds a static method get_available_index() to
allocate the index of new jack kcontrols and also adds
jack_kctl_name_gen() which is used to ensure compatibility
with jack naming by removing " Jack" from some incorrectly
passed names.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: jack: implement kctl creating for jack devices
Jie Yang [Mon, 27 Apr 2015 13:20:56 +0000 (21:20 +0800)]
ALSA: jack: implement kctl creating for jack devices

Currently the ALSA jack core registers only input devices for each jack
registered. These jack input devices are not readable by userspace devices
that run as non root. This patch series will implement kctls inside the
core jack part, including kctls creating, status changing report, for both
HD-Audio and ASoC jack. This allows non root userspace to read jack status
and act on it.

This patch adds a new API called snd_jack_add_new_kctl(), which will create
a kcontrol, add it to the card, and also attach it to the jack kctl list.

This patch also initialises the jack kctl list after jack is newed, and
reports kctl status when jack insertion/removal events occur.

snd_jack_new() is updated in the following patches to also support creating
phantom jacks and jack kcontrols. We then remove these duplicated features
from HDA jack and have jack kctls handled by core throughout HDA and ASoC.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Modified-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Jie Yang <yang.jie@intel.com>
Reveiwed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'for-4.2' into for-next
Takashi Iwai [Mon, 27 Apr 2015 14:42:45 +0000 (16:42 +0200)]
Merge branch 'for-4.2' into for-next

9 years agoALSA: hda - Fix missing va_end() call in snd_hda_codec_pcm_new()
Takashi Iwai [Mon, 27 Apr 2015 14:39:19 +0000 (16:39 +0200)]
ALSA: hda - Fix missing va_end() call in snd_hda_codec_pcm_new()

Reported by coverity CID 1296024.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: emux: Fix mutex deadlock at unloading
Takashi Iwai [Mon, 27 Apr 2015 12:50:39 +0000 (14:50 +0200)]
ALSA: emux: Fix mutex deadlock at unloading

The emux-synth driver has a possible AB/BA mutex deadlock at unloading
the emu10k1 driver:

  snd_emux_free() ->
    snd_emux_detach_seq(): mutex_lock(&emu->register_mutex) ->
      snd_seq_delete_kernel_client() ->
        snd_seq_free_client(): mutex_lock(&register_mutex)

  snd_seq_release() ->
    snd_seq_free_client(): mutex_lock(&register_mutex) ->
      snd_seq_delete_all_ports() ->
        snd_emux_unuse(): mutex_lock(&emu->register_mutex)

Basically snd_emux_detach_seq() doesn't need a protection of
emu->register_mutex as it's already being unregistered.  So, we can
get rid of this for avoiding the deadlock.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: emu10k1: Fix card shortname string buffer overflow
Takashi Iwai [Mon, 27 Apr 2015 11:00:09 +0000 (13:00 +0200)]
ALSA: emu10k1: Fix card shortname string buffer overflow

Some models provide too long string for the shortname that has 32bytes
including the terminator, and it results in a non-terminated string
exposed to the user-space.  This isn't too critical, though, as the
string is stopped at the succeeding longname string.

This patch fixes such entries by dropping "SB" prefix (it's enough to
fit within 32 bytes, so far).  Meanwhile, it also changes strcpy()
with strlcpy() to make sure that this kind of problem won't happen in
future, too.

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge branch 'topic/hda' into for-4.2
Takashi Iwai [Mon, 27 Apr 2015 10:25:42 +0000 (12:25 +0200)]
Merge branch 'topic/hda' into for-4.2

9 years agoALSA: Close holes in struct snd_pcm_constraint_list
Lars-Peter Clausen [Mon, 27 Apr 2015 10:20:29 +0000 (12:20 +0200)]
ALSA: Close holes in struct snd_pcm_constraint_list

On a 64-bit system there is a 32-bit hole in struct snd_pcm_constraint_list
and then 32-bit padding at the end. Reordering things slightly gets rid of
the hole and padding, reducing the size of the struct by 50% from its
original size.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: Close holes in struct snd_pcm_hw_rule
Lars-Peter Clausen [Mon, 27 Apr 2015 10:20:28 +0000 (12:20 +0200)]
ALSA: Close holes in struct snd_pcm_hw_rule

On a 64-bit system there are two 32-bit holes due to the alignment of 64-bit
fields. Reordering things slightly gets rid of those holes, reducing the
size of the struct by 17% percent of its original size.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Add mute-LED mode control to Thinkpad
Takashi Iwai [Mon, 27 Apr 2015 08:40:45 +0000 (10:40 +0200)]
ALSA: hda - Add mute-LED mode control to Thinkpad

This patch adds the missing flag to enable "Mute-LED Mode" mixer enum
ctl for Thinkpads that have also the software mute-LED control.

Reported-and-tested-by: Pali Rohár <pali.rohar@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Fix mute-LED fixed mode
Takashi Iwai [Mon, 27 Apr 2015 08:36:11 +0000 (10:36 +0200)]
ALSA: hda - Fix mute-LED fixed mode

The mute-LED mode control has the fixed on/off states that are
supposed to remain on/off regardless of the master switch.  However,
this doesn't work actually because the vmaster hook is called in the
vmaster code itself.

This patch fixes it by calling the hook indirectly after checking the
mute LED mode.

Reported-and-tested-by: Pali Rohár <pali.rohar@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: hda - Fix click noise at start on Dell XPS13
Takashi Iwai [Mon, 27 Apr 2015 08:43:22 +0000 (10:43 +0200)]
ALSA: hda - Fix click noise at start on Dell XPS13

Dell XPS13 produces a click noise at boot up, and Gabriele spotted out
that it's triggered by the initial pin control of the mic (NID 0x19).
This has to be set to Hi-Z Vref while the driver initializes to Vref
80% as a normal mic.

This patch fixes the generic parser code not to override the target
vref if it has been already set by the driver, and adds a proper
initialization of the target vref for this pin in the Realtek driver
side.

Reported-and-tested-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoLinux 4.1-rc1
Linus Torvalds [Mon, 27 Apr 2015 00:59:10 +0000 (17:59 -0700)]
Linux 4.1-rc1

9 years agox86_64, asm: Work around AMD SYSRET SS descriptor attribute issue
Andy Lutomirski [Sun, 26 Apr 2015 23:47:59 +0000 (16:47 -0700)]
x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue

AMD CPUs don't reinitialize the SS descriptor on SYSRET, so SYSRET with
SS == 0 results in an invalid usermode state in which SS is apparently
equal to __USER_DS but causes #SS if used.

Work around the issue by setting SS to __KERNEL_DS __switch_to, thus
ensuring that SYSRET never happens with SS set to NULL.

This was exposed by a recent vDSO cleanup.

Fixes: e7d6eefaaa44 x86/vdso32/syscall.S: Do not load __USER32_DS to %ss
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Peter Anvin <hpa@zytor.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Brian Gerst <brgerst@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Mon, 27 Apr 2015 00:55:26 +0000 (17:55 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull intel drm fixes from Dave Airlie.

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg
  drm/i915: Workaround to avoid lite restore with HEAD==TAIL
  drm/i915: cope with large i2c transfers

9 years agoMerge git://git.infradead.org/intel-iommu
Linus Torvalds [Mon, 27 Apr 2015 00:47:46 +0000 (17:47 -0700)]
Merge git://git.infradead.org/intel-iommu

Pull intel iommu updates from David Woodhouse:
 "This lays a little of the groundwork for upcoming Shared Virtual
  Memory support — fixing some bogus #defines for capability bits and
  adding the new ones, and starting to use the new wider page tables
  where we can, in anticipation of actually filling in the new fields
  therein.

  It also allows graphics devices to be assigned to VM guests again.
  This got broken in 3.17 by disallowing assignment of RMRR-afflicted
  devices.  Like USB, we do understand why there's an RMRR for graphics
  devices — and unlike USB, it's actually sane.  So we can make an
  exception for graphics devices, just as we do USB controllers.

  Finally, tone down the warning about the X2APIC_OPT_OUT bit, due to
  persistent requests.  X2APIC_OPT_OUT was added to the spec as a nasty
  hack to allow broken BIOSes to forbid us from using X2APIC when they
  do stupid and invasive things and would break if we did.

  Someone noticed that since Windows doesn't have full IOMMU support for
  DMA protection, setting the X2APIC_OPT_OUT bit made Windows avoid
  initialising the IOMMU on the graphics unit altogether.

  This means that it would be available for use in "driver mode", where
  the IOMMU registers are made available through a BAR of the graphics
  device and the graphics driver can do SVM all for itself.

  So they started setting the X2APIC_OPT_OUT bit on *all* platforms with
  SVM capabilities.  And even the platforms which *might*, if the
  planets had been aligned correctly, possibly have had SVM capability
  but which in practice actually don't"

* git://git.infradead.org/intel-iommu:
  iommu/vt-d: support extended root and context entries
  iommu/vt-d: Add new extended capabilities from v2.3 VT-d specification
  iommu/vt-d: Allow RMRR on graphics devices too
  iommu/vt-d: Print x2apic opt out info instead of printing a warning
  iommu/vt-d: kill bogus ecap_niotlb_iunits()

9 years agoMerge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
Linus Torvalds [Mon, 27 Apr 2015 00:44:09 +0000 (17:44 -0700)]
Merge branch 'i2c/for-next' of git://git./linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
 "This has a mixture of merge window cleanups and bugfixes"

* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: st: add include for pinctrl
  i2c: mux: use proper dev when removing "channel-X" symlinks
  i2c: digicolor: remove duplicate include
  i2c: Mark adapter devices with pm_runtime_no_callbacks
  i2c: pca-platform: fix broken email address
  i2c: mxs: fix broken email address
  i2c: rk3x: report number of messages transmitted

9 years agoMerge branch 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
Linus Torvalds [Mon, 27 Apr 2015 00:40:30 +0000 (17:40 -0700)]
Merge branch 'for-linus-4.1' of git://git./linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "Filipe hit two problems in my block group cache patches.  We finalized
  the fixes last week and ran through more tests"

* 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: prevent list corruption during free space cache processing
  Btrfs: fix inode cache writeout

9 years agoMerge tag 'drm-intel-next-fixes-2015-04-25' of git://anongit.freedesktop.org/drm...
Dave Airlie [Mon, 27 Apr 2015 00:35:15 +0000 (10:35 +1000)]
Merge tag 'drm-intel-next-fixes-2015-04-25' of git://anongit.freedesktop.org/drm-intel into drm-fixes

three fixes for i915.

* tag 'drm-intel-next-fixes-2015-04-25' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: vlv: fix save/restore of GFX_MAX_REQ_COUNT reg
  drm/i915: Workaround to avoid lite restore with HEAD==TAIL
  drm/i915: cope with large i2c transfers

9 years agoMerge tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Mon, 27 Apr 2015 00:33:59 +0000 (17:33 -0700)]
Merge tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client updates from Trond Myklebust:
 "Another set of mainly bugfixes and a couple of cleanups.  No new
  functionality in this round.

  Highlights include:

  Stable patches:
   - Fix a regression in /proc/self/mountstats
   - Fix the pNFS flexfiles O_DIRECT support
   - Fix high load average due to callback thread sleeping

  Bugfixes:
   - Various patches to fix the pNFS layoutcommit support
   - Do not cache pNFS deviceids unless server notifications are enabled
   - Fix a SUNRPC transport reconnection regression
   - make debugfs file creation failure non-fatal in SUNRPC
   - Another fix for circular directory warnings on NFSv4 "junctioned"
     mountpoints
   - Fix locking around NFSv4.2 fallocate() support
   - Truncating NFSv4 file opens should also sync O_DIRECT writes
   - Prevent infinite loop in rpcrdma_ep_create()

  Features:
   - Various improvements to the RDMA transport code's handling of
     memory registration
   - Various code cleanups"

* tag 'nfs-for-4.1-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (55 commits)
  fs/nfs: fix new compiler warning about boolean in switch
  nfs: Remove unneeded casts in nfs
  NFS: Don't attempt to decode missing directory entries
  Revert "nfs: replace nfs_add_stats with nfs_inc_stats when add one"
  NFS: Rename idmap.c to nfs4idmap.c
  NFS: Move nfs_idmap.h into fs/nfs/
  NFS: Remove CONFIG_NFS_V4 checks from nfs_idmap.h
  NFS: Add a stub for GETDEVICELIST
  nfs: remove WARN_ON_ONCE from nfs_direct_good_bytes
  nfs: fix DIO good bytes calculation
  nfs: Fetch MOUNTED_ON_FILEID when updating an inode
  sunrpc: make debugfs file creation failure non-fatal
  nfs: fix high load average due to callback thread sleeping
  NFS: Reduce time spent holding the i_mutex during fallocate()
  NFS: Don't zap caches on fallocate()
  xprtrdma: Make rpcrdma_{un}map_one() into inline functions
  xprtrdma: Handle non-SEND completions via a callout
  xprtrdma: Add "open" memreg op
  xprtrdma: Add "destroy MRs" memreg op
  xprtrdma: Add "reset MRs" memreg op
  ...

9 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Linus Torvalds [Sun, 26 Apr 2015 22:48:49 +0000 (15:48 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/viro/vfs

Pull fourth vfs update from Al Viro:
 "d_inode() annotations from David Howells (sat in for-next since before
  the beginning of merge window) + four assorted fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  RCU pathwalk breakage when running into a symlink overmounting something
  fix I_DIO_WAKEUP definition
  direct-io: only inc/dec inode->i_dio_count for file systems
  fs/9p: fix readdir()
  VFS: assorted d_backing_inode() annotations
  VFS: fs/inode.c helpers: d_inode() annotations
  VFS: fs/cachefiles: d_backing_inode() annotations
  VFS: fs library helpers: d_inode() annotations
  VFS: assorted weird filesystems: d_inode() annotations
  VFS: normal filesystems (and lustre): d_inode() annotations
  VFS: security/: d_inode() annotations
  VFS: security/: d_backing_inode() annotations
  VFS: net/: d_inode() annotations
  VFS: net/unix: d_backing_inode() annotations
  VFS: kernel/: d_inode() annotations
  VFS: audit: d_backing_inode() annotations
  VFS: Fix up some ->d_inode accesses in the chelsio driver
  VFS: Cachefiles should perform fs modifications on the top layer only
  VFS: AF_UNIX sockets should call mknod on the top layer only