summaryrefslogtreecommitdiff
path: root/include/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2025-07-09 18:04:27 +0200
committerTakashi Iwai <tiwai@suse.de>2025-07-11 09:55:38 +0200
commitcabaf5908e586156d1d59f3fb8c51d2b169bc636 (patch)
tree9aeb3f2e6cdad162348c02964f7404a222f3c852 /include/sound
parentad781b550f9a8829e3dae4bd3d18c4a126a53d04 (diff)
downloadlinux-cabaf5908e586156d1d59f3fb8c51d2b169bc636.tar.gz
linux-cabaf5908e586156d1d59f3fb8c51d2b169bc636.tar.bz2
linux-cabaf5908e586156d1d59f3fb8c51d2b169bc636.zip
ALSA: hda: Drop old codec binding method
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
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/hda_codec.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h
index a725ac48c20c..ddc9c392f93f 100644
--- a/include/sound/hda_codec.h
+++ b/include/sound/hda_codec.h
@@ -70,12 +70,8 @@ struct hda_bus {
/*
* codec preset
- *
- * Known codecs have the patch to build and set up the controls/PCMs
- * better than the generic parser.
*/
-typedef int (*hda_codec_patch_t)(struct hda_codec *);
-
+
#define HDA_CODEC_ID_SKIP_PROBE 0x00000001
#define HDA_CODEC_ID_GENERIC_HDMI 0x00000101
#define HDA_CODEC_ID_GENERIC 0x00000201
@@ -90,14 +86,6 @@ typedef int (*hda_codec_patch_t)(struct hda_codec *);
#define HDA_CODEC_ID(_vid, _name) \
HDA_CODEC_ID_REV(_vid, 0, _name)
-/* old macros for patch_ops -- to be deprecated */
-#define HDA_CODEC_REV_ENTRY(_vid, _rev, _name, _patch) \
- { .vendor_id = (_vid), .rev_id = (_rev), .name = (_name), \
- .api_version = HDA_DEV_LEGACY, \
- .driver_data = (unsigned long)(_patch) }
-#define HDA_CODEC_ENTRY(_vid, _name, _patch) \
- HDA_CODEC_REV_ENTRY(_vid, 0, _name, _patch)
-
struct hda_codec_driver {
struct hdac_driver core;
const struct hda_device_id *id;
@@ -116,14 +104,13 @@ void hda_codec_driver_unregister(struct hda_codec_driver *drv);
module_driver(drv, hda_codec_driver_register, \
hda_codec_driver_unregister)
-/* ops set by the preset patch */
+/* ops for hda codec driver */
struct hda_codec_ops {
int (*probe)(struct hda_codec *codec, const struct hda_device_id *id);
void (*remove)(struct hda_codec *codec);
int (*build_controls)(struct hda_codec *codec);
int (*build_pcms)(struct hda_codec *codec);
int (*init)(struct hda_codec *codec);
- void (*free)(struct hda_codec *codec);
void (*unsol_event)(struct hda_codec *codec, unsigned int res);
void (*set_power_state)(struct hda_codec *codec, hda_nid_t fg,
unsigned int power_state);
@@ -199,9 +186,6 @@ struct hda_codec {
const struct hda_device_id *preset;
const char *modelname; /* model name for preset */
- /* set by patch */
- struct hda_codec_ops patch_ops;
-
/* PCM to create, set by hda_codec_ops.build_pcms callback */
struct list_head pcm_list_head;
refcount_t pcm_ref;
@@ -500,8 +484,6 @@ int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid)
if (driver->ops && driver->ops->check_power_status)
return driver->ops->check_power_status(codec, nid);
- else if (codec->patch_ops.check_power_status)
- return codec->patch_ops.check_power_status(codec, nid);
return 0;
}