Merge tag 'asoc-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v4.9
Apart from the cleanups done by Morimoto-san this has very much been a
driver focused release with very little generic change:
- A big factoring out of the simple-card code to allow it to be shared
more with the rcar generic card from Kuninori Morimoto.
- Removal of some operations duplicated on the CODEC level, again by
Kuninori Morimoto.
- Lots more machine support for x86 systems.
- New drivers for Nuvoton NAU88C10, Realtek RT5660 and RT5663.
Mark Brown [Thu, 29 Sep 2016 18:22:52 +0000 (11:22 -0700)]
ASoC: fsl: Fix lockups with recent cache changes
The recent series of changes to the caching in the SSI driver have
caused a number of problems to appear in some test systems. These are
still not fully understood but we're coming up to the merge window so
for now let's revert commit 7de2763d9b3 (ASoC: fsl_ssi: Remove
.num_reg_defaults_raw from regmap_config) as backing that out seems to
resolve the problem on affected systems.
Reported-by: Maciej S. Szmigiero" <mail@maciej.szmigiero.name> Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Marek Vasut <marex@denx.de>
This patch adds SNDRV_PCM_TRIGGER_SUSPEND/RESUME.
Otherwise, it breaks rsnd driver internal start/stop counter
when suspend/resume. This issue was reported/tested by Hiep
Tested-by: Hiep Cao Minh <cm-hiep@jinso.co.jp> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: wm8960: remove usage of obsoleted TLV-related macro
TLV_DB_RANGE_HEAD macro was obsoleted by commit bf1d1c9b6179 ("ALSA: tlv:
add DECLARE_TLV_DB_RANGE()").
This commit removes usage of the macro, with the obsoleting macro renamed
to SNDRV_CTL_TLVD_DECLARE_DB_RANGE().
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/da7219.c:804:57: warning: dubious: x & !y
The line includes a condition statement; '(a < b) & !c'. Practically, the
evaluated value of this statement equals to the value of '(a < b) && !c'.
Although, it's not an usual way to use bitwise operations as logical
operations to several conditions.
This commit fixes the bug.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: stac9766: fix wrong usage of DECLARE_TLV_DB_LINEAR()
As long as reading datasheet of STAC9766/9767, this driver includes wrong
usage of DECLARE_TLV_DB_LINEAR().
In "8.1.2. Master Volume Registers", attenuation of lineout volumes is
represented in 5 bits by -1.5 dB/step from 0 to -46.5 dB. Thus,
'master_tlv' should be dB step representation.
In "8.1.14. Record Gain", gain of volumes is represented in 4 bits by
1.5 dB/step from 0 to 22.5 dB. Thus, 'record_tlv' should be dB step
representation.
In "8.1.5. PC BEEP Volume", attenuation of volume is represented in 4 bits
by -3 dB/step from 0 to 45 dB. Thus, 'beep_tlv' should be dB step
representation.
In "8.1.7. Stereo or Mic Volume" and so on, gain of volumes is represented
in 5 bits by -1.5 dB from 12 to -34.5 dB. Thus, 'mix_tlv' should be dB
step representation.
Totally, current implementation includes misuse of TLV-related macro.
This commit replaces usage of DECLARE_TLV_DB_LINEAR() with
SNDRV_CTL_TLVD_DECLARE_DB_SCALE(), to give proper information to
applications in user land.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Mark Brown <broonie@kernel.org>
This driver has some unused variables. They should be removed.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: wm8991: fix wrong usage of DECLARE_TLV_DB_LINEAR()
As long as reading datasheet of WM8991, this driver includes wrong usage
of DECLARE_TLV_DB_LINEAR().
In "Table 6 Input PGA Volume Range", volume is represented in 5 bits by
1.5 dB/step between -16.5/30.0 dB. Thus, 'in_pga_tlv' should be dB step
representation.
In "Table 34 LOMIX and ROMIX Volume Range", volume is represented in three
bits by -3 dB/step from 0 to -21 dB. Thus, 'out_mix_tlv' should be dB step
represenation.
In "Table 36 LOPGA, ROPGA, LOUT, ROUT and SPKVOL Volume Range", volume is
represented in 7 bits by 1 dB/step from -73 to 6 dB, including mute. Thus,
'out_pga_tlv' should be dB step representation.
In "Table 26 Digital Volume Range", volume is represented in 8 bits by
3/8 dB/step from -71.625 to 0 dB. Thus, 'out_dac_tlv' should be dB step
representation.
In "Table 16 ADC Digital Volume Range", volume is represented in 8 bits by
3/8 dB/step from -71.625 to 17.625 dB. Thus, 'in_adc_tlv' should be dB step
representation.
In "Table 23 Digital Sidetone Volume", volume is represented in 5 bits by
3 dB/step from -36 to 0 dB. Thus, 'out_sidetone_tlv' should be dB step
representation.
In "Table 12 Left Input Mixer Volume Control", volume is represented in
3 bits by 3 dB/step from -12 to 6 dB
Totally, current implementation includes misuse of TLV-related macro.
This commit replaces usage of DECLARE_TLV_DB_LINEAR() with proper macros,
to give proper information to applications in user land.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: rt5616: add static qualifier for file local symbols
Sparse reports below warnings.
rt5616.c:1270:24: warning: symbol 'rt5616_aif_dai_ops' was not declared. Should it be static?
rt5616.c:1277:27: warning: symbol 'rt5616_dai' was not declared. Should it be static?
These two symbols are just used inner the file, thus it's better to add
static qualifier.
This commit adds it.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Tue, 27 Sep 2016 15:35:45 +0000 (16:35 +0100)]
ASoC: arizona: Add output power up/down delays for speaker path
The later Arizona parts do run write sequences to power up and down the
speaker path as such a delay needs to be inserted into the DAPM sequence
to allow this to run. This patch adds appropriate delays into the
existing coalesced delay scheme.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Tue, 27 Sep 2016 15:35:44 +0000 (16:35 +0100)]
ASoC: arizona: Add debug prints for output power up/down times
When debugging it is useful to check the total power up/down delay that
is executed as part of the coalesced output delay. This patch adds some
debug prints for this.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: tlv320aic31xx: add explicit support for tlv320dac31xx
tlv320dac31xx is a subset of tlv320aic31xx:
- it does not have MIC inputs and ADC, thus capture is not supported,
- it has analog inputs AIN1/AIN2 that can be mixed into output.
Although tlv320dac31xx does work with tlv320aic31xx driver, this setup
does register non-existent widgets and non-existent capture stream.
Thus userspace lists non-existent objects in user interfaces, an can
access these, causing operations with device registers that are
declared as "reserved" in tlv320dac31xx datasheet.
This patch fixes this situation by separating controls/widgets/routes
into common, aic31xx-specific, and dac31xx-specific parts. Only parts
that match actual hardware (as declared in "compatible" device tree
property) are registered.
Changes from v1:
- update device tree binding documentation,
- rebased on top of "ASoC: codec duplicated callback function goes to
component on tlv320aic31xx" commit.
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Adam Thomson [Mon, 26 Sep 2016 13:29:21 +0000 (14:29 +0100)]
ASoC: da7219: Disable AAD if codec is not a wake-up source
Currently if AAD is enabled in the device, during system suspend
the feature remains, regardless of whether the codec is a wake-up
source or not. This means some additional power is being used
which is unnecessary, and can causes issues with some platforms'
IRQ handlers where state changes during system suspend aren't
captured.
This patch updates the driver to disable AAD during suspend, if
we're not a wake-up source, and then re-enables this on resume.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Adam Thomson [Mon, 26 Sep 2016 13:29:20 +0000 (14:29 +0100)]
ASoC: da7219: Reset codec gracefully, if still active
Currently the reset code in i2c_probe only resets the AAD part of
the device and not the entire codec. This patch updates the driver
to resolve this and ensures that if the codec is still active from
a previous boot then the audio paths are powered down prior to
reset.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Currently the driver exposes range of sample rates between 8KHz to
192KHz as a part of dai_driver. This does not hold true as the limited
number sample rates are allowed in hw_params DAI callback. This patch
limits the sample rates exposed via dai_driver.
Signed-off-by: Vishal Thanki <vishalthanki@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: sun4i-codec: Rename sun4i_codec_widgets for consistency
Rename "sun4i_codec_widgets" to "sun4i_codec_controls" for
consistency with the struct field name.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Mon, 26 Sep 2016 09:15:24 +0000 (10:15 +0100)]
ASoC: wm_adsp: Allow preloader to do the final shutdown of the DSP
The booting process for the DSP is clearly separated into two parts, the
preloader brings up the core and downloads code, then the main widget
starts the code actually executing. However the shutdown sequence is all
handled with the main widget.
To allow the preloading to be run independently of the main audio bring
up it makes sense, and is generally just cleaner, for the preloader
widget to shutdown those things it initialised. This patch moves the
appropriate parts of the shutdown process into the preloader widget.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Mon, 26 Sep 2016 09:15:23 +0000 (10:15 +0100)]
ASoC: wm_adsp: Put DSP into low power state between loading and running
Between when we load the DSP and when it actually starts running put the
core into a lower power state where the memory is retained but nothing
is clocked.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Mon, 26 Sep 2016 09:15:22 +0000 (10:15 +0100)]
ASoC: wm_adsp: Use usleep_range for short delay
Replace the 1ms msleep in wm_adsp2_ena with a usleep_range, as per
normal guidance on delay functions. Also tighten up the delay a little
as 1ms was quite generous.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Hui Wang [Mon, 26 Sep 2016 02:59:38 +0000 (10:59 +0800)]
ALSA: hda - Adding one more ALC255 pin definition for headset problem
We have two new Dell laptop models, they have the same ALC255 pin
definition, but not in the pin quirk table yet, as a result, the
headset microphone can't work. After adding the definition in the
table, the headset microphone works well.
Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge tag 'trace-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracefs fixes from Steven Rostedt:
"Al Viro has been looking at the tracefs code, and has pointed out some
issues. This contains one fix by me and one by Al. I'm sure that
he'll come up with more but for now I tested these patches and they
don't appear to have any negative impact on tracing"
* tag 'trace-v4.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
fix memory leaks in tracing_buffers_splice_read()
tracing: Move mutex to protect against resetting of seq data
When building XFS with -Werror, it now fails with:
include/linux/pagemap.h: In function 'fault_in_multipages_readable':
include/linux/pagemap.h:602:16: error: variable 'c' set but not used [-Werror=unused-but-set-variable]
volatile char c;
^
This is a regression caused by commit e23d4159b109 ("fix
fault_in_multipages_...() on architectures with no-op access_ok()").
Fix it by re-adding the "(void)c" trick taht was previously used to make
the compiler think the variable is used.
Signed-off-by: Dave Chinner <dchinner@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Lorenzo Stoakes [Sun, 11 Sep 2016 22:54:25 +0000 (23:54 +0100)]
mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing
The NUMA balancing logic uses an arch-specific PROT_NONE page table flag
defined by pte_protnone() or pmd_protnone() to mark PTEs or huge page
PMDs respectively as requiring balancing upon a subsequent page fault.
User-defined PROT_NONE memory regions which also have this flag set will
not normally invoke the NUMA balancing code as do_page_fault() will send
a segfault to the process before handle_mm_fault() is even called.
However if access_remote_vm() is invoked to access a PROT_NONE region of
memory, handle_mm_fault() is called via faultin_page() and
__get_user_pages() without any access checks being performed, meaning
the NUMA balancing logic is incorrectly invoked on a non-NUMA memory
region.
A simple means of triggering this problem is to access PROT_NONE mmap'd
memory using /proc/self/mem which reliably results in the NUMA handling
functions being invoked when CONFIG_NUMA_BALANCING is set.
This issue was reported in bugzilla (issue 99101) which includes some
simple repro code.
There are BUG_ON() checks in do_numa_page() and do_huge_pmd_numa_page()
added at commit c0e7cad to avoid accidentally provoking strange
behaviour by attempting to apply NUMA balancing to pages that are in
fact PROT_NONE. The BUG_ON()'s are consistently triggered by the repro.
This patch moves the PROT_NONE check into mm/memory.c rather than
invoking BUG_ON() as faulting in these pages via faultin_page() is a
valid reason for reaching the NUMA check with the PROT_NONE page table
flag set and is therefore not always a bug.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=99101 Reported-by: Trevor Saunders <tbsaunde@tbsaunde.org> Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Acked-by: Rik van Riel <riel@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Merge tag 'powerpc-4.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull one more powerpc fix from Michael Ellerman:
"powernv/pci: Fix m64 checks for SR-IOV and window alignment from
Russell Currey"
* tag 'powerpc-4.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/powernv/pci: Fix m64 checks for SR-IOV and window alignment
radix tree: fix sibling entry handling in radix_tree_descend()
The fixes to the radix tree test suite show that the multi-order case is
broken. The basic reason is that the radix tree code uses tagged
pointers with the "internal" bit in the low bits, and calculating the
pointer indices was supposed to mask off those bits. But gcc will
notice that we then use the index to re-create the pointer, and will
avoid doing the arithmetic and use the tagged pointer directly.
This cleans the code up, using the existing is_sibling_entry() helper to
validate the sibling pointer range (instead of open-coding it), and
using entry_to_node() to mask off the low tag bit from the pointer. And
once you do that, you might as well just use the now cleaned-up pointer
directly.
[ Side note: the multi-order code isn't actually ever used in the kernel
right now, and the only reason I didn't just delete all that code is
that Kirill Shutemov piped up and said:
"Well, my ext4-with-huge-pages patchset[1] uses multi-order entries.
It also converts shmem-with-huge-pages and hugetlb to them.
I'm okay with converting it to other mechanism, but I need
something. (I looked into Konstantin's RFC patchset[2]. It looks
okay, but I don't feel myself qualified to review it as I don't
know much about radix-tree internals.)"
ALSA: usb-line6: use the same declaration as definition in header for MIDI manufacturer ID
Currently, usb-line6 module exports an array of MIDI manufacturer ID and
usb-pod module uses it. However, the declaration is not the definition in
common header. The difference is explicit length of array. Although
compiler calculates it and everything goes well, it's better to use the
same representation between definition and declaration.
This commit fills the length of array for usb-line6 module. As a small
good sub-effect, this commit suppress below warnings from static analysis
by sparse v0.5.0.
ALSA: control: cage TLV_DB_RANGE_HEAD in kernel land because it was obsoleted
In commit bf1d1c9b6179 ("ALSA: tlv: add DECLARE_TLV_DB_RANGE()"), the new
macro was added so that "dB range information can be specified without
having to count the items manually for TLV_DB_RANGE_HEAD()". In short,
TLV_DB_RANGE_HEAD macro was obsoleted.
In commit 46e860f76804 ("ALSA: rename TLV-related macros so that they're
friendly to user applications"), TLV-related macros are exposed for
applications in user land to get content of data structured by
Type/Length/Value shape. The commit managed to expose TLV-related macros
as many as possible, while obsoleted TLV_DB_RANGE_HEAD() was included to
the list of exposed macros.
This situation brings some confusions to application developers because
they might think all exposed macros have their own purpose and useful for
applications.
For the reason, this commit moves TLV_DB_RANGE_HEAD macro from UAPI header
to a header for kernel land, again. The above commit is done within the
same development period for kernel 4.9, thus not published yet. This
commit might certainly brings no confusions to user land.
Reference: commit bf1d1c9b6179 ("ALSA: tlv: add DECLARE_TLV_DB_RANGE()")
Reference: commit 46e860f76804 ("ALSA: rename TLV-related macros so that they're friendly to user applications") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
tracing: Move mutex to protect against resetting of seq data
The iter->seq can be reset outside the protection of the mutex. So can
reading of user data. Move the mutex up to the beginning of the function.
Fixes: d7350c3f45694 ("tracing/core: make the read callbacks reentrants") Cc: stable@vger.kernel.org # 2.6.30+ Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Paul Burton [Thu, 22 Sep 2016 14:47:40 +0000 (15:47 +0100)]
MIPS: Fix delay slot emulation count in debugfs
Commit 432c6bacbd0c ("MIPS: Use per-mm page to execute branch delay slot
instructions") accidentally removed use of the MIPS_FPU_EMU_INC_STATS
macro from do_dsemulret, leading to the ds_emul file in debugfs always
returning zero even though we perform delay slot emulations.
Fix this by re-adding the use of the MIPS_FPU_EMU_INC_STATS macro.
Signed-off-by: Paul Burton <paul.burton@imgtec.com> Fixes: 432c6bacbd0c ("MIPS: Use per-mm page to execute branch delay slot instructions") Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14301/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Matt Redfearn [Thu, 22 Sep 2016 16:15:47 +0000 (17:15 +0100)]
MIPS: SMP: Fix possibility of deadlock when bringing CPUs online
This patch fixes the possibility of a deadlock when bringing up
secondary CPUs.
The deadlock occurs because the set_cpu_online() is called before
synchronise_count_slave(). This can cause a deadlock if the boot CPU,
having scheduled another thread, attempts to send an IPI to the
secondary CPU, which it sees has been marked online. The secondary is
blocked in synchronise_count_slave() waiting for the boot CPU to enter
synchronise_count_master(), but the boot cpu is blocked in
smp_call_function_many() waiting for the secondary to respond to it's
IPI request.
Fix this by marking the CPU online in cpu_callin_map and synchronising
counters before declaring the CPU online and calculating the maps for
IPIs.
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Thomas Gleixner:
"Three fixlets for perf:
- add a missing NULL pointer check in the intel BTS driver
- make BTS an exclusive PMU because BTS can only handle one event at
a time
- ensure that exclusive events are limited to one PMU so that several
exclusive events can be scheduled on different PMU instances"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/core: Limit matching exclusive events to one PMU
perf/x86/intel/bts: Make it an exclusive PMU
perf/x86/intel/bts: Make sure debug store is valid
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fixes from Thomas Gleixner:
"Two smallish fixes:
- use the proper asm constraint in the Super-H atomic_fetch_ops
- a trivial typo fix in the Kconfig help text"
* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
locking/hung_task: Fix typo in CONFIG_DETECT_HUNG_TASK help text
locking/atomic, arch/sh: Fix ATOMIC_FETCH_OP()
Merge branch 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI fixes from Thomas Gleixner:
"Two fixes for EFI/PAT:
- a 32bit overflow bug in the PAT code which was unearthed by the
large EFI mappings
- prevent a boot hang on large systems when EFI mixed mode is enabled
but not used"
* 'efi-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/efi: Only map RAM into EFI page tables if in mixed-mode
x86/mm/pat: Prevent hang during boot when mapping pages
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes from Thomas Gleixner:
"Three fixes for irq core and irq chip drivers:
- Do not set the irq type if type is NONE. Fixes a boot regression
on various SoCs
- Use the proper cpu for setting up the GIC target list. Discovered
by the cpumask debugging code.
- A rather large fix for the MIPS-GIC so per cpu local interrupts
work again. This was discovered late because the code falls back
to slower timers which use normal device interrupts"
* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
irqchip/mips-gic: Fix local interrupts
irqchip/gicv3: Silence noisy DEBUG_PER_CPU_MAPS warning
genirq: Skip chained interrupt trigger setup if type is IRQ_TYPE_NONE
Signed-off-by: Ben Zhang <benzh@chromium.org> Signed-off-by: Dylan Reid <dgreid@chromium.org>
[john@metanate.com:
- forward-port driver from Chromium OS 3.14 tree to master
- remove wake on voice function that isn't supported by upstream rt5677
driver
- remote owner assignment in platform_driver (Evan McClain)
- convert to devm_snd_soc_register_card (Evan McClain)
- add a full copyright header based on module license and Chromium OS
Git history
] Signed-off-by: John Keeping <john@metanate.com> Tested-by: Genki Marshall <genki@genki.is> Tested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Mark Brown <broonie@kernel.org>
John Keeping [Wed, 24 Aug 2016 21:06:35 +0000 (22:06 +0100)]
ASoC: rt5677: Add ACPI support
The Chromebook Pixel 2015 uses this codec with the ACPI ID RT5677CE, but
does not use the standard DT property names so add a new function to
parse the codec properties from these ACPI properties.
Also, the GPIOs are only available by index, so we need to register a
mapping to allow machine drivers to access the GPIOs by name.
Signed-off-by: John Keeping <john@metanate.com> Tested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Colin Ian King [Fri, 9 Sep 2016 09:09:29 +0000 (10:09 +0100)]
ASoC: Intel: remove status, it is shadowing status of a higher scope
The second declaration of status is shadowing the status of a higher
scope. This uninitialized status results in garbage being returned
by the !x86_match_cpu(cpu_ids) || !iosf_mbi_available() return exit
path. Fix this by removing the extraneous second declaration of
status.
Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Colin Ian King [Fri, 16 Sep 2016 17:30:53 +0000 (18:30 +0100)]
ASoC: samsung: add missing \n to end of pr_err messages
Trival fix, some pr_err messages are missing a \n, so add it.
Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Randy Li [Mon, 19 Sep 2016 18:57:50 +0000 (02:57 +0800)]
ASoC: exynos: organize the asoc audio into a menu
It is simple sound card time, we could assign different codec
to a interface without making a specific driver for it. The SPDIF
and I2S interface for Samsung would be possible used by
simple-sound-card, but not sure about the PCM.
Those S3C time entries are left alone as I don't think any new board
would need them.
Signed-off-by: Randy Li <ayaka@soulik.info> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Tue, 20 Sep 2016 12:52:31 +0000 (13:52 +0100)]
ASoC: wm_adsp: Make DSP preloader a supply widget
Currently the DSP loading is split into two widgets, the preloader that
is a snd_soc_dapm_dai_link widget which starts a thread to download
the firmware, and the DSP itself which is a snd_soc_dapm_out_drv and
synchronises the thread back in to the DAPM sequence. This allows the
firmware download to be overlapped with the rest of the path bring up.
The use of a snd_soc_dapm_dai_link widget requires the preloader to be part
of the audio path in DAPM, really a supply widget is a better fit for the
preloader. The preloader is something that needs to be done for the DSP to
function, not a part of the audio path itself.
This change makes the DSP preloader widget a supply widget, which as well
as probably being a better fit will also make it much simpler to power up
the preloader widget to trigger firmware download to the core independently
of the audio path coming up.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Tue, 20 Sep 2016 12:52:30 +0000 (13:52 +0100)]
ASoC: arizona: Attach SYSCLK to DSP preloaders
Currently SYSCLK is attached to every compressed DAI as this follows the
pattern of attaching clocks to the chips inputs and outputs, however, it is
really the DSP that requires the clock here. As firmware download can be a
significant part of the path startup time for these devices occasionally it
would be desirable to download the firmware in advance of the path being
brought up.
To help facilitate this early firmware loading this patch attaches the
SYSCLK to the DSP preloader widget. This also saves us adding a new route
to SYSCLK every time a new compressed DAI is created.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Tue, 20 Sep 2016 12:52:33 +0000 (13:52 +0100)]
ASoC: wm_adsp: Move control cache sync out of preloader
As part of the work to download firmware before the audio path is brought
up the DSP will be put into a low power state between downloading firmware
to the core and starting it running. This will mean that the firmware ALSA
controls are not accessible in the hardware during this period of time.
To prepare for this change we gate access to the hardware in the ALSA
control handlers on the DSP being running rather than simply booted and
move the synchronisation of the control caches out of the preloader delayed
work and into the main DAPM thread after the DSP will have been brought out
of its low power state.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Charles Keepax [Tue, 20 Sep 2016 12:52:32 +0000 (13:52 +0100)]
ASoC: wm_adsp: Separate concept of booted and running
Currently the wm_adsp driver has a flag that indicates the DSP is
"running", this flag is used to gate access to the hardware. However this
flag is actually set in the firmware download thread after the firmware has
been downloaded, but this is before the core is actually started running,
so really it currently indicates that the core has been booted and is
perhaps running.
This patch clearly separates out the concepts of booted (firmware is
downloaded) and running (code is executing on the DSP) within the wm_adsp
driver.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Merge branch 'hughd-fixes' (patches from Hugh Dickins)
Merge VM fixes from High Dickins:
"I get the impression that Andrew is away or busy at the moment, so I'm
going to send you three independent uncontroversial little mm fixes
directly - though none is strictly a 4.8 regression fix.
- shmem: fix tmpfs to handle the huge= option properly from Toshi
Kani is a one-liner to fix a major embarrassment in 4.8's hugepages
on tmpfs feature: although Hillf pointed it out in June, somehow
both Kirill and I repeatedly dropped the ball on this one. You
might wonder if the feature got tested at all with that bug in:
yes, it did, but for wider testing coverage, Kirill and I had each
relied too much on an override which bypasses that condition.
- huge tmpfs: fix Committed_AS leak just a run-of-the-mill accounting
fix in the same feature.
- mm: delete unnecessary and unsafe init_tlb_ubc() is an unrelated
fix to 4.3's TLB flush batching in reclaim: the bug would be rare,
and none of us will be shamed if this one misses 4.8; but it got
such a quick ack from Mel today that I'm inclined to offer it along
with the first two"
* emailed patches from Hugh Dickins <hughd@google.com>:
mm: delete unnecessary and unsafe init_tlb_ubc()
huge tmpfs: fix Committed_AS leak
shmem: fix tmpfs to handle the huge= option properly
ASoC: tpa6130a2: fix volume setting when no stream is running
After moving tpa6130a2 power management to DAPM, if chip can be physically
powered off (either reset_gpio is defined, or regulator indeed removes
power), then volume change no longer works unless chip is on due to
a running stream.
Fix that by entering regcache cache_only mode while chip is off.
Move regcache calls to tpa6130a2_power() to get them at driver init time
as well.
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Dharageswari R [Thu, 22 Sep 2016 08:30:39 +0000 (14:00 +0530)]
ASoC: Intel: Skylake: Add table for module id for quick ref
Since modules ids are generated dynamically, we do not know the id
associate with modules in another pipelines. This limits our ability to
tell DSP about neighbouring modules.
So add a table for quick referencing of allocated module ids.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Dharageswari R [Thu, 22 Sep 2016 08:30:40 +0000 (14:00 +0530)]
ASoC: Intel: Skylake: Update to use instance ids generated
Post bind parameters of KPB module contains the instance id's of
neighbouring modules in the sink path
Now that module instance ids are generated dynamically we need to update
these parameters as well, so use the table created and update the ids
Signed-off-by: Dharageswari R <dharageswari.r@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Dharageswari R [Thu, 22 Sep 2016 08:30:38 +0000 (14:00 +0530)]
ASoC: Intel: Skylake: Use private instance id of modules in IPC
Use private id's of module instances that are generated during
init_module for the IPC messages to DSP. These id's are freed
up during delete pipeline.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Dharageswari R [Thu, 22 Sep 2016 08:30:37 +0000 (14:00 +0530)]
ASoC: Intel: Skylake: Add module instance id generation APIs
Driver needs to send unique module instance id to firmware while
creating the module and uses this id to communicate with DSP for setting
parameters while audio use case is ongoing.
But, we have upper bound of instance ID. The current IDs are coming from
topology but it doesn't know the upper bound and can't assign unique
id's subject to upper bounds as we can create a big graph but not all
parts running at same time.
This patch adds a 128bit unique id management routines which are built
on top of ffz() for faster implementation. Unfortunately ffz() works on
32bits values, so additional code is added on top of ffz() to create a
128bit unique id.
Signed-off-by: Dharageswari R <dharageswari.r@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
init_tlb_ubc() looked unnecessary to me: tlb_ubc is statically
initialized with zeroes in the init_task, and copied from parent to
child while it is quiescent in arch_dup_task_struct(); so I went to
delete it.
But inserted temporary debug WARN_ONs in place of init_tlb_ubc() to
check that it was always empty at that point, and found them firing:
because memcg reclaim can recurse into global reclaim (when allocating
biosets for swapout in my case), and arrive back at the init_tlb_ubc()
in shrink_node_memcg().
Resetting tlb_ubc.flush_required at that point is wrong: if the upper
level needs a deferred TLB flush, but the lower level turns out not to,
we miss a TLB flush. But fortunately, that's the only part of the
protocol that does not nest: with the initialization removed, cpumask
collects bits from upper and lower levels, and flushes TLB when needed.
Fixes: 72b252aed506 ("mm: send one IPI per CPU to TLB flush all entries after unmapping pages") Signed-off-by: Hugh Dickins <hughd@google.com> Acked-by: Mel Gorman <mgorman@techsingularity.net> Cc: stable@vger.kernel.org # 4.3+ Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Under swapping load on huge tmpfs, /proc/meminfo's Committed_AS grows
bigger and bigger: just a cosmetic issue for most users, but disabling
for those who run without overcommit (/proc/sys/vm/overcommit_memory 2).
shmem_uncharge() was forgetting to unaccount __vm_enough_memory's
charge, and shmem_charge() was forgetting it on the filesystem-full
error path.
The A20 has a few extra registers that the A10 doesn't have.
Therefore, use different regmaps for A10 as compared to A20.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>
ASoC: sun4i-codec: Rename some sun7i-only registers
Some of the registers defined in the driver are only usable on the
A20. Rename these registers.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Mark Brown <broonie@kernel.org>