Commit b9a94a9c authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - convert to hda_device_id

Finally we have a proper infrastructure to generate the modaliases
automatically, let's move to hda_device_id from the legacy
hda_codec_preset that contains basically the same information.

The patch function hook is stored in driver_data field, which is long,
and we need an explicit cast.  Other than that, the conversion is
mostly straightforward.  Each entry is even simplified using a macro,
and the lengthy (and error-prone) manual modaliases got removed.

As a result, we achieved a quite good diet:
 14 files changed, 407 insertions(+), 595 deletions(-)
Reviewed-by: default avatarVinod Koul <vinod.koul@intel.com>
Tested-by: default avatarSubhransu S Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 78abb2af
......@@ -15,21 +15,22 @@
#include "hda_local.h"
/*
* find a matching codec preset
* find a matching codec id
*/
static int hda_codec_match(struct hdac_device *dev, struct hdac_driver *drv)
{
struct hda_codec *codec = container_of(dev, struct hda_codec, core);
struct hda_codec_driver *driver =
container_of(drv, struct hda_codec_driver, core);
const struct hda_codec_preset *preset;
const struct hda_device_id *list;
/* check probe_id instead of vendor_id if set */
u32 id = codec->probe_id ? codec->probe_id : codec->core.vendor_id;
u32 rev_id = codec->core.revision_id;
for (preset = driver->preset; preset->id; preset++) {
if (preset->id == id &&
(!preset->rev || preset->rev == codec->core.revision_id)) {
codec->preset = preset;
for (list = driver->id; list->vendor_id; list++) {
if (list->vendor_id == id &&
(!list->rev_id || list->rev_id == rev_id)) {
codec->preset = list;
return 1;
}
}
......@@ -77,6 +78,7 @@ static int hda_codec_driver_probe(struct device *dev)
{
struct hda_codec *codec = dev_to_hda_codec(dev);
struct module *owner = dev->driver->owner;
hda_codec_patch_t patch;
int err;
if (WARN_ON(!codec->preset))
......@@ -94,9 +96,12 @@ static int hda_codec_driver_probe(struct device *dev)
goto error;
}
err = codec->preset->patch(codec);
if (err < 0)
goto error_module;
patch = (hda_codec_patch_t)codec->preset->driver_data;
if (patch) {
err = patch(codec);
if (err < 0)
goto error_module;
}
err = snd_hda_codec_build_pcms(codec);
if (err < 0)
......@@ -173,11 +178,10 @@ static inline bool codec_probed(struct hda_codec *codec)
static void codec_bind_module(struct hda_codec *codec)
{
#ifdef MODULE
request_module("snd-hda-codec-id:%08x", codec->core.vendor_id);
if (codec_probed(codec))
return;
request_module("snd-hda-codec-id:%04x*",
(codec->core.vendor_id >> 16) & 0xffff);
char modalias[32];
snd_hdac_codec_modalias(&codec->core, modalias, sizeof(modalias));
request_module(modalias);
if (codec_probed(codec))
return;
#endif
......
......@@ -22,6 +22,7 @@
#define __SOUND_HDA_CODEC_H
#include <linux/kref.h>
#include <linux/mod_devicetable.h>
#include <sound/info.h>
#include <sound/control.h>
#include <sound/pcm.h>
......@@ -80,19 +81,21 @@ struct hda_bus {
* Known codecs have the patch to build and set up the controls/PCMs
* better than the generic parser.
*/
struct hda_codec_preset {
unsigned int id;
unsigned int rev;
const char *name;
int (*patch)(struct hda_codec *codec);
};
typedef int (*hda_codec_patch_t)(struct hda_codec *);
#define HDA_CODEC_ID_GENERIC_HDMI 0x00000101
#define HDA_CODEC_ID_GENERIC 0x00000201
#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_codec_preset *preset;
const struct hda_device_id *id;
};
int __hda_codec_driver_register(struct hda_codec_driver *drv, const char *name,
......@@ -183,7 +186,7 @@ struct hda_codec {
u32 probe_id; /* overridden id for probing */
/* detected preset */
const struct hda_codec_preset *preset;
const struct hda_device_id *preset;
const char *modelname; /* model name for preset */
/* set by patch */
......
......@@ -5877,13 +5877,14 @@ static int snd_hda_parse_generic_codec(struct hda_codec *codec)
return err;
}
static const struct hda_codec_preset snd_hda_preset_generic[] = {
{ .id = HDA_CODEC_ID_GENERIC, .patch = snd_hda_parse_generic_codec },
static const struct hda_device_id snd_hda_id_generic[] = {
HDA_CODEC_ENTRY(HDA_CODEC_ID_GENERIC, "Generic", snd_hda_parse_generic_codec),
{} /* terminator */
};
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_generic);
static struct hda_codec_driver generic_driver = {
.preset = snd_hda_preset_generic,
.id = snd_hda_id_generic,
};
module_hda_codec_driver(generic_driver);
......
......@@ -1165,32 +1165,31 @@ static int patch_ad1882(struct hda_codec *codec)
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_analog[] = {
{ .id = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884 },
{ .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 },
{ .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884 },
{ .id = 0x11d41884, .name = "AD1884", .patch = patch_ad1884 },
{ .id = 0x11d4194a, .name = "AD1984A", .patch = patch_ad1884 },
{ .id = 0x11d4194b, .name = "AD1984B", .patch = patch_ad1884 },
{ .id = 0x11d41981, .name = "AD1981", .patch = patch_ad1981 },
{ .id = 0x11d41983, .name = "AD1983", .patch = patch_ad1983 },
{ .id = 0x11d41984, .name = "AD1984", .patch = patch_ad1884 },
{ .id = 0x11d41986, .name = "AD1986A", .patch = patch_ad1986a },
{ .id = 0x11d41988, .name = "AD1988", .patch = patch_ad1988 },
{ .id = 0x11d4198b, .name = "AD1988B", .patch = patch_ad1988 },
{ .id = 0x11d4882a, .name = "AD1882A", .patch = patch_ad1882 },
{ .id = 0x11d4989a, .name = "AD1989A", .patch = patch_ad1988 },
{ .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 },
static const struct hda_device_id snd_hda_id_analog[] = {
HDA_CODEC_ENTRY(0x11d4184a, "AD1884A", patch_ad1884),
HDA_CODEC_ENTRY(0x11d41882, "AD1882", patch_ad1882),
HDA_CODEC_ENTRY(0x11d41883, "AD1883", patch_ad1884),
HDA_CODEC_ENTRY(0x11d41884, "AD1884", patch_ad1884),
HDA_CODEC_ENTRY(0x11d4194a, "AD1984A", patch_ad1884),
HDA_CODEC_ENTRY(0x11d4194b, "AD1984B", patch_ad1884),
HDA_CODEC_ENTRY(0x11d41981, "AD1981", patch_ad1981),
HDA_CODEC_ENTRY(0x11d41983, "AD1983", patch_ad1983),
HDA_CODEC_ENTRY(0x11d41984, "AD1984", patch_ad1884),
HDA_CODEC_ENTRY(0x11d41986, "AD1986A", patch_ad1986a),
HDA_CODEC_ENTRY(0x11d41988, "AD1988", patch_ad1988),
HDA_CODEC_ENTRY(0x11d4198b, "AD1988B", patch_ad1988),
HDA_CODEC_ENTRY(0x11d4882a, "AD1882A", patch_ad1882),
HDA_CODEC_ENTRY(0x11d4989a, "AD1989A", patch_ad1988),
HDA_CODEC_ENTRY(0x11d4989b, "AD1989B", patch_ad1988),
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:11d4*");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_analog);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Analog Devices HD-audio codec");
static struct hda_codec_driver analog_driver = {
.preset = snd_hda_preset_analog,
.id = snd_hda_id_analog,
};
module_hda_codec_driver(analog_driver);
......@@ -83,22 +83,19 @@ static int patch_ca0110(struct hda_codec *codec)
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_ca0110[] = {
{ .id = 0x1102000a, .name = "CA0110-IBG", .patch = patch_ca0110 },
{ .id = 0x1102000b, .name = "CA0110-IBG", .patch = patch_ca0110 },
{ .id = 0x1102000d, .name = "SB0880 X-Fi", .patch = patch_ca0110 },
static const struct hda_device_id snd_hda_id_ca0110[] = {
HDA_CODEC_ENTRY(0x1102000a, "CA0110-IBG", patch_ca0110),
HDA_CODEC_ENTRY(0x1102000b, "CA0110-IBG", patch_ca0110),
HDA_CODEC_ENTRY(0x1102000d, "SB0880 X-Fi", patch_ca0110),
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:1102000a");
MODULE_ALIAS("snd-hda-codec-id:1102000b");
MODULE_ALIAS("snd-hda-codec-id:1102000d");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_ca0110);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Creative CA0110-IBG HD-audio codec");
static struct hda_codec_driver ca0110_driver = {
.preset = snd_hda_preset_ca0110,
.id = snd_hda_id_ca0110,
};
module_hda_codec_driver(ca0110_driver);
......@@ -4778,18 +4778,17 @@ static int patch_ca0132(struct hda_codec *codec)
/*
* patch entries
*/
static struct hda_codec_preset snd_hda_preset_ca0132[] = {
{ .id = 0x11020011, .name = "CA0132", .patch = patch_ca0132 },
static struct hda_device_id snd_hda_id_ca0132[] = {
HDA_CODEC_ENTRY(0x11020011, "CA0132", patch_ca0132),
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:11020011");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_ca0132);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Creative Sound Core3D codec");
static struct hda_codec_driver ca0132_driver = {
.preset = snd_hda_preset_ca0132,
.id = snd_hda_id_ca0132,
};
module_hda_codec_driver(ca0132_driver);
......@@ -1201,26 +1201,21 @@ static int patch_cs4213(struct hda_codec *codec)
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_cirrus[] = {
{ .id = 0x10134206, .name = "CS4206", .patch = patch_cs420x },
{ .id = 0x10134207, .name = "CS4207", .patch = patch_cs420x },
{ .id = 0x10134208, .name = "CS4208", .patch = patch_cs4208 },
{ .id = 0x10134210, .name = "CS4210", .patch = patch_cs4210 },
{ .id = 0x10134213, .name = "CS4213", .patch = patch_cs4213 },
static const struct hda_device_id snd_hda_id_cirrus[] = {
HDA_CODEC_ENTRY(0x10134206, "CS4206", patch_cs420x),
HDA_CODEC_ENTRY(0x10134207, "CS4207", patch_cs420x),
HDA_CODEC_ENTRY(0x10134208, "CS4208", patch_cs4208),
HDA_CODEC_ENTRY(0x10134210, "CS4210", patch_cs4210),
HDA_CODEC_ENTRY(0x10134213, "CS4213", patch_cs4213),
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:10134206");
MODULE_ALIAS("snd-hda-codec-id:10134207");
MODULE_ALIAS("snd-hda-codec-id:10134208");
MODULE_ALIAS("snd-hda-codec-id:10134210");
MODULE_ALIAS("snd-hda-codec-id:10134213");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_cirrus);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Cirrus Logic HD-audio codec");
static struct hda_codec_driver cirrus_driver = {
.preset = snd_hda_preset_cirrus,
.id = snd_hda_id_cirrus,
};
module_hda_codec_driver(cirrus_driver);
......@@ -123,22 +123,19 @@ static int patch_cmi8888(struct hda_codec *codec)
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_cmedia[] = {
{ .id = 0x13f68888, .name = "CMI8888", .patch = patch_cmi8888 },
{ .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 },
{ .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 },
static const struct hda_device_id snd_hda_id_cmedia[] = {
HDA_CODEC_ENTRY(0x13f68888, "CMI8888", patch_cmi8888),
HDA_CODEC_ENTRY(0x13f69880, "CMI9880", patch_cmi9880),
HDA_CODEC_ENTRY(0x434d4980, "CMI9880", patch_cmi9880),
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:13f68888");
MODULE_ALIAS("snd-hda-codec-id:13f69880");
MODULE_ALIAS("snd-hda-codec-id:434d4980");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_cmedia);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("C-Media HD-audio codec");
static struct hda_codec_driver cmedia_driver = {
.preset = snd_hda_preset_cmedia,
.id = snd_hda_id_cmedia,
};
module_hda_codec_driver(cmedia_driver);
......@@ -954,100 +954,44 @@ static int patch_conexant_auto(struct hda_codec *codec)
/*
*/
static const struct hda_codec_preset snd_hda_preset_conexant[] = {
{ .id = 0x14f15045, .name = "CX20549 (Venice)",
.patch = patch_conexant_auto },
{ .id = 0x14f15047, .name = "CX20551 (Waikiki)",
.patch = patch_conexant_auto },
{ .id = 0x14f15051, .name = "CX20561 (Hermosa)",
.patch = patch_conexant_auto },
{ .id = 0x14f15066, .name = "CX20582 (Pebble)",
.patch = patch_conexant_auto },
{ .id = 0x14f15067, .name = "CX20583 (Pebble HSF)",
.patch = patch_conexant_auto },
{ .id = 0x14f15068, .name = "CX20584",
.patch = patch_conexant_auto },
{ .id = 0x14f15069, .name = "CX20585",
.patch = patch_conexant_auto },
{ .id = 0x14f1506c, .name = "CX20588",
.patch = patch_conexant_auto },
{ .id = 0x14f1506e, .name = "CX20590",
.patch = patch_conexant_auto },
{ .id = 0x14f15097, .name = "CX20631",
.patch = patch_conexant_auto },
{ .id = 0x14f15098, .name = "CX20632",
.patch = patch_conexant_auto },
{ .id = 0x14f150a1, .name = "CX20641",
.patch = patch_conexant_auto },
{ .id = 0x14f150a2, .name = "CX20642",
.patch = patch_conexant_auto },
{ .id = 0x14f150ab, .name = "CX20651",
.patch = patch_conexant_auto },
{ .id = 0x14f150ac, .name = "CX20652",
.patch = patch_conexant_auto },
{ .id = 0x14f150b8, .name = "CX20664",
.patch = patch_conexant_auto },
{ .id = 0x14f150b9, .name = "CX20665",
.patch = patch_conexant_auto },
{ .id = 0x14f150f1, .name = "CX20721",
.patch = patch_conexant_auto },
{ .id = 0x14f150f2, .name = "CX20722",
.patch = patch_conexant_auto },
{ .id = 0x14f150f3, .name = "CX20723",
.patch = patch_conexant_auto },
{ .id = 0x14f150f4, .name = "CX20724",
.patch = patch_conexant_auto },
{ .id = 0x14f1510f, .name = "CX20751/2",
.patch = patch_conexant_auto },
{ .id = 0x14f15110, .name = "CX20751/2",
.patch = patch_conexant_auto },
{ .id = 0x14f15111, .name = "CX20753/4",
.patch = patch_conexant_auto },
{ .id = 0x14f15113, .name = "CX20755",
.patch = patch_conexant_auto },
{ .id = 0x14f15114, .name = "CX20756",
.patch = patch_conexant_auto },
{ .id = 0x14f15115, .name = "CX20757",
.patch = patch_conexant_auto },
{ .id = 0x14f151d7, .name = "CX20952",
.patch = patch_conexant_auto },
static const struct hda_device_id snd_hda_id_conexant[] = {
HDA_CODEC_ENTRY(0x14f15045, "CX20549 (Venice)", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15047, "CX20551 (Waikiki)", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15051, "CX20561 (Hermosa)", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15066, "CX20582 (Pebble)", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15067, "CX20583 (Pebble HSF)", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15068, "CX20584", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15069, "CX20585", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f1506c, "CX20588", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f1506e, "CX20590", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15097, "CX20631", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15098, "CX20632", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150a1, "CX20641", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150a2, "CX20642", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150ab, "CX20651", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150ac, "CX20652", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150b8, "CX20664", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150b9, "CX20665", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150f1, "CX20721", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150f2, "CX20722", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150f3, "CX20723", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f150f4, "CX20724", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f1510f, "CX20751/2", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15110, "CX20751/2", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15111, "CX20753/4", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15113, "CX20755", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15114, "CX20756", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f15115, "CX20757", patch_conexant_auto),
HDA_CODEC_ENTRY(0x14f151d7, "CX20952", patch_conexant_auto),
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:14f15045");
MODULE_ALIAS("snd-hda-codec-id:14f15047");
MODULE_ALIAS("snd-hda-codec-id:14f15051");
MODULE_ALIAS("snd-hda-codec-id:14f15066");
MODULE_ALIAS("snd-hda-codec-id:14f15067");
MODULE_ALIAS("snd-hda-codec-id:14f15068");
MODULE_ALIAS("snd-hda-codec-id:14f15069");
MODULE_ALIAS("snd-hda-codec-id:14f1506c");
MODULE_ALIAS("snd-hda-codec-id:14f1506e");
MODULE_ALIAS("snd-hda-codec-id:14f15097");
MODULE_ALIAS("snd-hda-codec-id:14f15098");
MODULE_ALIAS("snd-hda-codec-id:14f150a1");
MODULE_ALIAS("snd-hda-codec-id:14f150a2");
MODULE_ALIAS("snd-hda-codec-id:14f150ab");
MODULE_ALIAS("snd-hda-codec-id:14f150ac");
MODULE_ALIAS("snd-hda-codec-id:14f150b8");
MODULE_ALIAS("snd-hda-codec-id:14f150b9");
MODULE_ALIAS("snd-hda-codec-id:14f150f1");
MODULE_ALIAS("snd-hda-codec-id:14f150f2");
MODULE_ALIAS("snd-hda-codec-id:14f150f3");
MODULE_ALIAS("snd-hda-codec-id:14f150f4");
MODULE_ALIAS("snd-hda-codec-id:14f1510f");
MODULE_ALIAS("snd-hda-codec-id:14f15110");
MODULE_ALIAS("snd-hda-codec-id:14f15111");
MODULE_ALIAS("snd-hda-codec-id:14f15113");
MODULE_ALIAS("snd-hda-codec-id:14f15114");
MODULE_ALIAS("snd-hda-codec-id:14f15115");
MODULE_ALIAS("snd-hda-codec-id:14f151d7");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_conexant);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Conexant HD-audio codec");
static struct hda_codec_driver conexant_driver = {
.preset = snd_hda_preset_conexant,
.id = snd_hda_id_conexant,
};
module_hda_codec_driver(conexant_driver);
This diff is collapsed.
......@@ -6617,78 +6617,70 @@ static int patch_alc680(struct hda_codec *codec)
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_realtek[] = {
{ .id = 0x10ec0221, .name = "ALC221", .patch = patch_alc269 },
{ .id = 0x10ec0231, .name = "ALC231", .patch = patch_alc269 },
{ .id = 0x10ec0233, .name = "ALC233", .patch = patch_alc269 },
{ .id = 0x10ec0235, .name = "ALC233", .patch = patch_alc269 },
{ .id = 0x10ec0255, .name = "ALC255", .patch = patch_alc269 },
{ .id = 0x10ec0256, .name = "ALC256", .patch = patch_alc269 },
{ .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 },
{ .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 },
{ .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
{ .id = 0x10ec0268, .name = "ALC268", .patch = patch_alc268 },
{ .id = 0x10ec0269, .name = "ALC269", .patch = patch_alc269 },
{ .id = 0x10ec0270, .name = "ALC270", .patch = patch_alc269 },
{ .id = 0x10ec0272, .name = "ALC272", .patch = patch_alc662 },
{ .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
{ .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 },
{ .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
{ .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 },
{ .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 },
{ .id = 0x10ec0284, .name = "ALC284", .patch = patch_alc269 },
{ .id = 0x10ec0285, .name = "ALC285", .patch = patch_alc269 },
{ .id = 0x10ec0286, .name = "ALC286", .patch = patch_alc269 },
{ .id = 0x10ec0288, .name = "ALC288", .patch = patch_alc269 },
{ .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 },
{ .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 },
{ .id = 0x10ec0293, .name = "ALC293", .patch = patch_alc269 },
{ .id = 0x10ec0298, .name = "ALC298", .patch = patch_alc269 },
{ .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
.patch = patch_alc861 },
{ .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
{ .id = 0x10ec0861, .name = "ALC861", .patch = patch_alc861 },
{ .id = 0x10ec0862, .name = "ALC861-VD", .patch = patch_alc861vd },
{ .id = 0x10ec0662, .rev = 0x100002, .name = "ALC662 rev2",
.patch = patch_alc882 },
{ .id = 0x10ec0662, .rev = 0x100101, .name = "ALC662 rev1",
.patch = patch_alc662 },
{ .id = 0x10ec0662, .rev = 0x100300, .name = "ALC662 rev3",
.patch = patch_alc662 },
{ .id = 0x10ec0663, .name = "ALC663", .patch = patch_alc662 },
{ .id = 0x10ec0665, .name = "ALC665", .patch = patch_alc662 },
{ .id = 0x10ec0667, .name = "ALC667", .patch = patch_alc662 },
{ .id = 0x10ec0668, .name = "ALC668", .patch = patch_alc662 },
{ .id = 0x10ec0670, .name = "ALC670", .patch = patch_alc662 },
{ .id = 0x10ec0671, .name = "ALC671", .patch = patch_alc662 },
{ .id = 0x10ec0680, .name = "ALC680", .patch = patch_alc680 },
{ .id = 0x10ec0867, .name = "ALC891", .patch = patch_alc882 },
{ .id = 0x10ec0880, .name = "ALC880", .patch = patch_alc880 },
{ .id = 0x10ec0882, .name = "ALC882", .patch = patch_alc882 },
{ .id = 0x10ec0883, .name = "ALC883", .patch = patch_alc882 },
{ .id = 0x10ec0885, .rev = 0x100101, .name = "ALC889A",
.patch = patch_alc882 },
{ .id = 0x10ec0885, .rev = 0x100103, .name = "ALC889A",
.patch = patch_alc882 },
{ .id = 0x10ec0885, .name = "ALC885", .patch = patch_alc882 },
{ .id = 0x10ec0887, .name = "ALC887", .patch = patch_alc882 },
{ .id = 0x10ec0888, .rev = 0x100101, .name = "ALC1200",
.patch = patch_alc882 },
{ .id = 0x10ec0888, .name = "ALC888", .patch = patch_alc882 },
{ .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc882 },
{ .id = 0x10ec0892, .name = "ALC892", .patch = patch_alc662 },
{ .id = 0x10ec0899, .name = "ALC898", .patch = patch_alc882 },
{ .id = 0x10ec0900, .name = "ALC1150", .patch = patch_alc882 },
static const struct hda_device_id snd_hda_id_realtek[] = {
HDA_CODEC_ENTRY(0x10ec0221, "ALC221", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0231, "ALC231", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0233, "ALC233", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0235, "ALC233", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0255, "ALC255", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0256, "ALC256", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0260, "ALC260", patch_alc260),
HDA_CODEC_ENTRY(0x10ec0262, "ALC262", patch_alc262),
HDA_CODEC_ENTRY(0x10ec0267, "ALC267", patch_alc268),
HDA_CODEC_ENTRY(0x10ec0268, "ALC268", patch_alc268),
HDA_CODEC_ENTRY(0x10ec0269, "ALC269", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0270, "ALC270", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0272, "ALC272", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0275, "ALC275", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0276, "ALC276", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0280, "ALC280", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0282, "ALC282", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0283, "ALC283", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0292, "ALC292", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0293, "ALC293", patch_alc269),
HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269),
HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861),
HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd),
HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861),
HDA_CODEC_ENTRY(0x10ec0862, "ALC861-VD", patch_alc861vd),
HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100002, "ALC662 rev2", patch_alc882),
HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100101, "ALC662 rev1", patch_alc662),
HDA_CODEC_REV_ENTRY(0x10ec0662, 0x100300, "ALC662 rev3", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0663, "ALC663", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0665, "ALC665", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0667, "ALC667", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0668, "ALC668", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0670, "ALC670", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0671, "ALC671", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0680, "ALC680", patch_alc680),
HDA_CODEC_ENTRY(0x10ec0867, "ALC891", patch_alc882),
HDA_CODEC_ENTRY(0x10ec0880, "ALC880", patch_alc880),
HDA_CODEC_ENTRY(0x10ec0882, "ALC882", patch_alc882),
HDA_CODEC_ENTRY(0x10ec0883, "ALC883", patch_alc882),
HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100101, "ALC889A", patch_alc882),
HDA_CODEC_REV_ENTRY(0x10ec0885, 0x100103, "ALC889A", patch_alc882),
HDA_CODEC_ENTRY(0x10ec0885, "ALC885", patch_alc882),
HDA_CODEC_ENTRY(0x10ec0887, "ALC887", patch_alc882),
HDA_CODEC_REV_ENTRY(0x10ec0888, 0x100101, "ALC1200", patch_alc882),
HDA_CODEC_ENTRY(0x10ec0888, "ALC888", patch_alc882),
HDA_CODEC_ENTRY(0x10ec0889, "ALC889", patch_alc882),
HDA_CODEC_ENTRY(0x10ec0892, "ALC892", patch_alc662),
HDA_CODEC_ENTRY(0x10ec0899, "ALC898", patch_alc882),
HDA_CODEC_ENTRY(0x10ec0900, "ALC1150", patch_alc882),
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:10ec*");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Realtek HD-audio codec");
static struct hda_codec_driver realtek_driver = {
.preset = snd_hda_preset_realtek,
.id = snd_hda_id_realtek,
};
module_hda_codec_driver(realtek_driver);
......@@ -289,41 +289,30 @@ static int patch_si3054(struct hda_codec *codec)
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_si3054[] = {
{ .id = 0x163c3055, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x163c3155, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x11c13026, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x11c13055, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x11c13155, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x10573055, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x10573057, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x10573155, .name = "Si3054", .patch = patch_si3054 },
static const struct hda_device_id snd_hda_id_si3054[] = {
HDA_CODEC_ENTRY(0x163c3055, "Si3054", patch_si3054),
HDA_CODEC_ENTRY(0x163c3155, "Si3054", patch_si3054),
HDA_CODEC_ENTRY(0x11c13026, "Si3054", patch_si3054),
HDA_CODEC_ENTRY(0x11c13055, "Si3054", patch_si3054),
HDA_CODEC_ENTRY(0x11c13155, "Si3054", patch_si3054),
HDA_CODEC_ENTRY(0x10573055, "Si3054", patch_si3054),
HDA_CODEC_ENTRY(0x10573057, "Si3054", patch_si3054),
HDA_CODEC_ENTRY(0x10573155, "Si3054", patch_si3054),
/* VIA HDA on Clevo m540 */
{ .id = 0x11063288, .name = "Si3054", .patch = patch_si3054 },
HDA_CODEC_ENTRY(0x11063288, "Si3054", patch_si3054),
/* Asus A8J Modem (SM56) */
{ .id = 0x15433155, .name = "Si3054", .patch = patch_si3054 },
HDA_CODEC_ENTRY(0x15433155, "Si3054", patch_si3054),
/* LG LW20 modem */
{ .id = 0x18540018, .name = "Si3054", .patch = patch_si3054 },
HDA_CODEC_ENTRY(0x18540018, "Si3054", patch_si3054),
{}
};
MODULE_ALIAS("snd-hda-codec-id:163c3055");
MODULE_ALIAS("snd-hda-codec-id:163c3155");
MODULE_ALIAS("snd-hda-codec-id:11c13026");
MODULE_ALIAS("snd-hda-codec-id:11c13055");
MODULE_ALIAS("snd-hda-codec-id:11c13155");
MODULE_ALIAS("snd-hda-codec-id:10573055");
MODULE_ALIAS("snd-hda-codec-id:10573057");
MODULE_ALIAS("snd-hda-codec-id:10573155");
MODULE_ALIAS("snd-hda-codec-id:11063288");
MODULE_ALIAS("snd-hda-codec-id:15433155");
MODULE_ALIAS("snd-hda-codec-id:18540018");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_si3054);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Si3054 HD-audio modem codec");
static struct hda_codec_driver si3054_driver = {
.preset = snd_hda_preset_si3054,
.id = snd_hda_id_si3054,
};
module_hda_codec_driver(si3054_driver);
This diff is collapsed.
......@@ -1200,109 +1200,64 @@ static int patch_vt3476(struct hda_codec *codec)
/*
* patch entries
*/
static const struct hda_codec_preset snd_hda_preset_via[] = {
{ .id = 0x11061708, .name = "VT1708", .patch = patch_vt1708},
{ .id = 0x11061709, .name = "VT1708", .patch = patch_vt1708},
{ .id = 0x1106170a, .name = "VT1708", .patch = patch_vt1708},
{ .id = 0x1106170b, .name = "VT1708", .patch = patch_vt1708},
{ .id = 0x1106e710, .name = "VT1709 10-Ch",
.patch = patch_vt1709},
{ .id = 0x1106e711, .name = "VT1709 10-Ch",
.patch = patch_vt1709},
{ .id = 0x1106e712, .name = "VT1709 10-Ch",
.patch = patch_vt1709},
{ .id = 0x1106e713, .name = "VT1709 10-Ch",
.patch = patch_vt1709},
{ .id = 0x1106e714, .name = "VT1709 6-Ch",
.patch = patch_vt1709},
{ .id = 0x1106e715, .name = "VT1709 6-Ch",
.patch = patch_vt1709},
{ .id = 0x1106e716, .name = "VT1709 6-Ch",
.patch = patch_vt1709},
{ .id = 0x1106e717, .name = "VT1709 6-Ch",
.patch = patch_vt1709},
{ .id = 0x1106e720, .name = "VT1708B 8-Ch",
.patch = patch_vt1708B},
{ .id = 0x1106e721, .name = "VT1708B 8-Ch",
.patch = patch_vt1708B},
{ .id = 0x1106e722, .name = "VT1708B 8-Ch",
.patch = patch_vt1708B},
{ .id = 0x1106e723, .name = "VT1708B 8-Ch",
.patch = patch_vt1708B},
{ .id = 0x1106e724, .name = "VT1708B 4-Ch",
.patch = patch_vt1708B},
{ .id = 0x1106e725, .name = "VT1708B 4-Ch",
.patch = patch_vt1708B},
{ .id = 0x1106e726, .name = "VT1708B 4-Ch",
.patch = patch_vt1708B},
{ .id = 0x1106e727, .name = "VT1708B 4-Ch",
.patch = patch_vt1708B},
{ .id = 0x11060397, .name = "VT1708S",
.patch = patch_vt1708S},
{ .id = 0x11061397, .name = "VT1708S",
.patch = patch_vt1708S},
{ .id = 0x11062397, .name = "VT1708S",
.patch = patch_vt1708S},
{ .id = 0x11063397, .name = "VT1708S",
.patch = patch_vt1708S},
{ .id = 0x11064397, .name = "VT1705",
.patch = patch_vt1708S},
{ .id = 0x11065397, .name = "VT1708S",
.patch = patch_vt1708S},
{ .id = 0x11066397, .name = "VT1708S",
.patch = patch_vt1708S},
{ .id = 0x11067397, .name = "VT1708S",
.patch = patch_vt1708S},
{ .id = 0x11060398, .name = "VT1702",
.patch = patch_vt1702},
{ .id = 0x11061398, .name = "VT1702",
.patch = patch_vt1702},
{ .id = 0x11062398, .name = "VT1702",
.patch = patch_vt1702},
{ .id = 0x11063398, .name = "VT1702",
.patch = patch_vt1702},
{ .id = 0x11064398, .name = "VT1702",
.patch = patch_vt1702},
{ .id = 0x11065398, .name = "VT1702",
.patch = patch_vt1702},
{ .id = 0x11066398, .name = "VT1702",
.patch = patch_vt1702},
{ .id = 0x11067398, .name = "VT1702",
.patch = patch_vt1702},
{ .id = 0x11060428, .name = "VT1718S",
.patch = patch_vt1718S},
{ .id = 0x11064428, .name = "VT1718S",
.patch = patch_vt1718S},
{ .id = 0x11060441, .name = "VT2020",
.patch = patch_vt1718S},
{ .id = 0x11064441, .name = "VT1828S",
.patch = patch_vt1718S},
{ .id = 0x11060433, .name = "VT1716S",
.patch = patch_vt1716S},
{ .id = 0x1106a721, .name = "VT1716S",
.patch = patch_vt1716S},
{ .id = 0x11060438, .name = "VT2002P", .patch = patch_vt2002P},
{ .id = 0x11064438, .name = "VT2002P", .patch = patch_vt2002P},
{ .id = 0x11060448, .name = "VT1812", .patch = patch_vt1812},
{ .id = 0x11060440, .name = "VT1818S",
.patch = patch_vt1708S},
{ .id = 0x11060446, .name = "VT1802",
.patch = patch_vt2002P},
{ .id = 0x11068446, .name = "VT1802",
.patch = patch_vt2002P},
{ .id = 0x11064760, .name = "VT1705CF",
.patch = patch_vt3476},
{ .id = 0x11064761, .name = "VT1708SCE",
.patch = patch_vt3476},
{ .id = 0x11064762, .name = "VT1808",
.patch = patch_vt3476},
static const struct hda_device_id snd_hda_id_via[] = {
HDA_CODEC_ENTRY(0x11061708, "VT1708", patch_vt1708),
HDA_CODEC_ENTRY(0x11061709, "VT1708", patch_vt1708),
HDA_CODEC_ENTRY(0x1106170a, "VT1708", patch_vt1708),
HDA_CODEC_ENTRY(0x1106170b, "VT1708", patch_vt1708),
HDA_CODEC_ENTRY(0x1106e710, "VT1709 10-Ch", patch_vt1709),
HDA_CODEC_ENTRY(0x1106e711, "VT1709 10-Ch", patch_vt1709),
HDA_CODEC_ENTRY(0x1106e712, "VT1709 10-Ch", patch_vt1709),
HDA_CODEC_ENTRY(0x1106e713, "VT1709 10-Ch", patch_vt1709),
HDA_CODEC_ENTRY(0x1106e714, "VT1709 6-Ch", patch_vt1709),
HDA_CODEC_ENTRY(0x1106e715, "VT1709 6-Ch", patch_vt1709),
HDA_CODEC_ENTRY(0x1106e716, "VT1709 6-Ch", patch_vt1709),
HDA_CODEC_ENTRY(0x1106e717, "VT1709 6-Ch", patch_vt1709),
HDA_CODEC_ENTRY(0x1106e720, "VT1708B 8-Ch", patch_vt1708B),
HDA_CODEC_ENTRY(0x1106e721, "VT1708B 8-Ch", patch_vt1708B),
HDA_CODEC_ENTRY(0x1106e722, "VT1708B 8-Ch", patch_vt1708B),
HDA_CODEC_ENTRY(0x1106e723, "VT1708B 8-Ch", patch_vt1708B),
HDA_CODEC_ENTRY(0x1106e724, "VT1708B 4-Ch", patch_vt1708B),
HDA_CODEC_ENTRY(0x1106e725, "VT1708B 4-Ch", patch_vt1708B),
HDA_CODEC_ENTRY(0x1106e726, "VT1708B 4-Ch", patch_vt1708B),
HDA_CODEC_ENTRY(0x1106e727, "VT1708B 4-Ch", patch_vt1708B),
HDA_CODEC_ENTRY(0x11060397, "VT1708S", patch_vt1708S),
HDA_CODEC_ENTRY(0x11061397, "VT1708S", patch_vt1708S),
HDA_CODEC_ENTRY(0x11062397, "VT1708S", patch_vt1708S),
HDA_CODEC_ENTRY(0x11063397, "VT1708S", patch_vt1708S),
HDA_CODEC_ENTRY(0x11064397, "VT1705", patch_vt1708S),
HDA_CODEC_ENTRY(0x11065397, "VT1708S", patch_vt1708S),
HDA_CODEC_ENTRY(0x11066397, "VT1708S", patch_vt1708S),
HDA_CODEC_ENTRY(0x11067397, "VT1708S", patch_vt1708S),
HDA_CODEC_ENTRY(0x11060398, "VT1702", patch_vt1702),
HDA_CODEC_ENTRY(0x11061398, "VT1702", patch_vt1702),
HDA_CODEC_ENTRY(0x11062398, "VT1702", patch_vt1702),
HDA_CODEC_ENTRY(0x11063398, "VT1702", patch_vt1702),
HDA_CODEC_ENTRY(0x11064398, "VT1702", patch_vt1702),
HDA_CODEC_ENTRY(0x11065398, "VT1702", patch_vt1702),
HDA_CODEC_ENTRY(0x11066398, "VT1702", patch_vt1702),
HDA_CODEC_ENTRY(0x11067398, "VT1702", patch_vt1702),
HDA_CODEC_ENTRY(0x11060428, "VT1718S", patch_vt1718S),
HDA_CODEC_ENTRY(0x11064428, "VT1718S", patch_vt1718S),
HDA_CODEC_ENTRY(0x11060441, "VT2020", patch_vt1718S),
HDA_CODEC_ENTRY(0x11064441, "VT1828S", patch_vt1718S),
HDA_CODEC_ENTRY(0x11060433, "VT1716S", patch_vt1716S),
HDA_CODEC_ENTRY(0x1106a721, "VT1716S", patch_vt1716S),
HDA_CODEC_ENTRY(0x11060438, "VT2002P", patch_vt2002P),
HDA_CODEC_ENTRY(0x11064438, "VT2002P", patch_vt2002P),
HDA_CODEC_ENTRY(0x11060448, "VT1812", patch_vt1812),
HDA_CODEC_ENTRY(0x11060440, "VT1818S", patch_vt1708S),
HDA_CODEC_ENTRY(0x11060446, "VT1802", patch_vt2002P),
HDA_CODEC_ENTRY(0x11068446, "VT1802", patch_vt2002P),
HDA_CODEC_ENTRY(0x11064760, "VT1705CF", patch_vt3476),
HDA_CODEC_ENTRY(0x11064761, "VT1708SCE", patch_vt3476),
HDA_CODEC_ENTRY(0x11064762, "VT1808", patch_vt3476),
{} /* terminator */
};
MODULE_ALIAS("snd-hda-codec-id:1106*");
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_via);
static struct hda_codec_driver via_driver = {
.preset = snd_hda_preset_via,
.id = snd_hda_id_via,
};
MODULE_LICENSE("GPL");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment