2019-05-19 20:07:45 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2015-02-18 04:46:37 +08:00
|
|
|
config SND_HDA_CORE
|
|
|
|
tristate
|
ALSA: hda - Add regmap support
This patch adds an infrastructure to support regmap-based verb
accesses. Because o the asymmetric nature of HD-audio verbs,
especially the amp verbs, we need to translate the verbs as a sort of
pseudo registers to be mapped uniquely in regmap.
In this patch, a pseudo register is built from the NID, the
AC_VERB_GET_* and 8bit parameters, i.e. almost in the form to be sent
to HD-audio bus but without codec address field. OTOH, for writing,
the same pseudo register is translated to AC_VERB_SET_* automatically.
The AC_VERB_SET_AMP_* verb is re-encoded from the corresponding
AC_VERB_GET_AMP_* verb and parameter at writing.
Some verbs has a single command for read but multiple for writes. A
write for such a verb is split automatically to multiple verbs.
The patch provides also a few handy helper functions. They are
designed to be accessible even without regmap. When no regmap is set
up (e.g. before the codec device instantiation), the direct hardware
access is used. Also, it tries to avoid the unnecessary power-up.
The power up/down sequence is performed only on demand.
The codec driver needs to call snd_hdac_regmap_exit() and
snd_hdac_regmap_exit() at probe and remove if it wants the regmap
access.
There is one flag added to hdac_device. When the flag lazy_cache is
set, regmap helper ignores a write for a suspended device and returns
as if it was actually written. It reduces the hardware access pretty
much, e.g. when adjusting the mixer volume while in idle. This
assumes that the driver will sync the cache later at resume properly,
so use it carefully.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-25 21:42:38 +08:00
|
|
|
select REGMAP
|
2015-04-14 18:53:28 +08:00
|
|
|
|
|
|
|
config SND_HDA_DSP_LOADER
|
|
|
|
bool
|
2015-05-19 22:29:30 +08:00
|
|
|
|
2019-08-08 02:32:08 +08:00
|
|
|
config SND_HDA_ALIGNED_MMIO
|
|
|
|
bool
|
|
|
|
|
ALSA: hda: Make audio component support more generic
This is the final step for more generic support of DRM audio
component. The generic audio component code is now moved to its own
file, and the symbols are renamed from snd_hac_i915_* to
snd_hdac_acomp_*, respectively. The generic code is enabled via the
new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
kept as the super-class.
Along with the split, three new callbacks are added to audio_ops:
pin2port is for providing the conversion between the pin number and
the widget id, and master_bind/master_unbin are called at binding /
unbinding the master component, respectively. All these are optional,
but used in i915 implementation and also other later implementations.
A note about the new snd_hdac_acomp_init() function: there is a slight
difference between this and the old snd_hdac_i915_init(). The latter
(still) synchronizes with the master component binding, i.e. it
assures that the relevant DRM component gets bound when it returns, or
gives a negative error. Meanwhile the new function doesn't
synchronize but just leaves as is. It's the responsibility by the
caller's side to synchronize, or the caller may accept the
asynchronous binding on the fly.
v1->v2: Fix missing NULL check in master_bind/unbind
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-11 22:23:16 +08:00
|
|
|
config SND_HDA_COMPONENT
|
|
|
|
bool
|
|
|
|
|
2015-05-19 22:29:30 +08:00
|
|
|
config SND_HDA_I915
|
|
|
|
bool
|
ALSA: hda: Make audio component support more generic
This is the final step for more generic support of DRM audio
component. The generic audio component code is now moved to its own
file, and the symbols are renamed from snd_hac_i915_* to
snd_hdac_acomp_*, respectively. The generic code is enabled via the
new kconfig, CONFIG_SND_HDA_COMPONENT, while CONFIG_SND_HDA_I915 is
kept as the super-class.
Along with the split, three new callbacks are added to audio_ops:
pin2port is for providing the conversion between the pin number and
the widget id, and master_bind/master_unbin are called at binding /
unbinding the master component, respectively. All these are optional,
but used in i915 implementation and also other later implementations.
A note about the new snd_hdac_acomp_init() function: there is a slight
difference between this and the old snd_hdac_i915_init(). The latter
(still) synchronizes with the master component binding, i.e. it
assures that the relevant DRM component gets bound when it returns, or
gives a negative error. Meanwhile the new function doesn't
synchronize but just leaves as is. It's the responsibility by the
caller's side to synchronize, or the caller may accept the
asynchronous binding on the fly.
v1->v2: Fix missing NULL check in master_bind/unbind
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2018-07-11 22:23:16 +08:00
|
|
|
select SND_HDA_COMPONENT
|
2015-06-11 16:41:47 +08:00
|
|
|
|
|
|
|
config SND_HDA_EXT_CORE
|
|
|
|
tristate
|
|
|
|
select SND_HDA_CORE
|
2015-06-16 23:30:22 +08:00
|
|
|
|
|
|
|
config SND_HDA_PREALLOC_SIZE
|
2021-03-19 00:06:18 +08:00
|
|
|
int "Pre-allocated buffer size for HD-audio driver" if !SND_DMA_SGBUF
|
2015-06-16 23:30:22 +08:00
|
|
|
range 0 32768
|
2021-03-19 00:06:18 +08:00
|
|
|
default 0 if SND_DMA_SGBUF
|
ALSA: hda: No preallocation on x86 platforms
Like many other drivers, HD-audio drivers also do PCM buffer
preallocation to assure the buffer pages allocated at the early boot
stage. This step is useful for platforms that may fail to allocate
the PCM hardware buffers -- which is mostly for either large
continuous pages or with the specific DMA mask (like emu10k1).
OTOH, when a buffer is allocated as SG-buffer and the DMA mask is
either 32 or 64 bits, the allocation almost never fails unless it hits
the real OOM situation. In such a case, we don't need the
preallocation inevitably unlike the cases above.
That said, we may drop the preallocation for HD-audio that does
allocate via SG-buffers, and the patch achieves it.
However, there is one caveat: the buffer allocation behavior depends
on CONFIG_SND_DMA_SGBUF, and it falls back to the continuous pages
when it's not set. And, currently this SG buffer allocation is
enabled only on x86 platforms. So, covering those fall-outs, the
patch adjusts CONFIG_SND_HDA_PREALLOC_SIZE depending on the condition,
and keeps the old behavior as-is for non-x86 platforms.
On x86, the kconfig item is no longer adjustable but always set to
zero for disabling the preallocation. You can still enable the
preallocation via procfs interface at any time later, too.
Link: https://lore.kernel.org/r/20200120124423.11862-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-01-20 20:44:23 +08:00
|
|
|
default 64 if !SND_DMA_SGBUF
|
2015-06-16 23:30:22 +08:00
|
|
|
help
|
|
|
|
Specifies the default pre-allocated buffer-size in kB for the
|
|
|
|
HD-audio driver. A larger buffer (e.g. 2048) is preferred
|
|
|
|
for systems using PulseAudio. The default 64 is chosen just
|
|
|
|
for compatibility reasons.
|
2021-03-19 00:06:18 +08:00
|
|
|
On x86 systems, the default is zero as we need no preallocation.
|
2015-06-16 23:30:22 +08:00
|
|
|
|
|
|
|
Note that the pre-allocation size can be changed dynamically
|
|
|
|
via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too.
|
2019-07-29 23:51:48 +08:00
|
|
|
|
|
|
|
config SND_INTEL_NHLT
|
2019-10-23 01:43:12 +08:00
|
|
|
bool
|
2019-07-29 23:51:48 +08:00
|
|
|
# this config should be selected only for Intel ACPI platforms.
|
2019-10-23 01:43:12 +08:00
|
|
|
# A fallback is provided so that the code compiles in all cases.
|
|
|
|
|
|
|
|
config SND_INTEL_DSP_CONFIG
|
|
|
|
tristate
|
2024-04-19 16:43:06 +08:00
|
|
|
select ACPI_NHLT if ACPI
|
2019-10-23 01:43:12 +08:00
|
|
|
select SND_INTEL_NHLT if ACPI
|
2021-03-02 08:31:24 +08:00
|
|
|
select SND_INTEL_SOUNDWIRE_ACPI if ACPI
|
2019-10-23 01:43:12 +08:00
|
|
|
# this config should be selected only for Intel DSP platforms.
|
|
|
|
# A fallback is provided so that the code compiles in all cases.
|
2021-02-08 21:59:19 +08:00
|
|
|
|
2021-03-02 08:31:24 +08:00
|
|
|
config SND_INTEL_SOUNDWIRE_ACPI
|
|
|
|
tristate
|
|
|
|
|
2021-02-08 21:59:19 +08:00
|
|
|
config SND_INTEL_BYT_PREFER_SOF
|
|
|
|
bool "Prefer SOF driver over SST on BY/CHT platforms"
|
|
|
|
depends on SND_SST_ATOM_HIFI2_PLATFORM_ACPI && SND_SOC_SOF_BAYTRAIL
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
The kernel has 2 drivers for the Low Power Engine audio-block on
|
|
|
|
Bay- and Cherry-Trail SoCs. The old SST driver and the new SOF
|
|
|
|
driver. If both drivers are enabled then the kernel will default
|
|
|
|
to using the old SST driver, unless told otherwise through the
|
|
|
|
snd_intel_dspcfg.dsp_driver module-parameter.
|
|
|
|
|
|
|
|
Set this option to Y to make the kernel default to the new SOF
|
|
|
|
driver instead.
|