Age | Commit message (Collapse) | Author |
|
Use a safer function strscpy() instead of strcpy() for copying to
arrays.
Only idiomatic code replacement, and no functional changes.
Link: https://patch.msgid.link/20250711083051.18759-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
snd_hda_codec_build_controls()
The error from snd_hda_codec_init() was ignored in
snd_hda_codec_build_controls(), which should have been taken account
and abort the flow. Fix it now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-28-tiwai@suse.de
|
|
After all conversions, driver->ops became a must in most places
(except for the codec power setup which might be called before binding
to the codec driver), hence we can get rid of the superfluous
driver->ops NULL checks, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-26-tiwai@suse.de
|
|
Now that all patch_ops usage have been converted to the new
hda_codec_ops probe, we can drop patch_ops from the hda_codec,
together with the calls of patch_ops callbacks.
The hda_codec_ops.free callback is removed as all have been replaced
with the new remove callback.
Also, correct comments mentioning "patch"; it's replaced with "codec
driver".
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-25-tiwai@suse.de
|
|
Until now, we use "patch_ops" embedded in hda_codec object for
defining the callbacks that are used in various places to manage
HD-audio codec. But from the device driver POV, this should have been
rather the driver ops, instead of the callbacks in the codec object.
This patch defines the driver ops for HD-audio codec driver as the
replacement. We reuse the same struct hda_codec_ops, and this is put
as hda_codec_driver.ops. When the driver->ops callbacks are defined,
they are called primarily instead of codec->patch_ops callbacks.
With converting to the driver ops, there is no need to pass the ugly
patch_ops handling in hda_device_id tables. That is, driver_data
field of hda_device_id becomes really optional and it can be used for
passing the codec-specific data (e.g. specifying a model).
The codec entries after the conversion should be with HDA_CODEC_ID()
and co, instead of the former HDA_CODEC_ENTRY().
Once after converting all codec drivers to use driver ops, we can get
rid of codec patch_ops.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-10-tiwai@suse.de
|
|
In the past, we unified HD-audio HDMI codec driver once with a slight
hope that more vendors will follow the standard, but in reality, the
driver received more and more vendor-specific code. In order to make
the messy code a bit more understandable, this patch splits the HDMI
codec driver into multiple drivers again.
Namely, the vendor-specific code for Intel, AMD and Nvidia are moved
into the own drivers, while we split the common HDMI code to two
drivers, the generic HDMI driver and the simple HDMI driver.
So, now we have:
- The generic HDMI driver (snd-hda-codec-hdmi):
providing the common helpers, also supports Glenfly HDMI codecs and
some other codecs that don't need vendor-specific stuff
- The simple HDMI driver (snd-hda-codec-simplehdmi):
devices with no dynamic PCM assignment and with fixed channels,
mostly used by some other drivers, but this driver alone suffices
for VIA HDMI codec support, too
- Intel HDMI driver (snd-hda-codec-intelhdmi):
bound with i915 / Xe DRM, based on the generic HDMI driver
- AMD/ATI HDMI driver (snd-hda-codec-atihdmi):
optionally bound with radeon / amdgpu DRM, based on the generic HDMI
driver
- Nvidia HDMI driver (snd-hda-codec-nvhdmi);
optionally bound with nouveau DRM, based on the generic HDMI driver
- Legacy Nvidia HDMI driver (snd-hda-codec-nvhdmi-mcp):
for 2ch or 8ch outputs, based on the simple HDMI driver
- Nvidia Tegra HDMI driver (snd-hda-codec-tegrahdmi):
based on the generic HDMI driver
Along with the driver split, the enable_silent_stream module option is
moved to snd-hda-codec-intelhdmi, too, as it's an Intel-specific
feature.
Most of the changes here are just to split and move the code to
different files, as well as to rename/expose the functions that are
commonly used by drivers.
The silent stream handling code is slightly modified for putting the
stuff into Intel driver; now a new callback "silent_stream" is defined
in hdmi_ops, and it's called in silent_stream_enable() and *_disable()
functions. The runtime-PM handling in silent_stream_enable() was
cleaned up, and rather taking the runtime PM refcount in the
silent_stream() callback appropriately, instead.
Other than that, there should be no functional changes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-9-tiwai@suse.de
|
|
CONFIG_SND_HDA_PREALLOC_SIZE is used only by controller.c in
sound/hda/common, hence it depends on CONFIG_SND_HDA.
Move the definition to the right place inside SND_HDA if/endif block
in sound/hda/common/Kconfig.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-5-tiwai@suse.de
|
|
The snd-hda-codec module contains the most of common code used by both
HD-audio controller and codec drivers, and it's basically independent
from PCI. Let's move the code to sound/hda/common directory as a part
of code reorganization.
The hda_ prefix is dropped from the most of file names as it's rather
superfluous.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250709160434.1859-4-tiwai@suse.de
|