Takashi Sakamoto [Wed, 18 May 2016 13:27:43 +0000 (22:27 +0900)]
ALSA: firewire-lib: change a member of event structure to suppress sparse wanings to bool type
Commit
a9c4284bf5a9 ("ALSA: firewire-lib: add context information to
tracepoints") adds new members to tracepoint events of this module, to
represent context information. One of the members is bool type and
this causes sparse warnings.
16:1: warning: expression using sizeof bool
60:1: warning: expression using sizeof bool
16:1: warning: odd constant _Bool cast (
ffffffffffffffff becomes 1)
60:1: warning: odd constant _Bool cast (
ffffffffffffffff becomes 1)
This commit suppresses the warnings, by changing type of the member
to 'unsigned int'. Additionally, this commit applies '!!' idiom to
get 0/1 from 'in_interrupt()'.
Fixes:
a9c4284bf5a9 ("ALSA: firewire-lib: add context information to tracepoints")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Muhammad Falak R Wani [Sun, 15 May 2016 10:56:51 +0000 (16:26 +0530)]
sound: oss: Use setup_timer and mod_timer.
The function setup_timer combines the initialization of a timer with the
initialization of the timer's function and data fields. The mulitiline
code for timer initialization is now replaced with function setup_timer.
Also, quoting the mod_timer() function comment:
-> mod_timer() is a more efficient way to update the expire field of an
active timer (if the timer is inactive it will be activated).
Use setup_timer() and mod_timer() to setup and arm a timer, making the
code compact and aid readablity.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 17 May 2016 10:45:31 +0000 (12:45 +0200)]
Merge tag 'asoc-v4.7-fix-hdac' of git://git./linux/kernel/git/broonie/sound into for-linus
ASoC: Fix for v4.7
Fix an unused variable warning in the HDAC code.
Fabio Estevam [Mon, 16 May 2016 12:50:07 +0000 (09:50 -0300)]
ASoC: hdac_hdmi: Remove the unused 'timeout' variable
Commit
b2047e996cd88d3 ("ASoC: hdac_hdmi: add link management")
introuduced the following build warning:
sound/soc/codecs/hdac_hdmi.c:1721:16: warning: unused variable 'timeout' [-Wunused-variable]
Remove the unused 'timeout' variable.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai [Mon, 16 May 2016 12:59:00 +0000 (14:59 +0200)]
Merge tag 'asoc-v4.7' of git://git./linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v4.7
The updates this time around are almost all driver code:
- Further slow progress on the topology code.
- Substantial updates and improvements for the da7219, es8328, fsl-ssi
Intel and rcar drivers.
Takashi Iwai [Mon, 16 May 2016 07:13:08 +0000 (09:13 +0200)]
Merge branch 'for-next' into for-linus
Mark Brown [Fri, 13 May 2016 13:27:16 +0000 (14:27 +0100)]
Merge remote-tracking branch 'asoc/topic/hdmi' into asoc-next
Mark Brown [Fri, 13 May 2016 13:27:01 +0000 (14:27 +0100)]
Merge remote-tracking branches 'asoc/topic/es8328', 'asoc/topic/find-dai', 'asoc/topic/fsl', 'asoc/topic/fsl-sai' and 'asoc/topic/fsl-ssi' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:46 +0000 (14:26 +0100)]
Merge remote-tracking branches 'asoc/topic/davinci' and 'asoc/topic/dwc' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:43 +0000 (14:26 +0100)]
Merge remote-tracking branches 'asoc/topic/bcm2835', 'asoc/topic/cs42l56', 'asoc/topic/da7213', 'asoc/topic/da7218' and 'asoc/topic/da7219' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:35 +0000 (14:26 +0100)]
Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/ak4624', 'asoc/topic/atmel' and 'asoc/topic/au1x' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:26 +0000 (14:26 +0100)]
Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:23 +0000 (14:26 +0100)]
Merge remote-tracking branch 'asoc/topic/pcm5102' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:22 +0000 (14:26 +0100)]
Merge remote-tracking branch 'asoc/topic/intel' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:21 +0000 (14:26 +0100)]
Merge remote-tracking branch 'asoc/topic/imx' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:20 +0000 (14:26 +0100)]
Merge remote-tracking branch 'asoc/topic/dmaengine' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:20 +0000 (14:26 +0100)]
Merge remote-tracking branch 'asoc/topic/dapm' into asoc-next
Mark Brown [Fri, 13 May 2016 13:26:15 +0000 (14:26 +0100)]
Merge remote-tracking branches 'asoc/fix/davinci', 'asoc/fix/fsl-ssi', 'asoc/fix/rockchip' and 'asoc/fix/rt286' into asoc-linus
Arnaud Mouiche [Tue, 3 May 2016 12:14:00 +0000 (14:14 +0200)]
ASoC: fsl_ssi: Fix channel slipping on capture (or playback) restart in full duplex.
Happened when the Playback (or Capture) is running continuously
and Capture (or Playback) is restarted (xrun, manual stop/start...)
Since the RX (or TX) FIFO are only reset when the whole SSI is disabled,
pending samples from previous capture (or playback) session may still
be present. They must be erased to not introduce channel slipping.
FIFO Clear register fields are documented in IMX51, IMX35 reference manual.
They are not documented in IMX50 or IMX6 RM, despite they are
working as expected on IMX6SL and IMX6solo.
Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Arnaud Mouiche [Tue, 3 May 2016 12:13:59 +0000 (14:13 +0200)]
ASoC: fsl_ssi: Fix channel slipping in Playback at startup
Previously, SCR.SSIEN and SCR.TE were enabled at once if no capture
stream was also running.
This may not give a chance for the DMA to write the first sample in
TX FIFO before the streaming starts on the PCM bus, inserting void
samples first.
Those void samples are then responsible for slipping the channels.
Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Arnaud Mouiche [Tue, 3 May 2016 12:13:58 +0000 (14:13 +0200)]
ASoC: fsl_ssi: Fix samples being dropped at Playback startup
If the capture is already running while playback is started, it is highly
probable (>80% in a 8 channels scenario) that samples are lost between
the DMA and TX fifo.
The reason is that SIER.TDMAE is set before STCR.TFEN0, leaving a time
window where the FIFO doesn't receive the samples written by the DMA.
This particular case happened only if capture is already enabled as
SCR.SSIEN is already set at the playback startup instant.
Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Arnaud Mouiche [Tue, 3 May 2016 12:13:57 +0000 (14:13 +0200)]
ASoC: fsl_ssi: Save a dev reference for dev_err() purpose.
Most of functions only receive the ssi_private reference and don't have
a knowledge of 'dev' pointer, even for debug purpose.
Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Tested-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Arnaud Mouiche [Tue, 3 May 2016 12:13:56 +0000 (14:13 +0200)]
ASoC: fsl_ssi: The IPG/5 limitation concerns the bitclk, not the sysclk.
im6sl reference manual 47.7.4:
"
Bit clock - Used to serially clock the data bits in and out of the SSI port.
This clock is either generated internally (from SSI's sys clock) or taken
from external clock source (through the Tx/Rx clock ports).
[...]
Care should be taken to ensure that the bit clock frequency (either
internally generated by dividing the SSI's sys clock or sourced from
external device through Tx/Rx clock ports) is never greater than 1/5
of the ipg_clk (from CCM) frequency.
"
Since, in master mode, the sysclk is a multiple of bitclk, we can
easily reach a high sysclk value, whereas keeping a reasonable bitclk.
ex: 8ch x 16bit x 48kHz = 6144000, requires a
24576000 sysclk (PM=1)
yet ipg_clk/5 = 66Mhz/5 = 13.2
Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Arnaud Mouiche [Tue, 3 May 2016 12:13:55 +0000 (14:13 +0200)]
ASoC: fsl_ssi: Real hardware channels max number is 32
The max number of slots in TDM mode is 32:
- Frame Rate Divider Control is a 5bit value
- Time slot mask registers control 32 slots.
Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Tested-by: Caleb Crome <caleb@crome.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Florian Meier [Fri, 13 May 2016 09:14:12 +0000 (09:14 +0000)]
ASoC: pcm5102a: Add support for PCM5102A codec
Some definitions to support the PCM5102A codec
by Texas Instruments.
Signed-off-by: Florian Meier <florian.meier@koalo.de>
Changes to original patch by Florian Meier:
* rebased (Makefile and Kconfig
* fixed checkpath errors (spaces, newlines)
* added dt-binding documentation
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Vinod Koul [Thu, 12 May 2016 03:28:55 +0000 (08:58 +0530)]
ASoC: hdac_hdmi: add link management
Manage the hda idisp link using shiny new link APIs. We need to
keep link On while we probe and also hold the reference in runtime
resume and drop in suspend
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Vinod Koul [Thu, 12 May 2016 03:28:54 +0000 (08:58 +0530)]
ASoC: Intel: Skylake: add link management
Use shiny new link APIs to manage the links. Also remove old link
configuration logic from driver.
We need to keep link and cmd dma to off during active suspend
to allow system to enter low power state and turn it on if
the link and cmd dma was on before active suspend in active
resume.
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Vinod Koul [Thu, 12 May 2016 03:28:53 +0000 (08:58 +0530)]
ALSA: hdac: add link pm and ref counting
The HDA links can be switched off when not is use, similarly
command DMA can be stopped as well. This calls for a reference
counting mechanism on the link by it's users to manage the link
power. The DMA can be turned off when all links are off
For this we add two APIs
snd_hdac_ext_bus_link_get
snd_hdac_ext_bus_link_put
They help users to turn up/down link and manage the DMA as well
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai [Thu, 12 May 2016 16:04:16 +0000 (18:04 +0200)]
ALSA: au88x0: Fix zero clear of stream->resources
There are a few calls of memset() to stream->resources, but they all
are called in a wrong size, sizeof(unsigned char) * VORTEX_RESOURCE_LAST,
while this field is a u32 array. This may leave the memories not
zero-cleared.
Fix it by replacing them with a simpler sizeof(stream->resources)
instead.
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Vinod Koul [Thu, 12 May 2016 04:08:50 +0000 (09:38 +0530)]
ASoC: rt298: Add DMI match for Broxton-P reference platform
Broxton-P 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: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Vinod Koul [Thu, 12 May 2016 04:08:49 +0000 (09:38 +0530)]
ASoC: rt298: fix null deref on acpi driver data
ACPI driver data can be NULL so we need to check that before
dereference the driver data.
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Thu, 12 May 2016 12:55:53 +0000 (13:55 +0100)]
ASoC: dapm: deprecate MICBIAS widget type
Commit
086d7f804e26 ("ASoC: Convert WM8962 MICBIAS to a supply widget",
2011-09-23) says:
A supply widget is generally clearer than a MICBIAS widget and a
mic bias is just a type of supply so use a supply widget for the
MICBIAS. This also avoids confusion with the routing when
connected to multiple inputs.
but this has never been documented as a policy. Add some comments to
make it clear.
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Sakamoto [Tue, 10 May 2016 22:35:09 +0000 (07:35 +0900)]
ALSA: firewire-lib: drop skip argument from helper functions to queue a packet
On most of audio and music units on IEEE 1394 bus which ALSA firewire stack
supports (or plans to support), CIP with two quadlets header is used.
Thus, there's no cases to queue packets with blank payload. If such packets
are going to be queued, it means that they're for skips of the cycle.
This commit simplifies helper functions to queue a packet.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Tue, 10 May 2016 22:33:27 +0000 (07:33 +0900)]
ALSA: firewire-lib: add context information to tracepoints
In current implementation, packet processing is done in both of software
IRQ contexts of IR/IT contexts and process contexts.
This is usual interrupt handling of IR/IT context for 1394 OHCI.
(in hardware IRQ context)
irq_handler() (drivers/firewire/ohci.c)
->tasklet_schedule()
(in software IRQ context)
handle_it_packet() or handle_ir_packet_per_buffer() (drivers/firewire/ohci.c)
->flush_iso_completions()
->struct fw_iso_context.callback.sc()
= out_stream_callback() or in_stream_callback()
However, we have another chance for packet processing. It's done in PCM
frame handling via ALSA PCM interfaces.
(in process context)
ioctl(i.e. SNDRV_PCM_IOCTL_HWSYNC)
->snd_pcm_hwsync() (sound/core/pcm_native.c)
->snd_pcm_update_hw_ptr() (sound/core/pcm_lib.c)
->snd_pcm_update_hw_ptr0()
->struct snd_pcm_ops.pointer()
= amdtp_stream_pcm_pointer()
->fw_iso_context_flush_completions() (drivers/firewire/core-iso.c)
->struct fw_card_driver.flush_iso_completions()
= ohci_flush_iso_completions() (drivers/firewire/ohci.c)
->flush_iso_completions()
->struct fw_iso_context.callback.sc()
= out_stream_callback() or in_stream_callback()
This design is for a better granularity of PCM pointer. When ioctl(2) is
executed with some commands for ALSA PCM interface, queued packets are
handled at first. Then, the latest number of handled PCM frames is
reported. The number can represent PCM frames transferred in most near
isochronous cycle.
Current tracepoints include no information to distinguish running contexts.
When tracing the interval of software IRQ context, this is not good.
This commit adds more information for current context. Additionally, the
index of packet processed in one context is added in a case that packet
processing is executed in continuous context of the same kind,
As a result, the output includes 11 fields with additional two fields
to commit
0c95c1d6197f ("ALSA: firewire-lib: add tracepoints to dump a part
of isochronous packet data"):
17131.9186: out_packet: 07 7494 ffc0 ffc1 00
000700c0 9001a496 058 45 1 13
17131.9186: out_packet: 07 7495 ffc0 ffc1 00
000700c8 9001ba00 058 46 1 14
17131.9186: out_packet: 07 7496 ffc0 ffc1 00
000700d0 9001ffff 002 47 1 15
17131.9189: out_packet: 07 7497 ffc0 ffc1 00
000700d0 9001d36a 058 00 0 00
17131.9189: out_packet: 07 7498 ffc0 ffc1 00
000700d8 9001e8d4 058 01 0 01
17131.9189: out_packet: 07 7499 ffc0 ffc1 00
000700e0 9001023e 058 02 0 00
17131.9206: in_packet: 07 7447 ffc1 ffc0 01
3f070072 9001783d 058 32 1 00
17131.9206: in_packet: 07 7448 ffc1 ffc0 01
3f070072 90ffffff 002 33 1 01
17131.9206: in_packet: 07 7449 ffc1 ffc0 01
3f07007a 900191a8 058 34 1 02
(Here, some common fields are omitted so that a line is within 80
characters.)
The legend is:
- The second of cycle scheduled for the packet
- The count of cycle scheduled for the packet
- The ID of node as source (hex)
- The ID of node as destination (hex)
- The value of isochronous channel
- The first quadlet of CIP header (hex)
- The second quadlet of CIP header (hex)
- The number of included quadlets
- The index of packet in a buffer maintained by this module
- 0 in process context, 1 in IRQ context
- The index of packet processed in the context
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Wed, 11 May 2016 17:17:39 +0000 (02:17 +0900)]
ALSA: firewire-lib: permit to flush queued packets only in process context for better PCM period granularity
These three commits were merged to improve PCM pointer granularity.
commit
76fb87894828 ("ALSA: firewire-lib: taskletize the snd_pcm_period_elapsed() call")
commit
e9148dddc3c7 ("ALSA: firewire-lib: flush completed packets when reading PCM position")
commit
92b862c7d685 ("ALSA: firewire-lib: optimize packet flushing")
The point of them is to handle queued packets not only in software IRQ
context of IR/IT contexts, but also in process context. As a result of
handling packets, period tasklet is scheduled when acrossing PCM period
boundary. This is to prevent recursive call of
'struct snd_pcm_ops.pointer()' in the same context.
When the pointer callback is executed in the process context, it's
better to avoid the second callback in the software IRQ context. The
software IRQ context runs immediately after scheduled in the process
context because few packets are queued yet.
For the aim, 'pointer_flush' is used, however it causes a race condition
between the process context and software IRQ context of IR/IT contexts.
Practically, this race is not so critical because it influences process
context to skip flushing queued packet and to get worse granularity of
PCM pointer. The race condition is quite rare but it should be improved
for stable service.
The similar effect can be achieved by using 'in_interrupt()' macro. This
commit obsoletes 'pointer_flush' with it.
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Stephen Rothwell [Wed, 11 May 2016 01:07:02 +0000 (11:07 +1000)]
ASoC: Intel: fix up for DAI link's be_id change
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai [Wed, 11 May 2016 15:48:00 +0000 (17:48 +0200)]
ALSA: usb-audio: Yet another Phoneix Audio device quirk
Phoenix Audio has yet another device with another id (even a different
vendor id, 0556:0014) that requires the same quirk for the sample
rate.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=110221
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mark Brown [Wed, 11 May 2016 16:11:22 +0000 (17:11 +0100)]
Merge branch 'topic/dai-link' of git://git./linux/kernel/git/broonie/sound into asoc-intel
Joonas Lahtinen [Tue, 10 May 2016 06:08:57 +0000 (09:08 +0300)]
ASoC: Intel: Fix printk formatting
Format number after 0x in hex.
Cc: Jie Yang <yang.jie@linux.intel.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai [Wed, 11 May 2016 12:56:12 +0000 (14:56 +0200)]
ALSA: hda - Fix regression on ATI HDMI audio
The HDMI/DP audio output on ATI/AMD chips got broken due to the recent
restructuring of chmap. Fortunately, Daniel Exner could bisect, and
pointed the culprit commit [
739ffee97ed5: ALSA: hda - Add hdmi chmap
verb programming ops to chmap object].
This commit moved some ops from hdmi_ops to chmap_ops, and reassigned
the ops in the embedded chmap object in hdmi_spec instead.
Unfortunately, the reassignment of these ops in patch_atihdmi() were
moved into an if block that is performed only for old chips. Thus, on
newer chips, the generic ops is still used, which doesn't work for
such ATI/AMD chips.
This patch addresses the regression, simply by moving the assignment
of chmap ops to the right place.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=114981
Fixes:
739ffee97ed5 ('ALSA: hda - Add hdmi chmap verb programming ops to chmap object')
Reported-and-tested-by: Daniel Exner <dex@dragonslave.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Adam Thomson [Tue, 10 May 2016 15:11:08 +0000 (16:11 +0100)]
ASoC: da7213: Allow PLL disable/bypass when using 32KHz sysclk
Current checking for PLL 32KHz mode fails in driver code when
bypassing the PLL. This is due to an incorrect check of PLL
source type when 32KHz clock is provided. Removal of this check
resolves the issue.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Adam Thomson [Tue, 10 May 2016 15:11:07 +0000 (16:11 +0100)]
ASoC: da7213: Update PLL ranges to improve locking at frequency boundary
This update changes the dividers used for ranges of input MCLK
frequencies, to improve PLL locking for a corner case when at edge
of MCLK frequency input divider range.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Adam Thomson [Tue, 10 May 2016 15:11:06 +0000 (16:11 +0100)]
ASoC: da7213: Default PC counter to free-running when DAI disabled
Currently PC counter is always synchronised to DAI which means that
when the DAI is disabled, features such as ALC calibration cannot
be executed successfully. This patch makes sure that when the DAI
is disabled, PC counter is set to free-running.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Adam Thomson [Tue, 10 May 2016 15:11:05 +0000 (16:11 +0100)]
ASoC: da7213: Add checking of SRM lock status before enabling DAI
When the codec is DAI clk slave, and the SRM feature of the PLL
is being used, the enabling of the DAI should occur only after
the PLL has locked to the incoming WCLK. This update adds checking
to the the DAI widget event, so it waits for SRM to lock. There is
also a timeout if that lock doesn't occur within a given time.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Adam Thomson [Tue, 10 May 2016 15:11:04 +0000 (16:11 +0100)]
ASoC: da7213: Add DAI DAPM event to control DAI clocks
Currently, when Codec is I2S master DAI clocks are continuously
generated even if all audio streams have stopped. To improve
efficiency, control of the DAI clocks for master mode have been
moved to a DAPM widget event so they're only enabled as required.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Ramesh Babu [Tue, 10 May 2016 16:32:06 +0000 (22:02 +0530)]
ASoC: Intel: Add Broxton-P machine driver
This patch adds the Broxton-P machine driver for Intel Broxton-P
reference boards. This machine uses the RT298 codec
Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Pardha Saradhi K [Tue, 10 May 2016 16:32:05 +0000 (22:02 +0530)]
ASoC: Intel: Skylake: Add more SSP DAIs
The Broxton-P platform has 6 SSPs so we need to add ssp2 thru
ssp5 to DAI list for the driver.
Signed-off-by: Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>
Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Mon, 9 May 2016 11:24:37 +0000 (12:24 +0100)]
ASoC: es8328: Set symmetric rates
Although the ES8328 does support different rates for capture and
playback, only very limited combinations are supported (8kHz and 48kHz
or 8.0182kHz and 44.1kHz) with most rates required to be symmetric.
Instead of adding a lot of complexity for little gain, let's enforce
symmetric rates.
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Mon, 9 May 2016 11:24:36 +0000 (12:24 +0100)]
ASoC: es8328: Support more sample rates
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Mon, 9 May 2016 11:24:35 +0000 (12:24 +0100)]
ASoC: es8328: Support more sample formats
The values are the same for the DAC and ADC so remove the specific
values and use values with shifts.
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Mon, 9 May 2016 11:24:34 +0000 (12:24 +0100)]
ASoC: es8328: Move sample size setup to hw_params
This is a refactor in preparation for supporting more sample sizes which
has no functional change.
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Mon, 9 May 2016 11:24:32 +0000 (12:24 +0100)]
ASoC: es8328: Use single R/W for regmap
The chip only supports single reads and writes.
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Mon, 9 May 2016 11:24:31 +0000 (12:24 +0100)]
ASoC: es8328: Fix mask for VMIDSEL
This is always used along with ES8328_CONTROL1_ENREF so there is no
change in the generated code as a result of this fix.
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Mon, 9 May 2016 11:24:30 +0000 (12:24 +0100)]
ASoC: es8328: Fix ADC format setup
The ADCCONTROL4 and DACCONTROL1 registers are similar but not identical,
with the DACCONTROL1 having each field starting one bit higher than
ADCCONTROL4.
Instead of introducing a magic shift, add new constants for the values
in ADCCONTROL4 and use a second variable to setup the ADC.
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Mon, 9 May 2016 11:24:29 +0000 (12:24 +0100)]
ASoC: es8328: Move clock setup to hw_params
This ensures that the clock is setup after its frequency has been set;
the existing code in set_dai_fmt may be called before the clock rate has
been set resulting in an incorrect configuration.
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai [Tue, 10 May 2016 14:07:40 +0000 (16:07 +0200)]
ALSA: pcm: Bail out when chmap is already present
When snd_pcm_add_chmap_ctls() is called to the PCM stream to which a
chmap has been already assigned, it returns as an error due to the
conflicting snd_ctl_add() result. However, this also clears the
already assigned chmap_kctl field via pcm_chmap_ctl_private_free(),
and becomes inconsistent in the later operation.
This patch adds the check of the conflicting chmap kctl before
actually trying to allocate / assign. The check failure is treated as
a kernel warning, as the double call of snd_pcm_add_chmap_ctls() is
basically a driver bug and having the stack trace would help
developers to figure out the bad code path.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 14:15:56 +0000 (23:15 +0900)]
ALSA: firewire-lib: enable the same feature as CIP_SKIP_INIT_DBC_CHECK flag
In former commit, drivers in ALSA firewire stack always starts IT context
before IR context. If IR context starts after packets are transmitted by
peer unit, packet discontinuity may be detected because the context starts
in the middle of packet streaming. This situation is rare because IT
context usually starts immediately. However, it's better to solve this
issue. This is suppressed with CIP_SKIP_INIT_DBC_CHECK flag.
This commit enables the same feature as CIP_SKIP_INIT_DBC_CHECK.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 14:15:55 +0000 (23:15 +0900)]
ALSA: firewire-lib: code cleanup for outgoing packet handling
In previous commit, this module has no need to reuse parameters of
incoming packets for outgoing packets anymore. This commit arranges some
needless codes for outgoing packet processing.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 14:15:54 +0000 (23:15 +0900)]
ALSA: firewire-lib: code cleanup for incoming packet handling
In previous commit, this module has no need to reuse parameters of
incoming packets for outgoing packets anymore. This commit arranges some
needless codes for incoming packet processing.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 14:15:53 +0000 (23:15 +0900)]
ALSA: firewire-lib: handle IT/IR contexts in each software interrupt context
In clause 6.3 of IEC 61883-6:2000, there's an explanation about processing
of presentation timestamp. In the clause, we can see "If a function block
receives a CIP, processes it and subsequently re-transmits it, then the
SYT of the outgoing CIP shall be the sum of the incoming SYT and the
processing delay." ALSA firewire stack has an implementation to partly
satisfy this specification. Developers assumed the stack to perform as an
Audio function block[1].
Following to the assumption, current implementation of ALSA firewire stack
use one software interrupt context to handle both of in/out packets. In
most case, this is processed in 1394 OHCI IR context independently of the
opposite context. Thus, this implementation uses longer CPU time in the
software interrupt context. This is not better for whole system.
Against the assumption, I confirmed that each ASIC for IEC 61883-1/6
doesn't necessarily expect it to the stack. Thus, current implementation
of ALSA firewire stack includes over-engineering.
This commit purges the implementation. As a result, packets of one
direction are handled in one software interrupt context and spends
minimum CPU time.
[1] [alsa-devel] [PATCH 0/8] [RFC] new driver for Echo Audio's Fireworks based devices
http://mailman.alsa-project.org/pipermail/alsa-devel/2013-June/062660.html
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 14:15:52 +0000 (23:15 +0900)]
ALSA: firewire-tascam: drop reuse of incoming packet parameter for outgoing packet parameter
In packet streaming protocol applied to TASCAM FireWire series, the value
of SYT field in CIP header is always zero, therefore it has no meaning.
There's no need to synchronize packets in both direction for the series.
In current implementation of ALSA firewire stack, driver for the series
uses incoming packet parameter for outgoing packet parameter to calculate
the number of data blocks. This can be simplified because the task of
corresponding driver is to transfer data blocks enough to sampling transfer
frequency.
This commit purges support of full duplex synchronization to prevent
over-engineering implementation.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 14:15:51 +0000 (23:15 +0900)]
ALSA: fireworks: drop reuse of incoming packet parameter for ougoing packet parameter
On Fireworks board module of Echo Audio, TSB43Cx43A (IceLynx Micro, iCEM)
is used to process payload of isochronous packets. There's an public
document of this chip[1]. This document is for firmware programmers to
transfer/receive AMDTP with IEC60958 data format, however in clause 2.5,
2.6 and 2.7, we can see system design to utilize the sequence of value in
SYT field of CIP header. In clause 2.3, we can see the specification of
Audio Master Clock (MCLK) from iCEM.
Well, this clock is actually not used for sampling clock. This can be
confirmed when corresponding driver transfer random value as the sequence
of SYT field. Even if in this case, the unit generates proper sound.
Additionally, in unique command set for this board module, the format
of CIP is changed; for IEC 61883-6 mode which we use, and for Windows
Operating System. In the latter mode, the whole 32 bit field in second CIP
header from Windows driver is used to represent counter of packets (NO-DATA
code is still used for packets without data blocks). If the master clock
was physically used by DSP on the board module, the Windows driver must
have transferred correct sequence of SYT field.
Furthermore, as long as seeing capacities of AudioFire2, AudioFire4,
AudioFire8, AudioFirePre8 and AudioFire12, these models don't support
SYT-Match clock source.
Summary, we have no need to relate incoming/outgoing packets. This commit
drops reusing SYT sequence of incoming packets for outgoing packets.
[1] Using TSB43Cx43A: S/PDIF over 1394 (2003, Texus Instruments
Incorporated)
http://www.ti.com/analog/docs/litabsmultiplefilelist.tsp?literatureNumber=slla148&docCategoryId=1&familyId=361
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 14:15:50 +0000 (23:15 +0900)]
ALSA: bebob: drop reuse of incoming packet parameter for outgoing packet parameter
Windows driver for BeBoB-based models mostly wait for transmitted packets,
then transfer packets to the models. This looks for the relationship
between incoming packets and outgoing packets to synchronize the sequence
of presentation timestamp.
However, the sequence between packets of both direction has no
relationship. Even if receiving NO-DATA packets, the drivers transfer
packets with meaningful value in SYT field. Additionally, the order of
starting packets is always the same, independently of the source of clock.
The corresponding driver is expected as a generator of presentation
timestamp and these models can select it as a source of sampling clock.
This commit drops reusing SYT sequence from ALSA bebob driver. The driver
always transfer packets with presentation timestamp generated by ALSA
firewire stack, without re-using the sequence of value in SYT field in
incoming packets to outgoing packets.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 10 May 2016 14:06:04 +0000 (16:06 +0200)]
Merge branch 'for-linus' into for-next
Yura Pakhuchiy [Sat, 7 May 2016 16:53:36 +0000 (23:53 +0700)]
ALSA: hda - Fix subwoofer pin on ASUS N751 and N551
Subwoofer does not work out of the box on ASUS N751/N551 laptops. This
patch fixes it. Patch tested on N751 laptop. N551 part is not tested,
but according to [1] and [2] this laptop requires similar changes, so I
included them in the patch.
1. https://github.com/honsiorovskyi/asus-n551-hda-fix
2. https://bugs.launchpad.net/ubuntu/+source/alsa-tools/+bug/1405691
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=117781
Signed-off-by: Yura Pakhuchiy <pakhuchiy@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 10 May 2016 08:24:02 +0000 (10:24 +0200)]
ALSA: hda - Fix broken reconfig
The HD-audio reconfig function got broken in the recent kernels,
typically resulting in a failure like:
snd_hda_intel 0000:00:1b.0: control 3:0:0:Playback Channel Map:0 is already present
This is because of the code restructuring to move the PCM and control
instantiation into the codec drive probe, by the commit [
bcd96557bd0a:
ALSA: hda - Build PCMs and controls at codec driver probe]. Although
the commit above removed the calls of snd_hda_codec_build_pcms() and
*_build_controls() at the controller driver probe, the similar calls
in the reconfig were still left forgotten. This caused the
conflicting and duplicated PCMs and controls.
The fix is trivial: just remove these superfluous calls from
reconfig_codec().
Fixes:
bcd96557bd0a ('ALSA: hda - Build PCMs and controls at codec driver probe')
Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
Cc: <stable@vger.kernel.org> # v4.1+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Peter Ujfalusi [Mon, 9 May 2016 10:42:32 +0000 (13:42 +0300)]
ASoC: davinci-mcasp: Calculate AUXCLK divider when setting up master clocks
If the McASP is used as clock master and the reference clock is AUXCLK we
can have additional level of divider. The BCLK divider is limited to
maximum 32, if the desired bclk can not be reached with this, the AUXCLK
divider also needs to be used.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Mon, 9 May 2016 10:42:31 +0000 (13:42 +0300)]
ASoC: davinci-mcasp: Restructure the davinci_mcasp_calc_clk_div()
Change the return value to error_pmm instead of the BCLK div and handle the
divider configuration to McASP within the function when the set flag is
true.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Mon, 9 May 2016 10:42:30 +0000 (13:42 +0300)]
ASoC: davinci-mcasp: Change __davinci_mcasp_set_clkdiv() first parameter
Change the first parameter to struct davinci_mcasp* from
struct snd_soc_dai*
The function internally does not use or need the DAI information.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Peter Ujfalusi [Mon, 9 May 2016 10:42:29 +0000 (13:42 +0300)]
ASoC: davinci-mcasp: Use defines for clkdiv IDs
Instead of hardwired IDs add defines for the available dividers.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai [Mon, 9 May 2016 15:47:37 +0000 (17:47 +0200)]
ALSA: hda - Clarify CONFIG_SND_HDA_RECONFIG usages
Since the recent rewrite of HD-audio infrastructure,
CONFIG_SND_HDA_RECONFIG has a slightly different meaning. In the
earlier versions, it implicitly assumed only the usage via hwdep sysfs
entries. Meanwhile, in the recent version, this option is meant to
enable the reconfig code in HD-audio driver, which may be used by the
patch loader without hwdep interface.
This patch tries to clarify the usage pattern a bit better, hopefully
avoid the further confusion.
Reported-by: Jochen Henneberg <jh@henneberg-systemdesign.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Charles Keepax [Wed, 4 May 2016 13:59:11 +0000 (14:59 +0100)]
ALSA: compress: Replace complex if statement with switch
A switch statement looks a bit cleaner than an if statement
spread over 3 lines, as such update this to a switch.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Charles Keepax [Wed, 4 May 2016 13:59:10 +0000 (14:59 +0100)]
ALSA: compress: Fix poll error return codes
We can't return a negative error code from the poll callback the return
type is unsigned and is checked against the poll specific flags we need
to return POLLERR if we encounter an error.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Charles Keepax [Wed, 4 May 2016 13:59:09 +0000 (14:59 +0100)]
ALSA: compress: Remove pointless NULL check
stream can't be NULL here as we have just taken the address of it, so no
need for the check.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Charles Keepax [Wed, 4 May 2016 13:59:08 +0000 (14:59 +0100)]
ALSA: compress: Use snd_compr_get_poll on error path
We have a function that returns the appropriate flags for the stream
direction, so we should use it.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Charles Keepax [Wed, 4 May 2016 13:59:07 +0000 (14:59 +0100)]
ALSA: pcm: Fix poll error return codes
We can't return a negative error code from the poll callback the return
type is unsigned and is checked against the poll specific flags we need
to return POLLERR if we encounter an error.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Peter Ujfalusi [Mon, 9 May 2016 10:39:14 +0000 (13:39 +0300)]
ASoC: davinci-mcasp: Do not allow multiple streams in one direction
Make sure that the user can not start multiple streams with the same
direction.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Fabio Estevam [Sat, 7 May 2016 23:04:52 +0000 (20:04 -0300)]
MAINTAINERS: Add myself as reviewer of FSL/NXP SoC sound drivers
I would like to help reviewing FSL/NXP SoC sound drivers.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Sakamoto [Mon, 9 May 2016 12:12:46 +0000 (21:12 +0900)]
ALSA: firewire-lib: add tracepoints to dump a part of isochronous packet data
When audio and music units have some quirks in their sequence of packet,
it's really hard for non-owners to identify the quirks. Although developers
need dumps for sequence of packets, it's difficult for users who have no
knowledges and no equipments for this purpose.
This commit adds tracepoints for this situation. When users encounter
the issue, they can dump a part of packet data via Linux tracing framework
as long as using drivers in ALSA firewire stack.
Additionally, tracepoints for outgoing packets will be our help to check
and debug packet processing of ALSA firewire stack.
This commit newly adds 'snd_firewire_lib' subsystem with 'in_packet' and
'out_packet' events. In the events, some attributes of packets and the
index of packet managed by this module are recorded per packet.
This is an usage:
$ trace-cmd record -e snd_firewire_lib:out_packet \
-e snd_firewire_lib:in_packet
/sys/kernel/tracing/events/snd_firewire_lib/out_packet/filter
/sys/kernel/tracing/events/snd_firewire_lib/in_packet/filter
Hit Ctrl^C to stop recording
^C
$ trace-cmd report trace.dat
...
23647.033934: in_packet: 01 4073 ffc0 ffc1 00
000f0040 9001b2d1 122 44
23647.033936: in_packet: 01 4074 ffc0 ffc1 00
000f0048 9001c83b 122 45
23647.033937: in_packet: 01 4075 ffc0 ffc1 00
000f0050 9001ffff 002 46
23647.033938: in_packet: 01 4076 ffc0 ffc1 00
000f0050 9001e1a6 122 47
23647.035426: out_packet: 01 4123 ffc1 ffc0 01
010f00d0 9001fb40 122 17
23647.035428: out_packet: 01 4124 ffc1 ffc0 01
010f00d8 9001ffff 002 18
23647.035429: out_packet: 01 4125 ffc1 ffc0 01
010f00d8 900114aa 122 19
23647.035430: out_packet: 01 4126 ffc1 ffc0 01
010f00e0 90012a15 122 20
(Here, some common fields are omitted so that a line to be within 80
characters.)
...
One line represent one packet. The legend for the last nine fields is:
- The second of cycle scheduled for the packet
- The count of cycle scheduled for the packet
- The ID of node as source (hex)
- Some devices transfer packets with invalid source node ID in their CIP
header.
- The ID of node as destination (hex)
- The value is not in CIP header of packets.
- The value of isochronous channel
- The first quadlet of CIP header (hex)
- The second quadlet of CIP header (hex)
- The number of included quadlets
- The index of packet in a buffer maintained by this module
This is an example to parse these lines from text file by Python3 script:
\#!/usr/bin/env python3
import sys
def parse_ts(second, cycle, syt):
offset = syt & 0xfff
syt >>= 12
if cycle & 0x0f > syt:
cycle += 0x10
cycle &= 0x1ff0
cycle |= syt
second += cycle // 8000
cycle %= 8000
# In CYCLE_TIMER of 1394 OHCI, second is represented in 8 bit.
second %= 128
return (second, cycle, offset)
def calc_ts(second, cycle, offset):
ts = offset
ts += cycle * 3072
# In DMA descriptor of 1394 OHCI, second is represented in 3 bit.
ts += (second % 8) * 8000 * 3072
return ts
def subtract_ts(minuend, subtrahend):
# In DMA descriptor of 1394 OHCI, second is represented in 3 bit.
if minuend < subtrahend:
minuend += 8 * 8000 * 3072
return minuend - subtrahend
if len(sys.argv) != 2:
print('At least, one argument is required for packet dump.')
sys.exit()
filename = sys.argv[1]
data = []
prev = 0
with open(filename, 'r') as f:
for line in f:
pos = line.find('packet:')
if pos < 0:
continue
pos += len('packet:')
line = line[pos:].strip()
fields = line.split(' ')
datum = []
datum.append(fields[8])
syt = int(fields[6][4:], 16)
# Empty packet in IEC 61883-1, or NODATA in IEC 61883-6
if syt == 0xffff:
data_blocks = 0
else:
payload_size = int(fields[7], 10)
data_block_size = int(fields[5][2:4], 16)
data_blocks = (payload_size - 2) / data_block_size
datum.append(data_blocks)
second = int(fields[0], 10)
cycle = int(fields[1], 10)
start = (second << 25) | (cycle << 12)
datum.append('0x{0:08x}'.format(start))
start = calc_ts(second, cycle, 0)
datum.append("0x" + fields[5])
datum.append("0x" + fields[6])
if syt == 0xffff:
second = 0
cycle = 0
tick = 0
else:
second, cycle, tick = parse_ts(second, cycle, syt)
ts = calc_ts(second, cycle, tick)
datum.append(start)
datum.append(ts)
if ts == 0:
datum.append(0)
datum.append(0)
else:
# Usual case, or a case over 8 seconds.
if ts > start or start > 7 * 8000 * 3072:
datum.append(subtract_ts(ts, start))
if ts > prev or start > 7 * 8000 * 3072:
gap = subtract_ts(ts, prev)
datum.append(gap)
else:
datum.append('backward')
else:
datum.append('invalid')
prev = ts
data.append(datum)
sys.exit()
The data variable includes array with these elements:
- The index of the packet
- The number of data blocks in the packet
- The value of cycle count (hex)
- The value of CIP header 1 (hex)
- The value of CIP header 2 (hex)
- The value of cycle count (tick)
- The value of calculated presentation timestamp (tick)
- The offset between the cycle count and presentation timestamp
- The elapsed ticks from the previous presentation timestamp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 12:12:45 +0000 (21:12 +0900)]
ALSA: firewire-lib: compute the value of second field in cycle count for IR context
In callback function of isochronous context, modules can queue packets to
indicated isochronous cycles. Although the cycle to queue a packet is
deterministic by calculation, this module doesn't implement the calculation
because it's useless for processing.
In future, the cycle count is going to be printed with the other parameters
for debugging. This commit is the preparation. The cycle count is computed
by cycle unit, and correctly arranged to corresponding packets. The
calculated count is used in later commit.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Mon, 9 May 2016 12:12:44 +0000 (21:12 +0900)]
ALSA: firewire-lib: compute the value of second field in cycle count for IT context
In callback function of isochronous context, u32 variable is passed for
cycle count. The value of this variable comes from DMA descriptors of 1394
Open Host Controller Interface (1394 OHCI). In the specification, DMA
descriptors transport lower 3 bits for second field and full cycle field in
16 bits field, therefore 16 bits of the u32 variable are available. The
value for second is modulo 8, and the value for cycle is modulo 8,000.
Currently, ALSA firewire-lib module don't use the value of the second
field, because the value is useless to calculate presentation timestamp in
IEC 61883-6. However, the value may be useful for debugging. In later
commit, it will be printed with the other parameters for debugging.
This commit makes this module to handle the whole cycle count including
second. The value is calculated by cycle unit. The existed code is already
written with ignoring the value of second, thus this commit causes no
issues.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Kaho Ng [Sun, 8 May 2016 16:27:49 +0000 (00:27 +0800)]
ALSA: hda - Fix white noise on Asus UX501VW headset
For reducing the noise from the headset output on ASUS UX501VW,
call the existing fixup, alc_fixup_headset_mode_alc668(), additionally.
Thread: https://bbs.archlinux.org/viewtopic.php?id=209554
Signed-off-by: Kaho Ng <ngkaho1234@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Linus Torvalds [Sun, 8 May 2016 21:38:32 +0000 (14:38 -0700)]
Linux 4.6-rc7
Jeeja KP [Thu, 5 May 2016 05:54:43 +0000 (11:24 +0530)]
ALSA: hda: fix to wait for RIRB & CORB DMA to set
If the DMAs are not being quiesced properly, it may lead to
stability issues, so the recommendation is to wait till DMAs are
stopped.
After setting the stop bit of RIRB/CORB DMA, we should wait for
stop bit to be set.
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Vinod Koul [Thu, 5 May 2016 05:54:42 +0000 (11:24 +0530)]
ALSA: hda: fix the missing ptr initialization
ebus is a member of extended device and was never initialized, so
do this at device creation.
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Oliver Neukum [Wed, 4 May 2016 12:18:40 +0000 (14:18 +0200)]
ALSA: usb-midi: correct speed checking
Allow for SS+ USB devices
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Oliver Neukum [Wed, 4 May 2016 12:18:39 +0000 (14:18 +0200)]
ALSA: usb-audio: correct speed checking
Allow handling SS+ USB devices correctly.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Kailang Yang [Wed, 4 May 2016 07:50:18 +0000 (15:50 +0800)]
ALSA: hda/realtek - New codecs support for ALC234/ALC274/ALC294
Support new codecs for ALC234/ALC274/ALC294.
This three codecs was the same IC.
But bonding is not the same.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Dan Carpenter [Wed, 4 May 2016 06:27:37 +0000 (09:27 +0300)]
ALSA: isa/wavefront: prevent some out of bound writes
"header->number" can be up to USHRT_MAX and it comes from the ioctl so
it needs to be capped.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Kangjie Lu [Tue, 3 May 2016 20:44:32 +0000 (16:44 -0400)]
ALSA: timer: Fix leak in events via snd_timer_user_tinterrupt
The stack object “r1” has a total size of 32 bytes. Its field
“event” and “val” both contain 4 bytes padding. These 8 bytes
padding bytes are sent to user without being initialized.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Kangjie Lu [Tue, 3 May 2016 20:44:20 +0000 (16:44 -0400)]
ALSA: timer: Fix leak in events via snd_timer_user_ccallback
The stack object “r1” has a total size of 32 bytes. Its field
“event” and “val” both contain 4 bytes padding. These 8 bytes
padding bytes are sent to user without being initialized.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Kangjie Lu [Tue, 3 May 2016 20:44:07 +0000 (16:44 -0400)]
ALSA: timer: Fix leak in SNDRV_TIMER_IOCTL_PARAMS
The stack object “tread” has a total size of 32 bytes. Its field
“event” and “val” both contain 4 bytes padding. These 8 bytes
padding bytes are sent to user without being initialized.
Signed-off-by: Kangjie Lu <kjlu@gatech.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Vinod Koul [Mon, 2 May 2016 08:36:28 +0000 (14:06 +0530)]
ALSA: compress: fix some typo
Noticed two typos in Documentation, so fix them up
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto [Sat, 30 Apr 2016 13:06:46 +0000 (22:06 +0900)]
ALSA: dice: add support for M-Audio Profire 610 and perhaps 2626
M-Audio Profire 610 has an unexpected value in version field of its config
ROM, thus ALSA dice driver is not assigned to the model due to a mismatch
of modalias.
This commit adds an entry to support the model. I expect the entry is
also for Profire 2626.
I note that Profire 610 uses TCD2220 (so-called Dice Jr.), and supports a
part of Extended Application Protocol (EAP).
$ cd linux-firewire-utils/src
$ ./crpp < /sys/bus/firewire/devices/fw1/config_rom
ROM header and bus information block
------------------------------------------------------------
400
04047689 bus_info_length 4, crc_length 4, crc 30345
404
31333934 bus_name "1394"
408
e0ff8112 irmc 1, cmc 1, isc 1, bmc 0, pmc 0, cyc_clk_acc 255,
max_rec 8 (512), max_rom 1, gen 1, spd 2 (S400)
40c
000d6c04 company_id 000d6c |
410
04400002 device_id
0404400002 | EUI-64
000d6c0404400002
root directory
------------------------------------------------------------
414
000695fe directory_length 6, crc 38398
418
03000d6c vendor
41c
8100000a --> descriptor leaf at 444
420
17000011 model
424
8100000d --> descriptor leaf at 458
428
0c0087c0 node capabilities per IEEE 1394
42c
d1000001 --> unit directory at 430
unit directory at 430
------------------------------------------------------------
430
0004fb14 directory_length 4, crc 64276
434
12000d6c specifier id
438
130100d1 version
43c
17000011 model
440
8100000c --> descriptor leaf at 470
descriptor leaf at 444
------------------------------------------------------------
444
0004b8e4 leaf_length 4, crc 47332
448
00000000 textual descriptor
44c
00000000 minimal ASCII
450
4d2d4175 "M-Au"
454
64696f00 "dio"
descriptor leaf at 458
------------------------------------------------------------
458
00053128 leaf_length 5, crc 12584
45c
00000000 textual descriptor
460
00000000 minimal ASCII
464
50726f46 "ProF"
468
69726520 "ire "
46c
36313000 "610"
descriptor leaf at 470
------------------------------------------------------------
470
00053128 leaf_length 5, crc 12584
474
00000000 textual descriptor
478
00000000 minimal ASCII
47c
50726f46 "ProF"
480
69726520 "ire "
484
36313000 "610"
$ cat /proc/asound/card1/dice
sections:
global: offset 10, size 90
tx: offset 100, size 142
rx: offset 242, size 282
ext_sync: offset 524, size 4
unused2: offset 0, size 0
global:
owner: ffc0:
000100000000
notification:
00000040
nick name: FW610
clock select: internal 48000
enable: 1
status: locked 48000
ext status:
00000040
sample rate: 48000
version: 1.0.4.0
clock caps: 32000 44100 48000 88200 96000 176400 192000 aes1 aes4 aes adat tdif wc arx1 arx2 internal
clock source names: SPDIF\AES34\AES56\TOS\AES_ANY\ADAT\ADAT_AUX\Word Clock\Unused\Unused\Unused\Unused\Internal\\
...
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Linus Torvalds [Sat, 7 May 2016 17:53:32 +0000 (10:53 -0700)]
Merge tag 'char-misc-4.6-rc7' of git://git./linux/kernel/git/gregkh/char-misc
Pull misc driver fixes from Gfreg KH:
"Here are three small fixes for some driver problems that were
reported. Full details in the shortlog below.
All of these have been in linux-next with no reported issues"
* tag 'char-misc-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
nvmem: mxs-ocotp: fix buffer overflow in read
Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()
misc: mic: Fix for double fetch security bug in VOP driver
Linus Torvalds [Sat, 7 May 2016 17:50:48 +0000 (10:50 -0700)]
Merge tag 'staging-4.6-rc7' of git://git./linux/kernel/git/gregkh/staging
Pull IIO driver fixes from Grek KH:
"It's really just IIO drivers here, some small fixes that resolve some
'crash on boot' errors that have shown up in the -rc series, and other
bugfixes that are required.
All have been in linux-next with no reported problems"
* tag 'staging-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
iio: imu: mpu6050: Fix name/chip_id when using ACPI
iio: imu: mpu6050: fix possible NULL dereferences
iio:adc:at91-sama5d2: Repair crash on module removal
iio: ak8975: fix maybe-uninitialized warning
iio: ak8975: Fix NULL pointer exception on early interrupt
Linus Torvalds [Sat, 7 May 2016 17:47:03 +0000 (10:47 -0700)]
Merge tag 'usb-4.6-rc7' of git://git./linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH:
"Here are some last-remaining fixes for USB drivers to resolve issues
that have shown up in testing. And two new device ids as well.
All of these have been in linux-next with no reported issues"
* tag 'usb-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
Revert "USB / PM: Allow USB devices to remain runtime-suspended when sleeping"
usb: musb: jz4740: fix error check of usb_get_phy()
Revert "usb: musb: musb_host: Enable HCD_BH flag to handle urb return in bottom half"
usb: musb: gadget: nuke endpoint before setting its descriptor to NULL
USB: serial: cp210x: add Straizona Focusers device ids
USB: serial: cp210x: add ID for Link ECU
Linus Torvalds [Sat, 7 May 2016 15:27:35 +0000 (08:27 -0700)]
Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King:
"These are a number of updates to fix a few problems found in the ARM
nommu code over the last couple of years, caused mostly by changes on
the mmu side"
* 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
ARM: 8573/1: domain: move {set,get}_domain under config guard
ARM: 8572/1: nommu: change memory reserve for the vectors
ARM: 8571/1: nommu: fix PMSAv7 setup
Linus Torvalds [Sat, 7 May 2016 15:17:45 +0000 (08:17 -0700)]
Merge tag 'media/v4.6-5' of git://git./linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab:
- deadlock fixes on driver probe at exynos4-is and s43-camif drivers
- a build breakage if media controller is enabled and USB or PCI is
built as module.
* tag 'media/v4.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
[media] media-device: fix builds when USB or PCI is compiled as module
[media] media: s3c-camif: fix deadlock on driver probe()
[media] media: exynos4-is: fix deadlock on driver probe
Linus Torvalds [Sat, 7 May 2016 15:13:42 +0000 (08:13 -0700)]
Merge branch 'for-4.6-fixes' of git://git./linux/kernel/git/tj/libata
Pull libata fixes from Tejun Heo:
"An ahci driver addition and updates to ahci port enable handling for
some platform devices"
* 'for-4.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
ata: add AMD Seattle platform driver
ARM: dts: apq8064: add ahci ports-implemented mask
ata: ahci-platform: Add ports-implemented DT bindings.
libahci: save port map for forced port map