提交 1289e9e8 编写于 作者: T Takashi Iwai

ALSA: hda - Modularize HD-audio driver

Split the monolithc HD-audio driver into several pieces:
 - snd-hda-intel   HD-audio PCI controller driver; loaded via udev
 - snd-hda-codec   HD-audio codec bus driver
 - snd-hda-codec-* Specific HD-audio codec drivers

When built as modules, snd-hda-codec (that is invoked by snd-hda-intel)
looks up the codec vendor ID and loads the corresponding codec module
automatically via request_module().

When built in a kernel, each codec drivers are statically hooked up
before probing the PCI.

This patch adds appropriate EXPORT_SYMBOL_GPL()'s and the module
information for each driver, and driver-linking codes between
codec-bus and codec drivers.

TODO:
  - Avoid EXPORT_SYMBOL*() when built-in kernel
  - Restore __devinit appropriately depending on the condition
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 30d72e9f
...@@ -46,6 +46,11 @@ config SND_HDA_CODEC_REALTEK ...@@ -46,6 +46,11 @@ config SND_HDA_CODEC_REALTEK
Say Y here to include Realtek HD-audio codec support in Say Y here to include Realtek HD-audio codec support in
snd-hda-intel driver, such as ALC880. snd-hda-intel driver, such as ALC880.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-realtek.
This module is automatically loaded at probing.
config SND_HDA_CODEC_ANALOG config SND_HDA_CODEC_ANALOG
bool "Build Analog Device HD-audio codec support" bool "Build Analog Device HD-audio codec support"
default y default y
...@@ -53,6 +58,11 @@ config SND_HDA_CODEC_ANALOG ...@@ -53,6 +58,11 @@ config SND_HDA_CODEC_ANALOG
Say Y here to include Analog Device HD-audio codec support in Say Y here to include Analog Device HD-audio codec support in
snd-hda-intel driver, such as AD1986A. snd-hda-intel driver, such as AD1986A.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-analog.
This module is automatically loaded at probing.
config SND_HDA_CODEC_SIGMATEL config SND_HDA_CODEC_SIGMATEL
bool "Build IDT/Sigmatel HD-audio codec support" bool "Build IDT/Sigmatel HD-audio codec support"
default y default y
...@@ -60,6 +70,11 @@ config SND_HDA_CODEC_SIGMATEL ...@@ -60,6 +70,11 @@ config SND_HDA_CODEC_SIGMATEL
Say Y here to include IDT (Sigmatel) HD-audio codec support in Say Y here to include IDT (Sigmatel) HD-audio codec support in
snd-hda-intel driver, such as STAC9200. snd-hda-intel driver, such as STAC9200.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-idt.
This module is automatically loaded at probing.
config SND_HDA_CODEC_VIA config SND_HDA_CODEC_VIA
bool "Build VIA HD-audio codec support" bool "Build VIA HD-audio codec support"
default y default y
...@@ -67,6 +82,11 @@ config SND_HDA_CODEC_VIA ...@@ -67,6 +82,11 @@ config SND_HDA_CODEC_VIA
Say Y here to include VIA HD-audio codec support in Say Y here to include VIA HD-audio codec support in
snd-hda-intel driver, such as VT1708. snd-hda-intel driver, such as VT1708.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-via.
This module is automatically loaded at probing.
config SND_HDA_CODEC_ATIHDMI config SND_HDA_CODEC_ATIHDMI
bool "Build ATI HDMI HD-audio codec support" bool "Build ATI HDMI HD-audio codec support"
default y default y
...@@ -74,6 +94,11 @@ config SND_HDA_CODEC_ATIHDMI ...@@ -74,6 +94,11 @@ config SND_HDA_CODEC_ATIHDMI
Say Y here to include ATI HDMI HD-audio codec support in Say Y here to include ATI HDMI HD-audio codec support in
snd-hda-intel driver, such as ATI RS600 HDMI. snd-hda-intel driver, such as ATI RS600 HDMI.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-atihdmi.
This module is automatically loaded at probing.
config SND_HDA_CODEC_NVHDMI config SND_HDA_CODEC_NVHDMI
bool "Build NVIDIA HDMI HD-audio codec support" bool "Build NVIDIA HDMI HD-audio codec support"
default y default y
...@@ -81,6 +106,11 @@ config SND_HDA_CODEC_NVHDMI ...@@ -81,6 +106,11 @@ config SND_HDA_CODEC_NVHDMI
Say Y here to include NVIDIA HDMI HD-audio codec support in Say Y here to include NVIDIA HDMI HD-audio codec support in
snd-hda-intel driver, such as NVIDIA MCP78 HDMI. snd-hda-intel driver, such as NVIDIA MCP78 HDMI.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-nvhdmi.
This module is automatically loaded at probing.
config SND_HDA_CODEC_INTELHDMI config SND_HDA_CODEC_INTELHDMI
bool "Build INTEL HDMI HD-audio codec support" bool "Build INTEL HDMI HD-audio codec support"
default y default y
...@@ -88,6 +118,11 @@ config SND_HDA_CODEC_INTELHDMI ...@@ -88,6 +118,11 @@ config SND_HDA_CODEC_INTELHDMI
Say Y here to include INTEL HDMI HD-audio codec support in Say Y here to include INTEL HDMI HD-audio codec support in
snd-hda-intel driver, such as Eaglelake integrated HDMI. snd-hda-intel driver, such as Eaglelake integrated HDMI.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-intelhdmi.
This module is automatically loaded at probing.
config SND_HDA_ELD config SND_HDA_ELD
def_bool y def_bool y
depends on SND_HDA_CODEC_INTELHDMI depends on SND_HDA_CODEC_INTELHDMI
...@@ -99,6 +134,11 @@ config SND_HDA_CODEC_CONEXANT ...@@ -99,6 +134,11 @@ config SND_HDA_CODEC_CONEXANT
Say Y here to include Conexant HD-audio codec support in Say Y here to include Conexant HD-audio codec support in
snd-hda-intel driver, such as CX20549. snd-hda-intel driver, such as CX20549.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-conexant.
This module is automatically loaded at probing.
config SND_HDA_CODEC_CMEDIA config SND_HDA_CODEC_CMEDIA
bool "Build C-Media HD-audio codec support" bool "Build C-Media HD-audio codec support"
default y default y
...@@ -106,6 +146,11 @@ config SND_HDA_CODEC_CMEDIA ...@@ -106,6 +146,11 @@ config SND_HDA_CODEC_CMEDIA
Say Y here to include C-Media HD-audio codec support in Say Y here to include C-Media HD-audio codec support in
snd-hda-intel driver, such as CMI9880. snd-hda-intel driver, such as CMI9880.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-cmedia.
This module is automatically loaded at probing.
config SND_HDA_CODEC_SI3054 config SND_HDA_CODEC_SI3054
bool "Build Silicon Labs 3054 HD-modem codec support" bool "Build Silicon Labs 3054 HD-modem codec support"
default y default y
...@@ -113,6 +158,11 @@ config SND_HDA_CODEC_SI3054 ...@@ -113,6 +158,11 @@ config SND_HDA_CODEC_SI3054
Say Y here to include Silicon Labs 3054 HD-modem codec Say Y here to include Silicon Labs 3054 HD-modem codec
(and compatibles) support in snd-hda-intel driver. (and compatibles) support in snd-hda-intel driver.
When the HD-audio driver is built as a module, the codec
support code is also built as another module,
snd-hda-codec-si3054.
This module is automatically loaded at probing.
config SND_HDA_GENERIC config SND_HDA_GENERIC
bool "Enable generic HD-audio codec parser" bool "Enable generic HD-audio codec parser"
default y default y
......
snd-hda-intel-y := hda_intel.o snd-hda-intel-objs := hda_intel.o
# since snd-hda-intel is the only driver using hda-codec,
# merge it into a single module although it was originally
# designed to be individual modules
snd-hda-intel-y += hda_codec.o
snd-hda-intel-$(CONFIG_PROC_FS) += hda_proc.o
snd-hda-intel-$(CONFIG_SND_HDA_ELD) += hda_eld.o
snd-hda-intel-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o
snd-hda-intel-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o
snd-hda-intel-$(CONFIG_SND_HDA_GENERIC) += hda_generic.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_REALTEK) += patch_realtek.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_CMEDIA) += patch_cmedia.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_ANALOG) += patch_analog.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_SIGMATEL) += patch_sigmatel.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_SI3054) += patch_si3054.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_ATIHDMI) += patch_atihdmi.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_CONEXANT) += patch_conexant.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_VIA) += patch_via.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_NVHDMI) += patch_nvhdmi.o
snd-hda-intel-$(CONFIG_SND_HDA_CODEC_INTELHDMI) += patch_intelhdmi.o
snd-hda-codec-y := hda_codec.o
snd-hda-codec-$(CONFIG_SND_HDA_GENERIC) += hda_generic.o
snd-hda-codec-$(CONFIG_PROC_FS) += hda_proc.o
# snd-hda-codec-$(CONFIG_SND_HDA_ELD) += hda_eld.o
snd-hda-codec-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o
snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o
snd-hda-codec-realtek-objs := patch_realtek.o
snd-hda-codec-cmedia-objs := patch_cmedia.o
snd-hda-codec-analog-objs := patch_analog.o
snd-hda-codec-idt-objs := patch_sigmatel.o
snd-hda-codec-si3054-objs := patch_si3054.o
snd-hda-codec-atihdmi-objs := patch_atihdmi.o
snd-hda-codec-conexant-objs := patch_conexant.o
snd-hda-codec-via-objs := patch_via.o
snd-hda-codec-nvhdmi-objs := patch_nvhdmi.o
snd-hda-codec-intelhdmi-objs := patch_intelhdmi.o hda_eld.o
# common driver
obj-$(CONFIG_SND_HDA_INTEL) := snd-hda-codec.o
# codec drivers (note: CONFIG_SND_HDA_CODEC_XXX are booleans)
ifdef CONFIG_SND_HDA_CODEC_REALTEK
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-realtek.o
endif
ifdef CONFIG_SND_HDA_CODEC_CMEDIA
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-cmedia.o
endif
ifdef CONFIG_SND_HDA_CODEC_ANALOG
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-analog.o
endif
ifdef CONFIG_SND_HDA_CODEC_SIGMATEL
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-idt.o
endif
ifdef CONFIG_SND_HDA_CODEC_SI3054
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-si3054.o
endif
ifdef CONFIG_SND_HDA_CODEC_ATIHDMI
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-atihdmi.o
endif
ifdef CONFIG_SND_HDA_CODEC_CONEXANT
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-conexant.o
endif
ifdef CONFIG_SND_HDA_CODEC_VIA
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-via.o
endif
ifdef CONFIG_SND_HDA_CODEC_NVHDMI
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-nvhdmi.o
endif
ifdef CONFIG_SND_HDA_CODEC_INTELHDMI
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-codec-intelhdmi.o
endif
# this must be the last entry after codec drivers;
# otherwise the codec patches won't be hooked before the PCI probe
# when built in kernel
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o
...@@ -128,6 +128,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) ...@@ -128,6 +128,7 @@ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
INIT_WORK(&beep->beep_work, &snd_hda_generate_beep); INIT_WORK(&beep->beep_work, &snd_hda_generate_beep);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_attach_beep_device);
void snd_hda_detach_beep_device(struct hda_codec *codec) void snd_hda_detach_beep_device(struct hda_codec *codec)
{ {
...@@ -140,3 +141,4 @@ void snd_hda_detach_beep_device(struct hda_codec *codec) ...@@ -140,3 +141,4 @@ void snd_hda_detach_beep_device(struct hda_codec *codec)
kfree(beep); kfree(beep);
} }
} }
EXPORT_SYMBOL_GPL(snd_hda_detach_beep_device);
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <sound/initval.h> #include <sound/initval.h>
#include "hda_local.h" #include "hda_local.h"
#include <sound/hda_hwdep.h> #include <sound/hda_hwdep.h>
#include "hda_patch.h" /* codec presets */
/* /*
* vendor / preset table * vendor / preset table
...@@ -62,39 +61,26 @@ static struct hda_vendor_id hda_vendor_ids[] = { ...@@ -62,39 +61,26 @@ static struct hda_vendor_id hda_vendor_ids[] = {
{} /* terminator */ {} /* terminator */
}; };
static const struct hda_codec_preset *hda_preset_tables[] = { static DEFINE_MUTEX(preset_mutex);
#ifdef CONFIG_SND_HDA_CODEC_REALTEK static LIST_HEAD(hda_preset_tables);
snd_hda_preset_realtek,
#endif int snd_hda_add_codec_preset(struct hda_codec_preset_list *preset)
#ifdef CONFIG_SND_HDA_CODEC_CMEDIA {
snd_hda_preset_cmedia, mutex_lock(&preset_mutex);
#endif list_add_tail(&preset->list, &hda_preset_tables);
#ifdef CONFIG_SND_HDA_CODEC_ANALOG mutex_unlock(&preset_mutex);
snd_hda_preset_analog, return 0;
#endif }
#ifdef CONFIG_SND_HDA_CODEC_SIGMATEL EXPORT_SYMBOL_GPL(snd_hda_add_codec_preset);
snd_hda_preset_sigmatel,
#endif int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset)
#ifdef CONFIG_SND_HDA_CODEC_SI3054 {
snd_hda_preset_si3054, mutex_lock(&preset_mutex);
#endif list_del(&preset->list);
#ifdef CONFIG_SND_HDA_CODEC_ATIHDMI mutex_unlock(&preset_mutex);
snd_hda_preset_atihdmi, return 0;
#endif }
#ifdef CONFIG_SND_HDA_CODEC_CONEXANT EXPORT_SYMBOL_GPL(snd_hda_delete_codec_preset);
snd_hda_preset_conexant,
#endif
#ifdef CONFIG_SND_HDA_CODEC_VIA
snd_hda_preset_via,
#endif
#ifdef CONFIG_SND_HDA_CODEC_NVHDMI
snd_hda_preset_nvhdmi,
#endif
#ifdef CONFIG_SND_HDA_CODEC_INTELHDMI
snd_hda_preset_intelhdmi,
#endif
NULL
};
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
static void hda_power_work(struct work_struct *work); static void hda_power_work(struct work_struct *work);
...@@ -128,6 +114,7 @@ const char *snd_hda_get_jack_location(u32 cfg) ...@@ -128,6 +114,7 @@ const char *snd_hda_get_jack_location(u32 cfg)
} }
return "UNKNOWN"; return "UNKNOWN";
} }
EXPORT_SYMBOL_GPL(snd_hda_get_jack_location);
const char *snd_hda_get_jack_connectivity(u32 cfg) const char *snd_hda_get_jack_connectivity(u32 cfg)
{ {
...@@ -135,6 +122,7 @@ const char *snd_hda_get_jack_connectivity(u32 cfg) ...@@ -135,6 +122,7 @@ const char *snd_hda_get_jack_connectivity(u32 cfg)
return jack_locations[(cfg >> (AC_DEFCFG_LOCATION_SHIFT + 4)) & 3]; return jack_locations[(cfg >> (AC_DEFCFG_LOCATION_SHIFT + 4)) & 3];
} }
EXPORT_SYMBOL_GPL(snd_hda_get_jack_connectivity);
const char *snd_hda_get_jack_type(u32 cfg) const char *snd_hda_get_jack_type(u32 cfg)
{ {
...@@ -148,6 +136,7 @@ const char *snd_hda_get_jack_type(u32 cfg) ...@@ -148,6 +136,7 @@ const char *snd_hda_get_jack_type(u32 cfg)
return jack_types[(cfg & AC_DEFCFG_DEVICE) return jack_types[(cfg & AC_DEFCFG_DEVICE)
>> AC_DEFCFG_DEVICE_SHIFT]; >> AC_DEFCFG_DEVICE_SHIFT];
} }
EXPORT_SYMBOL_GPL(snd_hda_get_jack_type);
/* /*
* Compose a 32bit command word to be sent to the HD-audio controller * Compose a 32bit command word to be sent to the HD-audio controller
...@@ -196,6 +185,7 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid, ...@@ -196,6 +185,7 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid,
snd_hda_power_down(codec); snd_hda_power_down(codec);
return res; return res;
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_read);
/** /**
* snd_hda_codec_write - send a single command without waiting for response * snd_hda_codec_write - send a single command without waiting for response
...@@ -224,6 +214,7 @@ int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct, ...@@ -224,6 +214,7 @@ int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct,
snd_hda_power_down(codec); snd_hda_power_down(codec);
return err; return err;
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_write);
/** /**
* snd_hda_sequence_write - sequence writes * snd_hda_sequence_write - sequence writes
...@@ -238,6 +229,7 @@ void snd_hda_sequence_write(struct hda_codec *codec, const struct hda_verb *seq) ...@@ -238,6 +229,7 @@ void snd_hda_sequence_write(struct hda_codec *codec, const struct hda_verb *seq)
for (; seq->nid; seq++) for (; seq->nid; seq++)
snd_hda_codec_write(codec, seq->nid, 0, seq->verb, seq->param); snd_hda_codec_write(codec, seq->nid, 0, seq->verb, seq->param);
} }
EXPORT_SYMBOL_GPL(snd_hda_sequence_write);
/** /**
* snd_hda_get_sub_nodes - get the range of sub nodes * snd_hda_get_sub_nodes - get the range of sub nodes
...@@ -259,6 +251,7 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, ...@@ -259,6 +251,7 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid,
*start_id = (parm >> 16) & 0x7fff; *start_id = (parm >> 16) & 0x7fff;
return (int)(parm & 0x7fff); return (int)(parm & 0x7fff);
} }
EXPORT_SYMBOL_GPL(snd_hda_get_sub_nodes);
/** /**
* snd_hda_get_connections - get connection list * snd_hda_get_connections - get connection list
...@@ -347,6 +340,7 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, ...@@ -347,6 +340,7 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
} }
return conns; return conns;
} }
EXPORT_SYMBOL_GPL(snd_hda_get_connections);
/** /**
...@@ -381,6 +375,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex) ...@@ -381,6 +375,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_queue_unsol_event);
/* /*
* process queued unsolicited events * process queued unsolicited events
...@@ -482,7 +477,7 @@ static int snd_hda_bus_dev_register(struct snd_device *device) ...@@ -482,7 +477,7 @@ static int snd_hda_bus_dev_register(struct snd_device *device)
* *
* Returns 0 if successful, or a negative error code. * Returns 0 if successful, or a negative error code.
*/ */
int __devinit snd_hda_bus_new(struct snd_card *card, int /*__devinit*/ snd_hda_bus_new(struct snd_card *card,
const struct hda_bus_template *temp, const struct hda_bus_template *temp,
struct hda_bus **busp) struct hda_bus **busp)
{ {
...@@ -526,6 +521,7 @@ int __devinit snd_hda_bus_new(struct snd_card *card, ...@@ -526,6 +521,7 @@ int __devinit snd_hda_bus_new(struct snd_card *card,
*busp = bus; *busp = bus;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_bus_new);
#ifdef CONFIG_SND_HDA_GENERIC #ifdef CONFIG_SND_HDA_GENERIC
#define is_generic_config(codec) \ #define is_generic_config(codec) \
...@@ -534,19 +530,33 @@ int __devinit snd_hda_bus_new(struct snd_card *card, ...@@ -534,19 +530,33 @@ int __devinit snd_hda_bus_new(struct snd_card *card,
#define is_generic_config(codec) 0 #define is_generic_config(codec) 0
#endif #endif
#ifdef CONFIG_SND_HDA_INTEL_MODULE
#define HDA_MODREQ_MAX_COUNT 2 /* two request_modules()'s */
#else
#define HDA_MODREQ_MAX_COUNT 0
#endif
/* /*
* find a matching codec preset * find a matching codec preset
*/ */
static const struct hda_codec_preset * static const struct hda_codec_preset *
find_codec_preset(struct hda_codec *codec) find_codec_preset(struct hda_codec *codec)
{ {
const struct hda_codec_preset **tbl, *preset; struct hda_codec_preset_list *tbl;
const struct hda_codec_preset *preset;
int mod_requested = 0;
if (is_generic_config(codec)) if (is_generic_config(codec))
return NULL; /* use the generic parser */ return NULL; /* use the generic parser */
for (tbl = hda_preset_tables; *tbl; tbl++) { again:
for (preset = *tbl; preset->id; preset++) { mutex_lock(&preset_mutex);
list_for_each_entry(tbl, &hda_preset_tables, list) {
if (!try_module_get(tbl->owner)) {
snd_printk(KERN_ERR "hda_codec: cannot module_get\n");
continue;
}
for (preset = tbl->preset; preset->id; preset++) {
u32 mask = preset->mask; u32 mask = preset->mask;
if (preset->afg && preset->afg != codec->afg) if (preset->afg && preset->afg != codec->afg)
continue; continue;
...@@ -556,10 +566,28 @@ find_codec_preset(struct hda_codec *codec) ...@@ -556,10 +566,28 @@ find_codec_preset(struct hda_codec *codec)
mask = ~0; mask = ~0;
if (preset->id == (codec->vendor_id & mask) && if (preset->id == (codec->vendor_id & mask) &&
(!preset->rev || (!preset->rev ||
preset->rev == codec->revision_id)) preset->rev == codec->revision_id)) {
mutex_unlock(&preset_mutex);
codec->owner = tbl->owner;
return preset; return preset;
} }
} }
module_put(tbl->owner);
}
mutex_unlock(&preset_mutex);
if (mod_requested < HDA_MODREQ_MAX_COUNT) {
char name[32];
if (!mod_requested)
snprintf(name, sizeof(name), "snd-hda-codec-id:%08x",
codec->vendor_id);
else
snprintf(name, sizeof(name), "snd-hda-codec-id:%04x*",
(codec->vendor_id >> 16) & 0xffff);
request_module(name);
mod_requested++;
goto again;
}
return NULL; return NULL;
} }
...@@ -598,7 +626,7 @@ static int get_codec_name(struct hda_codec *codec) ...@@ -598,7 +626,7 @@ static int get_codec_name(struct hda_codec *codec)
/* /*
* look for an AFG and MFG nodes * look for an AFG and MFG nodes
*/ */
static void __devinit setup_fg_nodes(struct hda_codec *codec) static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec)
{ {
int i, total_nodes; int i, total_nodes;
hda_nid_t nid; hda_nid_t nid;
...@@ -661,6 +689,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) ...@@ -661,6 +689,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
codec->bus->caddr_tbl[codec->addr] = NULL; codec->bus->caddr_tbl[codec->addr] = NULL;
if (codec->patch_ops.free) if (codec->patch_ops.free)
codec->patch_ops.free(codec); codec->patch_ops.free(codec);
module_put(codec->owner);
free_hda_cache(&codec->amp_cache); free_hda_cache(&codec->amp_cache);
free_hda_cache(&codec->cmd_cache); free_hda_cache(&codec->cmd_cache);
kfree(codec->name); kfree(codec->name);
...@@ -677,7 +706,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) ...@@ -677,7 +706,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
* *
* Returns 0 if successful, or a negative error code. * Returns 0 if successful, or a negative error code.
*/ */
int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
struct hda_codec **codecp) struct hda_codec **codecp)
{ {
struct hda_codec *codec; struct hda_codec *codec;
...@@ -779,6 +808,7 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, ...@@ -779,6 +808,7 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
*codecp = codec; *codecp = codec;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_new);
int snd_hda_codec_configure(struct hda_codec *codec) int snd_hda_codec_configure(struct hda_codec *codec)
{ {
...@@ -838,6 +868,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, ...@@ -838,6 +868,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
msleep(1); msleep(1);
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, format); snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, format);
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_setup_stream);
void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
{ {
...@@ -851,6 +882,7 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) ...@@ -851,6 +882,7 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0); snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0);
#endif #endif
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_cleanup_stream);
/* /*
* amp access functions * amp access functions
...@@ -862,7 +894,7 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) ...@@ -862,7 +894,7 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid)
#define INFO_AMP_VOL(ch) (1 << (1 + (ch))) #define INFO_AMP_VOL(ch) (1 << (1 + (ch)))
/* initialize the hash table */ /* initialize the hash table */
static void __devinit init_hda_cache(struct hda_cache_rec *cache, static void /*__devinit*/ init_hda_cache(struct hda_cache_rec *cache,
unsigned int record_size) unsigned int record_size)
{ {
memset(cache, 0, sizeof(*cache)); memset(cache, 0, sizeof(*cache));
...@@ -932,6 +964,7 @@ u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction) ...@@ -932,6 +964,7 @@ u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction)
} }
return info->amp_caps; return info->amp_caps;
} }
EXPORT_SYMBOL_GPL(query_amp_caps);
int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
unsigned int caps) unsigned int caps)
...@@ -945,6 +978,7 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, ...@@ -945,6 +978,7 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
info->head.val |= INFO_AMP_CAPS; info->head.val |= INFO_AMP_CAPS;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_override_amp_caps);
/* /*
* read the current volume to info * read the current volume to info
...@@ -998,6 +1032,7 @@ int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, ...@@ -998,6 +1032,7 @@ int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch,
return 0; return 0;
return get_vol_mute(codec, info, nid, ch, direction, index); return get_vol_mute(codec, info, nid, ch, direction, index);
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_amp_read);
/* /*
* update the AMP value, mask = bit mask to set, val = the value * update the AMP value, mask = bit mask to set, val = the value
...@@ -1017,6 +1052,7 @@ int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch, ...@@ -1017,6 +1052,7 @@ int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch,
put_vol_mute(codec, info, nid, ch, direction, idx, val); put_vol_mute(codec, info, nid, ch, direction, idx, val);
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_amp_update);
/* /*
* update the AMP stereo with the same mask and value * update the AMP stereo with the same mask and value
...@@ -1030,6 +1066,7 @@ int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, ...@@ -1030,6 +1066,7 @@ int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid,
idx, mask, val); idx, mask, val);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_amp_stereo);
#ifdef SND_HDA_NEEDS_RESUME #ifdef SND_HDA_NEEDS_RESUME
/* resume the all amp commands from the cache */ /* resume the all amp commands from the cache */
...@@ -1055,6 +1092,7 @@ void snd_hda_codec_resume_amp(struct hda_codec *codec) ...@@ -1055,6 +1092,7 @@ void snd_hda_codec_resume_amp(struct hda_codec *codec)
} }
} }
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_resume_amp);
#endif /* SND_HDA_NEEDS_RESUME */ #endif /* SND_HDA_NEEDS_RESUME */
/* volume */ /* volume */
...@@ -1082,6 +1120,7 @@ int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol, ...@@ -1082,6 +1120,7 @@ int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol,
uinfo->value.integer.max = caps; uinfo->value.integer.max = caps;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_volume_info);
int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -1101,6 +1140,7 @@ int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, ...@@ -1101,6 +1140,7 @@ int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol,
& HDA_AMP_VOLMASK; & HDA_AMP_VOLMASK;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_volume_get);
int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -1125,6 +1165,7 @@ int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, ...@@ -1125,6 +1165,7 @@ int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol,
snd_hda_power_down(codec); snd_hda_power_down(codec);
return change; return change;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_volume_put);
int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag,
unsigned int size, unsigned int __user *_tlv) unsigned int size, unsigned int __user *_tlv)
...@@ -1151,6 +1192,7 @@ int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, ...@@ -1151,6 +1192,7 @@ int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag,
return -EFAULT; return -EFAULT;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_tlv);
/* /*
* set (static) TLV for virtual master volume; recalculated as max 0dB * set (static) TLV for virtual master volume; recalculated as max 0dB
...@@ -1170,6 +1212,7 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, ...@@ -1170,6 +1212,7 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
tlv[2] = -nums * step; tlv[2] = -nums * step;
tlv[3] = step; tlv[3] = step;
} }
EXPORT_SYMBOL_GPL(snd_hda_set_vmaster_tlv);
/* find a mixer control element with the given name */ /* find a mixer control element with the given name */
static struct snd_kcontrol * static struct snd_kcontrol *
...@@ -1189,6 +1232,7 @@ struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, ...@@ -1189,6 +1232,7 @@ struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
{ {
return _snd_hda_find_mixer_ctl(codec, name, 0); return _snd_hda_find_mixer_ctl(codec, name, 0);
} }
EXPORT_SYMBOL_GPL(snd_hda_find_mixer_ctl);
/* Add a control element and assign to the codec */ /* Add a control element and assign to the codec */
int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl) int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl)
...@@ -1205,6 +1249,7 @@ int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl) ...@@ -1205,6 +1249,7 @@ int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl)
*knewp = kctl; *knewp = kctl;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_ctl_add);
#ifdef CONFIG_SND_HDA_RECONFIG #ifdef CONFIG_SND_HDA_RECONFIG
/* Clear all controls assigned to the given codec */ /* Clear all controls assigned to the given codec */
...@@ -1243,6 +1288,8 @@ void snd_hda_codec_reset(struct hda_codec *codec) ...@@ -1243,6 +1288,8 @@ void snd_hda_codec_reset(struct hda_codec *codec)
codec->num_pcms = 0; codec->num_pcms = 0;
codec->pcm_info = NULL; codec->pcm_info = NULL;
codec->preset = NULL; codec->preset = NULL;
module_put(codec->owner);
codec->owner = NULL;
} }
#endif /* CONFIG_SND_HDA_RECONFIG */ #endif /* CONFIG_SND_HDA_RECONFIG */
...@@ -1281,6 +1328,7 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name, ...@@ -1281,6 +1328,7 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_add_vmaster);
/* switch */ /* switch */
int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol,
...@@ -1294,6 +1342,7 @@ int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, ...@@ -1294,6 +1342,7 @@ int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol,
uinfo->value.integer.max = 1; uinfo->value.integer.max = 1;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_switch_info);
int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -1313,6 +1362,7 @@ int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, ...@@ -1313,6 +1362,7 @@ int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol,
HDA_AMP_MUTE) ? 0 : 1; HDA_AMP_MUTE) ? 0 : 1;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_switch_get);
int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -1343,6 +1393,7 @@ int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, ...@@ -1343,6 +1393,7 @@ int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol,
snd_hda_power_down(codec); snd_hda_power_down(codec);
return change; return change;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_switch_put);
/* /*
* bound volume controls * bound volume controls
...@@ -1368,6 +1419,7 @@ int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, ...@@ -1368,6 +1419,7 @@ int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return err; return err;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_switch_get);
int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -1391,6 +1443,7 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, ...@@ -1391,6 +1443,7 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return err < 0 ? err : change; return err < 0 ? err : change;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_switch_put);
/* /*
* generic bound volume/swtich controls * generic bound volume/swtich controls
...@@ -1410,6 +1463,7 @@ int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, ...@@ -1410,6 +1463,7 @@ int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return err; return err;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_info);
int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -1426,6 +1480,7 @@ int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, ...@@ -1426,6 +1480,7 @@ int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return err; return err;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_get);
int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
...@@ -1448,6 +1503,7 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, ...@@ -1448,6 +1503,7 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return err < 0 ? err : change; return err < 0 ? err : change;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_put);
int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag,
unsigned int size, unsigned int __user *tlv) unsigned int size, unsigned int __user *tlv)
...@@ -1464,6 +1520,7 @@ int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, ...@@ -1464,6 +1520,7 @@ int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return err; return err;
} }
EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_tlv);
struct hda_ctl_ops snd_hda_bind_vol = { struct hda_ctl_ops snd_hda_bind_vol = {
.info = snd_hda_mixer_amp_volume_info, .info = snd_hda_mixer_amp_volume_info,
...@@ -1471,6 +1528,7 @@ struct hda_ctl_ops snd_hda_bind_vol = { ...@@ -1471,6 +1528,7 @@ struct hda_ctl_ops snd_hda_bind_vol = {
.put = snd_hda_mixer_amp_volume_put, .put = snd_hda_mixer_amp_volume_put,
.tlv = snd_hda_mixer_amp_tlv .tlv = snd_hda_mixer_amp_tlv
}; };
EXPORT_SYMBOL_GPL(snd_hda_bind_vol);
struct hda_ctl_ops snd_hda_bind_sw = { struct hda_ctl_ops snd_hda_bind_sw = {
.info = snd_hda_mixer_amp_switch_info, .info = snd_hda_mixer_amp_switch_info,
...@@ -1478,6 +1536,7 @@ struct hda_ctl_ops snd_hda_bind_sw = { ...@@ -1478,6 +1536,7 @@ struct hda_ctl_ops snd_hda_bind_sw = {
.put = snd_hda_mixer_amp_switch_put, .put = snd_hda_mixer_amp_switch_put,
.tlv = snd_hda_mixer_amp_tlv .tlv = snd_hda_mixer_amp_tlv
}; };
EXPORT_SYMBOL_GPL(snd_hda_bind_sw);
/* /*
* SPDIF out controls * SPDIF out controls
...@@ -1739,6 +1798,7 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid) ...@@ -1739,6 +1798,7 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid)
codec->spdif_status = convert_to_spdif_status(codec->spdif_ctls); codec->spdif_status = convert_to_spdif_status(codec->spdif_ctls);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_create_spdif_out_ctls);
/* /*
* SPDIF sharing with analog output * SPDIF sharing with analog output
...@@ -1776,6 +1836,7 @@ int snd_hda_create_spdif_share_sw(struct hda_codec *codec, ...@@ -1776,6 +1836,7 @@ int snd_hda_create_spdif_share_sw(struct hda_codec *codec,
return snd_hda_ctl_add(codec, return snd_hda_ctl_add(codec,
snd_ctl_new1(&spdif_share_sw, mout)); snd_ctl_new1(&spdif_share_sw, mout));
} }
EXPORT_SYMBOL_GPL(snd_hda_create_spdif_share_sw);
/* /*
* SPDIF input * SPDIF input
...@@ -1885,6 +1946,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) ...@@ -1885,6 +1946,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid)
AC_DIG1_ENABLE; AC_DIG1_ENABLE;
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_create_spdif_in_ctls);
#ifdef SND_HDA_NEEDS_RESUME #ifdef SND_HDA_NEEDS_RESUME
/* /*
...@@ -1930,6 +1992,7 @@ int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid, ...@@ -1930,6 +1992,7 @@ int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid,
snd_hda_power_down(codec); snd_hda_power_down(codec);
return err; return err;
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_write_cache);
/* resume the all commands from the cache */ /* resume the all commands from the cache */
void snd_hda_codec_resume_cache(struct hda_codec *codec) void snd_hda_codec_resume_cache(struct hda_codec *codec)
...@@ -1945,6 +2008,7 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec) ...@@ -1945,6 +2008,7 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec)
get_cmd_cache_cmd(key), buffer->val); get_cmd_cache_cmd(key), buffer->val);
} }
} }
EXPORT_SYMBOL_GPL(snd_hda_codec_resume_cache);
/** /**
* snd_hda_sequence_write_cache - sequence writes with caching * snd_hda_sequence_write_cache - sequence writes with caching
...@@ -1962,6 +2026,7 @@ void snd_hda_sequence_write_cache(struct hda_codec *codec, ...@@ -1962,6 +2026,7 @@ void snd_hda_sequence_write_cache(struct hda_codec *codec,
snd_hda_codec_write_cache(codec, seq->nid, 0, seq->verb, snd_hda_codec_write_cache(codec, seq->nid, 0, seq->verb,
seq->param); seq->param);
} }
EXPORT_SYMBOL_GPL(snd_hda_sequence_write_cache);
#endif /* SND_HDA_NEEDS_RESUME */ #endif /* SND_HDA_NEEDS_RESUME */
/* /*
...@@ -2080,7 +2145,7 @@ static void hda_call_codec_resume(struct hda_codec *codec) ...@@ -2080,7 +2145,7 @@ static void hda_call_codec_resume(struct hda_codec *codec)
* *
* Returns 0 if successful, otherwise a negative error code. * Returns 0 if successful, otherwise a negative error code.
*/ */
int __devinit snd_hda_build_controls(struct hda_bus *bus) int /*__devinit*/ snd_hda_build_controls(struct hda_bus *bus)
{ {
struct hda_codec *codec; struct hda_codec *codec;
...@@ -2091,6 +2156,7 @@ int __devinit snd_hda_build_controls(struct hda_bus *bus) ...@@ -2091,6 +2156,7 @@ int __devinit snd_hda_build_controls(struct hda_bus *bus)
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_build_controls);
int snd_hda_codec_build_controls(struct hda_codec *codec) int snd_hda_codec_build_controls(struct hda_codec *codec)
{ {
...@@ -2202,6 +2268,7 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate, ...@@ -2202,6 +2268,7 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
return val; return val;
} }
EXPORT_SYMBOL_GPL(snd_hda_calc_stream_format);
/** /**
* snd_hda_query_supported_pcm - query the supported PCM rates and formats * snd_hda_query_supported_pcm - query the supported PCM rates and formats
...@@ -2381,6 +2448,7 @@ int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid, ...@@ -2381,6 +2448,7 @@ int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid,
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(snd_hda_is_supported_format);
/* /*
* PCM stuff * PCM stuff
...@@ -2578,6 +2646,7 @@ int __devinit snd_hda_build_pcms(struct hda_bus *bus) ...@@ -2578,6 +2646,7 @@ int __devinit snd_hda_build_pcms(struct hda_bus *bus)
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_build_pcms);
/** /**
* snd_hda_check_board_config - compare the current codec with the config table * snd_hda_check_board_config - compare the current codec with the config table
...@@ -2633,6 +2702,7 @@ int snd_hda_check_board_config(struct hda_codec *codec, ...@@ -2633,6 +2702,7 @@ int snd_hda_check_board_config(struct hda_codec *codec,
} }
return -1; return -1;
} }
EXPORT_SYMBOL_GPL(snd_hda_check_board_config);
/** /**
* snd_hda_add_new_ctls - create controls from the array * snd_hda_add_new_ctls - create controls from the array
...@@ -2668,6 +2738,7 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) ...@@ -2668,6 +2738,7 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew)
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_add_new_ctls);
#ifdef CONFIG_SND_HDA_POWER_SAVE #ifdef CONFIG_SND_HDA_POWER_SAVE
static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
...@@ -2710,6 +2781,10 @@ void snd_hda_power_up(struct hda_codec *codec) ...@@ -2710,6 +2781,10 @@ void snd_hda_power_up(struct hda_codec *codec)
cancel_delayed_work(&codec->power_work); cancel_delayed_work(&codec->power_work);
codec->power_transition = 0; codec->power_transition = 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_power_up);
#define power_save(codec) \
((codec)->bus->power_save ? *(codec)->bus->power_save : 0)
#define power_save(codec) \ #define power_save(codec) \
((codec)->bus->power_save ? *(codec)->bus->power_save : 0) ((codec)->bus->power_save ? *(codec)->bus->power_save : 0)
...@@ -2725,6 +2800,7 @@ void snd_hda_power_down(struct hda_codec *codec) ...@@ -2725,6 +2800,7 @@ void snd_hda_power_down(struct hda_codec *codec)
msecs_to_jiffies(power_save(codec) * 1000)); msecs_to_jiffies(power_save(codec) * 1000));
} }
} }
EXPORT_SYMBOL_GPL(snd_hda_power_down);
int snd_hda_check_amp_list_power(struct hda_codec *codec, int snd_hda_check_amp_list_power(struct hda_codec *codec,
struct hda_loopback_check *check, struct hda_loopback_check *check,
...@@ -2761,6 +2837,7 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec, ...@@ -2761,6 +2837,7 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec,
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_check_amp_list_power);
#endif #endif
/* /*
...@@ -2780,6 +2857,7 @@ int snd_hda_ch_mode_info(struct hda_codec *codec, ...@@ -2780,6 +2857,7 @@ int snd_hda_ch_mode_info(struct hda_codec *codec,
chmode[uinfo->value.enumerated.item].channels); chmode[uinfo->value.enumerated.item].channels);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_ch_mode_info);
int snd_hda_ch_mode_get(struct hda_codec *codec, int snd_hda_ch_mode_get(struct hda_codec *codec,
struct snd_ctl_elem_value *ucontrol, struct snd_ctl_elem_value *ucontrol,
...@@ -2797,6 +2875,7 @@ int snd_hda_ch_mode_get(struct hda_codec *codec, ...@@ -2797,6 +2875,7 @@ int snd_hda_ch_mode_get(struct hda_codec *codec,
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_ch_mode_get);
int snd_hda_ch_mode_put(struct hda_codec *codec, int snd_hda_ch_mode_put(struct hda_codec *codec,
struct snd_ctl_elem_value *ucontrol, struct snd_ctl_elem_value *ucontrol,
...@@ -2817,6 +2896,7 @@ int snd_hda_ch_mode_put(struct hda_codec *codec, ...@@ -2817,6 +2896,7 @@ int snd_hda_ch_mode_put(struct hda_codec *codec,
snd_hda_sequence_write_cache(codec, chmode[mode].sequence); snd_hda_sequence_write_cache(codec, chmode[mode].sequence);
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(snd_hda_ch_mode_put);
/* /*
* input MUX helper * input MUX helper
...@@ -2837,6 +2917,7 @@ int snd_hda_input_mux_info(const struct hda_input_mux *imux, ...@@ -2837,6 +2917,7 @@ int snd_hda_input_mux_info(const struct hda_input_mux *imux,
strcpy(uinfo->value.enumerated.name, imux->items[index].label); strcpy(uinfo->value.enumerated.name, imux->items[index].label);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_input_mux_info);
int snd_hda_input_mux_put(struct hda_codec *codec, int snd_hda_input_mux_put(struct hda_codec *codec,
const struct hda_input_mux *imux, const struct hda_input_mux *imux,
...@@ -2858,6 +2939,7 @@ int snd_hda_input_mux_put(struct hda_codec *codec, ...@@ -2858,6 +2939,7 @@ int snd_hda_input_mux_put(struct hda_codec *codec,
*cur_val = idx; *cur_val = idx;
return 1; return 1;
} }
EXPORT_SYMBOL_GPL(snd_hda_input_mux_put);
/* /*
...@@ -2910,6 +2992,7 @@ int snd_hda_multi_out_dig_open(struct hda_codec *codec, ...@@ -2910,6 +2992,7 @@ int snd_hda_multi_out_dig_open(struct hda_codec *codec,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_multi_out_dig_open);
int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
struct hda_multi_out *mout, struct hda_multi_out *mout,
...@@ -2922,6 +3005,7 @@ int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, ...@@ -2922,6 +3005,7 @@ int snd_hda_multi_out_dig_prepare(struct hda_codec *codec,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_multi_out_dig_prepare);
/* /*
* release the digital out * release the digital out
...@@ -2934,6 +3018,7 @@ int snd_hda_multi_out_dig_close(struct hda_codec *codec, ...@@ -2934,6 +3018,7 @@ int snd_hda_multi_out_dig_close(struct hda_codec *codec,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_multi_out_dig_close);
/* /*
* set up more restrictions for analog out * set up more restrictions for analog out
...@@ -2973,6 +3058,7 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec, ...@@ -2973,6 +3058,7 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec,
return snd_pcm_hw_constraint_step(substream->runtime, 0, return snd_pcm_hw_constraint_step(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_CHANNELS, 2); SNDRV_PCM_HW_PARAM_CHANNELS, 2);
} }
EXPORT_SYMBOL_GPL(snd_hda_multi_out_analog_open);
/* /*
* set up the i/o for analog out * set up the i/o for analog out
...@@ -3031,6 +3117,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, ...@@ -3031,6 +3117,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_multi_out_analog_prepare);
/* /*
* clean up the setting for analog out * clean up the setting for analog out
...@@ -3057,6 +3144,7 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, ...@@ -3057,6 +3144,7 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec,
mutex_unlock(&codec->spdif_mutex); mutex_unlock(&codec->spdif_mutex);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_multi_out_analog_cleanup);
/* /*
* Helper for automatic pin configuration * Helper for automatic pin configuration
...@@ -3342,11 +3430,13 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, ...@@ -3342,11 +3430,13 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_parse_pin_def_config);
/* labels for input pins */ /* labels for input pins */
const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = {
"Mic", "Front Mic", "Line", "Front Line", "CD", "Aux" "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux"
}; };
EXPORT_SYMBOL_GPL(auto_pin_cfg_labels);
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -3374,6 +3464,7 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state) ...@@ -3374,6 +3464,7 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state)
} }
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(snd_hda_suspend);
/** /**
* snd_hda_resume - resume the codecs * snd_hda_resume - resume the codecs
...@@ -3394,7 +3485,8 @@ int snd_hda_resume(struct hda_bus *bus) ...@@ -3394,7 +3485,8 @@ int snd_hda_resume(struct hda_bus *bus)
} }
return 0; return 0;
} }
#endif EXPORT_SYMBOL_GPL(snd_hda_resume);
#endif /* CONFIG_PM */
/* /*
* generic arrays * generic arrays
...@@ -3423,6 +3515,7 @@ void *snd_array_new(struct snd_array *array) ...@@ -3423,6 +3515,7 @@ void *snd_array_new(struct snd_array *array)
} }
return snd_array_elem(array, array->used++); return snd_array_elem(array, array->used++);
} }
EXPORT_SYMBOL_GPL(snd_array_new);
/* free the given array elements */ /* free the given array elements */
void snd_array_free(struct snd_array *array) void snd_array_free(struct snd_array *array)
...@@ -3432,6 +3525,7 @@ void snd_array_free(struct snd_array *array) ...@@ -3432,6 +3525,7 @@ void snd_array_free(struct snd_array *array)
array->alloced = 0; array->alloced = 0;
array->list = NULL; array->list = NULL;
} }
EXPORT_SYMBOL_GPL(snd_array_free);
/* /*
* used by hda_proc.c and hda_eld.c * used by hda_proc.c and hda_eld.c
...@@ -3450,6 +3544,7 @@ void snd_print_pcm_rates(int pcm, char *buf, int buflen) ...@@ -3450,6 +3544,7 @@ void snd_print_pcm_rates(int pcm, char *buf, int buflen)
buf[j] = '\0'; /* necessary when j == 0 */ buf[j] = '\0'; /* necessary when j == 0 */
} }
EXPORT_SYMBOL_GPL(snd_print_pcm_rates);
void snd_print_pcm_bits(int pcm, char *buf, int buflen) void snd_print_pcm_bits(int pcm, char *buf, int buflen)
{ {
...@@ -3462,3 +3557,7 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen) ...@@ -3462,3 +3557,7 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen)
buf[j] = '\0'; /* necessary when j == 0 */ buf[j] = '\0'; /* necessary when j == 0 */
} }
EXPORT_SYMBOL_GPL(snd_print_pcm_bits);
MODULE_DESCRIPTION("HDA codec core");
MODULE_LICENSE("GPL");
...@@ -642,6 +642,16 @@ struct hda_codec_preset { ...@@ -642,6 +642,16 @@ struct hda_codec_preset {
int (*patch)(struct hda_codec *codec); int (*patch)(struct hda_codec *codec);
}; };
struct hda_codec_preset_list {
const struct hda_codec_preset *preset;
struct module *owner;
struct list_head list;
};
/* initial hook */
int snd_hda_add_codec_preset(struct hda_codec_preset_list *preset);
int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset);
/* ops set by the preset patch */ /* ops set by the preset patch */
struct hda_codec_ops { struct hda_codec_ops {
int (*build_controls)(struct hda_codec *codec); int (*build_controls)(struct hda_codec *codec);
...@@ -735,6 +745,7 @@ struct hda_codec { ...@@ -735,6 +745,7 @@ struct hda_codec {
/* detected preset */ /* detected preset */
const struct hda_codec_preset *preset; const struct hda_codec_preset *preset;
struct module *owner;
const char *name; /* codec name */ const char *name; /* codec name */
const char *modelname; /* model name for preset */ const char *modelname; /* model name for preset */
......
...@@ -1101,3 +1101,4 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec) ...@@ -1101,3 +1101,4 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec)
snd_hda_generic_free(codec); snd_hda_generic_free(codec);
return err; return err;
} }
EXPORT_SYMBOL(snd_hda_parse_generic_codec);
...@@ -116,7 +116,7 @@ static void hwdep_free(struct snd_hwdep *hwdep) ...@@ -116,7 +116,7 @@ static void hwdep_free(struct snd_hwdep *hwdep)
clear_hwdep_elements(hwdep->private_data); clear_hwdep_elements(hwdep->private_data);
} }
int __devinit snd_hda_create_hwdep(struct hda_codec *codec) int /*__devinit*/ snd_hda_create_hwdep(struct hda_codec *codec)
{ {
char hwname[16]; char hwname[16];
struct snd_hwdep *hwdep; struct snd_hwdep *hwdep;
......
/*
* HDA Patches - included by hda_codec.c
*/
/* Realtek codecs */
extern struct hda_codec_preset snd_hda_preset_realtek[];
/* C-Media codecs */
extern struct hda_codec_preset snd_hda_preset_cmedia[];
/* Analog Devices codecs */
extern struct hda_codec_preset snd_hda_preset_analog[];
/* SigmaTel codecs */
extern struct hda_codec_preset snd_hda_preset_sigmatel[];
/* SiLabs 3054/3055 modem codecs */
extern struct hda_codec_preset snd_hda_preset_si3054[];
/* ATI HDMI codecs */
extern struct hda_codec_preset snd_hda_preset_atihdmi[];
/* Conexant audio codec */
extern struct hda_codec_preset snd_hda_preset_conexant[];
/* VIA codecs */
extern struct hda_codec_preset snd_hda_preset_via[];
/* NVIDIA HDMI codecs */
extern struct hda_codec_preset snd_hda_preset_nvhdmi[];
/* INTEL HDMI codecs */
extern struct hda_codec_preset snd_hda_preset_intelhdmi[];
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
struct ad198x_spec { struct ad198x_spec {
struct snd_kcontrol_new *mixers[5]; struct snd_kcontrol_new *mixers[5];
...@@ -4308,7 +4307,7 @@ static int patch_ad1882(struct hda_codec *codec) ...@@ -4308,7 +4307,7 @@ static int patch_ad1882(struct hda_codec *codec)
/* /*
* patch entries * patch entries
*/ */
struct hda_codec_preset snd_hda_preset_analog[] = { static struct hda_codec_preset snd_hda_preset_analog[] = {
{ .id = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884a }, { .id = 0x11d4184a, .name = "AD1884A", .patch = patch_ad1884a },
{ .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 }, { .id = 0x11d41882, .name = "AD1882", .patch = patch_ad1882 },
{ .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a }, { .id = 0x11d41883, .name = "AD1883", .patch = patch_ad1884a },
...@@ -4326,3 +4325,26 @@ struct hda_codec_preset snd_hda_preset_analog[] = { ...@@ -4326,3 +4325,26 @@ struct hda_codec_preset snd_hda_preset_analog[] = {
{ .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 }, { .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 },
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:11d4*");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Analog Devices HD-audio codec");
static struct hda_codec_preset_list analog_list = {
.preset = snd_hda_preset_analog,
.owner = THIS_MODULE,
};
static int __init patch_analog_init(void)
{
return snd_hda_add_codec_preset(&analog_list);
}
static void __exit patch_analog_exit(void)
{
snd_hda_delete_codec_preset(&analog_list);
}
module_init(patch_analog_init)
module_exit(patch_analog_exit)
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
struct atihdmi_spec { struct atihdmi_spec {
struct hda_multi_out multiout; struct hda_multi_out multiout;
...@@ -187,7 +186,7 @@ static int patch_atihdmi(struct hda_codec *codec) ...@@ -187,7 +186,7 @@ static int patch_atihdmi(struct hda_codec *codec)
/* /*
* patch entries * patch entries
*/ */
struct hda_codec_preset snd_hda_preset_atihdmi[] = { static struct hda_codec_preset snd_hda_preset_atihdmi[] = {
{ .id = 0x1002793c, .name = "ATI RS600 HDMI", .patch = patch_atihdmi }, { .id = 0x1002793c, .name = "ATI RS600 HDMI", .patch = patch_atihdmi },
{ .id = 0x10027919, .name = "ATI RS600 HDMI", .patch = patch_atihdmi }, { .id = 0x10027919, .name = "ATI RS600 HDMI", .patch = patch_atihdmi },
{ .id = 0x1002791a, .name = "ATI RS690/780 HDMI", .patch = patch_atihdmi }, { .id = 0x1002791a, .name = "ATI RS690/780 HDMI", .patch = patch_atihdmi },
...@@ -196,3 +195,31 @@ struct hda_codec_preset snd_hda_preset_atihdmi[] = { ...@@ -196,3 +195,31 @@ struct hda_codec_preset snd_hda_preset_atihdmi[] = {
{ .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_atihdmi }, { .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_atihdmi },
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:1002793c");
MODULE_ALIAS("snd-hda-codec-id:10027919");
MODULE_ALIAS("snd-hda-codec-id:1002791a");
MODULE_ALIAS("snd-hda-codec-id:1002aa01");
MODULE_ALIAS("snd-hda-codec-id:10951390");
MODULE_ALIAS("snd-hda-codec-id:17e80047");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("ATI HDMI HD-audio codec");
static struct hda_codec_preset_list atihdmi_list = {
.preset = snd_hda_preset_atihdmi,
.owner = THIS_MODULE,
};
static int __init patch_atihdmi_init(void)
{
return snd_hda_add_codec_preset(&atihdmi_list);
}
static void __exit patch_atihdmi_exit(void)
{
snd_hda_delete_codec_preset(&atihdmi_list);
}
module_init(patch_atihdmi_init)
module_exit(patch_atihdmi_exit)
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
#define NUM_PINS 11 #define NUM_PINS 11
...@@ -736,8 +735,32 @@ static int patch_cmi9880(struct hda_codec *codec) ...@@ -736,8 +735,32 @@ static int patch_cmi9880(struct hda_codec *codec)
/* /*
* patch entries * patch entries
*/ */
struct hda_codec_preset snd_hda_preset_cmedia[] = { static struct hda_codec_preset snd_hda_preset_cmedia[] = {
{ .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 }, { .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 },
{ .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 }, { .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 },
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:13f69880");
MODULE_ALIAS("snd-hda-codec-id:434d4980");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("C-Media HD-audio codec");
static struct hda_codec_preset_list cmedia_list = {
.preset = snd_hda_preset_cmedia,
.owner = THIS_MODULE,
};
static int __init patch_cmedia_init(void)
{
return snd_hda_add_codec_preset(&cmedia_list);
}
static void __exit patch_cmedia_exit(void)
{
snd_hda_delete_codec_preset(&cmedia_list);
}
module_init(patch_cmedia_init)
module_exit(patch_cmedia_exit)
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
#define CXT_PIN_DIR_IN 0x00 #define CXT_PIN_DIR_IN 0x00
#define CXT_PIN_DIR_OUT 0x01 #define CXT_PIN_DIR_OUT 0x01
...@@ -1771,7 +1770,7 @@ static int patch_cxt5051(struct hda_codec *codec) ...@@ -1771,7 +1770,7 @@ static int patch_cxt5051(struct hda_codec *codec)
/* /*
*/ */
struct hda_codec_preset snd_hda_preset_conexant[] = { static struct hda_codec_preset snd_hda_preset_conexant[] = {
{ .id = 0x14f15045, .name = "CX20549 (Venice)", { .id = 0x14f15045, .name = "CX20549 (Venice)",
.patch = patch_cxt5045 }, .patch = patch_cxt5045 },
{ .id = 0x14f15047, .name = "CX20551 (Waikiki)", { .id = 0x14f15047, .name = "CX20551 (Waikiki)",
...@@ -1780,3 +1779,28 @@ struct hda_codec_preset snd_hda_preset_conexant[] = { ...@@ -1780,3 +1779,28 @@ struct hda_codec_preset snd_hda_preset_conexant[] = {
.patch = patch_cxt5051 }, .patch = patch_cxt5051 },
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:14f15045");
MODULE_ALIAS("snd-hda-codec-id:14f15047");
MODULE_ALIAS("snd-hda-codec-id:14f15051");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Conexant HD-audio codec");
static struct hda_codec_preset_list conexant_list = {
.preset = snd_hda_preset_conexant,
.owner = THIS_MODULE,
};
static int __init patch_conexant_init(void)
{
return snd_hda_add_codec_preset(&conexant_list);
}
static void __exit patch_conexant_exit(void)
{
snd_hda_delete_codec_preset(&conexant_list);
}
module_init(patch_conexant_init)
module_exit(patch_conexant_exit)
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
#define CVT_NID 0x02 /* audio converter */ #define CVT_NID 0x02 /* audio converter */
#define PIN_NID 0x03 /* HDMI output pin */ #define PIN_NID 0x03 /* HDMI output pin */
...@@ -675,7 +674,7 @@ static int patch_intel_hdmi(struct hda_codec *codec) ...@@ -675,7 +674,7 @@ static int patch_intel_hdmi(struct hda_codec *codec)
return 0; return 0;
} }
struct hda_codec_preset snd_hda_preset_intelhdmi[] = { static struct hda_codec_preset snd_hda_preset_intelhdmi[] = {
{ .id = 0x808629fb, .name = "INTEL G45 DEVCL", .patch = patch_intel_hdmi }, { .id = 0x808629fb, .name = "INTEL G45 DEVCL", .patch = patch_intel_hdmi },
{ .id = 0x80862801, .name = "INTEL G45 DEVBLC", .patch = patch_intel_hdmi }, { .id = 0x80862801, .name = "INTEL G45 DEVBLC", .patch = patch_intel_hdmi },
{ .id = 0x80862802, .name = "INTEL G45 DEVCTG", .patch = patch_intel_hdmi }, { .id = 0x80862802, .name = "INTEL G45 DEVCTG", .patch = patch_intel_hdmi },
...@@ -683,3 +682,30 @@ struct hda_codec_preset snd_hda_preset_intelhdmi[] = { ...@@ -683,3 +682,30 @@ struct hda_codec_preset snd_hda_preset_intelhdmi[] = {
{ .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_intel_hdmi }, { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_intel_hdmi },
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:808629fb");
MODULE_ALIAS("snd-hda-codec-id:80862801");
MODULE_ALIAS("snd-hda-codec-id:80862802");
MODULE_ALIAS("snd-hda-codec-id:80862803");
MODULE_ALIAS("snd-hda-codec-id:10951392");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Intel HDMI HD-audio codec");
static struct hda_codec_preset_list intel_list = {
.preset = snd_hda_preset_intelhdmi,
.owner = THIS_MODULE,
};
static int __init patch_intelhdmi_init(void)
{
return snd_hda_add_codec_preset(&intel_list);
}
static void __exit patch_intelhdmi_exit(void)
{
snd_hda_delete_codec_preset(&intel_list);
}
module_init(patch_intelhdmi_init)
module_exit(patch_intelhdmi_exit)
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
struct nvhdmi_spec { struct nvhdmi_spec {
struct hda_multi_out multiout; struct hda_multi_out multiout;
...@@ -159,8 +158,32 @@ static int patch_nvhdmi(struct hda_codec *codec) ...@@ -159,8 +158,32 @@ static int patch_nvhdmi(struct hda_codec *codec)
/* /*
* patch entries * patch entries
*/ */
struct hda_codec_preset snd_hda_preset_nvhdmi[] = { static struct hda_codec_preset snd_hda_preset_nvhdmi[] = {
{ .id = 0x10de0002, .name = "NVIDIA MCP78 HDMI", .patch = patch_nvhdmi }, { .id = 0x10de0002, .name = "NVIDIA MCP78 HDMI", .patch = patch_nvhdmi },
{ .id = 0x10de0007, .name = "NVIDIA MCP7A HDMI", .patch = patch_nvhdmi }, { .id = 0x10de0007, .name = "NVIDIA MCP7A HDMI", .patch = patch_nvhdmi },
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:10de0002");
MODULE_ALIAS("snd-hda-codec-id:10de0007");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Nvidia HDMI HD-audio codec");
static struct hda_codec_preset_list nvhdmi_list = {
.preset = snd_hda_preset_nvhdmi,
.owner = THIS_MODULE,
};
static int __init patch_nvhdmi_init(void)
{
return snd_hda_add_codec_preset(&nvhdmi_list);
}
static void __exit patch_nvhdmi_exit(void)
{
snd_hda_delete_codec_preset(&nvhdmi_list);
}
module_init(patch_nvhdmi_init)
module_exit(patch_nvhdmi_exit)
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
#define ALC880_FRONT_EVENT 0x01 #define ALC880_FRONT_EVENT 0x01
#define ALC880_DCVOL_EVENT 0x02 #define ALC880_DCVOL_EVENT 0x02
...@@ -16579,7 +16578,7 @@ static int patch_alc662(struct hda_codec *codec) ...@@ -16579,7 +16578,7 @@ static int patch_alc662(struct hda_codec *codec)
/* /*
* patch entries * patch entries
*/ */
struct hda_codec_preset snd_hda_preset_realtek[] = { static struct hda_codec_preset snd_hda_preset_realtek[] = {
{ .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 }, { .id = 0x10ec0260, .name = "ALC260", .patch = patch_alc260 },
{ .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 }, { .id = 0x10ec0262, .name = "ALC262", .patch = patch_alc262 },
{ .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 }, { .id = 0x10ec0267, .name = "ALC267", .patch = patch_alc268 },
...@@ -16611,3 +16610,26 @@ struct hda_codec_preset snd_hda_preset_realtek[] = { ...@@ -16611,3 +16610,26 @@ struct hda_codec_preset snd_hda_preset_realtek[] = {
{ .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 }, { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 },
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:10ec*");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Realtek HD-audio codec");
static struct hda_codec_preset_list realtek_list = {
.preset = snd_hda_preset_realtek,
.owner = THIS_MODULE,
};
static int __init patch_realtek_init(void)
{
return snd_hda_add_codec_preset(&realtek_list);
}
static void __exit patch_realtek_exit(void)
{
snd_hda_delete_codec_preset(&realtek_list);
}
module_init(patch_realtek_init)
module_exit(patch_realtek_exit)
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
/* si3054 verbs */ /* si3054 verbs */
#define SI3054_VERB_READ_NODE 0x900 #define SI3054_VERB_READ_NODE 0x900
...@@ -283,7 +282,7 @@ static int patch_si3054(struct hda_codec *codec) ...@@ -283,7 +282,7 @@ static int patch_si3054(struct hda_codec *codec)
/* /*
* patch entries * patch entries
*/ */
struct hda_codec_preset snd_hda_preset_si3054[] = { static struct hda_codec_preset snd_hda_preset_si3054[] = {
{ .id = 0x163c3055, .name = "Si3054", .patch = patch_si3054 }, { .id = 0x163c3055, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x163c3155, .name = "Si3054", .patch = patch_si3054 }, { .id = 0x163c3155, .name = "Si3054", .patch = patch_si3054 },
{ .id = 0x11c13026, .name = "Si3054", .patch = patch_si3054 }, { .id = 0x11c13026, .name = "Si3054", .patch = patch_si3054 },
...@@ -301,3 +300,35 @@ struct hda_codec_preset snd_hda_preset_si3054[] = { ...@@ -301,3 +300,35 @@ struct hda_codec_preset snd_hda_preset_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_LICENSE("GPL");
MODULE_DESCRIPTION("Si3054 HD-audio modem codec");
static struct hda_codec_preset_list si3054_list = {
.preset = snd_hda_preset_si3054,
.owner = THIS_MODULE,
};
static int __init patch_si3054_init(void)
{
return snd_hda_add_codec_preset(&si3054_list);
}
static void __exit patch_si3054_exit(void)
{
snd_hda_delete_codec_preset(&si3054_list);
}
module_init(patch_si3054_init)
module_exit(patch_si3054_exit)
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <sound/jack.h> #include <sound/jack.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
#include "hda_beep.h" #include "hda_beep.h"
enum { enum {
...@@ -5455,7 +5454,7 @@ static int patch_stac9872(struct hda_codec *codec) ...@@ -5455,7 +5454,7 @@ static int patch_stac9872(struct hda_codec *codec)
/* /*
* patch entries * patch entries
*/ */
struct hda_codec_preset snd_hda_preset_sigmatel[] = { static struct hda_codec_preset snd_hda_preset_sigmatel[] = {
{ .id = 0x83847690, .name = "STAC9200", .patch = patch_stac9200 }, { .id = 0x83847690, .name = "STAC9200", .patch = patch_stac9200 },
{ .id = 0x83847882, .name = "STAC9220 A1", .patch = patch_stac922x }, { .id = 0x83847882, .name = "STAC9220 A1", .patch = patch_stac922x },
{ .id = 0x83847680, .name = "STAC9221 A1", .patch = patch_stac922x }, { .id = 0x83847680, .name = "STAC9221 A1", .patch = patch_stac922x },
...@@ -5519,3 +5518,27 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = { ...@@ -5519,3 +5518,27 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = {
{ .id = 0x111d76b7, .name = "92HD71B5X", .patch = patch_stac92hd71bxx }, { .id = 0x111d76b7, .name = "92HD71B5X", .patch = patch_stac92hd71bxx },
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:8384*");
MODULE_ALIAS("snd-hda-codec-id:111d*");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("IDT/Sigmatel HD-audio codec");
static struct hda_codec_preset_list sigmatel_list = {
.preset = snd_hda_preset_sigmatel,
.owner = THIS_MODULE,
};
static int __init patch_sigmatel_init(void)
{
return snd_hda_add_codec_preset(&sigmatel_list);
}
static void __exit patch_sigmatel_exit(void)
{
snd_hda_delete_codec_preset(&sigmatel_list);
}
module_init(patch_sigmatel_init)
module_exit(patch_sigmatel_exit)
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#include <sound/asoundef.h> #include <sound/asoundef.h>
#include "hda_codec.h" #include "hda_codec.h"
#include "hda_local.h" #include "hda_local.h"
#include "hda_patch.h"
/* amp values */ /* amp values */
#define AMP_VAL_IDX_SHIFT 19 #define AMP_VAL_IDX_SHIFT 19
...@@ -3249,7 +3248,7 @@ static int patch_vt1702(struct hda_codec *codec) ...@@ -3249,7 +3248,7 @@ static int patch_vt1702(struct hda_codec *codec)
/* /*
* patch entries * patch entries
*/ */
struct hda_codec_preset snd_hda_preset_via[] = { static struct hda_codec_preset snd_hda_preset_via[] = {
{ .id = 0x11061708, .name = "VIA VT1708", .patch = patch_vt1708}, { .id = 0x11061708, .name = "VIA VT1708", .patch = patch_vt1708},
{ .id = 0x11061709, .name = "VIA VT1708", .patch = patch_vt1708}, { .id = 0x11061709, .name = "VIA VT1708", .patch = patch_vt1708},
{ .id = 0x1106170A, .name = "VIA VT1708", .patch = patch_vt1708}, { .id = 0x1106170A, .name = "VIA VT1708", .patch = patch_vt1708},
...@@ -3320,3 +3319,26 @@ struct hda_codec_preset snd_hda_preset_via[] = { ...@@ -3320,3 +3319,26 @@ struct hda_codec_preset snd_hda_preset_via[] = {
.patch = patch_vt1702}, .patch = patch_vt1702},
{} /* terminator */ {} /* terminator */
}; };
MODULE_ALIAS("snd-hda-codec-id:1106*");
static struct hda_codec_preset_list via_list = {
.preset = snd_hda_preset_via,
.owner = THIS_MODULE,
};
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("VIA HD-audio codec");
static int __init patch_via_init(void)
{
return snd_hda_add_codec_preset(&via_list);
}
static void __exit patch_via_exit(void)
{
snd_hda_delete_codec_preset(&via_list);
}
module_init(patch_via_init)
module_exit(patch_via_exit)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册