Commit Graph

26829 Commits

Author SHA1 Message Date
Jeeja KP 66d6bbc6c0 ASoC: hdac_hdmi: Update sig_bits based on converter capability
When creating the codec dai, use sig_bits to update the max bps based
on the codec capability. So both the link DMA and codec format will be
calculated based on DAI sig_bits.

So update the sig_bits with converter capability and use the sig_bits
for HDA format calculation.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29 12:53:21 +01:00
Jeeja KP 7f975a385b ASoC: Intel: Skylake: Use the sig_bits to define dai bps capability
For calculating the HDA DMA format, use the max_bps supported by the
DAI caps instead of fixing it to 32/24. For host DMA the Max bps support
is 32, but in case of link DMA, this depends on the codec capability.
So use the sig_bits to define the bps supported by dai.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29 12:53:06 +01:00
Mark Brown 240a07dbc3 Merge branch 'topic/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel 2017-03-29 12:50:26 +01:00
Daniel Baluta db22d18945 ASoC: imx-wm8962: Fix codec_clk cleanup
Resource managed devm_clk_get only works with platform's device dev.

Reported-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29 12:50:12 +01:00
Daniel Baluta fd8ba1e309 ASoC: imx-wm8962: Let codec driver enable/disable its MCLK
WM8962 needs its MCLK when powerup in wm8962_resume(). Thus it's better
to control the MCLK in codec driver. Thus remove the clock enable in
machine driver accordingly.

While at it, get rid of imx_wm8962_remove function since it is now
empty.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29 12:48:33 +01:00
B, Jayachandran ccfdf9f6a4 ALSA: hda: Fix LLCH register read
LLCH is a 16 bit register. Use readw instead of readl API.

Signed-off-by: B, Jayachandran <jayachandran.b@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29 12:01:35 +01:00
Kuninori Morimoto e0c4211854 ASoC: rcar: remove rsnd_kctrl_remove()
Current rcar driver is trying to remove kctrl when remove time.
But, 1) rcar driver can't/shouldn't remove before removing sound
card driver, 2) sound card driver will call snd_ctl_dev_free()
and removes all kctrls by snd_ctl_remove().
Thus, rsnd_kctrl_remove() is not necessary. Current implementation
will get Oops when removing rcar driver after sound card.
This patch fix this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29 12:01:10 +01:00
Ryder Lee 8625c1dbd8 ASoC: mediatek: Add mt2701-wm8960 machine driver
Add wm8960 machine driver and config option for MT2701.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29 11:37:53 +01:00
Takashi Sakamoto 5992e30034 ALSA: firewire-motu: add support for MOTU 828mk3 (FireWire/Hybrid) as a model with protocol version 3
MOTU 828mk3 (FireWire/Hybrid) is one of third generation in MOTU FireWire
series, produced in 2008/2014. This model consists of three chips for
functionality on IEEE 1394 bus:

 * TI TSB41AB2 (Physical layer for IEEE 1394 bus)
 * Xilinx Spartan-3E FPGA Family (Link layer for IEEE 1394 bus, packet
   processing and data block processing layer)
 * TI TMS320C6722 (Digital signal processing)

This commit adds a support for this model, with its unique protocol as
version 3. This protocol has some additional features to protocol
version 2.

 * Support several optical interfaces.
 * Support a data chunk for return of reverb effect.
 * Have a quirk of tx packets.
 * Support heartbeat asynchronous transaction.

In this protocol, series of transferred packets has some quirks. Below
fields in CIP headers of the packets are out of IEC 61883-1:
 - SID (source node id): always 0x0d
 - DBS (data block size): always 0x04
 - DBC (data block counter): always 0x00
 - EOH (End of header): always 0x00

Below is an actual sample of transferred packets.

quads CIP1       CIP2
520   0x0D040400 0x22FFFFFF
  8   0x0D040400 0x22FFFFFF
520   0x0D040400 0x22FFFFFF
520   0x0D040400 0x22FFFFFF
  8   0x0D040400 0x22FFFFFF

Status of clock is configured by write transactions to 0x'ffff'f000'0b14,
as well as version 2, while meanings of fields are different from the
former protocols. Modes of optical interfaces are configured by write
transactions to 0x'ffff'f000'0c94.

Drivers can register its address to receive heatbeat transactions from the
unit. 0x'ffff'f000'0b0c is for the higher part and 0x'ffff'f000'0b10 is
for the lower part. Nevertheless, this feature is not useless for this
driver and this commit omits it.

Each data block consists of two parts in a point of the number of included
data chunks. In both of 'fixed' and 'differed' parts, the number of
included data blocks are a multiple of 4, thus depending on models there's
some empty data chunks. For example, 828mk3 includes one pair of empty
data chunks in its fixed part. When optical interface is configured to
S/PDIF, 828mk3 includes one pair of empty data chunks in its differed part.
To reduce consumption of CPU cycles with additional conditions/loops, this
commit just exposes these empty chunks to user space as PCM channels.

Additionally, 828mk3 has a non-negligible overhead to change its sampling
transfer frequency. When softwares send asynchronous transaction to
perform it, LED on the unit starts to blink. In a worst case, it continues
blink during several seconds; e.g. 10 seconds. When stopping blinking,
the unit seems to be prepared for the requested sampling transfer
frequency. To wait for the preparation, this commit forces the driver
to call task scheduler and applications sleeps for 4 seconds.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:34:13 +02:00
Takashi Sakamoto 2128f78f75 ALSA: firewire-lib: add a quirk of packet without valid EOH in CIP format
In IEC 61883-1, when two quadlets CIP header is used, the most significant
bit in second CIP header stands. However, packets from units with MOTU
protocol version 3 have a quirk without this flag. Current packet streaming
layer handles this as protocol error.

This commit adds a new enumeration constant for this quirk, to handle MOTU
protocol version 3.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:34:11 +02:00
Takashi Sakamoto 949613e366 ALSA: firewire-motu: add support for MOTU 828mk2 as a model with protocol version 2
MOTU 828mk2 is one of second generation in MOTU FireWire series, produced in
2003. This model consists of four chips:
 * TI TSB41AB2 (Physical layer for IEEE 1394 bus)
 * PDI 1394L40BE (Link layer for IEEE 1394 bus and packet processing layer)
 * ALTERA ACEX 1K EP1K30 Series FPGA (Data block processing layer)
 * TI TMS320VC5402 (Digital signal processing)

This commit adds a support for this model, with its unique protocol as
version 2. The features of this protocol are:

 * Support data chunks for status and control messages for both
   directions.
 * Support a pair of MIDI input/output.
 * Support a data chunk for mic/instrument independent of analog line in.
 * Support a data chunk for playback return.
 * Support independent data chunks for S/PDIF of both optical/coaxial
   interfaces.
 * Support independent data chunks for each of main out and phone out.

Status of clock is configured by write transactions to 0x'ffff'f000'0b14.
Modes of optical interfaces are configured by write transactions to
0x'ffff'f000'0c04.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:34:08 +02:00
Takashi Sakamoto 5aaab1bf37 ALSA: firewire-motu: enable to read transaction cache via hwdep interface
MOTU FireWire series can transfer messages to registered address. These
messages are transferred for the status of internal clock synchronization
just after starting streams.

When the synchronization is stable, it's 0x01ffffff. Else, it's 0x05ffffff.

This commit adds a functionality for user space applications to receive
content of the message.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:34:06 +02:00
Takashi Sakamoto 71c3797779 ALSA: firewire-motu: add hwdep interface
This commit adds hwdep interface so as the other sound drivers for units
on IEEE 1394 bus have.

This interface is designed for mixer/control applications. By using this
interface, an application can get information about firewire node, can
lock/unlock kernel streaming and can get notification at starting/stopping
kernel streaming.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:34:02 +02:00
Takashi Sakamoto 9e796e7d59 ALSA: firewire-motu: add MIDI functionality
In MOTU FireWire series, MIDI messages are multiplexed to isochronous
packets as well as PCM frames, while the way is different from the one
in IEC 61883-6.

MIDI messages are put into a certain position in message chunks. One data
block can includes one byte of the MIDI messages. When data block includes
a MIDI byte, the block has a flag in a certain position of the message
chunk. These positions are unique depending on protocols.

Once a data block includes a MIDI byte, some following data blocks includes
no MIDI bytes. Next MIDI byte appears on a data block corresponding to
next cycle of physical MIDI bus. This seems to avoid buffer overflow caused
by bandwidth differences between IEEE 1394 bus and physical MIDI bus.

This commit adds MIDI functionality to transfer/receive MIDI messages.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:56 +02:00
Takashi Sakamoto dd49b2d1f0 ALSA: firewire-motu: add PCM functionality
This commit adds PCM functionality to transmit/receive PCM samples.

When one of PCM substreams are running or external clock source is
selected, current sampling rate is used. Else, the sampling rate is
changed according to requests from a userspace application.

Available number of samples in a frame of PCM substream is determined at
open(2) to corresponding PCM character device. Later, packet streaming
starts by ioctl(2) with SNDRV_PCM_IOCTL_PREPARE. In theory, between them,
applications can change state of the unit by any write transaction to
change the number. In this case, this driver may fail packet streaming due
to wrong data format.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:53 +02:00
Takashi Sakamoto 4638ec6ede ALSA: firewire-motu: add proc node to show current statuc of clock and packet formats
This commit adds a proc node for debugging purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:51 +02:00
Takashi Sakamoto 9b2bb4f2f4 ALSA: firewire-motu: add stream management functionality
This commit adds a functionality to manage packet streaming for MOTU
FireWire series.

The streaming is not controlled by CMP, thus against IEC 61883-1. Write
transaction to certain addresses start/stop packet streaming.

Transactions to 0x'ffff'f000'0b00 results in isochronous channel number for
both directions and starting/stopping transmission of packets. The
isochronous channel number is represented in 6 bit field, thus units can
identify the channels up to 64, as IEEE 1394 bus specification described.

Transactions to 0x'ffff'f000'0b10 results in packet format for both
directions and transmission speed. When each of data block includes fixed
part of data chunks only, corresponding flags stand.

When bus reset occurs, the units continue to transmit packets with
non-contiguous data block counter. This causes discontinuity detection in
packet streaming engine and ALSA PCM applications receives EPIPE from any
I/O operation. In this case, typical applications manage to recover
corresponding PCM substream. This behaviour is kicked much earlier than
callback of bus reset handler by Linux FireWire subsystem, therefore
status of packet streaming is not changed in the handler.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:34 +02:00
Takashi Sakamoto 2e76701bbb ALSA: firewire-motu: handle transactions specific for MOTU FireWire models
All models of MOTU FireWire series can be controlled by write transaction
to addresses in a range from 0x'ffff'f0000'0b00 to 0x'ffff'f000'0cff.

The models support asynchronous notification. This notification has 32 bit
field data, and is transferred when status of clock changes. Meaning of
the value is not enough clear yet.

Drivers can register its address to receive the notification. Write
transaction to 0x'ffff'f000'0b04 registers higher 16 bits of the address.
Write transaction to 0x'ffff'f0000'0b08 registers the rest of bits. The
address includes node ID, thus it should be registered every time of bus
reset.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:32 +02:00
Takashi Sakamoto 4641c93940 ALSA: firewire-motu: add MOTU specific protocol layer
MOTU FireWire series uses blocking transmission for AMDTP packet streaming.
They transmit/receive 8,000 packets per second, to handle the same number
of data blocks as current sampling transmission frequency. Thus,
IEC 61883-1/6 packet streaming engine of ALSA firewire stack is available
for them.

However, the sequence of packet and data blocks includes some quirks.
Below sample is a sequence of CIP headers of packets received by 828mk2,
at 44.1kHz of sampling transmission frequency.

quads CIP1        CIP2
488   0x020F04E8  0x8222FFFF
  8   0x020F04F8  0x8222FFFF
488   0x020F0400  0x8222FFFF
488   0x020F0408  0x8222FFFF
  8   0x020F04E8  0x8222FFFF
488   0x020F04F0  0x8222FFFF
488   0x020F04F8  0x8222FFFF

The SID (source node ID), DBS (data block size), SPH (source packet header),
FMT (format ID), FDF (format dependent field) and SYT (time stamp) fields
are in IEC 61883-1. Especially, FMT is 0x02, FDF is 0x22 and SYT is 0xffff
to define MOTU specific protocol. In an aspect of dbc field, the value
represents accumulated number of data blocks included the packet. This
is against IEC 61883-1, because according to the specification this value
should be the number of data blocks already transferred.

In ALSA IEC 61883-1/6 engine, this quirk is already supported by
CIP_DBC_IS_END_EVENT flag, because Echo Audio Fireworks has.

Each data block includes SPH as its first quadlet field, to represent its
presentation time stamp. Actual value of SPH is compliant to IEC 61883-1;
lower 25 bits of 32 bits width consists of 13 bits cycle count and 12 bits
cycle offset.

The rest of each data block consists of 24 bit chunks. All of PCM samples,
MIDI messages, status and control messages are transferred by the chunks.
This is similar to '24-bit * 4 Audio Pack' in IEC 61883-6. The position of
each kind of data depends on generations of each model. The number of
whole chunks in a data block is a multiple of 4, to consists of
quadlet-aligned packets.

