HD-audio modularization
Hi,
since my original diet plan for HD-audio driver isn't going well as expected, I decided the traditional strategy: divide and conquer.
The below is the preliminary patch for modularizing snd-hda-intel. Now the codec-specific codes are split into several modules, and loaded automatically on demand.
The patch is against the latest sound.git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
It's also included in the recent sound-unstable tree, too (topic/hda-modularize branch):
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable-2.6.git
A known issue is that "alsasound stop" may not work with this because of the explicit module refcount without dependency. But it's a script problem, basically. The similar problem must be there for snd-aoa, for example, too.
Let me know if you see any other issues.
thanks,
Takashi
===
Quoted 1 line
From
1289e9e8b42f973f2ab39e5f4f2239ff826c27e9Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Thu, 27 Nov 2008 15:47:11 +0100
Subject: [PATCH] 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
--- sound/pci/hda/Kconfig | 50 +++++++++++ sound/pci/hda/Makefile | 77 ++++++++++++---- sound/pci/hda/hda_beep.c | 2 + sound/pci/hda/hda_codec.c | 187 ++++++++++++++++++++++++++++++--------- sound/pci/hda/hda_codec.h | 11 +++ sound/pci/hda/hda_generic.c | 1 + sound/pci/hda/hda_hwdep.c | 2 +- sound/pci/hda/hda_patch.h | 24 ----- sound/pci/hda/patch_analog.c | 26 +++++- sound/pci/hda/patch_atihdmi.c | 31 ++++++- sound/pci/hda/patch_cmedia.c | 27 +++++- sound/pci/hda/patch_conexant.c | 28 ++++++- sound/pci/hda/patch_intelhdmi.c | 30 ++++++- sound/pci/hda/patch_nvhdmi.c | 27 +++++- sound/pci/hda/patch_realtek.c | 26 +++++- sound/pci/hda/patch_si3054.c | 35 +++++++- sound/pci/hda/patch_sigmatel.c | 27 +++++- sound/pci/hda/patch_via.c | 26 +++++- 18 files changed, 528 insertions(+), 109 deletions(-) delete mode 100644 sound/pci/hda/hda_patch.h
sound/pci/hda/Kconfig +50 -0
@@ -46,6 +46,11 @@ config SND_HDA_CODEC_REALTEK Say Y here to include Realtek HD-audio codec support in 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 bool "Build Analog Device HD-audio codec support" default y
@@ -53,6 +58,11 @@ config SND_HDA_CODEC_ANALOG Say Y here to include Analog Device HD-audio codec support in 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 bool "Build IDT/Sigmatel HD-audio codec support" default y
@@ -60,6 +70,11 @@ config SND_HDA_CODEC_SIGMATEL Say Y here to include IDT (Sigmatel) HD-audio codec support in 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 bool "Build VIA HD-audio codec support" default y
@@ -67,6 +82,11 @@ config SND_HDA_CODEC_VIA Say Y here to include VIA HD-audio codec support in 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 bool "Build ATI HDMI HD-audio codec support" default y
@@ -74,6 +94,11 @@ config SND_HDA_CODEC_ATIHDMI Say Y here to include ATI HDMI HD-audio codec support in 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 bool "Build NVIDIA HDMI HD-audio codec support" default y
@@ -81,6 +106,11 @@ config SND_HDA_CODEC_NVHDMI Say Y here to include NVIDIA HDMI HD-audio codec support in 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 bool "Build INTEL HDMI HD-audio codec support" default y
@@ -88,6 +118,11 @@ config SND_HDA_CODEC_INTELHDMI Say Y here to include INTEL HDMI HD-audio codec support in 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 def_bool y depends on SND_HDA_CODEC_INTELHDMI
@@ -99,6 +134,11 @@ config SND_HDA_CODEC_CONEXANT Say Y here to include Conexant HD-audio codec support in 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 bool "Build C-Media HD-audio codec support" default y
@@ -106,6 +146,11 @@ config SND_HDA_CODEC_CMEDIA Say Y here to include C-Media HD-audio codec support in 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 bool "Build Silicon Labs 3054 HD-modem codec support" default y
@@ -113,6 +158,11 @@ config SND_HDA_CODEC_SI3054 Say Y here to include Silicon Labs 3054 HD-modem codec (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 bool "Enable generic HD-audio codec parser" default y
sound/pci/hda/Makefile +57 -20
79 lines not on this page · raw message
sound/pci/hda/hda_beep.c +2 -0
@@ -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);return 0 ; } +EXPORT_SYMBOL_GPL (snd_hda_attach_beep_device);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); } } +EXPORT_SYMBOL_GPL (snd_hda_detach_beep_device);
sound/pci/hda/hda_codec.c +143 -44
693 lines not on this page · raw message
sound/pci/hda/hda_codec.h +11 -0
@@ -642,6 +642,16 @@ struct hda_codec_preset {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 */ struct hda_codec_ops {int (*build_controls)(struct hda_codec *codec);
@@ -735,6 +745,7 @@ struct hda_codec {/* detected preset */ const struct hda_codec_preset *preset; +struct module *owner;const char *name;/* codec name */ const char *modelname;/* model name for preset */
sound/pci/hda/hda_generic.c +1 -0
@@ -1101,3 +1101,4 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec)snd_hda_generic_free (codec);return err; } +EXPORT_SYMBOL (snd_hda_parse_generic_codec);
sound/pci/hda/hda_hwdep.c +1 -1
@@ -116,7 +116,7 @@ static void hwdep_free(struct snd_hwdep *hwdep)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 ];struct snd_hwdep *hwdep;
sound/pci/hda/hda_patch.h deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* 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[];
sound/pci/hda/patch_analog.c +24 -2
@@ -27,7 +27,6 @@#include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" struct ad198x_spec {struct snd_kcontrol_new *mixers[5 ];
@@ -4308,7 +4307,7 @@ static int patch_ad1882(struct hda_codec *codec)/* * 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 =0x11d41882 , .name ="AD1882" , .patch = patch_ad1882 }, { .id =0x11d41883 , .name ="AD1883" , .patch = patch_ad1884a },
@@ -4326,3 +4325,26 @@ struct hda_codec_preset snd_hda_preset_analog[] = { { .id = 0x11d4989b, .name = "AD1989B", .patch = patch_ad1988 }, {}/* 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)
sound/pci/hda/patch_atihdmi.c +29 -2
@@ -27,7 +27,6 @@#include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" struct atihdmi_spec {struct hda_multi_out multiout;
@@ -187,7 +186,7 @@ static int patch_atihdmi(struct hda_codec *codec)/* * 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 =0x10027919 , .name ="ATI RS600 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[] = { { .id = 0x17e80047, .name = "Chrontel HDMI", .patch = patch_atihdmi }, {}/* 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)
sound/pci/hda/patch_cmedia.c +25 -2
@@ -28,7 +28,6 @@#include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" #define NUM_PINS 11
@@ -736,8 +735,32 @@ static int patch_cmi9880(struct hda_codec *codec)/* * 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 =0x434d4980 , .name ="CMI9880" , .patch = patch_cmi9880 }, {}/* 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)
sound/pci/hda/patch_conexant.c +26 -2
@@ -27,7 +27,6 @@#include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" #define CXT_PIN_DIR_IN 0x00#define CXT_PIN_DIR_OUT 0x01
@@ -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)" , .patch = patch_cxt5045 }, { .id =0x14f15047 , .name ="CX20551 (Waikiki)" ,
@@ -1780,3 +1779,28 @@ struct hda_codec_preset snd_hda_preset_conexant[] = { .patch = patch_cxt5051 }, {}/* 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)
sound/pci/hda/patch_intelhdmi.c +28 -2
@@ -32,7 +32,6 @@#include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" #define CVT_NID 0x02/* audio converter */ #define PIN_NID 0x03/* HDMI output pin */
@@ -675,7 +674,7 @@ static int patch_intel_hdmi(struct hda_codec *codec)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 =0x80862801 , .name ="INTEL G45 DEVBLC" , .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[] = { { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_intel_hdmi }, {}/* 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)
sound/pci/hda/patch_nvhdmi.c +25 -2
@@ -28,7 +28,6 @@#include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" struct nvhdmi_spec {struct hda_multi_out multiout;
@@ -159,8 +158,32 @@ static int patch_nvhdmi(struct hda_codec *codec)/* * 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 =0x10de0007 , .name ="NVIDIA MCP7A HDMI" , .patch = patch_nvhdmi }, {}/* 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)
sound/pci/hda/patch_realtek.c +24 -2
@@ -30,7 +30,6 @@#include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" #define ALC880_FRONT_EVENT 0x01#define ALC880_DCVOL_EVENT 0x02
@@ -16579,7 +16578,7 @@ static int patch_alc662(struct hda_codec *codec)/* * 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 =0x10ec0262 , .name ="ALC262" , .patch = patch_alc262 }, { .id =0x10ec0267 , .name ="ALC267" , .patch = patch_alc268 },
@@ -16611,3 +16610,26 @@ struct hda_codec_preset snd_hda_preset_realtek[] = { { .id = 0x10ec0889, .name = "ALC889", .patch = patch_alc883 }, {}/* 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)
sound/pci/hda/patch_si3054.c +33 -2
@@ -28,7 +28,6 @@#include <sound/core.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" /* si3054 verbs */ #define SI3054_VERB_READ_NODE 0x900
@@ -283,7 +282,7 @@ static int patch_si3054(struct hda_codec *codec)/* * 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 =0x163c3155 , .name ="Si3054" , .patch = patch_si3054 }, { .id =0x11c13026 , .name ="Si3054" , .patch = patch_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)
sound/pci/hda/patch_sigmatel.c +25 -2
@@ -33,7 +33,6 @@#include <sound/jack.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" #include "hda_beep.h" enum {
@@ -5455,7 +5454,7 @@ static int patch_stac9872(struct hda_codec *codec)/* * 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 =0x83847882 , .name ="STAC9220 A1" , .patch = patch_stac922x }, { .id =0x83847680 , .name ="STAC9221 A1" , .patch = patch_stac922x },
@@ -5519,3 +5518,27 @@ struct hda_codec_preset snd_hda_preset_sigmatel[] = { { .id = 0x111d76b7, .name = "92HD71B5X", .patch = patch_stac92hd71bxx }, {}/* 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)
sound/pci/hda/patch_via.c +24 -2
@@ -47,7 +47,6 @@#include <sound/asoundef.h> #include "hda_codec.h" #include "hda_local.h" -#include "hda_patch.h" /* amp values */ #define AMP_VAL_IDX_SHIFT 19
@@ -3249,7 +3248,7 @@ static int patch_vt1702(struct hda_codec *codec)/* * 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 =0x11061709 , .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[] = { .patch = patch_vt1702}, {}/* 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)
Signature · 1 line
1.6.0.4
At Fri, 28 Nov 2008 11:34:35 +0100,
Quoted 13 lines · I wrote:
Hi,
since my original diet plan for HD-audio driver isn't going well as expected, I decided the traditional strategy: divide and conquer.
The below is the preliminary patch for modularizing snd-hda-intel. Now the codec-specific codes are split into several modules, and loaded automatically on demand.
The patch is against the latest sound.git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
Quoted 8 lines
It's also included in the recent sound-unstable tree, too (topic/hda-modularize branch):
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable-2.6.gitA known issue is that "alsasound stop" may not work with this because of the explicit module refcount without dependency. But it's a script problem, basically. The similar problem must be there for snd-aoa, for example, too.
FYI, the hda-modularization patches are now merged to master branch on sound git tree. The snapshot tarball includes this change as well.
Please report if you get any build errors by this.
thanks,
Takashi
I don't like the fact that CONFIG_HDA_CODEC_SIGMATEL produces a module named hda-codec-idt. All the other modules are named as their config options. Can you make this one as well?
2008/12/3 Takashi Iwai <[email protected]>:
Quoted 38 lines
At Fri, 28 Nov 2008 11:34:35 +0100,
Quoted 13 lines · I wrote:
Hi,
since my original diet plan for HD-audio driver isn't going well as expected, I decided the traditional strategy: divide and conquer.
The below is the preliminary patch for modularizing snd-hda-intel. Now the codec-specific codes are split into several modules, and loaded automatically on demand.
The patch is against the latest sound.git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.gitQuoted 8 lines
It's also included in the recent sound-unstable tree, too (topic/hda-modularize branch):
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable-2.6.gitA known issue is that "alsasound stop" may not work with this because of the explicit module refcount without dependency. But it's a script problem, basically. The similar problem must be there for snd-aoa, for example, too.
FYI, the hda-modularization patches are now merged to master branch on sound git tree. The snapshot tarball includes this change as well.
Please report if you get any build errors by this.
thanks,
Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Signature · 5 lines
Vedran Miletić _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
At Wed, 3 Dec 2008 16:24:42 +0100,
Quoted 4 lines · =?UTF-8?Q?Vedran_Mileti=C4=87?= wrote:
I don't like the fact that
CONFIG_HDA_CODEC_SIGMATELproduces a module named hda-codec-idt. All the other modules are named as their config options. Can you make this one as well?
Well, it's now really IDT, and one should avoid the name Sigmatel. So, if this really matters, it's better to rename the kconfig to CONFIG_SND_HDA_CODEC_IDT. However, then this doesn't match with patch_sigmatel.c. And renaming the file is a worse option.
So, there is no perfect solution.
Takashi
Quoted 31 lines
2008/12/3 Takashi Iwai <[email protected]>:
Quoted 30 lines
At Fri, 28 Nov 2008 11:34:35 +0100,
Quoted 13 lines · I wrote:
Hi,
since my original diet plan for HD-audio driver isn't going well as expected, I decided the traditional strategy: divide and conquer.
The below is the preliminary patch for modularizing snd-hda-intel. Now the codec-specific codes are split into several modules, and loaded automatically on demand.
The patch is against the latest sound.git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.gitQuoted 8 lines
It's also included in the recent sound-unstable tree, too (topic/hda-modularize branch):
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable-2.6.gitA known issue is that "alsasound stop" may not work with this because of the explicit module refcount without dependency. But it's a script problem, basically. The similar problem must be there for snd-aoa, for example, too.
FYI, the hda-modularization patches are now merged to master branch on sound git tree. The snapshot tarball includes this change as well.
Please report if you get any build errors by this.
Quoted 13 lines
Quoted 8 lines
thanks,
Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-develSignature · 1 line
Vedran Miletić
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Really? I thought that filename mattered a lot only in cases where it's included in many locations/headers, which I hardly doubt being the case for patch_sigmatel.c.
2008/12/3 Takashi Iwai <[email protected]>:
Quoted 63 lines
At Wed, 3 Dec 2008 16:24:42 +0100,
Quoted 4 lines · =?UTF-8?Q?Vedran_Mileti=C4=87?= wrote:
I don't like the fact that
CONFIG_HDA_CODEC_SIGMATELproduces a module named hda-codec-idt. All the other modules are named as their config options. Can you make this one as well?Well, it's now really IDT, and one should avoid the name Sigmatel. So, if this really matters, it's better to rename the kconfig to
CONFIG_SND_HDA_CODEC_IDT. However, then this doesn't match withpatch_sigmatel.c. And renaming the file is a worse option.So, there is no perfect solution.
Takashi
Quoted 44 lines
2008/12/3 Takashi Iwai <[email protected]>:
Quoted 30 lines
At Fri, 28 Nov 2008 11:34:35 +0100,
Quoted 13 lines · I wrote:
Hi,
since my original diet plan for HD-audio driver isn't going well as expected, I decided the traditional strategy: divide and conquer.
The below is the preliminary patch for modularizing snd-hda-intel. Now the codec-specific codes are split into several modules, and loaded automatically on demand.
The patch is against the latest sound.git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.gitQuoted 8 lines
It's also included in the recent sound-unstable tree, too (topic/hda-modularize branch):
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable-2.6.gitA known issue is that "alsasound stop" may not work with this because of the explicit module refcount without dependency. But it's a script problem, basically. The similar problem must be there for snd-aoa, for example, too.
FYI, the hda-modularization patches are now merged to master branch on sound git tree. The snapshot tarball includes this change as well.
Please report if you get any build errors by this.
Quoted 8 lines
thanks,
Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel--
Vedran Miletić
Signature · 5 lines
Vedran Miletić _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
At Wed, 3 Dec 2008 18:05:06 +0100,
Quoted 4 lines · =?UTF-8?Q?Vedran_Mileti=C4=87?= wrote:
Really? I thought that filename mattered a lot only in cases where it's included in many locations/headers, which I hardly doubt being the case for
patch_sigmatel.c.
It makes harder to keep the change history. GIT can detect the rename, but it's not always doing (beacuse it costs time). Better not to rename a file unless you really need it.
Takashi
Quoted 61 lines
2008/12/3 Takashi Iwai <[email protected]>:
Quoted 60 lines
At Wed, 3 Dec 2008 16:24:42 +0100,
Quoted 4 lines · =?UTF-8?Q?Vedran_Mileti=C4=87?= wrote:
I don't like the fact that
CONFIG_HDA_CODEC_SIGMATELproduces a module named hda-codec-idt. All the other modules are named as their config options. Can you make this one as well?Well, it's now really IDT, and one should avoid the name Sigmatel. So, if this really matters, it's better to rename the kconfig to
CONFIG_SND_HDA_CODEC_IDT. However, then this doesn't match withpatch_sigmatel.c. And renaming the file is a worse option.So, there is no perfect solution.
Takashi
Quoted 42 lines
2008/12/3 Takashi Iwai <[email protected]>:
Quoted 38 lines
At Fri, 28 Nov 2008 11:34:35 +0100,
Quoted 13 lines · I wrote:
Hi,
since my original diet plan for HD-audio driver isn't going well as expected, I decided the traditional strategy: divide and conquer.
The below is the preliminary patch for modularizing snd-hda-intel. Now the codec-specific codes are split into several modules, and loaded automatically on demand.
The patch is against the latest sound.git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.gitQuoted 8 lines
It's also included in the recent sound-unstable tree, too (topic/hda-modularize branch):
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable-2.6.gitA known issue is that "alsasound stop" may not work with this because of the explicit module refcount without dependency. But it's a script problem, basically. The similar problem must be there for snd-aoa, for example, too.
FYI, the hda-modularization patches are now merged to master branch on sound git tree. The snapshot tarball includes this change as well.
Please report if you get any build errors by this.
thanks,
Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 8 lines
Quoted 3 lines
Quoted 2 lines
--
Vedran MiletićSignature · 1 line
Vedran Miletić
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Quoted 9 lines · On Wed, 03 Dec 2008 15:25:02 +0100 Takashi Iwai <[email protected]> wrote:
At Fri, 28 Nov 2008 11:34:35 +0100,
Quoted 4 lines · I wrote:
A known issue is that "alsasound stop" may not work with this because of the explicit module refcount without dependency. But it's a script problem, basically. The similar problem must be there for snd-aoa, for example, too.
FYI, the hda-modularization patches are now merged to master branch on sound git tree. The snapshot tarball includes this change as well.
Hey! My system doesn't shutdown anymore! And i found it is the alsasound-stop problem.
Is there no way to have snd_hda_intel listed in the used-by column of lsmod for snd_hda_codec_analog ?
how should that ''script problem'' be solved?
up until now, the gentoo-initscript takes the lsmod output and removes recursively the dependancies of the /^snd_/ modules.
a simple shootdown-script doesn't work:
--------------------------------------------
#!/bin/sh
unload_module_my() {
echo "Unloading: $1"
rmmod -v --wait "$1"
echo $?
}unload_modules_26() {
# First of all, remove the snd module and all the modules depending
# on it, this should remove already most of ALSA modules.
UNLOAD_MODULES_LIST=
lsmod | grep -q "^snd[[:space:]]" && rmmod --wait "snd"
&
wait
# Then find the remaining ones, and handle them too.
for module in $(lsmod | sed -n -e
's/^\(snd[^ ]*\) .*/\1/p'); do unload_module_my
"${module}" & done
wait
lsmod | grep -vq "^snd"
}unload_modules_26
-----------------------------------------------
dosn't work.
it gives:
Unloading: snd_pcm_oss
rmmod snd_pcm_oss, wait=yes
Unloading: snd_mixer_oss
Unloading: snd_hda_codec_analog
rmmod snd_mixer_oss, wait=yes
rmmod snd_hda_codec_analog, wait=yes
Unloading: snd_hda_intel
Unloading: snd_hda_codec
rmmod snd_hda_intel, wait=yes
rmmod snd_hda_codec, wait=yes
Unloading: snd_pcm
Unloading: snd_page_alloc
rmmod snd_pcm, wait=yes
rmmod snd_page_alloc, wait=yes
Unloading: snd_timer
rmmod snd_timer, wait=yes
0
0
ERROR: Removing 'snd_pcm': Resource temporarily unavailable 1
0
ERROR: Removing 'snd_hda_codec': Resource temporarily unavailable 0
1
ERROR: Removing 'snd_page_alloc': Resource temporarily unavailable
ERROR: Removing 'snd_timer': Resource temporarily unavailable 1
1
how is one supposed to get the unload-ordering, to do a step by step unload?
Sincerely,
Florian
At Sun, 8 Feb 2009 11:20:13 +0100,
Quoted 20 lines · Florian Mickler
Quoted 9 lines · On Wed, 03 Dec 2008 15:25:02 +0100 Takashi Iwai <[email protected]> wrote:
At Fri, 28 Nov 2008 11:34:35 +0100,
Quoted 4 lines · I wrote:
A known issue is that "alsasound stop" may not work with this because of the explicit module refcount without dependency. But it's a script problem, basically. The similar problem must be there for snd-aoa, for example, too.
FYI, the hda-modularization patches are now merged to master branch on sound git tree. The snapshot tarball includes this change as well.
Hey! My system doesn't shutdown anymore! And i found it is the alsasound-stop problem.
Is there no way to have
snd_hda_intellisted in the used-by column of lsmod forsnd_hda_codec_analog?
Quoted 6 lines
how should that ''script problem'' be solved?
up until now, the gentoo-initscript takes the lsmod output and removes recursively the dependancies of the /^snd_/ modules.
a simple shootdown-script doesn't work:
For example, the recent SUSE init script has the following
mod=$(grep -m1 -E '^(snd[^ ]*|ac97_bus) [0-9]+ 0' /proc/modules)
while [ -n "$mod" ]; do
mod=${mod%% *}
/sbin/modprobe -r $mod
mod=$(grep -m1 -E '^(snd[^ ]*|ac97_bus) [0-9]+ 0' /proc/modules)
doneBut, basically it's stupid to unload modules at shtudown/reboot, just a waste of time. If possible, you should check the next runlevel and skip unloading if unnecessary.
Takashi
A message that is not in the archive (sent off-list or not yet received): 20090209093934.26945a82@schatten
At Mon, 9 Feb 2009 09:39:34 +0100,
Quoted 17 lines · Florian Mickler
Hi!
Quoted 14 lines
For example, the recent SUSE init script has the following
mod=$(grep -m1 -E '^(snd[^ ]*|ac97_bus) [0-9]+ 0' /proc/modules) while [ -n "$mod" ]; do mod=${mod%% *} /sbin/modprobe -r $mod mod=$(grep -m1 -E '^(snd[^ ]*|ac97_bus) [0-9]+ 0' /proc/modules) doneBut, basically it's stupid to unload modules at shtudown/reboot, just a waste of time. If possible, you should check the next runlevel and skip unloading if unnecessary.
Quoted 7 lines
Quoted 1 line
Takashi
Yeah, it _is_ stupid to unload modules at shutdown. (and I kicked it out of my init-script... but one wonders how it's supposed to work)
modprobe -r
snd_hda_codec_analog
gives me an error (''in use'')
The codec driver is indeed used by the controller driver, snd-hda-intel.
Takashi
Quoted 13 lines
# lsmod | grep snd_; modprobe -r snd_hda_codec_analog snd_pcm_oss 42112 0 snd_mixer_oss 16224 1 snd_pcm_oss snd_hda_codec_analog 78144 1 snd_hda_intel 28264 0 snd_hda_codec 68992 2 snd_hda_codec_analog,snd_hda_intel snd_pcm 86440 3 snd_pcm_oss,snd_hda_intel,snd_hda_codec snd_timer 23472 1 snd_pcm snd_page_alloc 10288 2 snd_hda_intel,snd_pcm FATAL: Module snd_hda_codec_analog is in use....so, if i accidentially don't unload
snd_hda_intelbeforesnd_hda_codec_analogit doesn't work? or are my tools somehow broken?