Commit 756e2b01 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] hda-intel - Merge hda-codec module to a single module

Merge hda-codec module to a single hda-intel module since this is the
only user right now.  Although hda-codec stuff is designed to be used
universally from different controller drivers, currently only one
controller interface (and compatibles) are used.  So, let's merge them
to a single module to save memory.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 5930ca41
snd-hda-intel-objs := hda_intel.o snd-hda-intel-objs := hda_intel.o
snd-hda-codec-objs := hda_codec.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-objs += hda_codec.o \
hda_generic.o \ hda_generic.o \
patch_realtek.o \ patch_realtek.o \
patch_cmedia.o \ patch_cmedia.o \
...@@ -10,7 +13,7 @@ snd-hda-codec-objs := hda_codec.o \ ...@@ -10,7 +13,7 @@ snd-hda-codec-objs := hda_codec.o \
patch_conexant.o \ patch_conexant.o \
patch_via.o patch_via.o
ifdef CONFIG_PROC_FS ifdef CONFIG_PROC_FS
snd-hda-codec-objs += hda_proc.o snd-hda-intel-objs += hda_proc.o
endif endif
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o snd-hda-codec.o obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/moduleparam.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <sound/core.h> #include <sound/core.h>
#include "hda_codec.h" #include "hda_codec.h"
...@@ -34,11 +33,6 @@ ...@@ -34,11 +33,6 @@
#include "hda_local.h" #include "hda_local.h"
MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
MODULE_DESCRIPTION("Universal interface for High Definition Audio Codec");
MODULE_LICENSE("GPL");
/* /*
* vendor / preset table * vendor / preset table
*/ */
...@@ -90,8 +84,6 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid, int dire ...@@ -90,8 +84,6 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid, int dire
return res; return res;
} }
EXPORT_SYMBOL(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
* @codec: the HDA codec * @codec: the HDA codec
...@@ -114,8 +106,6 @@ int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct, ...@@ -114,8 +106,6 @@ int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct,
return err; return err;
} }
EXPORT_SYMBOL(snd_hda_codec_write);
/** /**
* snd_hda_sequence_write - sequence writes * snd_hda_sequence_write - sequence writes
* @codec: the HDA codec * @codec: the HDA codec
...@@ -130,8 +120,6 @@ void snd_hda_sequence_write(struct hda_codec *codec, const struct hda_verb *seq) ...@@ -130,8 +120,6 @@ void snd_hda_sequence_write(struct hda_codec *codec, const struct hda_verb *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(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
* @codec: the HDA codec * @codec: the HDA codec
...@@ -150,8 +138,6 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, hda_nid_t *sta ...@@ -150,8 +138,6 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, hda_nid_t *sta
return (int)(parm & 0x7fff); return (int)(parm & 0x7fff);
} }
EXPORT_SYMBOL(snd_hda_get_sub_nodes);
/** /**
* snd_hda_get_connections - get connection list * snd_hda_get_connections - get connection list
* @codec: the HDA codec * @codec: the HDA codec
...@@ -268,8 +254,6 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex) ...@@ -268,8 +254,6 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
return 0; return 0;
} }
EXPORT_SYMBOL(snd_hda_queue_unsol_event);
/* /*
* process queueud unsolicited events * process queueud unsolicited events
*/ */
...@@ -298,7 +282,7 @@ static void process_unsol_events(struct work_struct *work) ...@@ -298,7 +282,7 @@ static void process_unsol_events(struct work_struct *work)
/* /*
* initialize unsolicited queue * initialize unsolicited queue
*/ */
static int init_unsol_queue(struct hda_bus *bus) static int __devinit init_unsol_queue(struct hda_bus *bus)
{ {
struct hda_bus_unsolicited *unsol; struct hda_bus_unsolicited *unsol;
...@@ -355,8 +339,9 @@ static int snd_hda_bus_dev_free(struct snd_device *device) ...@@ -355,8 +339,9 @@ static int snd_hda_bus_dev_free(struct snd_device *device)
* *
* Returns 0 if successful, or a negative error code. * Returns 0 if successful, or a negative error code.
*/ */
int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp, int __devinit snd_hda_bus_new(struct snd_card *card,
struct hda_bus **busp) const struct hda_bus_template *temp,
struct hda_bus **busp)
{ {
struct hda_bus *bus; struct hda_bus *bus;
int err; int err;
...@@ -394,12 +379,11 @@ int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp, ...@@ -394,12 +379,11 @@ int snd_hda_bus_new(struct snd_card *card, const struct hda_bus_template *temp,
return 0; return 0;
} }
EXPORT_SYMBOL(snd_hda_bus_new);
/* /*
* find a matching codec preset * find a matching codec preset
*/ */
static const struct hda_codec_preset *find_codec_preset(struct hda_codec *codec) static const struct hda_codec_preset __devinit *
find_codec_preset(struct hda_codec *codec)
{ {
const struct hda_codec_preset **tbl, *preset; const struct hda_codec_preset **tbl, *preset;
...@@ -450,7 +434,7 @@ void snd_hda_get_codec_name(struct hda_codec *codec, ...@@ -450,7 +434,7 @@ void snd_hda_get_codec_name(struct hda_codec *codec,
/* /*
* look for an AFG and MFG nodes * look for an AFG and MFG nodes
*/ */
static void 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;
...@@ -517,8 +501,8 @@ static void init_amp_hash(struct hda_codec *codec); ...@@ -517,8 +501,8 @@ static void init_amp_hash(struct hda_codec *codec);
* *
* Returns 0 if successful, or a negative error code. * Returns 0 if successful, or a negative error code.
*/ */
int 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;
char component[13]; char component[13];
...@@ -603,8 +587,6 @@ int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, ...@@ -603,8 +587,6 @@ int snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
return 0; return 0;
} }
EXPORT_SYMBOL(snd_hda_codec_new);
/** /**
* snd_hda_codec_setup_stream - set up the codec for streaming * snd_hda_codec_setup_stream - set up the codec for streaming
* @codec: the CODEC to set up * @codec: the CODEC to set up
...@@ -627,8 +609,6 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, u32 stre ...@@ -627,8 +609,6 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, u32 stre
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(snd_hda_codec_setup_stream);
/* /*
* amp access functions * amp access functions
*/ */
...@@ -639,7 +619,7 @@ EXPORT_SYMBOL(snd_hda_codec_setup_stream); ...@@ -639,7 +619,7 @@ EXPORT_SYMBOL(snd_hda_codec_setup_stream);
#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 init_amp_hash(struct hda_codec *codec) static void __devinit init_amp_hash(struct hda_codec *codec)
{ {
memset(codec->amp_hash, 0xff, sizeof(codec->amp_hash)); memset(codec->amp_hash, 0xff, sizeof(codec->amp_hash));
codec->num_amp_entries = 0; codec->num_amp_entries = 0;
...@@ -1169,7 +1149,8 @@ static struct snd_kcontrol_new dig_mixes[] = { ...@@ -1169,7 +1149,8 @@ static struct snd_kcontrol_new dig_mixes[] = {
* *
* Returns 0 if successful, or a negative error code. * Returns 0 if successful, or a negative error code.
*/ */
int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid) int __devinit snd_hda_create_spdif_out_ctls(struct hda_codec *codec,
hda_nid_t nid)
{ {
int err; int err;
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
...@@ -1261,7 +1242,8 @@ static struct snd_kcontrol_new dig_in_ctls[] = { ...@@ -1261,7 +1242,8 @@ static struct snd_kcontrol_new dig_in_ctls[] = {
* *
* Returns 0 if successful, or a negative error code. * Returns 0 if successful, or a negative error code.
*/ */
int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) int __devinit snd_hda_create_spdif_in_ctls(struct hda_codec *codec,
hda_nid_t nid)
{ {
int err; int err;
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
...@@ -1311,7 +1293,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, ...@@ -1311,7 +1293,7 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
* *
* Returns 0 if successful, otherwise a negative error code. * Returns 0 if successful, otherwise a negative error code.
*/ */
int snd_hda_build_controls(struct hda_bus *bus) int __devinit snd_hda_build_controls(struct hda_bus *bus)
{ {
struct list_head *p; struct list_head *p;
...@@ -1342,8 +1324,6 @@ int snd_hda_build_controls(struct hda_bus *bus) ...@@ -1342,8 +1324,6 @@ int snd_hda_build_controls(struct hda_bus *bus)
return 0; return 0;
} }
EXPORT_SYMBOL(snd_hda_build_controls);
/* /*
* stream formats * stream formats
*/ */
...@@ -1433,8 +1413,6 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate, ...@@ -1433,8 +1413,6 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate,
return val; return val;
} }
EXPORT_SYMBOL(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
* @codec: the HDA codec * @codec: the HDA codec
...@@ -1688,7 +1666,7 @@ static int set_pcm_default_values(struct hda_codec *codec, struct hda_pcm_stream ...@@ -1688,7 +1666,7 @@ static int set_pcm_default_values(struct hda_codec *codec, struct hda_pcm_stream
* *
* This function returns 0 if successfull, or a negative error code. * This function returns 0 if successfull, or a negative error code.
*/ */
int snd_hda_build_pcms(struct hda_bus *bus) int __devinit snd_hda_build_pcms(struct hda_bus *bus)
{ {
struct list_head *p; struct list_head *p;
...@@ -1716,8 +1694,6 @@ int snd_hda_build_pcms(struct hda_bus *bus) ...@@ -1716,8 +1694,6 @@ int snd_hda_build_pcms(struct hda_bus *bus)
return 0; return 0;
} }
EXPORT_SYMBOL(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
* @codec: the HDA codec * @codec: the HDA codec
...@@ -1731,9 +1707,9 @@ EXPORT_SYMBOL(snd_hda_build_pcms); ...@@ -1731,9 +1707,9 @@ EXPORT_SYMBOL(snd_hda_build_pcms);
* *
* If no entries are matching, the function returns a negative value. * If no entries are matching, the function returns a negative value.
*/ */
int snd_hda_check_board_config(struct hda_codec *codec, int __devinit snd_hda_check_board_config(struct hda_codec *codec,
int num_configs, const char **models, int num_configs, const char **models,
const struct snd_pci_quirk *tbl) const struct snd_pci_quirk *tbl)
{ {
if (codec->bus->modelname && models) { if (codec->bus->modelname && models) {
int i; int i;
...@@ -1783,7 +1759,8 @@ int snd_hda_check_board_config(struct hda_codec *codec, ...@@ -1783,7 +1759,8 @@ int snd_hda_check_board_config(struct hda_codec *codec,
* *
* Returns 0 if successful, or a negative error code. * Returns 0 if successful, or a negative error code.
*/ */
int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) int __devinit snd_hda_add_new_ctls(struct hda_codec *codec,
struct snd_kcontrol_new *knew)
{ {
int err; int err;
...@@ -2040,7 +2017,7 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_o ...@@ -2040,7 +2017,7 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, struct hda_multi_o
* Helper for automatic ping configuration * Helper for automatic ping configuration
*/ */
static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list) static int __devinit is_in_nid_list(hda_nid_t nid, hda_nid_t *list)
{ {
for (; *list; list++) for (; *list; list++)
if (*list == nid) if (*list == nid)
...@@ -2065,8 +2042,9 @@ static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list) ...@@ -2065,8 +2042,9 @@ static int is_in_nid_list(hda_nid_t nid, hda_nid_t *list)
* The digital input/output pins are assigned to dig_in_pin and dig_out_pin, * The digital input/output pins are assigned to dig_in_pin and dig_out_pin,
* respectively. * respectively.
*/ */
int snd_hda_parse_pin_def_config(struct hda_codec *codec, struct auto_pin_cfg *cfg, int __devinit snd_hda_parse_pin_def_config(struct hda_codec *codec,
hda_nid_t *ignore_nids) struct auto_pin_cfg *cfg,
hda_nid_t *ignore_nids)
{ {
hda_nid_t nid, nid_start; hda_nid_t nid, nid_start;
int i, j, nodes; int i, j, nodes;
...@@ -2273,8 +2251,6 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state) ...@@ -2273,8 +2251,6 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state)
return 0; return 0;
} }
EXPORT_SYMBOL(snd_hda_suspend);
/** /**
* snd_hda_resume - resume the codecs * snd_hda_resume - resume the codecs
* @bus: the HDA bus * @bus: the HDA bus
...@@ -2297,8 +2273,6 @@ int snd_hda_resume(struct hda_bus *bus) ...@@ -2297,8 +2273,6 @@ int snd_hda_resume(struct hda_bus *bus)
return 0; return 0;
} }
EXPORT_SYMBOL(snd_hda_resume);
/** /**
* snd_hda_resume_ctls - resume controls in the new control list * snd_hda_resume_ctls - resume controls in the new control list
* @codec: the HDA codec * @codec: the HDA codec
...@@ -2357,19 +2331,3 @@ int snd_hda_resume_spdif_in(struct hda_codec *codec) ...@@ -2357,19 +2331,3 @@ int snd_hda_resume_spdif_in(struct hda_codec *codec)
return snd_hda_resume_ctls(codec, dig_in_ctls); return snd_hda_resume_ctls(codec, dig_in_ctls);
} }
#endif #endif
/*
* INIT part
*/
static int __init alsa_hda_init(void)
{
return 0;
}
static void __exit alsa_hda_exit(void)
{
}
module_init(alsa_hda_init)
module_exit(alsa_hda_exit)
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