This commit adds data block processing layer specific for the MOTU
protocol. The remarkable point is the way to generate SPH header. Time
stamps for each data blocks are generated by below calculation:

 * Using pre-computed table for the number of ticks per event
  *  44,1kHz: (557 + 123/441)
  *  48.0kHz: (512 +   0/441)
  *  88.2kHz: (278 + 282/441)
  *  96.0kHz: (256 +   0/441)
  * 176.4kHz: (139 + 141/441)
  * 192.0kHz: (128 +   0/441)
 * Accumulate the ticks and set the value to SPH for every events.
 * This way makes sense only for blocking transmission because this mode
   transfers fixed number or none of events.

This calculation assumes that each data block has a PCM frame which is
sampled according to event timing clock. Current packet streaming layer
has the same assumption.

Although this sequence works fine for MOTU FireWire series at sampling
transmission frequency based on 48.0kHz, it is not enough at the frequency
based on 44.1kHz. The units generate choppy noise every few seconds.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:30 +02:00
Takashi Sakamoto 9dae017bf6 ALSA: firewire-lib: enable CIP_DBC_IS_END_EVENT for both directions of stream
Commit c8bdf49b9935("ALSA: fireworks/firewire-lib: Add a quirk for the
meaning of dbc") adds CIP_DBC_IS_END_EVENT flag just for tx packets.
However, MOTU FireWire series has this quirk for rx packets.

This commit allows both directions with the flag.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:28 +02:00
Takashi Sakamoto 9863874f02 ALSA: firewire-lib: add support for source packet header field in CIP header
In IEC 61883-1, CIP headers can have a SPH field. When a packet has 1 in
SPH field of its CIP header, the packet has a source packet headers. A
source packet header consists of 32 bit field (= 1 quadlet) and it
transfers time stamp, which is the same value as the lower 25 bits of the
IEEE 1394 CYCLE_TIMER register and the rest is zero.

This commit just supports source packet header field because IEC 61883-1
includes ambiguity the position of this header and its count. Each
protocol layer is allowed to have actual implementation according its
requirements.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:26 +02:00
Takashi Sakamoto a04513f8b1 ALSA: firewire-lib: record cycle count for the first packet
Currently, packet streaming layer passes generated SYT value to data block
processing layer. However, this is not enough in a case that the data block
processing layer generates time stamps by its own ways.

For out-packet stream, the packet streaming layer guarantees 8,000 times
calls of data block processing layers per sec. Therefore, when cycle count
of the first packet is recorded, data block processing layers can calculate
own time stamps with the recorded value.

For the reason, this commit allows packet streaming layer to record the
first cycle count. Each data block processing layer can read the count by
accessing a member of structure for packet streaming layer.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:24 +02:00
Takashi Sakamoto 59f6482c21 ALSA: firewire-motu: add an abstraction layer for three types of protocols
In an aspect of used protocols to communicate, models of MOTU FireWire
units are categorized to three generations.

This commit adds an abstraction layer of the protocols for features
related to packet streaming functionality. This layer includes 5
operations.

When configuring packet streaming functionality with sampling rate and
sampling transmission frequency, .get_clock_rate and .set_clock_rate are
called with proper arguments. MOTU FireWire series supports up to 192.0kHz.

When checking current source of sampling clock (not clock for packetization
layer), .get_clock_source is used. Enumeration is added to represent the
sources supported by this series. This operation can be used to expose
available sampling rate to user space applications when the unit is
configured to use any input signal as source of clock instead of crystal
clock.

In the protocols, the path between packet processing layer and digital
signal processing layer can be controlled. This looks a functionality to
'mute' the unit. For this feature, .switch_fetching_mode is added. This
can be used to suppress noises every time packet streaming starts/stops.

In a point of the size of data blocks at a certain sampling transmission
frequency, the most units accept several modes. This is due to usage of
optical interfaces. The size differs depending on which modes are
configured to the interfaces; None, S/PDIF and ADAT. Additionally, format
of packet is different depending on protocols. To cache current size of
data blocks and its format, .cache_packet_formats is added. This is used
by PCM functionality, packet streaming functionality and data block
processing layer.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:23 +02:00
Takashi Sakamoto 5e03c33e3d ALSA: firewire-motu: add a structure for model-dependent parameters.
MOTU FireWire series doesn't tell drivers their capabilities, thus
the drivers should have and apply model-dependent parameters to detected
models.

This commit adds a structure to represent such parameters. Capabilities
are represented by enumeration except for the number of analog line
in/out. Identification name also be in the structure because the units has
no registers for this purpose.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:21 +02:00
Takashi Sakamoto 8865a31e0f ALSA: firewire-motu: postpone sound card registration
Just after appearing on IEEE 1394 bus, this unit generates several bus
resets. This is due to loading firmware from on-board flash memory and
initialize hardware. It's better to postpone sound card registration.

This commit applies this idea.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:19 +02:00
Takashi Sakamoto 6c3cef4890 ALSA: firewire-motu: add skeleton for Mark of the unicorn (MOTU) FireWire series
This commit adds an new driver for MOTU FireWire series. In this commit,
this driver just creates/removes card instance according to bus event.
More functionalities will be added in following commits.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-28 12:33:16 +02:00
Charles Keepax 8e71321d19 ASoC: cs35l35: Clear reset_gpio on the error path in probe
The error path in probe attempts to put the device back into reset.
Should we fail to get the reset_gpio (such as a probe defer) we will
leave the error value in there, which the gpiod_set_value_cansleep on
the error path will attempt to deference.

Fix this issue by clearing reset_gpio before we head into the error
path.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-27 17:26:53 +01:00
Colin Ian King 74a4ce4c8e ASoC: intel: remove unused variable data and associated code
The variable 'data' is assigned null and never re-assigned. There
is also a redundant check for data being non-null which is always
false, so remove this and the variable data and dma_addr as they
are not used once the dead code has been removed.

Detected with CoverityScan, CID#1324015 ("'Constant' variable gaurds
dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-27 12:31:43 +01:00
Takashi Iwai 36d96039e7 ASoC: intel: Don't print FW version repeatedly
Intel SST driver spews an info message "FW Versoin xxxx" at each time
the device gets initialized.  Since it's triggered at each PM (or even
runtime PM), it appears so ofetn, and rather becomes annoying than
useful.

This patch suppresses the superfluous messages by checking the
currently loaded FW version with the previously loaded one.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-27 12:30:55 +01:00
Daniel Baluta 3c01b9ee2a ASoC: codec: wm8960: Relax bit clock computation
WM8960 derives bit clock from sysclock using BCLKDIV[3:0] of R8
clocking register (See WM8960 datasheet, page 71).

There are use cases, like this:
aplay -Dhw:0,0 -r 48000 -c 1 -f S20_3LE -t raw audio48k20b_3LE1c.pcm

where no BCLKDIV applied to sysclock can give us the exact requested
bitclk, so driver fails to configure clocking and aplay fails to run.

Fix this by relaxing bitclk computation, so that when no exact value
can be derived from sysclk pick the closest value greater than
expected bitclk.

Suggested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:53:06 +00:00
Daniel Baluta 3ddc97211c ASoC: codec: wm8960: Refactor sysclk freq search
Add a separate function for finding (sysclk, lrclk, bclk)
when the clock is auto or mclk. This makes code easier to
read and reduces the indentation level in wm8960_configure_clocking.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:53:04 +00:00
Dmitry Torokhov 73548dd316 ASoC: jack - check status of GPIO-based pins on resume
For GPIO-backed pins that are not configured as wakeup sources, we may
miss change in their state that happens while system is suspended. Let's
use PM notifier to refresh their state upon resume.

Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:52:32 +00:00
Kuninori Morimoto 6b8530cc05 ASoC: rcar: ssi: don't set SSICR.CKDV = 000 with SSIWSR.CONT
R-Car Datasheet is indicating "SSICR.CKDV = 000 is invalid when
SSIWSR.WS_MODE = 1 or SSIWSR.CONT = 1".
Current driver will set CONT, thus, we shouldn't use CKDV = 000.
This patch fixup it.

Reported-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:49:45 +00:00
Hiroyuki Yokoyama dc2721564f ASoC: rcar: enable PCM RATE untile 192000
R-Car sound can handle untile 192000 rate.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:48:24 +00:00
Bhumika Goyal 381ca1d12e ASoC: blackfin: constify snd_soc_ops structures
Declare snd_soc_ops structures as const as they are only stored
in the ops field of a snd_soc_dai_link structure. This field is
of type const, so snd_soc_ops structures having this property
can be made const too.

Cross compiled the .o files for blackfin architecture.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:48:10 +00:00
Lucas Stach 971edb0a00 ASoC: simple-card: fix simple_dai clk lookup
The clock needs to be stored in the simple_dai structure, so it can
be enabled later on. This has been broken during the conversion to use
devm_* functions for the clk lookup.

Fixes: e984fd61e8 (ASoC: simple-card: use devm_get_clk_from_child())
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:46:36 +00:00
Arnaud Pouliquen 3c9d3f1bc2 ASoC: STI: Fix reader substream pointer set
reader->substream is used in IRQ handler for error case but is never set.
Set value to pcm substream on DAI startup and clean it on dai shutdown.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:44:07 +00:00
Kuninori Morimoto 991454e170 ASoC: core: remove pointless auxiliary from snd_soc_component
commit 1a653aa447 ("ASoC: core: replace aux_comp_list to ...")
tried to replace aux_comp_list to component_dev_list,
but it failed because of binding timing. Thus, Sylwester fixuped it by
commit d2e3a1358c ("ASoC: Fix binding and probing of auxiliary...").

One of main purpose of commit 1a653aa447 ("ASoC: core: replace...")
was remove replaceable list (= list_aux) from snd_soc_component by using
new "auxiliary" flags (but it failed).
Because of this background, current code has reborned card_aux_list
(= same as original list_aux), and almost pointless "auxiliary" flags.

Let's remove pointless "auxiliary" flags by this patch
This means, it is same as revert both
commit 1a653aa447 ("ASoC: core: replace aux_comp_list to ...") and
commit d2e3a1358c ("ASoC: Fix binding and probing of auxiliary...").

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-24 18:41:26 +00:00
Takashi Iwai 2d7d54002e ALSA: seq: Fix race during FIFO resize
When a new event is queued while processing to resize the FIFO in
snd_seq_fifo_clear(), it may lead to a use-after-free, as the old pool
that is being queued gets removed.  For avoiding this race, we need to
close the pool to be deleted and sync its usage before actually
deleting it.

The issue was spotted by syzkaller.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-24 17:11:00 +01:00
Arnd Bergmann 13f99ebdd6 ALSA: au88x0: avoid theoretical uninitialized access
The latest gcc-7.0.1 snapshot points out that we if nr_ch is zero, we never
initialize some variables:

sound/pci/au88x0/au88x0_core.c: In function 'vortex_adb_allocroute':
sound/pci/au88x0/au88x0_core.c:2304:68: error: 'mix[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
sound/pci/au88x0/au88x0_core.c:2305:58: error: 'src[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I assume this can never happen in practice, but adding a check here doesn't
hurt either and avoids the warning. The code has been unchanged since
the start of git history.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-24 11:59:51 +01:00
Hui Wang 3f307834e6 ALSA: hda - Adding a group of pin definition to fix headset problem
A new Dell laptop needs to apply ALC269_FIXUP_DELL1_MIC_NO_PRESENCE to
fix the headset problem, and the pin definiton of this machine is not
in the pin quirk table yet, now adding it to the table.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-23 09:39:55 +01:00
Harsha Priya d7fba9dcf6 ASoC: Intel: Update bxt_da7219_max98357a to add a new
This patch adds a platform clock widget to turn off the clock only when
both headset capture and headset playback are not in use. This removes
turning off the clock in hw_free so that the clock is on when
either capture or playback of headset is in progress.

Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-21 18:43:32 +00:00
Takashi Iwai c520ff3d03 ALSA: seq: Fix racy cell insertions during snd_seq_pool_done()
When snd_seq_pool_done() is called, it marks the closing flag to
refuse the further cell insertions.  But snd_seq_pool_done() itself
doesn't clear the cells but just waits until all cells are cleared by
the caller side.  That is, it's racy, and this leads to the endless
stall as syzkaller spotted.

This patch addresses the racy by splitting the setup of pool->closing
flag out of snd_seq_pool_done(), and calling it properly before
snd_seq_pool_done().

BugLink: http://lkml.kernel.org/r/CACT4Y+aqqy8bZA1fFieifNxR2fAfFQQABcBHj801+u5ePV0URw@mail.gmail.com
Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-21 14:01:10 +01:00
Takashi Iwai c6736a94d0 ALSA: x86: Make CONFIG_SND_X86 bool
CONFIG_SND_X86 is a menu config to filter only for x86-specific
drivers in its sub-menu, and this doesn't have to be tristate but
rather it should be a bool.  Also, like other sub-menu configs, it's
more user-friendly to be default=y; it's merely a menu config and the
actual drivers are configured in the sub-menu, after all.

Fixes: 287599cf2d ("ALSA: add Intel HDMI LPE audio driver for BYT/CHT-T")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-21 13:26:02 +01:00
Mylène Josserand d1792285ca ASoC: sun8i-codec: Convert to use SND_SOC_DAPM_AIF_IN
Update the driver to use SND_SOC_DAPM_AIF_IN instead of
SND_SOC_DAPM_DAC.
Rename the interface's widgets to be more precise on which slot
the interface is connected.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-21 12:16:30 +00:00
Mylène Josserand 79e26de814 ASoC: sun8i-codec: Fix space on audio-routing widget
An unwanted space is present in an audio widget's name on the dapm
routing. It causes an error on the recognition of this widget (error:
("no dapm match for AIF1 Slot 0 Right").

Remove the space fixes it.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-21 12:16:25 +00:00
Mylène Josserand 649d554361 ASoC: sun8i-codec: Update mixer to use SOC_DAPM_DOUBLE
Update the driver to use the new SOC_DAPM_DOUBLE definition
on the digital DAC mixer.
Update the names accordingly as, when they are shared, the
controls are not prefixed with the widget's name anymore.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-21 12:16:21 +00:00
Mylène Josserand a82f16188a ASoC: sun8i-codec: Remove analog "HP" widget
The "HP" widget is already present and take part to
the analog part (sun8i-codec-analog).

Remove it from the digital part as it is unnecessary.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-21 12:16:10 +00:00
Matthias Kaehlcke a16fbb85c7 ALSA: hda/ca0132: Remove double parentheses
The extra pairs of parantheses are not needed and causes clang to
generate warnings like this:

sound/pci/hda/patch_ca0132.c:1171:14: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
        if ((buffer == NULL))
             ~~~~~~~^~~~~~~
sound/pci/hda/patch_ca0132.c:1171:14: note: remove extraneous parentheses around the comparison to silence this warning
        if ((buffer == NULL))
            ~       ^      ~
sound/pci/hda/patch_ca0132.c:1171:14: note: use '=' to turn this equality comparison into an assignment
        if ((buffer == NULL))

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-20 12:55:01 +01:00
Bhumika Goyal 2261cf1ce6 ASoC: omap: constify snd_soc_ops structures
Declare snd_soc_ops structures as const as they are only stored
in the ops field of a snd_soc_dai_link structure. This field is
of type const, so snd_soc_ops structures having this property
can be made const too.

Cross compiled the .o files for arm architecture.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20 11:26:37 +00:00
Bhumika Goyal 424dfbf2c0 ASoC: mediatek: constify snd_soc_ops structures
Declare snd_soc_ops structures as const as they are only stored
in the ops field of a snd_soc_dai_link structure. This field is
of type const, so snd_soc_ops structures having this property
can be made const too.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20 11:25:47 +00:00
Bard Liao 17febfa607 ASoC: rt5665: fix wrong pre div reg of IF2 and IF3
The pre divider control register of IF1 and IF2/3 are different.
The driver used the same register for all interfaces which was a
mistake.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20 11:25:23 +00:00
Bard Liao 83749abaaf ASoC: rt5665: fix wrong shift rt5665_if2_1_adc_in_enum
The shift is RT5665_IF2_1_ADC_IN_SFT not RT5665_IF3_ADC_IN_SFT.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20 11:25:05 +00:00
Nicolas Iooss cd7d1eab85 ALSA: es1688: Use strcpy() instead of sprintf()
There is no point in using sprintf() without a format string when
strcpy() can perform the same operation.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-20 12:24:34 +01:00
Takashi Iwai ebe2aa911f Merge branch 'topic/for-4.12' into for-next 2017-03-20 12:24:26 +01:00
Linus Walleij b3bbef45e9 ASoC: wm8903: add regulator handling
The WM8903 has four different voltage inputs: AVDD, CPVDD, DBVDD
and DCVDD. On the Qualcomm APQ8060 Dragonboard these are all
supplied from proper regulators and thus need activating and
binding.

This is a quick-and-dirty solution just grabbing and enabling the
regulator supplies on probe() and disabling them on remove() and
the errorpath. More elaborate power management is likely possible.

I assume the nVidia designs using this codec have some hard-wired
always-on power and will be happy with using the dummy regulators
for this. But someone from the nVidia camp should probably check
whether they can bind these to proper regulators instead.

We also amend the DT binding document. A small change like this
does not warrant a separate patch for augmenting these.

Cc: devicetree@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20 11:24:05 +00:00
Jaroslav Kysela cc3a47a248 ALSA: hda - add support for docking station for HP 840 G3
This tested patch adds missing initialization for Line-In/Out PINs for
the docking station for HP 840 G3.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-20 12:18:05 +01:00
Jaroslav Kysela 04d5466a97 ALSA: hda - add support for docking station for HP 820 G2
This tested patch adds missing initialization for Line-In/Out PINs for
the docking station for HP 820 G2.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-20 12:18:00 +01:00
Takashi Iwai f363a06642 ALSA: ctxfi: Fix the incorrect check of dma_set_mask() call
In the commit [15c75b09f8d1: ALSA: ctxfi: Fallback DMA mask to 32bit],
I forgot to put "!" at dam_set_mask() call check in cthw20k1.c (while
cthw20k2.c is OK).  This patch fixes that obvious bug.

(As a side note: although the original commit was completely wrong,
 it's still working for most of machines, as it sets to 32bit DMA mask
 in the end.  So the bug severity is low.)

Fixes: 15c75b09f8 ("ALSA: ctxfi: Fallback DMA mask to 32bit")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-03-20 10:08:19 +01:00
Charles Keepax 5d3d0ad688 ASoC: cs35l35: Stash dev pointer directly rather than CODEC pointer
The driver stashes a CODEC pointer in the cs35l35_private structure,
which is used to obtain a struct device pointer for error messages in the
interrupt handler.

However, doing so is not very safe as the interrupt is registered, as it
should be in bus probe, but the CODEC pointer can't be safely stored until
the ASoC level probe. This leaves a window between the two probes where if
any interrupts are received a NULL pointer will be deferenced in the IRQ
handler.

Fix this issue by saving a pointer to the device directly and passing that
to the error messages in the interrupt handler rather than using the CODEC
pointer to access the device pointer.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-17 21:40:31 +00:00
Kuninori Morimoto d27f3b4a2d ASoC: simple-scu-card: add new simple_priv_to_card() macro
Current simple card driver is directly calling priv->snd_card
everywhere, but it makes unreadable code.
Let's use simple_priv_to_card() macro for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:10:37 +00:00
Kuninori Morimoto 5be509576c ASoC: simple-card: add new simple_priv_to_card() macro
Current simple card driver is directly calling priv->snd_card
everywhere, but it makes unreadable code.
Let's use simple_priv_to_card() macro for it

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:10:37 +00:00
Kuninori Morimoto 40b68dac75 ASoC: simple-scu-card: use defined dev on probe()
Current asoc_simple_card_probe() already has dev definition,
but some place doesn't use it. Let's fix this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:10:36 +00:00
Kuninori Morimoto dcee9bfe89 ASoC: simple-card: use defined dev on probe()
Current asoc_simple_card_probe() already has dev definition,
but some place doesn't use it. Let's fix this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:10:36 +00:00
Bard Liao 9b5d3865b3 ASoC: rt5665: set i2s pin share configuration
I2S2 and I2S3 are share pins. We need to configure it when i2s is
active and disable it when i2s is inactive. To disable i2s pins
means to set them as gpio.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:08:04 +00:00
Bard Liao 763811987d ASoC: rt5665: fix define of RT5665_HP_DRIVER_5X
It is (0x3 << 2), not (0x2 << 2).

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:07:50 +00:00
Kuninori Morimoto 9986943ef5 ASoC: rcar: dma: remove unnecessary "volatile"
commit 2a3af642eb20("ASoC: rcar: clear DE bit only in PDMACHCR...")
added rsnd_dmapp_bset(), but it used copy-paste. Thus, it had
unnecessary "volatile", and had below warning on x86.
This patch fix it.

   sound/soc/sh/rcar/dma.c: In function 'rsnd_dmapp_bset':
>> sound/soc/sh/rcar/dma.c:463:21: warning: passing argument 1 of \
   'ioread32' discards 'volatile' qualifier from pointer target \
   type [-Wdiscarded-qualifiers]
     u32 val = ioread32(addr);
                        ^~~~
   In file included from arch/x86/include/asm/io.h:203:0,
                    from arch/x86/include/asm/realmode.h:5,
                    from arch/x86/include/asm/acpi.h:33,
                    from arch/x86/include/asm/fixmap.h:19,
                    from arch/x86/include/asm/apic.h:10,
                    from arch/x86/include/asm/smp.h:12,
                    from include/linux/smp.h:59,
                    from include/linux/topology.h:33,
                    from include/linux/gfp.h:8,
                    from include/linux/idr.h:16,
                    from include/linux/kernfs.h:14,
                    from include/linux/sysfs.h:15,
                    from include/linux/kobject.h:21,
                    from include/linux/of.h:21,
                    from include/linux/of_dma.h:16,
                    from sound/soc/sh/rcar/dma.c:12:
   include/asm-generic/iomap.h:31:21: note: expected 'void *' \
   but argument is of type 'volatile void *'
    extern unsigned int ioread32(void __iomem *);
                        ^~~~~~~~
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16 14:07:25 +00:00
Mylène Josserand 9123aa8645 ASoC: sun8i-codec: Convert to use SND_SOC_DAPM_AIF_IN
Update the driver to use SND_SOC_DAPM_AIF_IN instead of
SND_SOC_DAPM_DAC.
Rename the interface's widgets to be more precise on which slot
the interface is connected.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 18:10:51 +00:00
Mylène Josserand 80405d44c3 ASoC: sun8i-codec: Fix space on audio-routing widget
An unwanted space is present in an audio widget's name on the dapm
routing. It causes an error on the recognition of this widget (error:
("no dapm match for AIF1 Slot 0 Right").

Remove the space fixes it.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 18:10:51 +00:00
Icenowy Zheng 6ff4eb7e5d ASoC: sun8i-codec-analog: split out line in
Allwinner V3s features an analog codec without LINEIN.

Split out this part, in order to prepare for the V3s analog codec.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 18:05:44 +00:00
Icenowy Zheng 3f48947d56 ASoC: sun8i-codec-analog: split out mic2
Allwinner V3s features an analog codec without MIC2.

Split out this part, in order to prepare for the V3s analog codec.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 18:05:32 +00:00
Bryce Ferguson e54fde6171 ASoC: Add AU1761 audio codec as selectable option
This commit adds the ADI AU1761 audio codec as a selectable option
in the kernel config.  Currently the driver can only be selected
for ADI blackfin devices or if SND_SOC_ALL_CODECS is enabled.

Signed-off-by: Bryce Ferguson <bryce.ferguson@rockwellcollins.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 18:04:40 +00:00
Kuninori Morimoto 62a10498af ASoC: rcar: clear DE bit only in PDMACHCR when it stops
R-Car datasheet indicates "Clear DE in PDMACHCR" for transfer stop,
but current code clears all bits in PDMACHCR.
Because of this, DE bit might never been cleared,
and it causes CMD overflow. This patch fixes this issue.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:28:47 +00:00
Dharageswari R bf3e5ef5d5 ASoC: Intel: Skylake: Fix parameter overwrite for KPB Module
KPB module default parameter were overwritten by the dynamic instance
id once use case is executed. This will cause module crash from
subsequent execution of use case as the updated parameters are used.

So instead of over writing the default parameter, make a copy and
update the module parameter and use this in IPC message.

Signed-off-by: Dharageswari R <dharageswari.r@intel.com>
Signed-off-by: Kranthikumar, GudishaX <gudishax.kranthikumar@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:28:22 +00:00
Jeeja KP b7d0254c51 ASoC: Intel: Skylake: Fix module load when module size > DMA buffer size
When module size > DMA buffer size, driver copies first chunk and waits
for the BDL complete interrupt. BDL complete interrupt never occurs and
wait time expires as module load IPC is not send to start the DMA from
DSP.

To fix the above issue need to follow the below steps:
1. After copying the first chunk, send the module load IPC to start the
DMA.
2. Wait for the BDL interrupt. Once interrupt is received, copy the
next chunk.
3. Continue step 2 till all bytes are copied.
4. When all the bytes are copied (bytes_left = 0), wait for module load
IPC response
5. Handled module load IPC response messages, check the load module IPC
response and wake up the thread to complete module load.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:28:18 +00:00
G Kranthi 7bd86a3059 ASoC: Intel: Skylake: Remove get dsp_ops in cleanup routine
dsp ops is already set in init, so use this in cleanup routine
instead of again retrieving it. Also constify struct skl_dsp_ops.

Signed-off-by: G Kranthi <gudishax.kranthikumar@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:28:15 +00:00
G Kranthi cb729d80b5 ASoC: Intel: Skylake: Disable notifications at boot after DSP FW init
DSP firmware sends notification every 1ms, which is disabled in runtime
suspend. But if a system has no runtime pm, we keep getting
notification, so disable after FW init as well.

Signed-off-by: G Kranthi <gudishax.kranthikumar@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:28:11 +00:00
Jeeja KP 3643ff10d4 ASoC: Intel: Skylake: Remove BE prepare ops
Remove BE prepare ops which enables MCLK by default. If MCLK is required
to be enabled for any specific platform, it needs to be enabled in the
corresponding machine driver.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:28:08 +00:00
Jeeja KP 03de8c2ef8 ASoC: Intel: bxtn: Reload the firmware in case of D3 failure
If D3 IPC fails or times out, firmware needs to be reloaded as driver
continues the reset.
So set the fw_load flag to false to reload the firmware in D0.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:28:04 +00:00
Jeeja KP 1fb344a33a ASoC: Intel: bxtn: Update DSP core state in D0
In system suspend, firmware needs to be re-downloaded as IMR is cleared.
When firmware is downloaded in D0, core state is not set to running
state causing instability with subsequent D0-D3 cycles.

So set the core state correctly during D0 and check the DSP core state
if not in reset to set the DSP to D3.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:28:01 +00:00
Jeeja KP 5518af9f97 ASoC: Intel: bxtn: Disable interrupt when DSP is in D3
When DSP is in D3, no interrupts are expected, so disable
interrupt while entering D3.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:27:58 +00:00
Guneshwor Singh 3b563e0a84 ASoC: Intel: Skylake: Fix not to stop src pipe in pre pmd event handler
If the widget is a mixin module, just unbind between source and sink
and don't stop the source pipe as there can be multiple sinks
connected.

Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:27:54 +00:00
Jeeja KP 6914968b82 ASoC: Intel: Skylake: Fix to delete DSP pipe after stopping pipe
DSP pipe needs to stopped before deleting the pipe. Currently check is
for pipe state > STARTED, which is incorrect. So changed to include
pipe state STARTED to stop the pipe if it started.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 17:27:44 +00:00
Bhumika Goyal 5ace37bd79 ASoC: fsl: constify snd_soc_ops structures
Declare snd_soc_ops structures as const as they are only stored
in the ops field of a snd_soc_dai_link structure. This field is
of type const, so snd_soc_ops structures having this property
can be made const too.

The following .o files did not compile:
sound/soc/fsl/{p1022_rdk.c/p1022_ds.c/mpc8610_hpcd.c}

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 13:34:32 +00:00
Bhumika Goyal 943b73112d ASoC: pxa: constify snd_soc_ops structures
Declare snd_soc_ops structures as const as they are only stored
in the ops field of a snd_soc_dai_link structure. This field is
of type const, so snd_soc_ops structures having this property
can be made const too.

The .o files did not compile for all the changed .c files.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-15 13:34:16 +00:00
Bard Liao 28d2ca39be ASoC: rt5665: move set_sysclk to codec level
Move set_sysclk to codec level and people can use it at both
codec and dai level.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:56:13 +00:00
Bard Liao ccd00d5911 ASoC: rt5665: move set_pll to codec level
Move set_pll function to codec level and people can use it at both
codec and dai level. Also, lower case "source" to keep it consistent.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:56:12 +00:00
Dan Carpenter bfe41c678d ASoC: cs35l35: returning uninitialized in probe()
If cs35l35->pdata.stereo is false then "ret" isn't initialized.

Fixes: 6387f866a2 ("ASoC: Add support for Cirrus Logic CS35L35 Amplifier")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:54:38 +00:00
kbuild test robot f3a612a655 ASoC: cs35l35: fix semicolon.cocci warnings
sound/soc/codecs/cs35l35.c:706:2-3: Unneeded semicolon
sound/soc/codecs/cs35l35.c:543:4-5: Unneeded semicolon
sound/soc/codecs/cs35l35.c:553:4-5: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:47:56 +00:00
Colin Ian King 03ff570c6b ASoC: cs35l35: trivial fix to indentation
Remove extraneous tab to correct the nesting level indentation

Detected by CoverityScan, CID#1416584 ("Nesting level does
not match indentation")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:47:20 +00:00
Axel Lin 82875163a8 ASoC: cs35l35: Fix display revision id
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:44:47 +00:00
Pierre-Louis Bossart a9b6567d03 ASoC: Intel: Enable bytcht_nocodec machine driver
Make sure this machine driver is only used if enabled explicitly
and if there is no information found in the SSDT.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:41:18 +00:00
Pierre-Louis Bossart 759db1c466 ASoC: Intel: boards: add card for MinnowBoardMax/Up I2S access
Add card with dummy codec and DAI to make I2S signals observable.
Uses Mic and Speaker pins/widgets to control DAPM

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:41:15 +00:00
Pierre-Louis Bossart a63b8a117d ASoC: Intel: Atom: enable BYT/CHT+DA7213 machine driver
Add entries in HID table and reference to bytcht_da7213 driver

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:41:11 +00:00
Pierre-Louis Bossart 82cf89de2c ASoC: Intel: add machine driver for BYT/CHT + DA7213
Add new machine driver, tested with Ard-Audio-DA7212 [1]
connected to MinnowBoardMAX Turbot.

The MCLK is managed by the codec driver using the "mclk" handle
to reuse existing code, but it could just as well be handled
by this machine driver.

[1] http://www.dialog-semiconductor.com/content/ard-audio-da7212

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:41:06 +00:00
Pierre-Louis Bossart 8f42c23a98 ASoC: da7213: add ACPI support
Add DLGS7212 and DLGS7213 HID

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:18:08 +00:00
Charles Keepax bf5043d69c ASoC: cs35l35: Add IRQF_SHARED to IRQ flags
As it is quite common to use a stereo pair of amps but share the IRQ
line between them both add the IRQF_SHARED flag whilst requesting
cs35l35's IRQ.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:09:25 +00:00
Charles Keepax 1f758cd9da ASoC: cs35l35: Add local variable for dev in probe
Tidy up the code a little by adding a local variable for i2c_client->dev
rather than referring to it explicitly everytime.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:09:21 +00:00
Charles Keepax 8d45f2d238 ASoC: cs35l35: Add for configuring drive mode in unused slots
Add support for setting how the I2S pins are driven in unused slots,
currently the chip will just use the default of drive 0, however this
causes issues when multiple devices are attached to the same bus.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:09:17 +00:00
Charles Keepax 1bb06ada03 ASoC: cs35l35: Add missing return in probe
A return statement is missing just before the error paths at the end of
probe. This causes us to fall straight into the error path and disable
the supplies and re-enable reset, as these are only controlled during
probe this causes the part to no longer function.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:09:10 +00:00
Takashi Sakamoto 998d6fb512 ASoC: Intel: Skylake: code cleanup for pin fixup limitation
As a commit 4cd9899f0d ("ASoC: Intel: Skylake: Add multiple pin
formats") describes, 'fixups is applied to pin 0 only'. On the other
hand, the commit left some codes as what they were. This might
confuses readers.

This commit fixes the issue. This doesn't change driver behaviour at all.

Fixes: 4cd9899f0d ("ASoC: Intel: Skylake: Add multiple pin formats")
Signed-off-by: Takashi Sakamoto <takashi.sakamoto@miraclelinux.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 16:07:41 +00:00
Hiroyuki Yokoyama a1c2ff5372 ASoC: rsnd: fix sound route path when using SRC6/SRC9
This patch fixes the problem that the missing value of the route path
setting table and incorrect values are set in the CMD_ROUTE_SELECT
register.

Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
[Kuninori: shared data on MIX and non-MIX case]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13 12:58:07 +00:00
Masahiro Yamada 8a1115ff6b scripts/spelling.txt: add "disble(d)" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  disble||disable
  disbled||disabled

I kept the TSL2563_INT_DISBLED in /drivers/iio/light/tsl2563.c
untouched.  The macro is not referenced at all, but this commit is
touching only comment blocks just in case.

Link: http://lkml.kernel.org/r/1481573103-11329-20-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-03-09 17:01:09 -08:00
Brian Norris d6c098a1db ASoC: don't dereference NULL pcm_{new,free}
Not all platform drivers have pcm_{new,free} callbacks. Seen with a
"snd-soc-dummy" codec from sound/soc/rockchip/rk3399_gru_sound.c.

Fixes: 99b04f4c40 ("ASoC: add Component level pcm_new/pcm_free")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-09 12:34:17 +01:00
Mylène Josserand fa22ca4f90 ASoC: sun8i-codec: Convert to SOC_MIXER_ARRAY
SOC_MIXER_ARRAY is a simplified function of SND_SOC_DAPM_MIXER
which handles automatically the ARRAY_SIZE of controls.

Update the driver to use SOC_MIXER_ARRAY.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 14:17:53 +01:00
Mylène Josserand ca14da6e61 ASoC: sun8i-codec: Update mixer to use SOC_DAPM_DOUBLE
Update the driver to use the new SOC_DAPM_DOUBLE definition
on the digital DAC mixer.
Update the names accordingly as, when they are shared, the
controls are not prefixed with the widget's name anymore.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 14:17:49 +01:00
Mylène Josserand 4aa8146c89 ASoC: sun8i-codec: Remove analog "HP" widget
The "HP" widget is already present and take part to
the analog part (sun8i-codec-analog).

Remove it from the digital part as it is unnecessary.

Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 14:17:44 +01:00
Bard Liao 39841944c6 ASoC: rt5665: enhance jack type detection function
Use manual mode for jack detection function to increase accuracy.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:48:03 +01:00
Bard Liao 948059ddf9 ASoC: rt5665: enable TDM if more than 2 channels
TDM is necessary for more than 2 channels. And there is no control bit
to specify which slots are using. Machine driver will not need to call
snd_soc_dai_set_tdm_slot if we do it in rt5665_hw_params.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:47:53 +01:00
Bard Liao 246126b0a4 ASoC: rt5665: increase button detection accuracy
Use sar adc for button detection to increase accuracy.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:47:52 +01:00
Bard Liao 09b50c3703 ASoC: rt5665: CLKDET is also a power of ASRC
We need to power on CLKDET to use ASRC function.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:45:14 +01:00
Bard Liao 8f365313be ASoC: rt5665: Vref3 is necessary for Mono Amp
Vref3 is necessary for Mono Amp. So add it to dapm routes

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:45:14 +01:00
Bard Liao 593dd5d9fb ASoC: rt5665: increase LDO level
Too low LDO level will cause a few functions unstable.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 13:45:13 +01:00
Bard Liao f1994a9c09 ASoC: rt5665: fix getting wrong work handler container
We got rt5665 private data from wrong work. It will result in kernel
panic.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2017-03-08 13:44:10 +01:00
Alin Grigorean cb7d53b499 ASoC: fsl: Remove unneeded init of static variable
This was reported by checkpatch.pl

Signed-off-by: Alin Grigorean <alin.grig93@gmail.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 11:11:51 +01:00
Takashi Sakamoto 8e15e762cd ASoC: Intel: Skylake: use a helper macro to rounding-up calculation
In 'include/linux/kernel.h', there's a helper macro to round numerical
value. Let's use it.

Signed-off-by: Takashi Sakamoto <takashi.sakamoto@miraclelinux.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 11:02:42 +01:00
Lucas Stach 70d435ba1c ASoC: imx-pcm-dma: simplify pcm_config
The generic snd_dmaengine_pcm is able to retrieve all the needed
information from the attached dmaengine and is in fact able to
provide much more accurate flags to userspace, like the SDMA engine
being only able to operate in batch mode.

To avoid any future inconsistencies between the dmaengine and the
pcm_config, rip out the fixed config and rely on the core to fill
in the right flags derived from the dmaengine information.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08 10:58:42 +01:00
Songjun Wu cd3ac9affc ASoC: atmel-classd: fix audio clock rate
Fix the audio clock rate according to the datasheet.

Reported-by: Dushara Jayasinghe <dushara@successful.com.au>
Signed-off-by: Songjun Wu <songjun.wu@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2017-03-07 15:20:32 +01:00
Takashi Sakamoto d1a6fe41d3 ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer
In 'skl_tplg_set_module_init_data()', a pointer to 'params' member of
'struct skl_algo_data' is calculated, then casted to (u32 *) and assigned
to a member of configuration data. The configuration data is passed to the
other functions and used to process intel IPC. In this processing, the
value of member is used to get message data, however this can bring invalid
memory access in 'skl_set_module_params()' as a result of calculation of
a pointer for actual message data.

(sound/soc/intel/skylake/skl-topology.c)
skl_tplg_init_pipe_modules()
->skl_tplg_set_module_init_data() (has this bug)
->skl_tplg_set_module_params()
  (sound/soc/intel/skylake/skl-messages.c)
  ->skl_set_module_params()
    ((char *)param) + data_offset

This commit fixes the bug.

Fixes: abb740033b ("ASoC: Intel: Skylake: Add support to configure module params")
Signed-off-by: Takashi Sakamoto <takashi.sakamoto@miraclelinux.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org> # v4.5+
2017-03-07 15:19:39 +01:00
Codrut Grosu 84052652fe ASoC: txx9: Added requiered spaces.
This was reported by checpatch.pl

Signed-off-by: Codrut GROSU <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 15:18:35 +01:00
Calin Cruceru 114ab993e1 ASoC: samsung: Remove extra blank lines
This was reported by checkpatch.pl

Signed-off-by: Calin Cruceru <calin@rosedu.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 15:17:49 +01:00
Jerome Brunet ea2a2ad17c ASoC: dio2125: use gpiod_set_value_cansleep
Use the "cansleep" variant of gpiod_set_value so the driver can be used
with slow gpio controllers as well.

Fixes: 85825d5e88 ("ASoC: dio2125: add dio2125 amp driver")
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:56:06 +01:00
Codrut Grosu 7be5c5fe92 ASoC: pxa: Add space around '='
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:32:21 +01:00
Codrut Grosu adbdba3fa1 ASoC: sirf: Added blank line after declarations
This was reported by checkpatch.pl

Signed-off-by: Codrut GROSU <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:31:51 +01:00
Codrut Grosu fe3a980cd3 ASoC: ux500: Added blank line after declarations
This was reported by checkpatch.pl

Signed-off-by: Codrut GROSU <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:31:27 +01:00
Codrut Grosu b1c5d92372 ASoC: ux500: Remove unuseful break after return
This was reported by checkpatch.pl

Signed-off-by: Codrut GROSU <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:31:26 +01:00
Codrut Grosu 8fcf1e5eb4 ASoC: ux500: Added */ to the next line
This was reported by checkpatch.pl

Signed-off-by: Codrut GROSU <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:31:25 +01:00
Codrut Grosu c2dcce361a ASoC: txx9: Added blank line after declarations
This was reported by checkpatch.pl

Signed-off-by: Codrut GROSU <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:30:37 +01:00
Codrut Grosu bf3c6ef7f5 ASoC: tegra: Add blank line after declarations
This was reported by checkpatch.pl

Signed-off-by: Codrut GROSU <codrut.cristian.grosu@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:29:51 +01:00
Adriana Constantinescu 8804e073a8 ASoC: omap: Remove unnecessary 'out of memory' message
Out of memory message detected using checkpatch.pl

Signed-off-by: Adriana Constantinescu <constantinescu33@gmail.com>
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:29:09 +01:00
Codrut Grosu 34e82433c2 ASoC: pxa-ssp: Line up *s in block comments
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:28:46 +01:00
Codrut Grosu 17339f6099 ASoC: pxa: Remove unneeded return statement in void function
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:28:42 +01:00
Codrut Grosu 672e3cbe78 ASoC: pxa: Remove spaces before tabs
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:28:42 +01:00
Codrut Grosu ca87cfad69 ASoC: pxa: Add space around ':' and '('
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:28:41 +01:00
Codrut Grosu 05af0917aa ASoC: pxa: The open brace is placed with the previous line
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:27:43 +01:00
Codrut Grosu 291aaff0c6 ASoC: pxa: Remove unneeded else after return statement
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:27:43 +01:00
Codrut Grosu 3e22e9d702 ASoC: pxa: Remove space before semicolon
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:27:43 +01:00
Codrut Grosu 1dbe692380 ASoC: pxa-ssp: Added blank line after declarations
This was reported by checkpatch.pl

Signed-off-by: Codrut Grosu <codrut.cristian.grosu@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 14:27:42 +01:00
Adrian Dinu ec5a82d6c0 ASoC: Add space around '='
This was reported by checkpatch.pl

Signed-off-by: Adrian Dinu <adrian.dinu95@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:51:07 +01:00
Codrut Grosu e2c187a689 ASoC: tegra: Remove unnecessary 'out of memory' message
This was reported by checkpatch.pl

Signed-off-by: Codrut GROSU <codrut.cristian.grosu@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:50:49 +01:00
Jeeja KP 7d3f91dc1e ASoC: Intel: bxtn: optimize ROM init retries
During S3->S0 transition, sometime ROM init fails because of
authentication engine loads later than the OS. In this case driver
waits for a longer period and then retries the FW download causing
huge delay in resume time of audio device.

To avoid this, ROM INIT wait time is set to a optimal value and
increased the retries for firmware download.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:48:01 +01:00
Jeeja KP 31d648f051 ASoC: Intel: bxtn: Store the FW/Library context at boot
Store the DSP firmware/library at boot, so that for S3 to S0 transition
use the stored ctx for downloading the firmware to DSP memory.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:47:34 +01:00
Andy Shevchenko b3ec72ace9 ASoC: Intel: bdw-rt5677: Use devm_gpiod_get()
Since index is always 0 replace devm_gpiod_get_index() by devm_gpiod_get()
and apply proper flags.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:46:38 +01:00
Colin Ian King 08458871b6 ASoC: Intel: Skylake: fix spelling mistake: "allocationf" -> "allocation"
Trivial fix to spelling mistake in dev_err message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:46:02 +01:00
Jerome Brunet 85825d5e88 ASoC: dio2125: add dio2125 amp driver
The dio2125 is a stereo output driver with adjustable gain.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:37:11 +01:00
Brian Austin 6387f866a2 ASoC: Add support for Cirrus Logic CS35L35 Amplifier
This patch adds support for the Cirrus Logic
CS35L35 9V Boosted Amplifier

Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:29:33 +01:00
Charles Keepax 7b4af793a7 ASoC: wm_adsp: Acknowledge controls should also check the DSP is running
We should not be writing acknowledge controls until the firmware is
running, as in the case of preloaded firmwares the DSP memory may be
unaccessible to whilst in the preloaded state. This means a write to the
control during this time could be lost.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:07:59 +01:00
Charles Keepax 67430a39ca ASoC: wm_adsp: Return an error on write to a disabled volatile control
Volatile controls should only be accessed when the firmware is active,
currently however writes to these controls will succeed, but the data
will be lost, if the firmware is powered down. Update this behaviour such
that an error is returned the same as it is for reads.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-07 13:07:58 +01:00
Michał Kępień 44319ab7e0 platform/x86: dell-laptop: import dell_micmute_led_set() from drivers/leds/dell-led.c
To ensure all users of dell-smbios are in drivers/platform/x86, move the
dell_micmute_led_set() method from drivers/leds/dell-led.c to
drivers/platform/x86/dell-laptop.c.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2017-03-06 22:07:04 +01:00
Michał Kępień 5dba8804e8 ALSA: hda - rename dell_led_set_func to dell_micmute_led_set_func
With dell_app_wmi_led_set() replaced by dell_micmute_led_set(), rename
the function pointer to the latter for consistency.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2017-03-06 22:07:01 +01:00
Michał Kępień fa5923cea8 ALSA: hda - use dell_micmute_led_set() instead of dell_app_wmi_led_set()
The dell_app_wmi_led_set() method introduced in commit db6d8cc007
("dell-led: add mic mute led interface") was implemented as an easily
extensible entry point for other modules to set the state of various
LEDs.  However, almost three years later it is still only used to
control the mic mute LED, so it will be replaced with direct calls to
dell_micmute_led_set().

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Tested-by: Alex Hung <alex.hung@canonical.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2017-03-06 22:06:59 +01:00
Jerome Brunet 9000b59d7a ASoC: es7134: add es7134 DAC driver
The es7134 is 24bit, 192Khz i2s DA converter for PCM audio.
Datasheet is available here : http://www.everest-semi.com/pdf/ES7134LV%20DS.pdf

This driver is also compatible with the es7144, which is the same as the
es7134, with 2 additional pins for filtering capacitors.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:45:24 +01:00
Linus Walleij f1013cdeee ASoC: ux500: drop platform DAI assignments
This platform is completely probed by device tree nowadays, so
we need to do a bigger cleanup removing all the non-DT codepaths.
This cleanup must however go in as a fix since it fixes a
regression.

Currently when Ux500 audio is enabled, dmesg complains like
this:

entry->name == "prealloc"
entry->name == "prealloc_max"
entry->name == "prealloc"
------------[ cut here ]------------
WARNING: CPU: 0 PID: 95 at ../fs/proc/generic.c:346
proc_register+0xf0/0x110
proc_dir_entry 'sub0/prealloc' already registered
(...)
entry->name == "prealloc_max"
------------[ cut here ]------------
WARNING: CPU: 0 PID: 95 at ../fs/proc/generic.c:346
proc_register+0xf0/0x110
proc_dir_entry 'sub0/prealloc_max' already registered
(...)
snd-soc-mop500 soc🔉 ab8500-codec-dai.0 <->
80124000.msp mapping ok
entry->name == "prealloc"
entry->name == "prealloc_max"
entry->name == "prealloc"
------------[ cut here ]------------
WARNING: CPU: 0 PID: 95 at ../fs/proc/generic.c:346
proc_register+0xf0/0x110
proc_dir_entry 'sub0/prealloc' already registered
(...)
entry->name == "prealloc_max"
------------[ cut here ]------------
WARNING: CPU: 0 PID: 95 at ../fs/proc/generic.c:346
proc_register+0xf0/0x110
proc_dir_entry 'sub0/prealloc_max' already registered
snd-soc-mop500 soc🔉 ab8500-codec-dai.1 <->
80125000.msp mapping ok

This is because PCMs are created twice for the same hardware,
and this happens because both "platform" and "CPU" DAI links
are specified.

But platform/CPU is an either/or pair, not a both/and pair.
This has maybe worked in the past, but it is causing trouble
now, so let us begin the cleanups by removing the platform
assignment and silencing the boot noise, and make a proper DT
cleanup for the next kernel cycle.

Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:43:45 +01:00
Jeeja KP 2fe42dd0f1 ASoC: hdac_hdmi: don't update the iterator in pcm list remove
Fix not to update the iterator element, instead use list_del to remove
entry from the list.

This fixes the following coccinelle and static checker warning:
sound/soc/codecs/hdac_hdmi.c:1884:2-21:iterator with update on line
1885
sound/soc/codecs/hdac_hdmi.c:2011 hdac_hdmi_dev_remove()
	error: potential NULL dereference 'port'.

Fixes: e0e5d3e5a53b('ASoC: hdac_hdmi: Add support for multiple ports to a PCM')
Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:42:34 +01:00
Jeeja KP 04c8f2bf91 ASoC: hdac_hdmi: avoid reference to invalid variable of the pin list
Using pin list array iterator outside the iteration of the list can
point to dummy element, which can be invalid. So don't use pin variable
outside the pin list iteration.

This fixes the following coccinelle warning:
sound/soc/codecs/hdac_hdmi.c:1419:5-8: ERROR: invalid reference to the
index variable of the iterator

Fixes: 2acd8309a3a4('ASoC: hdac_hdmi: Add support to handle MST capable pin')
Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:42:29 +01:00
Liviu Dudau a03faba972 ASoC: TLV320AIC23: Unquote NULL from control name
Without this I am getting the following messages at boot on my Trimslice:
   tlv320aic23-codec 2-001a: Control not supported for path LLINEIN -> [NULL] -> Line Input
   tlv320aic23-codec 2-001a: ASoC: no dapm match for LLINEIN --> NULL --> Line Input
   tlv320aic23-codec 2-001a: ASoC: Failed to add route LLINEIN -> NULL -> Line Input
   tlv320aic23-codec 2-001a: Control not supported for path RLINEIN -> [NULL] -> Line Input
   tlv320aic23-codec 2-001a: ASoC: no dapm match for RLINEIN --> NULL --> Line Input
   tlv320aic23-codec 2-001a: ASoC: Failed to add route RLINEIN -> NULL -> Line Input
   tlv320aic23-codec 2-001a: Control not supported for path MICIN -> [NULL] -> Mic Input
   tlv320aic23-codec 2-001a: ASoC: no dapm match for MICIN --> NULL --> Mic Input
   tlv320aic23-codec 2-001a: ASoC: Failed to add route MICIN -> NULL -> Mic Input
   tegra-snd-trimslice sound: tlv320aic23-hifi <-> 70002800.i2s mapping ok

Signed-off-by: Liviu Dudau <liviu@dudau.co.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:41:11 +01:00
Romain Perier 89433a284d ASoC: rockchip: Enable 192khz in hw_params operation
As the sampling frequency is supported by es8328 in slave mode,
add support for it in the corresponding operation.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:41:03 +01:00
Romain Perier 2e589fdc35 ASoC: rockchip: Enable 192khz in hw_params operation
As the sampling frequency is supported by es8328 in slave mode,
add support for it in the corresponding operation.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:40:46 +01:00
Romain Perier 404785f9ef ASoC: es8328: Enabling support for 192k
The master and slave modes don't share the same table for MCLK/LRCLK
ratios. The slaves mode has bigger ratios that allow to use BCLK that
matche sampling frequency of 192khz.

This commit enables this rate only for slave mode, i.e it does not
declare this frequency in sysclk_contraints, resulting to an error in
master mode (not supported CLK).

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:40:17 +01:00
Romain Perier c7ad841eae ASoC: es8328: Simplify rates definition
Currently most of the standard rates are supported by this driver.
Instead of defining each supported rate one by one, we use the SND macro
SNDRV_PCM_RATE_8000_48000. Also adds support for 88.2khz as the codec
supports it and the sys clocks are already supported.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:40:15 +01:00
Romain Perier ae884ae78a ASoC: es8328: Let device auto detect ratios in slave mode
In master mode, SCLK and LRCLK signals are generated by the CODEC when
any of the ADC/DAC are enabled. SCLK is derived from MCLK via a
programmable division set by BLK_DIV, LRCLK is derived from MCLK via
another programmable division set by ADCFsRatio/DACFsRatio.

In slave mode, SCLK and LRCLK signals are received as inputs and
supplied externally. LRCLK and SCLK must be synchronously derived from
MCLK with specific rates. The device can auto detect MCLK/LRCLK ratio
according to a predefined table. LRCLK/SCLK ratio is usually 64 (SCLK =
64 * LRCLK)

This commits adds support to let to device auto detect and decide which
ratio to use. The mclkdiv2 and BCLK_DIV ratio and put to zero.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:40:15 +01:00
Kuninori Morimoto 4b30eebfc3 ASoC: rcar: avoid SSI_MODEx settings for SSI8
SSI8 is is sharing pin with SSI7, and nothing to do for SSI_MODEx.
It is special pin and it needs special settings whole system,
but we can't confirm it, because we never have SSI8 available board.

This patch fixup SSI_MODEx settings error for SSI8 on connection test,
but should be confirmed behavior on real board in the future.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-06 11:16:08 +01:00
Ingo Molnar 174cd4b1e5 sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h>
Fix up affected files that include this signal functionality via sched.h.

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-03-02 08:42:32 +01:00
Linus Torvalds 044d5dfd62 sound fixes for 4.11-rc1
A few last-minute fixes for rc1:
 
 - ALSA core timer and sequencer fixes for bugs spotted by syzkaller
 - A couple of trivial HD-audio fixups
 - Additional PCI / codec IDs for Intel Geminilake
 - Fixes for CT-XFi DMA mask bugs
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEECxfAB4MH3rD5mfB6bDGAVD0pKaQFAli2mQcOHHRpd2FpQHN1
 c2UuZGUACgkQbDGAVD0pKaTboA//fvaaaGlU+IUBvEHV8LlqyfHOUBIIyowYIeJE
 mQHV4lrdMa9vEfXpIB5bztrqRcB6O9Trw0l4gEZfkC+YgLdZKZXi/haSdVnYsHRi
 koD8ZM1EtNu8o9FzGhOg8Cefu+bvQCg/dAglt6oitf3av/j6NmpFwC3EZzcAosH/
 VE3VRBk8AyQj1DYmlfoc+i27ksO9OceQI9xvJvGwdbbwzBTH/dL+PGXCwfF88T2p
 CyUvxtCk2HohHMloV6PtbpdD+ldouZxRvQsiV6MRy0Wg+ARAILvjeS9gdn3UT2LE
 E5J2JLM1X0x5J82Hki3z9vctwvmZbifCj/ewlql+3gFgAAvt0/PiRYZ0W1jcUpK6
 5THLRwU8zCOuAhQxsEzhDZh6mQq/gV69mWdVCgp3Er5faZQm6LqPUsHp2+yB/0aK
 0mXFRCAIjJa62ddtl40LPkPtJoEX9M00+ILNeASjMhpZSM8KyuBUnqygCoB1Kxhv
 vOiNhfIzXl8wQl406o/nIiDzbOdK7Ze7GyT6DHNQtNaS/aA9lS5RxYfcxDGce6c4
 nm9bnfkvRypNeY+dQwX5KefOd+ilYLHcOevUv1rC395pby7rEuVuMl/j83Qr8Pof
 cIjdSFefCCCQafH37UZhQ31noBIrxNFwlDBJh2YLWVDj6tU5ikY4GnjZQnMX/uv9
 /6XhpiM=
 =hOYM
 -----END PGP SIGNATURE-----

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

Pull sound fixes from Takashi Iwai:
 "A few last-minute fixes for rc1:

   - ALSA core timer and sequencer fixes for bugs spotted by syzkaller

   - a couple of trivial HD-audio fixups

   - additional PCI / codec IDs for Intel Geminilake

   - fixes for CT-XFi DMA mask bugs"

* tag 'sound-fix-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: seq: Fix link corruption by event error handling
  ALSA: hda - Add subwoofer support for Dell Inspiron 17 7000 Gaming
  ALSA: ctxfi: Fallback DMA mask to 32bit
  ALSA: timer: Reject user params with too small ticks
  ALSA: hda: Add Geminilake HDMI codec ID
  ALSA: hda - Fix micmute hotkey problem for a lenovo AIO machine
  ALSA: hda - Add Geminilake PCI ID
2017-03-01 09:59:21 -08:00
Takashi Iwai f3ac9f7376 ALSA: seq: Fix link corruption by event error handling
The sequencer FIFO management has a bug that may lead to a corruption
(shortage) of the cell linked list.  When a sequencer client faces an
error at the event delivery, it tries to put back the dequeued cell.
When the first queue was put back, this forgot the tail pointer
tracking, and the link will be screwed up.

Although there is no memory corruption, the sequencer client may stall
forever at exit while flushing the pending FIFO cells in
snd_seq_pool_done(), as spotted by syzkaller.

This patch addresses the missing tail pointer tracking at
snd_seq_fifo_cell_putback().  Also the patch makes sure to clear the
cell->enxt pointer at snd_seq_fifo_event_in() for avoiding a similar
mess-up of the FIFO linked list.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 22:15:51 +01:00
Chris Chiu eeed4cd15a ALSA: hda/realtek - Fix speaker support for Asus AiO ZN270IE
Asus AiO ZN270IE with ALC256 has no audio ouput for internal speaker
and headphone. It requires GPIO 2 as an amp. This commit enables the
GPIO and pulls it high.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 21:32:04 +01:00
Chris Chiu 216d7aebbf ALSA: hda/realtek - Fix headset mic and speaker on Asus X441SA/X441UV
ASUS X441SA and X441UV laptops with ALC3236 (ALC223) codec require
the known fixup (ALC269_FIXUP_HEADSET_MIC) and a different pin value on
pin 0x19 to make the headset mic work.

To make the speaker work, it requires an EAPD verb fixup.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 21:32:02 +01:00
Chris Chiu c1732ede5e ALSA: hda/realtek - Fix headset and mic on several Asus laptops with ALC256
Enable jack sensing and fix internal mic and headset mic on
Asus X555UB and X540SA.

Fix internal mic and headset mic on Asus E402NA and E403NA.

Fix headset mic on Asus X541UV, X541SA and Z550SA.

Unfortunately jack sensing for the headset mic is still not working.
We believe this is a codec limitation.

Some of these quirks were authored by João Paulo Rechi Vita.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 21:32:01 +01:00
Chris Chiu 615966adc4 ALSA: hda/realtek - Fix headset mic on several Asus laptops with ALC255
Add pin quirks to enable use of the headset mic on Asus Z550MA,
X540LA, X540LJ, X556UR, Z450LA, and X441NC.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 21:32:00 +01:00
Chris Chiu 5824ce8de7 ALSA: hda/realtek - Add support for Acer Aspire E5-475 headset mic
The Acer laptop Aspire E5-475 with ALC255 can't detect the headset
microphone until we modify a pin definition.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 21:31:58 +01:00
Takashi Iwai 493de34274 ALSA: hda - Add subwoofer support for Dell Inspiron 17 7000 Gaming
Dell Inspiron 17 7000 Gaming laptop needs a similar quirk like
Inspiron 7599 to support its subwoofer speaker.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=194191
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 17:58:05 +01:00
Takashi Iwai 15c75b09f8 ALSA: ctxfi: Fallback DMA mask to 32bit
Currently ctxfi driver tries to set only the 64bit DMA mask on 64bit
architectures, and bails out if it fails.  This causes a problem on
some platforms since the 64bit DMA isn't always guaranteed.  We should
fall back to the default 32bit DMA when 64bit DMA fails.

Fixes: 6d74b86d3c ("ALSA: ctxfi - Allow 64bit DMA")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 17:58:02 +01:00
Takashi Iwai 71321eb3f2 ALSA: timer: Reject user params with too small ticks
When a user sets a too small ticks with a fine-grained timer like
hrtimer, the kernel tries to fire up the timer irq too frequently.
This may lead to the condensed locks, eventually the kernel spinlock
lockup with warnings.

For avoiding such a situation, we define a lower limit of the
resolution, namely 1ms.  When the user passes a too small tick value
that results in less than that, the kernel returns -EINVAL now.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 15:06:01 +01:00
Mihai Burduselu a65895e0ee ALSA: vx: remove 'out of memory' message
Reported by checkpatch.pl

Signed-off-by: Mihai Burduselu <michelcatalin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-28 07:54:33 +01:00
Alexey Dobriyan 5b5e0928f7 lib/vsprintf.c: remove %Z support
Now that %z is standartised in C99 there is no reason to support %Z.
Unlike %L it doesn't even make format strings smaller.

Use BUILD_BUG_ON in a couple ATM drivers.

In case anyone didn't notice lib/vsprintf.o is about half of SLUB which
is in my opinion is quite an achievement.  Hopefully this patch inspires
someone else to trim vsprintf.c more.

Link: http://lkml.kernel.org/r/20170103230126.GA30170@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:47 -08:00
Masahiro Yamada 4091fb95b5 scripts/spelling.txt: add "followings" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  followings||following

While we are here, add a missing colon in the boilerplate in DT binding
documents.  The "you SoC" in allwinner,sunxi-pinctrl.txt was fixed as
well.

I reworded "as the followings:" to "as follows:" for
drivers/usb/gadget/udc/renesas_usb3.c.

Link: http://lkml.kernel.org/r/1481573103-11329-32-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:47 -08:00
Masahiro Yamada b8a14f3379 scripts/spelling.txt: add "overwriten" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  overwrien||overwritten

Link: http://lkml.kernel.org/r/1481573103-11329-30-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:47 -08:00
Masahiro Yamada 1cce200081 scripts/spelling.txt: add "deintialize(d)" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  deintializing||deinitializing
  deintialize||deinitialize
  deintialized||deinitialized

Link: http://lkml.kernel.org/r/1481573103-11329-28-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:47 -08:00
Masahiro Yamada 183b8021fc scripts/spelling.txt: add "intialization" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  intialization||initialization

The "inintialization" in drivers/acpi/spcr.c is a different pattern but
I fixed it as well in this commit.

Link: http://lkml.kernel.org/r/1481573103-11329-16-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:47 -08:00
Masahiro Yamada 4d39f0ac8e scripts/spelling.txt: add "unneded" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  unneded||unneeded

Link: http://lkml.kernel.org/r/1481573103-11329-15-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:47 -08:00
Masahiro Yamada 03440c4e5e scripts/spelling.txt: add "an union" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  an union||a union

Link: http://lkml.kernel.org/r/1481573103-11329-5-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:46 -08:00
Masahiro Yamada 08a7e621ff scripts/spelling.txt: add "swith" pattern and fix typo instances
Fix typos and add the following to the scripts/spelling.txt:

  swith||switch
  swithable||switchable
  swithed||switched
  swithing||switching

While we are here, fix the "update" to "updates" in the touched hunk in
drivers/net/wireless/marvell/mwifiex/wmm.c.

Link: http://lkml.kernel.org/r/1481573103-11329-2-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-27 18:43:46 -08:00
Vinod Koul 126cfa2f5e ALSA: hda: Add Geminilake HDMI codec ID
Geminilake HDMI codec 0x280d is similar to previous platforms, so add it with
similar ops as previous.

Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-27 17:10:01 +01:00
Hui Wang 29693efcea ALSA: hda - Fix micmute hotkey problem for a lenovo AIO machine
On this machine, the micmute button is connected to Line2 of the
codec and the micmute led is connected to GPIO2 of the codec.

After applying this quirk, both hotkey and led work well.

Cc: <stable@vger.kernel.org>
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-27 12:20:20 +01:00
Vinod Koul 44b46d739d ALSA: hda - Add Geminilake PCI ID
Geminilake is another Intel part, so need to add PCI ID for it.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-25 08:29:36 +01:00
Dave Jiang 11bac80004 mm, fs: reduce fault, page_mkwrite, and pfn_mkwrite to take only vmf
->fault(), ->page_mkwrite(), and ->pfn_mkwrite() calls do not need to
take a vma and vmf parameter when the vma already resides in vmf.

Remove the vma parameter to simplify things.

[arnd@arndb.de: fix ARM build]
  Link: http://lkml.kernel.org/r/20170125223558.1451224-1-arnd@arndb.de
Link: http://lkml.kernel.org/r/148521301778.19116.10840599906674778980.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jan Kara <jack@suse.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-24 17:46:54 -08:00
Linus Torvalds ef96152e6a Less anger inducing pull request for 4.11
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJYr5aeAAoJEAx081l5xIa+ZK4P/RD3XUsduYqziVFCRQ2n0X8r
 +D92F4peTnSeSq7ZcZvprv+fezUGAHbfsWFs8feYCI5quUO6pEQSPwN+wyGazUi0
 4hUVB/K9Iq7U/Bj7Z/SmsU3NuWJnkNqbmvSFvUdqYK9D/kl+Tnllzap2N4cTzjwu
 GZOObz4n85cx94NqC3qw+7/ptL1X2MhXa+z0MzbkKyas84Bko1LwCSHRHsDKUnJc
 IcSpOcYZ6pSRMIsKH4Kd79Go4vWm7djXT9XL3PwDk2NcXXUOuR+cfdHqYchYaM/O
 iD2hvaSywBcflxSAml5x6vlXraoRd91ZZulgOObXtFfnUXdZB81TVq4uv6LU4Bx3
 jLFixUZuk/TJT+W/8N10l7M6yMIFaTpNoNMc5n4IF5RNNyWba4BKnrI+f+lQiOpY
 mmjIaidb0t5BICnJzCD264RhCEXmP0HaDV+iQQV6y6jJRXfd1bgnOXLKP73JekzB
 TsbDshCoE7UO0dJ7n0LFpXSTQDTYzlazoEp14f2kFBxir5/l7r67nUlnDTvUQfuN
 tSRvpN/s0wqvH3o7zhmpHxyJ/ZasPMQjNCFAuUEbx8L5SKXsua0FubIzN4aVpilb
 XvfdFRWM/lkOT/q+8cGI/TcE3YTqEmALmGxdV/akbdNCiCg6aClyCLRE/DZhgmSQ
 UMFjr9wlHl5Qo/OqLKj0
 =Yjfg
 -----END PGP SIGNATURE-----

Merge tag 'drm-for-v4.11-less-shouty' of git://people.freedesktop.org/~airlied/linux

Pull drm updates from Dave Airlie:
 "This is the main drm pull request for v4.11.

  Nothing too major, the tinydrm and mmu-less support should make
  writing smaller drivers easier for some of the simpler platforms, and
  there are a bunch of documentation updates.

  Intel grew displayport MST audio support which is hopefully useful to
  people, and FBC is on by default for GEN9+ (so people know where to
  look for regressions). AMDGPU has a lot of fixes that would like new
  firmware files installed for some GPUs.

  Other than that it's pretty scattered all over.

  I may have a follow up pull request as I know BenH has a bunch of AST
  rework and fixes and I'd like to get those in once they've been tested
  by AST, and I've got at least one pull request I'm just trying to get
  the author to fix up.

  Core:
   - drm_mm reworked
   - Connector list locking and iterators
   - Documentation updates
   - Format handling rework
   - MMU-less support for fbdev helpers
   - drm_crtc_from_index helper
   - Core CRC API
   - Remove drm_framebuffer_unregister_private
   - Debugfs cleanup
   - EDID/Infoframe fixes
   - Release callback
   - Tinydrm support (smaller drivers for simple hw)

  panel:
   - Add support for some new simple panels

  i915:
   - FBC by default for gen9+
   - Shared dpll cleanups and docs
   - GEN8 powerdomain cleanup
   - DMC support on GLK
   - DP MST audio support
   - HuC loading support
   - GVT init ordering fixes
   - GVT IOMMU workaround fix

  amdgpu/radeon:
   - Power/clockgating improvements
   - Preliminary SR-IOV support
   - TTM buffer priority and eviction fixes
   - SI DPM quirks removed due to firmware fixes
   - Powerplay improvements
   - VCE/UVD powergating fixes
   - Cleanup SI GFX code to match CI/VI
   - Support for > 2 displays on 3/5 crtc asics
   - SI headless fixes

  nouveau:
   - Rework securre boot code in prep for GP10x secure boot
   - Channel recovery improvements
   - Initial power budget code
   - MMU rework preperation

  vmwgfx:
   - Bunch of fixes and cleanups

  exynos:
   - Runtime PM support for MIC driver
   - Cleanups to use atomic helpers
   - UHD Support for TM2/TM2E boards
   - Trigger mode fix for Rinato board

  etnaviv:
   - Shader performance fix
   - Command stream validator fixes
   - Command buffer suballocator

  rockchip:
   - CDN DisplayPort support
   - IOMMU support for arm64 platform

  imx-drm:
   - Fix i.MX5 TV encoder probing
   - Remove lower fb size limits

  msm:
   - Support for HW cursor on MDP5 devices
   - DSI encoder cleanup
   - GPU DT bindings cleanup

  sti:
   - stih410 cleanups
   - Create fbdev at binding
   - HQVDP fixes
   - Remove stih416 chip functionality
   - DVI/HDMI mode selection fixes
   - FPS statistic reporting

  omapdrm:
   - IRQ code cleanup

  dwi-hdmi bridge:
   - Cleanups and fixes

  adv-bridge:
   - Updates for nexus

  sii8520 bridge:
   - Add interlace mode support
   - Rework HDMI and lots of fixes

  qxl:
   - probing/teardown cleanups

  ZTE drm:
   - HDMI audio via SPDIF interface
   - Video Layer overlay plane support
   - Add TV encoder output device

  atmel-hlcdc:
   - Rework fbdev creation logic

  tegra:
   - OF node fix

  fsl-dcu:
   - Minor fixes

  mali-dp:
   - Assorted fixes

  sunxi:
   - Minor fix"

[ This was the "fixed" pull, that still had build warnings due to people
  not even having build tested the result. I'm not a happy camper

  I've fixed the things I noticed up in this merge.      - Linus ]

* tag 'drm-for-v4.11-less-shouty' of git://people.freedesktop.org/~airlied/linux: (1177 commits)
  lib/Kconfig: make PRIME_NUMBERS not user selectable
  drm/tinydrm: helpers: Properly fix backlight dependency
  drm/tinydrm: mipi-dbi: Fix field width specifier warning
  drm/tinydrm: mipi-dbi: Silence: ‘cmd’ may be used uninitialized
  drm/sti: fix build warnings in sti_drv.c and sti_vtg.c files
  drm/amd/powerplay: fix PSI feature on Polars12
  drm/amdgpu: refuse to reserve io mem for split VRAM buffers
  drm/ttm: fix use-after-free races in vm fault handling
  drm/tinydrm: Add support for Multi-Inno MI0283QT display
  dt-bindings: Add Multi-Inno MI0283QT binding
  dt-bindings: display/panel: Add common rotation property
  of: Add vendor prefix for Multi-Inno
  drm/tinydrm: Add MIPI DBI support
  drm/tinydrm: Add helper functions
  drm: Add DRM support for tiny LCD displays
  drm/amd/amdgpu: post card if there is real hw resetting performed
  drm/nouveau/tmr: provide backtrace when a timeout is hit
  drm/nouveau/pci/g92: Fix rearm
  drm/nouveau/drm/therm/fan: add a fallback if no fan control is specified in the vbios
  drm/nouveau/hwmon: expose power_max and power_crit
  ..
2017-02-23 18:58:18 -08:00
Dave Airlie 94000cc329 Linux 4.10-rc8
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJYoM2fAAoJEHm+PkMAQRiGr9MH/izEAMri7rJ0QMc3ejt+WmD0
 8pkZw3+MVn71z6cIEgpzk4QkEWJd5rfhkETCeCp7qQ9V6cDW1FDE9+0OmPjiphDt
 nnzKs7t7skEBwH5Mq5xygmIfkv+Z0QGHZ20gfQWY3F56Uxo+ARF88OBHBLKhqx3v
 98C7YbMFLKBslKClA78NUEIdx0UfBaRqerlERx0Lfl9aoOrbBS6WI3iuREiylpih
 9o7HTrwaGKkU4Kd6NdgJP2EyWPsd1LGalxBBjeDSpm5uokX6ALTdNXDZqcQscHjE
 RmTqJTGRdhSThXOpNnvUJvk9L442yuNRrVme/IqLpxMdHPyjaXR3FGSIDb2SfjY=
 =VMy8
 -----END PGP SIGNATURE-----

Merge tag 'v4.10-rc8' into drm-next

Linux 4.10-rc8

Backmerge Linus rc8 to fix some conflicts, but also
to avoid pulling it in via a fixes pull from someone.
2017-02-23 12:10:12 +10:00
Takashi Iwai 7086b7b3d1 ALSA: usb-audio: Tidy up mixer_us16x08.c
A few more cleanups and improvements that have been overlooked:

- Use ARRAY_SIZE() macro appropriately
- Code shuffling for minor optimization
- Omit superfluous variable initializations
- Get rid of superfluous NULL checks
- Add const to snd_us16x08_control_params definitions

No functional changes.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-22 15:07:20 +01:00
Takashi Iwai e2810d76c5 ALSA: usb-audio: Fix memory leak and corruption in mixer_us16x08.c
There are a few places leaking memory and doing double-free in
mixer_us16x08.c.

The driver allocates a usb_mixer_elem_info object at each
add_new_ctl() call.  This has to be freed via kctl->private_free, but
currently this is done properly only for some controls.

Also, the driver allocates three external objects (comp_store,
eq_store, meter_store), and these are referred in elem->private_data
(it's not kctl->private_data).  And these have to be released, but
there are none doing it.  Moreover, these extra objects have to be
released only once.  Thus the release should be done only by the first
kctl element that refers to it.

For fixing these, we call either snd_usb_mixer_elem_free() (only for
kctl->private_data) or elem_private_free() (for both
kctl->private_data and elem->private_data) via kctl->private_free
appropriately.

Last but not least, snd_us16x08_controls_create() may return in the
middle without releasing the allocated *_store objects due to an
error.  For fixing this, we shuffle the allocation code so that it's
called just before its reference.

Fixes: d2bb390a20 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk")
Reported-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-22 14:24:09 +01:00
Takashi Sakamoto 89b593c30e ALSA: usb-audio: purge needless variable length array
Variable length array is used in 'snd_us16x08_meter_get()', while there
is no need. It's better to purge it because variable length array has
overhead for stack handling.

This commit replaces the array with static length. Sparse generated below
warning.

sound/usb/mixer_us16x08.c:714:18: warning: Variable length array is used.

Fixes: d2bb390a20 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-22 07:12:23 +01:00
Baoyou Xie 870e0ddc43 ASoC: zx-tdm: add zte's tdm controller driver
This patch adds tdm controller driver for zte's SoC family.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Reviewed-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-21 15:11:17 -08:00
Arnd Bergmann 72cedf599f ASoC: mediatek: add I2C dependency for CS42XX8
We should not select drivers that depend on I2C when that is disabled,
as it results in a build error:

warning: (SND_SOC_MT2701_CS42448) selects SND_SOC_CS42XX8_I2C which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && I2C)
sound/soc/codecs/cs42xx8-i2c.c:60:1: warning: data definition has no type or storage class
 module_i2c_driver(cs42xx8_i2c_driver);
sound/soc/codecs/cs42xx8-i2c.c:60:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]

Fixes: 1f458d53f7 ("ASoC: mediatek: Add mt2701-cs42448 driver and config option.")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-21 15:02:34 -08:00
Arnd Bergmann 4b49f0f7ee ALSA: x86: hdmi: select CONFIG_SND_PCM
The newly added driver uses the PCM helpers and fails to link if they are disabled:

sound/built-in.o: In function `hdmi_lpe_audio_runtime_suspend':
intel_hdmi_audio.c:(.text+0x15906): undefined reference to `snd_pcm_suspend'
sound/built-in.o: In function `had_pcm_hw_params':
intel_hdmi_audio.c:(.text+0x15ac7): undefined reference to `snd_pcm_lib_malloc_pages'
sound/built-in.o: In function `had_pcm_open':
intel_hdmi_audio.c:(.text+0x15d49): undefined reference to `snd_pcm_hw_constraint_integer'

This uses a Kconfig 'select' statement to make sure they are enabled.

Fixes: 5dab11d897 ("ALSA: x86: hdmi: Add audio support for BYT and CHT")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-21 23:39:14 +01:00
Takashi Iwai 0b6b524f39 ALSA: x86: Don't enable runtime PM as default
Unlike HSW and newer, BYT/CHT devices have no fine control of audio
power domain in i915 side.  Since there is little gain by runtime PM
on BYT/CHT, so far, this commit removes the pm_runtime_enable() call
as default.

User who still wants the runtime PM may adjust the corresponding
sysfs files (power/control and power/autosuspend_delay_ms)
appropriately, of course.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-21 22:23:14 +01:00
Takashi Iwai 3002b9fb7c ALSA: x86: Use runtime PM autosuspend
This patch adds a few lines to the driver to use autosuspend for the
runtime PM.  It'll become useful with the combination of the keep-link
feature.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-21 22:17:45 +01:00
Bhumika Goyal 04bab35044 ALSA: usb-audio: constify snd_kcontrol_new structures
Declare snd_kcontrol_new structures as const as they are only passed as
an argument to the function add_new_ctl. This agrument is of type const,
so snd_kcontrol_new structures having this property can be made const
too.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-21 22:02:03 +01:00
Bhumika Goyal f3b827e0b1 ALSA: pci: constify snd_kcontrol_new structures
Declare snd_kcontrol_new structures as const as they are only passed as
an argument to the function snd_ctl_new1. This argument is of type
const, so snd_kcontrol_new structures having the same property can be
made const too.
Done using Coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct snd_kcontrol_new i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1;
@@
snd_ctl_new1(&i@p,e1)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct snd_kcontrol_new i;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-21 22:01:21 +01:00
Wolfram Sang 56d2c61d61 ASoC: rsnd: check return value of init function
Currently, this function cannot fail for the ADG case. Still, let's
apply defensive programming techniques to make sure we fail gracefully
whenever rsnd_mod_init() gets extended with another failure case.
Reported by Coverity (CID 1397893).

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-21 09:51:23 -08:00
Wolfram Sang 34157f7bec ASoC: rsnd: drop useles self-assignments
Coverity reported (CID 1397992) this self-assignment. I think the code
stays readable even with the assignments removed.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-21 09:51:23 -08:00
Takashi Sakamoto 34371d236e ALSA: usb-audio: localize function without external linkage
When accessed inner a file, functions should have static qualifier for
local-linkage.

This commit fixes the bug. Sparse generated below warning.

sound/usb/mixer_us16x08.c:1043:32: warning: symbol 'snd_us16x08_create_meter_store' was not declared. Should it be static?

Fixes: d2bb390a20 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-20 21:53:14 +01:00
Takashi Sakamoto 02ed051fe1 ALSA: usb-audio: localize one-referrer variable
When accessed by one referrer inner a file, variables should have static
qualifier to declare local-linkage.

This commit fixes the bug. Sparse generated below warnings.
sound/usb/mixer_us16x08.c:156:13: warning: duplicate const
sound/usb/mixer_us16x08.c:156:18: warning: symbol 'route_names' was not declared. Should it be static?

Fixes: d2bb390a20 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-20 21:45:37 +01:00
Takashi Iwai 4e25d30c8d ASoC: Updates for v4.11
Another release that's mainly focused on drivers rather than core
 changes, highlights include:
 
  - A huge batch of updates to the Intel drivers, mainly around
    DisplayPort and HDMI with some additional board support too.
  - Channel mapping support for HDMI.
  - Support for AllWinner A31 and A33, Everest Semiconductor ES8328,
    Nuvoton NAU8540.
 -----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCAAxFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlirN2kTHGJyb29uaWVA
 a2VybmVsLm9yZwAKCRAk1otyXVSH0D7qB/sFOllsPc/ZNBKiB1dTSFlg//HUpupp
 gecc64hrQrg2wQtFG//TS+6NFt6MxzZphmyjsPWe6BGZhAq05AXtklWCdi0j8H3q
 KVy5gOxYM67rtGnobQ4WcTD291vkjenP7/qNxYqOgWtLfv+mMygm9FpM7S0zs18P
 u+Y+8cY1ljX0DaeDuMBnsNjVNyfQ+qRLhMOVT6hBVLnYHKrtcQJi1S2qC4WZV6o3
 vy7Tbh+l0rf0+cbcJKBJ3qcPqS11BGt/L9QwsOeHkmTy9dzHEULRifkWcCzR7lU7
 AGS5+EeCtscg29+PKDtLX4f+KHgIFHqJ/uBwoNnAdf1PMaYTUAYn/8de
 =x9RY
 -----END PGP SIGNATURE-----

Merge tag 'asoc-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Updates for v4.11

Another release that's mainly focused on drivers rather than core
changes, highlights include:

 - A huge batch of updates to the Intel drivers, mainly around
   DisplayPort and HDMI with some additional board support too.
 - Channel mapping support for HDMI.
 - Support for AllWinner A31 and A33, Everest Semiconductor ES8328,
   Nuvoton NAU8540.
2017-02-20 21:43:40 +01:00
Detlef Urban d2bb390a20 ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk
Add mixer quirk for Tascam US-16x08 usb interface.
Even that this is an usb compliant device,
the input channels and DSP functions (EQ/Compressor) aren't accessible
by default.

Signed-off-by: Detlef Urban <onkel@paraair.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-20 10:59:54 +01:00
Takashi Iwai fc0e23fad3 Merge branch 'for-next' into for-linus 2017-02-20 08:52:50 +01:00
Bhumika Goyal 3bb9eca913 ALSA: emu10k1: constify snd_emux_operators structure
Declare snd_emux_operators structure as const as it is only copied into
another structure. So, snd_emux_operators structures having this property
can be made const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-19 22:07:29 +01:00
Mark Brown 141dee78c4 Merge remote-tracking branches 'asoc/topic/wm8753' and 'asoc/topic/zte' into asoc-next 2017-02-19 16:37:07 +00:00
Mark Brown ebfa3dccd2 Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/topology', 'asoc/topic/wm0010', 'asoc/topic/wm8731' and 'asoc/topic/wm8741' into asoc-next 2017-02-19 16:37:01 +00:00
Mark Brown 166729f37d Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5677', 'asoc/topic/samsung', 'asoc/topic/simple' and 'asoc/topic/sunxi' into asoc-next 2017-02-19 16:36:54 +00:00
Mark Brown a564394660 Merge remote-tracking branches 'asoc/topic/rt5514', 'asoc/topic/rt5640', 'asoc/topic/rt5645', 'asoc/topic/rt5659' and 'asoc/topic/rt5660' into asoc-next 2017-02-19 16:36:48 +00:00
Mark Brown 8237d99c3b Merge remote-tracking branches 'asoc/topic/pxa', 'asoc/topic/qcom' and 'asoc/topic/rockchip' into asoc-next 2017-02-19 16:36:44 +00:00
Mark Brown a701802c4e Merge remote-tracking branches 'asoc/topic/max9867', 'asoc/topic/mtk', 'asoc/topic/nau8540', 'asoc/topic/nau8825' and 'asoc/topic/omap' into asoc-next 2017-02-19 16:36:35 +00:00
Mark Brown 64c37d50ad Merge remote-tracking branches 'asoc/topic/img' and 'asoc/topic/max98090' into asoc-next 2017-02-19 16:36:32 +00:00
Mark Brown 96f0e8a5b0 Merge remote-tracking branches 'asoc/topic/dwc', 'asoc/topic/es8328', 'asoc/topic/fsl', 'asoc/topic/fsl-sai' and 'asoc/topic/graph' into asoc-next 2017-02-19 16:36:23 +00:00
Mark Brown 59acd5dfcc Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/debugfs' and 'asoc/topic/doc' into asoc-next 2017-02-19 16:36:18 +00:00
Mark Brown b7707a8be6 Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/chmap', 'asoc/topic/cq93vc' and 'asoc/topic/da7218' into asoc-next 2017-02-19 16:36:13 +00:00
Mark Brown a2d64282dd Merge remote-tracking branches 'asoc/topic/adau17x1', 'asoc/topic/adsp', 'asoc/topic/ak4642', 'asoc/topic/amd' and 'asoc/topic/arizona' into asoc-next 2017-02-19 16:35:51 +00:00
Mark Brown 715d525b41 Merge remote-tracking branch 'asoc/topic/pcm3168a' into asoc-next 2017-02-19 16:35:47 +00:00
Mark Brown 16b5711485 Merge remote-tracking branch 'asoc/topic/intel' into asoc-next 2017-02-19 16:35:45 +00:00
Mark Brown c7bb6d8060 Merge remote-tracking branch 'asoc/topic/dmaengine' into asoc-next 2017-02-19 16:35:44 +00:00
Mark Brown 4ae8be8ea9 Merge remote-tracking branch 'asoc/topic/component' into asoc-next 2017-02-19 16:35:41 +00:00
Mark Brown 39bc30f253 Merge remote-tracking branches 'asoc/fix/fsl-mxs-saif' and 'asoc/fix/sunxi' into asoc-linus 2017-02-19 16:35:37 +00:00
Mark Brown bd85d189b3 Merge remote-tracking branch 'asoc/fix/rcar' into asoc-linus 2017-02-19 16:35:36 +00:00
Mark Brown 5bf3db18db Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus 2017-02-19 16:35:34 +00:00
Mark Brown 19532a2477 Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus 2017-02-19 16:35:33 +00:00
Wei Yongjun c97c4604c0 ASoC: sun4i-spdif: drop unnessary snd_soc_unregister_component()
It's not necessary to unregister a component registered
with devm_snd_soc_register_component(). Also removed
pointness clk_disable_unprepare() from error path and
snd_soc_unregister_platform() from the remove.

Fixes: f8260afa44 ("ASoC: sunxi: Add support for the SPDIF block")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-19 16:08:14 +00:00
Jeeja KP 7ba8ba3f4f ASoC: Intel: bxt: Add jack port initialize in bxt_rt298 machine
After the pcm jack is created, create and initialize the pin switch
widget for each port. Pin switch is to enable/disable the pin when
monitor is connected/disconnected.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-17 11:24:13 +00:00
John Hsu 1e561f6166 ASoC: nau8825: automatic BCLK and LRC divde in master mode
configurable LRC and BCLK divide. The driver
will make configurations of LRC and BCLK automatically according to
BCLK and FS information in master mode.

Signed-off-by: John Hsu <KCHSU0@nuvoton.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-17 10:42:53 +00:00
Vinod Koul e3efb2ad83 ASoC: hdac_hdmi: Add device id for Geminilake
Geminilake is new Intel SoC, so add codec entry for HDMI

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:58:09 +00:00
Vinod Koul 2550486343 ASoC: Intel: Skylake: Add Geminlake IDs
Geminilake is next gen SoC, so add the IDs for Geminilake.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:58:09 +00:00
Vinod Koul 06a99ddd20 ASoC: rt298: Add DMI match for Geminilake reference platform
Geminilake reference platform also uses combo jack for audio connector
so we need to set codec pdata to use this based on DMI match for this
board.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:58:09 +00:00
Senthilnathan Veppur db2f586b80 ASoC: Intel: Skylake: Check device type to get endpoint configuration
Geminilake has two different devices connected to the same SSP, so use
device_type check to get correct device configuration.

Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:58:09 +00:00
Jeeja KP c5cf9f37a0 ASoC: Intel: bxt: Add jack port initialize in da7219_max98357a machine
After the pcm jack is created, create and initialize the pin switch
widget for each port. Pin switch is to enable/disable the pin when
monitor is connected/disconnected.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:57:15 +00:00
Jeeja KP 86b5703158 ASoC: Intel: Skylake: Add jack port initialize in nau88l25_ssm4567 machine
After the pcm jack is created, create and initialize the pin switch
widget for each port. Pin switch is to enable/disable the pin when
monitor is connected/disconnected.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:56:19 +00:00
Jeeja KP 565f13a95e ASoC: Intel: Skylake: Add jack port initialize in nau88l25_max98357a machine
After the pcm jack is created, create and initialize the pin switch
widget for each port. Pin switch is to enable/disable the pin when
monitor is connected/disconnected.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:56:15 +00:00
Jeeja KP 64f8620d48 ASoC: Intel: Skylake: Add jack port initialize in rt286 machine
After the pcm jack is created, create and initialize the pin switch
widget for each port. Pin switch is to enable/disable the pin when
monitor is connected/disconnected.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:56:12 +00:00
Jeeja KP 0324e51b5b ASoC: hdac_hdmi: Add machine pin widget for each port
Represent each port as machine DAPM pin widget. This helps in
enable/disable pin when monitor is connected/disconnected in case pcm
is rendered to multiple ports.

Create machine pin widgets  and pin switch kcontrol for each port and
report based on the pin status

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:56:06 +00:00
Jeeja KP 625de2bf2e ASoC: Intel: bxt: Create ASoC jack for hdmi in bxt_da7219_max98357 machine
Creates ASoC jack for HDMI PCM and calls hdmi codec API to initialize
jack in bxt_da7219_max98357 machine

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:56:03 +00:00
Jeeja KP 7932b8ace3 ASoC: Intel: bxt: Create ASoC jack for hdmi in bxt_rt298 machine
Creates ASoC jack for HDMI PCM and calls hdmi codec API to initialize
jack in bxt_rt298.c machine

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:59 +00:00
Jeeja KP 9e4278cd9b ASoC: Intel: Skylake: Create ASoC jack for hdmi in nau88l25_ssm4567 machine
Creates ASoC jack for HDMI PCM and calls hdmi codec API to initialize
jack in skl_nau88l25_ssm4567 machine

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:55 +00:00
Jeeja KP c541b2dd45 ASoC: Intel: Skylake: Create ASoC jack for hdmi in skl_nau88l25_max98357a machine
Creates ASoC jack for HDMI PCM and calls hdmi codec API to initialize
jack in skl_nau88l25_max98357a machine

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:51 +00:00
Jeeja KP f3af359242 ASoC: Intel: Skylake: Create ASoC jack for hdmi in rt286 machine
Creates ASoC jack for HDMI pcm and calls hdmi codec API to initialize
jack in skl_rt268 machine

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:47 +00:00
Jeeja KP 624900163d ASoC: hdac_hdmi: Use ASoC jack instead of snd_jack
Use snd_soc_jack instead of snd_jack and create the jack in machine
driver and pass the jack pointer to hdac_hdmi driver for jack
reporting.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:43 +00:00
Jeeja KP e0e5d3e5a5 ASoC: hdac_hdmi: Add support for multiple ports to a PCM
Since we have the MST feature enabled and Pin-Port mux for user to
select the converter routing, multiple port mapping to same converter
needs to be supported.

To support multiple port mapped to same converter following changes are
done for this:.
o Add port list to pcm, so that multiple ports can be mapped to a PCM.
o Jack reporting in case where multiple port are attached to same PCM.
o Change hdac_hdmi_get_port_from_cvt(), channel_map, remove functions
to parse through all ports mapped to same the PCM.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:40 +00:00
Jeeja KP 1b46ebd136 ASoc: hdac_hdmi: Configure pin verbs for MST
To enable stream on a specific port of a MST capable pin, the port
needs to be selected before we configure the pin widget verb.

When port is selected, all the pin widget verb controlling the sink
device operation will be directed to selected port. So add port
selection before configuring the pin widget verb.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:36 +00:00
Jeeja KP a9ce96bcd9 ASoC: hdac_hdmi: Handle MST pin jack detection at boot/resume
The ELD notification can be received asynchronously from the graphics
side and this may happen just at the moment the sound driver is
initializing and notification will be missed. Similarly at system
resume, the notification is ignored as the  ELD and connection states
are updated in anyway at the end of the resume.
So check the jack status in boot/resume by querying the port presence
based on pin caps and report the jack status.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:32 +00:00
Jeeja KP fc181b04f2 ASoC: hdac_hdmi: Add MST verb support
To support DP MST audio, new pin verbs/params are added. This patch
adds helper functions to do following:
o To set a specific port
o To get the currently selected port
o To get the length of port.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:14 +00:00
Garlic Tseng cc3e1ce2c7 ASoC: mediatek: add power-domain get/put ctrl for mt2701
add power-domain ctrl for audio driver

Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:27:17 +00:00
Takashi Iwai b1ef30e5ed ALSA: x86: Don't bail out from PCM ops when disconnected
Currently the driver returns -ENODEV when the monitor is disconnected.
But PA alsa module doesn't like this and it starts playing Juliet,
kills itself as if it were a fatal tragedy.

Since we protect the whole read/write at disconnection, just allow the
PCM accesses even during disconnection.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-16 09:22:44 +01:00
Takashi Iwai 2d42c033ae ALSA: x86: Minor code rearrangement
Put the stuff in the right order; notification should be at the end of
the action.

Also dropped a superfluous debug print and incorrect comments.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-02-16 09:22:44 +01:00