Commit b21fd933 authored by Jaroslav Kysela's avatar Jaroslav Kysela Committed by Linus Torvalds

[PATCH] ALSA update [7/10] - 2002/07/24

  - renamed snd-dt0197h to snd-dt019x
  - added support for DT0196, DT0197h and ALS007 to snd-dt019x
  - searial-u16550 - added support for generic adapter type
  - pcm.c
    - fixed the initialization of runtime->status
    - removed unnecessary check of n_register callback
  - timer.c
    - fixed kmod behaviour
  - Opti92x/93x fixes by Michael Corlett
  - fixed compilation of YMFPCI driver (PPC)
parent eb7e7cd8
...@@ -8,6 +8,7 @@ The snd_adaptor module parameter allows you to select either: ...@@ -8,6 +8,7 @@ The snd_adaptor module parameter allows you to select either:
1 - Midiator MS-124T support (1) 1 - Midiator MS-124T support (1)
2 - Midiator MS-124W S/A mode (2) 2 - Midiator MS-124W S/A mode (2)
3 - MS-124W M/B mode support (3) 3 - MS-124W M/B mode support (3)
4 - Generic device with multiple input support (4)
For the Midiator MS-124W, you must set the physical M-S and A-B For the Midiator MS-124W, you must set the physical M-S and A-B
switches on the Midiator to match the driver mode you select. switches on the Midiator to match the driver mode you select.
...@@ -82,3 +83,9 @@ compatible, nor are the other known models MS-101, MS-101B, MS-103, and MS-114. ...@@ -82,3 +83,9 @@ compatible, nor are the other known models MS-101, MS-101B, MS-103, and MS-114.
I do have documentation (tim.mann@compaq.com) that partially covers these models, I do have documentation (tim.mann@compaq.com) that partially covers these models,
but no units to experiment with. The MS-124W support is tested with a real unit. but no units to experiment with. The MS-124W support is tested with a real unit.
The MS-124T support is untested, but should work. The MS-124T support is untested, but should work.
The Generic driver supports multiple input and output substreams over a single
serial port. Similar to Roland Soundcanvas mode, F5 NN is used to select the
appropriate input or output stream (depending on the data direction).
Additionally, the CTS signal is used to regulate the data flow. The number of
inputs is specified by the snd_ins parameter.
...@@ -36,6 +36,7 @@ enum sb_hw_type { ...@@ -36,6 +36,7 @@ enum sb_hw_type {
SB_HW_16CSP, /* SB16 with CSP chip */ SB_HW_16CSP, /* SB16 with CSP chip */
SB_HW_ALS100, /* Avance Logic ALS100 chip */ SB_HW_ALS100, /* Avance Logic ALS100 chip */
SB_HW_ALS4000, /* Avance Logic ALS4000 chip */ SB_HW_ALS4000, /* Avance Logic ALS4000 chip */
SB_HW_DT019X, /* Diamond Tech. DT-019X / Avance Logic ALS-007 */
}; };
#define SB_OPEN_PCM 0x01 #define SB_OPEN_PCM 0x01
...@@ -215,6 +216,24 @@ typedef struct _snd_sb sb_t; ...@@ -215,6 +216,24 @@ typedef struct _snd_sb sb_t;
#define SB_DSP4_3DSE 0x90 #define SB_DSP4_3DSE 0x90
/* Registers for DT-019x / ALS-007 mixer */
#define SB_DT019X_MASTER_DEV 0x62
#define SB_DT019X_PCM_DEV 0x64
#define SB_DT019X_SYNTH_DEV 0x66
#define SB_DT019X_CD_DEV 0x68
#define SB_DT019X_MIC_DEV 0x6a
#define SB_DT019X_SPKR_DEV 0x6a
#define SB_DT019X_LINE_DEV 0x6e
#define SB_DT019X_OUTPUT_SW1 0x3c
#define SB_DT019X_OUTPUT_SW2 0x4c
#define SB_DT019X_CAPTURE_SW 0x6c
#define SB_DT019X_CAP_CD 0x02
#define SB_DT019X_CAP_MIC 0x04
#define SB_DT019X_CAP_LINE 0x06
#define SB_DT019X_CAP_SYNTH 0x07
#define SB_DT019X_CAP_MAIN 0x07
/* IRQ setting bitmap */ /* IRQ setting bitmap */
#define SB_IRQSETUP_IRQ9 0x01 #define SB_IRQSETUP_IRQ9 0x01
#define SB_IRQSETUP_IRQ5 0x02 #define SB_IRQSETUP_IRQ5 0x02
......
/* include/version.h. Generated automatically by configure. */ /* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "0.9.0rc2" #define CONFIG_SND_VERSION "0.9.0rc2"
#define CONFIG_SND_DATE " (Sat Jul 20 07:16:41 2002 UTC)" #define CONFIG_SND_DATE " (Wed Jul 24 10:42:45 2002 UTC)"
...@@ -41,7 +41,7 @@ obj-$(CONFIG_SND_MPU401) += snd-rawmidi.o snd.o snd-timer.o ...@@ -41,7 +41,7 @@ obj-$(CONFIG_SND_MPU401) += snd-rawmidi.o snd.o snd-timer.o
obj-$(CONFIG_SND_ALS100) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_ALS100) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_AZT2320) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_AZT2320) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_CMI8330) += snd-pcm.o snd-timer.o snd.o obj-$(CONFIG_SND_CMI8330) += snd-pcm.o snd-timer.o snd.o
obj-$(CONFIG_SND_DT0197H) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_DT019X) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_ES18XX) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_ES18XX) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_OPL3SA2) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o obj-$(CONFIG_SND_OPL3SA2) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o snd-hwdep.o
obj-$(CONFIG_SND_SGALAXY) += snd-pcm.o snd-timer.o snd.o obj-$(CONFIG_SND_SGALAXY) += snd-pcm.o snd-timer.o snd.o
......
...@@ -753,16 +753,15 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, ...@@ -753,16 +753,15 @@ int snd_pcm_open_substream(snd_pcm_t *pcm, int stream,
kfree(runtime); kfree(runtime);
return -ENOMEM; return -ENOMEM;
} }
memset((void*)runtime->status, 0, size);
size = PAGE_ALIGN(sizeof(snd_pcm_mmap_control_t)); size = PAGE_ALIGN(sizeof(snd_pcm_mmap_control_t));
runtime->control = snd_malloc_pages(size, GFP_KERNEL); runtime->control = snd_malloc_pages(size, GFP_KERNEL);
if (runtime->control == NULL) { if (runtime->control == NULL) {
kfree((void *)runtime->status); snd_free_pages((void*)runtime->status, PAGE_ALIGN(sizeof(snd_pcm_mmap_status_t)));
kfree(runtime); kfree(runtime);
return -ENOMEM; return -ENOMEM;
} }
memset((void*)runtime->status, 0, size);
memset((void*)runtime->control, 0, size); memset((void*)runtime->control, 0, size);
init_waitqueue_head(&runtime->sleep); init_waitqueue_head(&runtime->sleep);
...@@ -840,7 +839,6 @@ int snd_pcm_dev_register(snd_device_t *device) ...@@ -840,7 +839,6 @@ int snd_pcm_dev_register(snd_device_t *device)
list_for_each(list, &snd_pcm_notify_list) { list_for_each(list, &snd_pcm_notify_list) {
snd_pcm_notify_t *notify; snd_pcm_notify_t *notify;
notify = list_entry(list, snd_pcm_notify_t, list); notify = list_entry(list, snd_pcm_notify_t, list);
if (notify->n_register)
notify->n_register(-1 /* idx + SNDRV_MINOR_PCM */, pcm); notify->n_register(-1 /* idx + SNDRV_MINOR_PCM */, pcm);
} }
snd_pcm_lock(1); snd_pcm_lock(1);
...@@ -878,7 +876,6 @@ static int snd_pcm_dev_unregister(snd_device_t *device) ...@@ -878,7 +876,6 @@ static int snd_pcm_dev_unregister(snd_device_t *device)
list_for_each(list, &snd_pcm_notify_list) { list_for_each(list, &snd_pcm_notify_list) {
snd_pcm_notify_t *notify; snd_pcm_notify_t *notify;
notify = list_entry(list, snd_pcm_notify_t, list); notify = list_entry(list, snd_pcm_notify_t, list);
if (notify->n_unregister)
notify->n_unregister(-1 /* SNDRV_MINOR_PCM + idx */, pcm); notify->n_unregister(-1 /* SNDRV_MINOR_PCM + idx */, pcm);
} }
snd_pcm_devices[idx] = NULL; snd_pcm_devices[idx] = NULL;
......
...@@ -35,7 +35,7 @@ obj-$(CONFIG_SND_MTPAV) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-mid ...@@ -35,7 +35,7 @@ obj-$(CONFIG_SND_MTPAV) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-mid
obj-$(CONFIG_SND_MPU401) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o obj-$(CONFIG_SND_MPU401) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o
obj-$(CONFIG_SND_ALS100) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o obj-$(CONFIG_SND_ALS100) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
obj-$(CONFIG_SND_AZT2320) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o obj-$(CONFIG_SND_AZT2320) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
obj-$(CONFIG_SND_DT0197H) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o obj-$(CONFIG_SND_DT019X) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
obj-$(CONFIG_SND_ES18XX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o obj-$(CONFIG_SND_ES18XX) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
obj-$(CONFIG_SND_OPL3SA2) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o obj-$(CONFIG_SND_OPL3SA2) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
obj-$(CONFIG_SND_AD1816A) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o obj-$(CONFIG_SND_AD1816A) += snd-seq-midi.o snd-seq.o snd-seq-device.o snd-seq-midi-event.o snd-seq-midi-emul.o snd-seq-instr.o
......
...@@ -13,7 +13,7 @@ snd-ainstr-iw-objs := ainstr_iw.o ...@@ -13,7 +13,7 @@ snd-ainstr-iw-objs := ainstr_iw.o
# Toplevel Module Dependency # Toplevel Module Dependency
obj-$(CONFIG_SND_ALS100) += snd-ainstr-fm.o obj-$(CONFIG_SND_ALS100) += snd-ainstr-fm.o
obj-$(CONFIG_SND_AZT2320) += snd-ainstr-fm.o obj-$(CONFIG_SND_AZT2320) += snd-ainstr-fm.o
obj-$(CONFIG_SND_DT0197H) += snd-ainstr-fm.o obj-$(CONFIG_SND_DT019X) += snd-ainstr-fm.o
obj-$(CONFIG_SND_ES18XX) += snd-ainstr-fm.o obj-$(CONFIG_SND_ES18XX) += snd-ainstr-fm.o
obj-$(CONFIG_SND_OPL3SA2) += snd-ainstr-fm.o obj-$(CONFIG_SND_OPL3SA2) += snd-ainstr-fm.o
obj-$(CONFIG_SND_AD1816A) += snd-ainstr-fm.o obj-$(CONFIG_SND_AD1816A) += snd-ainstr-fm.o
......
...@@ -48,7 +48,7 @@ MODULE_LICENSE("GPL"); ...@@ -48,7 +48,7 @@ MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}"); MODULE_CLASSES("{sound}");
MODULE_SUPPORTED_DEVICE("sound"); MODULE_SUPPORTED_DEVICE("sound");
MODULE_PARM(snd_seq_client_load, "i"); MODULE_PARM(snd_seq_client_load, "1-64i");
MODULE_PARM_DESC(snd_seq_client_load, "The numbers of global (system) clients to load through kmod."); MODULE_PARM_DESC(snd_seq_client_load, "The numbers of global (system) clients to load through kmod.");
MODULE_PARM(snd_seq_default_timer_class, "i"); MODULE_PARM(snd_seq_default_timer_class, "i");
MODULE_PARM_DESC(snd_seq_default_timer_class, "The default timer class."); MODULE_PARM_DESC(snd_seq_default_timer_class, "The default timer class.");
......
...@@ -35,13 +35,19 @@ ...@@ -35,13 +35,19 @@
#include <linux/kerneld.h> #include <linux/kerneld.h>
#endif #endif
int snd_timer_limit = 1; #if !defined(CONFIG_SND_RTCTIMER) && !defined(CONFIG_SND_RTCTIMER_MODULE)
#define DEFAULT_TIMER_LIMIT 1
#else
#define DEFAULT_TIMER_LIMIT 2
#endif
int snd_timer_limit = DEFAULT_TIMER_LIMIT;
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de>"); MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Takashi Iwai <tiwai@suse.de>");
MODULE_DESCRIPTION("ALSA timer interface"); MODULE_DESCRIPTION("ALSA timer interface");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}"); MODULE_CLASSES("{sound}");
MODULE_PARM(snd_timer_limit, "i"); MODULE_PARM(snd_timer_limit, "i");
MODULE_PARM_DESC(snd_timer_limit, "Maximum global timers in system. (1 by default)"); MODULE_PARM_DESC(snd_timer_limit, "Maximum global timers in system.");
typedef struct { typedef struct {
snd_timer_instance_t *timeri; snd_timer_instance_t *timeri;
...@@ -146,10 +152,14 @@ static void snd_timer_request(snd_timer_id_t *tid) ...@@ -146,10 +152,14 @@ static void snd_timer_request(snd_timer_id_t *tid)
switch (tid->dev_class) { switch (tid->dev_class) {
case SNDRV_TIMER_CLASS_GLOBAL: case SNDRV_TIMER_CLASS_GLOBAL:
if (tid->device >= snd_timer_limit)
return;
sprintf(str, "snd-timer-%i", tid->device); sprintf(str, "snd-timer-%i", tid->device);
break; break;
case SNDRV_TIMER_CLASS_CARD: case SNDRV_TIMER_CLASS_CARD:
case SNDRV_TIMER_CLASS_PCM: case SNDRV_TIMER_CLASS_PCM:
if (tid->card >= snd_ecards_limit)
return;
sprintf(str, "snd-card-%i", tid->card); sprintf(str, "snd-card-%i", tid->card);
break; break;
default: default:
...@@ -876,7 +886,7 @@ static void snd_timer_proc_read(snd_info_entry_t *entry, ...@@ -876,7 +886,7 @@ static void snd_timer_proc_read(snd_info_entry_t *entry,
} }
snd_iprintf(buffer, "%s :", timer->name); snd_iprintf(buffer, "%s :", timer->name);
if (timer->hw.resolution) if (timer->hw.resolution)
snd_iprintf(buffer, " %lu.%luus (%lu ticks)", timer->hw.resolution / 1000, timer->hw.resolution % 1000, timer->hw.ticks); snd_iprintf(buffer, " %lu.%03luus (%lu ticks)", timer->hw.resolution / 1000, timer->hw.resolution % 1000, timer->hw.ticks);
if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE) if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
snd_iprintf(buffer, " SLAVE"); snd_iprintf(buffer, " SLAVE");
snd_iprintf(buffer, "\n"); snd_iprintf(buffer, "\n");
......
...@@ -12,7 +12,7 @@ snd-mpu401-uart-objs := mpu401_uart.o ...@@ -12,7 +12,7 @@ snd-mpu401-uart-objs := mpu401_uart.o
obj-$(CONFIG_SND_MPU401) += snd-mpu401.o snd-mpu401-uart.o obj-$(CONFIG_SND_MPU401) += snd-mpu401.o snd-mpu401-uart.o
obj-$(CONFIG_SND_ALS100) += snd-mpu401-uart.o obj-$(CONFIG_SND_ALS100) += snd-mpu401-uart.o
obj-$(CONFIG_SND_AZT2320) += snd-mpu401-uart.o obj-$(CONFIG_SND_AZT2320) += snd-mpu401-uart.o
obj-$(CONFIG_SND_DT0197H) += snd-mpu401-uart.o obj-$(CONFIG_SND_DT019X) += snd-mpu401-uart.o
obj-$(CONFIG_SND_ES18XX) += snd-mpu401-uart.o obj-$(CONFIG_SND_ES18XX) += snd-mpu401-uart.o
obj-$(CONFIG_SND_OPL3SA2) += snd-mpu401-uart.o obj-$(CONFIG_SND_OPL3SA2) += snd-mpu401-uart.o
obj-$(CONFIG_SND_AD1816A) += snd-mpu401-uart.o obj-$(CONFIG_SND_AD1816A) += snd-mpu401-uart.o
......
...@@ -16,7 +16,7 @@ endif ...@@ -16,7 +16,7 @@ endif
# Toplevel Module Dependency # Toplevel Module Dependency
obj-$(CONFIG_SND_ALS100) += snd-opl3-lib.o obj-$(CONFIG_SND_ALS100) += snd-opl3-lib.o
obj-$(CONFIG_SND_AZT2320) += snd-opl3-lib.o obj-$(CONFIG_SND_AZT2320) += snd-opl3-lib.o
obj-$(CONFIG_SND_DT0197H) += snd-opl3-lib.o obj-$(CONFIG_SND_DT019X) += snd-opl3-lib.o
obj-$(CONFIG_SND_ES18XX) += snd-opl3-lib.o obj-$(CONFIG_SND_ES18XX) += snd-opl3-lib.o
obj-$(CONFIG_SND_OPL3SA2) += snd-opl3-lib.o obj-$(CONFIG_SND_OPL3SA2) += snd-opl3-lib.o
obj-$(CONFIG_SND_AD1816A) += snd-opl3-lib.o obj-$(CONFIG_SND_AD1816A) += snd-opl3-lib.o
...@@ -41,7 +41,7 @@ obj-$(CONFIG_SND_YMFPCI) += snd-opl3-lib.o ...@@ -41,7 +41,7 @@ obj-$(CONFIG_SND_YMFPCI) += snd-opl3-lib.o
ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y) ifeq ($(subst m,y,$(CONFIG_SND_SEQUENCER)),y)
obj-$(CONFIG_SND_ALS100) += snd-opl3-synth.o obj-$(CONFIG_SND_ALS100) += snd-opl3-synth.o
obj-$(CONFIG_SND_AZT2320) += snd-opl3-synth.o obj-$(CONFIG_SND_AZT2320) += snd-opl3-synth.o
obj-$(CONFIG_SND_DT0197H) += snd-opl3-synth.o obj-$(CONFIG_SND_DT019X) += snd-opl3-synth.o
obj-$(CONFIG_SND_ES18XX) += snd-opl3-synth.o obj-$(CONFIG_SND_ES18XX) += snd-opl3-synth.o
obj-$(CONFIG_SND_OPL3SA2) += snd-opl3-synth.o obj-$(CONFIG_SND_OPL3SA2) += snd-opl3-synth.o
obj-$(CONFIG_SND_AD1816A) += snd-opl3-synth.o obj-$(CONFIG_SND_AD1816A) += snd-opl3-synth.o
......
This diff is collapsed.
...@@ -88,9 +88,9 @@ CONFIG_SND_AZT2320 ...@@ -88,9 +88,9 @@ CONFIG_SND_AZT2320
CONFIG_SND_CMI8330 CONFIG_SND_CMI8330
Say 'Y' or 'M' to include support for C-Media CMI8330 based soundcards. Say 'Y' or 'M' to include support for C-Media CMI8330 based soundcards.
CONFIG_SND_DT0197H CONFIG_SND_DT019X
Say 'Y' or 'M' to include support for Diamond Technologies DT-0197H Say 'Y' or 'M' to include support for Diamond Technologies DT-019X and
soundcards. Avance Logic ALS-007 soundcards.
CONFIG_SND_OPL3SA2 CONFIG_SND_OPL3SA2
Say 'Y' or 'M' to include support for Yamaha OPL3SA2 or OPL3SA3 chips. Say 'Y' or 'M' to include support for Yamaha OPL3SA2 or OPL3SA3 chips.
......
...@@ -29,7 +29,7 @@ dep_tristate 'Turtle Beach Maui,Tropez,Tropez+ (Wavefront)' CONFIG_SND_WAVEFRONT ...@@ -29,7 +29,7 @@ dep_tristate 'Turtle Beach Maui,Tropez,Tropez+ (Wavefront)' CONFIG_SND_WAVEFRONT
dep_tristate 'Avance Logic ALS100/ALS120' CONFIG_SND_ALS100 $CONFIG_SND $CONFIG_ISAPNP dep_tristate 'Avance Logic ALS100/ALS120' CONFIG_SND_ALS100 $CONFIG_SND $CONFIG_ISAPNP
dep_tristate 'Aztech Systems AZT2320' CONFIG_SND_AZT2320 $CONFIG_SND $CONFIG_ISAPNP dep_tristate 'Aztech Systems AZT2320' CONFIG_SND_AZT2320 $CONFIG_SND $CONFIG_ISAPNP
dep_tristate 'C-Media CMI8330' CONFIG_SND_CMI8330 $CONFIG_SND dep_tristate 'C-Media CMI8330' CONFIG_SND_CMI8330 $CONFIG_SND
dep_tristate 'Diamond Technologies DT-0197H' CONFIG_SND_DT0197H $CONFIG_SND $CONFIG_ISAPNP dep_tristate 'Diamond Technologies DT-019X, Avance Logic ALS-007' CONFIG_SND_DT019X $CONFIG_SND $CONFIG_ISAPNP
dep_tristate 'Yamaha OPL3-SA2/SA3' CONFIG_SND_OPL3SA2 $CONFIG_SND dep_tristate 'Yamaha OPL3-SA2/SA3' CONFIG_SND_OPL3SA2 $CONFIG_SND
dep_tristate 'Aztech Sound Galaxy' CONFIG_SND_SGALAXY $CONFIG_SND dep_tristate 'Aztech Sound Galaxy' CONFIG_SND_SGALAXY $CONFIG_SND
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
snd-als100-objs := als100.o snd-als100-objs := als100.o
snd-azt2320-objs := azt2320.o snd-azt2320-objs := azt2320.o
snd-cmi8330-objs := cmi8330.o snd-cmi8330-objs := cmi8330.o
snd-dt0197h-objs := dt0197h.o snd-dt019x-objs := dt019x.o
snd-es18xx-objs := es18xx.o snd-es18xx-objs := es18xx.o
snd-opl3sa2-objs := opl3sa2.o snd-opl3sa2-objs := opl3sa2.o
snd-sgalaxy-objs := sgalaxy.o snd-sgalaxy-objs := sgalaxy.o
...@@ -15,7 +15,7 @@ snd-sgalaxy-objs := sgalaxy.o ...@@ -15,7 +15,7 @@ snd-sgalaxy-objs := sgalaxy.o
obj-$(CONFIG_SND_ALS100) += snd-als100.o obj-$(CONFIG_SND_ALS100) += snd-als100.o
obj-$(CONFIG_SND_AZT2320) += snd-azt2320.o obj-$(CONFIG_SND_AZT2320) += snd-azt2320.o
obj-$(CONFIG_SND_CMI8330) += snd-cmi8330.o obj-$(CONFIG_SND_CMI8330) += snd-cmi8330.o
obj-$(CONFIG_SND_DT0197H) += snd-dt0197h.o obj-$(CONFIG_SND_DT019X) += snd-dt019x.o
obj-$(CONFIG_SND_ES18XX) += snd-es18xx.o obj-$(CONFIG_SND_ES18XX) += snd-es18xx.o
obj-$(CONFIG_SND_OPL3SA2) += snd-opl3sa2.o obj-$(CONFIG_SND_OPL3SA2) += snd-opl3sa2.o
obj-$(CONFIG_SND_SGALAXY) += snd-sgalaxy.o obj-$(CONFIG_SND_SGALAXY) += snd-sgalaxy.o
......
This diff is collapsed.
...@@ -326,9 +326,13 @@ static char * snd_opti9xx_names[] = { ...@@ -326,9 +326,13 @@ static char * snd_opti9xx_names[] = {
static int __init snd_opti9xx_init(opti9xx_t *chip, unsigned short hardware) static int __init snd_opti9xx_init(opti9xx_t *chip, unsigned short hardware)
{ {
static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
chip->hardware = hardware; chip->hardware = hardware;
strcpy(chip->name, snd_opti9xx_names[hardware]); strcpy(chip->name, snd_opti9xx_names[hardware]);
chip->mc_base_size = opti9xx_mc_size[hardware];
spin_lock_init(&chip->lock); spin_lock_init(&chip->lock);
chip->wss_base = -1; chip->wss_base = -1;
...@@ -600,7 +604,7 @@ static int __init snd_opti9xx_configure(opti9xx_t *chip) ...@@ -600,7 +604,7 @@ static int __init snd_opti9xx_configure(opti9xx_t *chip)
#endif /* CS4231 || OPTi93X */ #endif /* CS4231 || OPTi93X */
spin_lock_irqsave(&chip->lock, flags); spin_lock_irqsave(&chip->lock, flags);
outb(irq_bits << 3 | dma_bits, chip->wss_base); snd_opti9xx_write(chip, OPTi9XX_MC_REG(3), (irq_bits << 3 | dma_bits));
spin_unlock_irqrestore(&chip->lock, flags); spin_unlock_irqrestore(&chip->lock, flags);
__skip_resources: __skip_resources:
...@@ -972,7 +976,7 @@ static int snd_opti93x_trigger(snd_pcm_substream_t *substream, ...@@ -972,7 +976,7 @@ static int snd_opti93x_trigger(snd_pcm_substream_t *substream,
s = s->link_next; s = s->link_next;
} while (s != substream); } while (s != substream);
spin_lock(&chip->lock); spin_lock(&chip->lock);
if (SNDRV_PCM_TRIGGER_START) if (cmd == SNDRV_PCM_TRIGGER_START)
snd_opti93x_out_mask(chip, OPTi93X_IFACE_CONF, what, what); snd_opti93x_out_mask(chip, OPTi93X_IFACE_CONF, what, what);
else else
snd_opti93x_out_mask(chip, OPTi93X_IFACE_CONF, what, 0x00); snd_opti93x_out_mask(chip, OPTi93X_IFACE_CONF, what, 0x00);
...@@ -1178,7 +1182,6 @@ static int snd_opti93x_playback_open(snd_pcm_substream_t *substream) ...@@ -1178,7 +1182,6 @@ static int snd_opti93x_playback_open(snd_pcm_substream_t *substream)
chip->playback_substream = substream; chip->playback_substream = substream;
runtime->hw = snd_opti93x_playback; runtime->hw = snd_opti93x_playback;
snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.buffer_bytes_max); snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.buffer_bytes_max);
snd_pcm_limit_isa_dma_size(chip->dma1, &runtime->hw.period_bytes_max);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
return error; return error;
} }
...@@ -1194,7 +1197,6 @@ static int snd_opti93x_capture_open(snd_pcm_substream_t *substream) ...@@ -1194,7 +1197,6 @@ static int snd_opti93x_capture_open(snd_pcm_substream_t *substream)
runtime->hw = snd_opti93x_capture; runtime->hw = snd_opti93x_capture;
snd_pcm_set_sync(substream); snd_pcm_set_sync(substream);
snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.buffer_bytes_max); snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.buffer_bytes_max);
snd_pcm_limit_isa_dma_size(chip->dma2, &runtime->hw.period_bytes_max);
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates);
return error; return error;
} }
...@@ -1259,6 +1261,9 @@ static int snd_opti93x_free(opti93x_t *chip) ...@@ -1259,6 +1261,9 @@ static int snd_opti93x_free(opti93x_t *chip)
disable_dma(chip->dma2); disable_dma(chip->dma2);
free_dma(chip->dma2); free_dma(chip->dma2);
} }
if (chip->irq >= 0) {
free_irq(chip->irq, chip);
}
snd_magic_kfree(chip); snd_magic_kfree(chip);
return 0; return 0;
} }
...@@ -1312,6 +1317,11 @@ int snd_opti93x_create(snd_card_t *card, opti9xx_t *chip, ...@@ -1312,6 +1317,11 @@ int snd_opti93x_create(snd_card_t *card, opti9xx_t *chip,
} }
codec->dma2 = chip->dma2; codec->dma2 = chip->dma2;
if (request_irq(chip->irq, snd_opti93x_interrupt, SA_INTERRUPT, DRIVER_NAME" - WSS", codec)) {
snd_opti93x_free(codec);
return -EBUSY;
}
codec->card = card; codec->card = card;
codec->port = chip->wss_base + 4; codec->port = chip->wss_base + 4;
codec->irq = chip->irq; codec->irq = chip->irq;
...@@ -1328,7 +1338,7 @@ int snd_opti93x_create(snd_card_t *card, opti9xx_t *chip, ...@@ -1328,7 +1338,7 @@ int snd_opti93x_create(snd_card_t *card, opti9xx_t *chip,
snd_opti93x_init(codec); snd_opti93x_init(codec);
/* Register device */ /* Register device */
if ((error = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { if ((error = snd_device_new(card, SNDRV_DEV_LOWLEVEL, codec, &ops)) < 0) {
snd_opti93x_free(codec); snd_opti93x_free(codec);
return error; return error;
} }
...@@ -1439,8 +1449,8 @@ static int snd_opti93x_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ...@@ -1439,8 +1449,8 @@ static int snd_opti93x_put_mux(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *
right = (chip->image[OPTi93X_MIXOUT_RIGHT] & ~OPTi93X_MIXOUT_MIXER) | right; right = (chip->image[OPTi93X_MIXOUT_RIGHT] & ~OPTi93X_MIXOUT_MIXER) | right;
change = left != chip->image[OPTi93X_MIXOUT_LEFT] || change = left != chip->image[OPTi93X_MIXOUT_LEFT] ||
right != chip->image[OPTi93X_MIXOUT_RIGHT]; right != chip->image[OPTi93X_MIXOUT_RIGHT];
snd_opti93x_out(chip, OPTi93X_MIXOUT_LEFT, left); snd_opti93x_out_image(chip, OPTi93X_MIXOUT_LEFT, left);
snd_opti93x_out(chip, OPTi93X_MIXOUT_RIGHT, right); snd_opti93x_out_image(chip, OPTi93X_MIXOUT_RIGHT, right);
spin_unlock_irqrestore(&chip->lock, flags); spin_unlock_irqrestore(&chip->lock, flags);
return change; return change;
} }
...@@ -1520,7 +1530,7 @@ static int snd_opti93x_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ ...@@ -1520,7 +1530,7 @@ static int snd_opti93x_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
static int snd_opti93x_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) static int snd_opti93x_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{ {
int mask = (kcontrol->private_value >> 16) & 0xff; int mask = (kcontrol->private_value >> 24) & 0xff;
uinfo->type = mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = mask == 1 ? SNDRV_CTL_ELEM_TYPE_BOOLEAN : SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2; uinfo->count = 2;
...@@ -1576,8 +1586,8 @@ static int snd_opti93x_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ ...@@ -1576,8 +1586,8 @@ static int snd_opti93x_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
val1 = (chip->image[left_reg] & ~(mask << shift_left)) | val1; val1 = (chip->image[left_reg] & ~(mask << shift_left)) | val1;
val2 = (chip->image[right_reg] & ~(mask << shift_right)) | val2; val2 = (chip->image[right_reg] & ~(mask << shift_right)) | val2;
change = val1 != chip->image[left_reg] || val2 != chip->image[right_reg]; change = val1 != chip->image[left_reg] || val2 != chip->image[right_reg];
snd_opti93x_out(chip, left_reg, val1); snd_opti93x_out_image(chip, left_reg, val1);
snd_opti93x_out(chip, right_reg, val1); snd_opti93x_out_image(chip, right_reg, val2);
spin_unlock_irqrestore(&chip->lock, flags); spin_unlock_irqrestore(&chip->lock, flags);
return change; return change;
} }
...@@ -1586,20 +1596,20 @@ static int snd_opti93x_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ ...@@ -1586,20 +1596,20 @@ static int snd_opti93x_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
static snd_kcontrol_new_t snd_opti93x_controls[] = { static snd_kcontrol_new_t snd_opti93x_controls[] = {
OPTi93X_DOUBLE("Master Playback Switch", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), OPTi93X_DOUBLE("Master Playback Switch", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1),
OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 0, 0, 31, 1), OPTi93X_DOUBLE("Master Playback Volume", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1),
OPTi93X_DOUBLE("PCM Playback Switch", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 7, 7, 1, 1), OPTi93X_DOUBLE("PCM Playback Switch", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 7, 7, 1, 1),
OPTi93X_DOUBLE("PCM Playback Volume", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 0, 0, 31, 0), OPTi93X_DOUBLE("PCM Playback Volume", 0, OPTi93X_DAC_LEFT, OPTi93X_DAC_RIGHT, 0, 0, 31, 1),
OPTi93X_DOUBLE("FM Playback Switch", 0, OPTi931_FM_LEFT_INPUT, OPTi931_FM_RIGHT_INPUT, 7, 7, 1, 1), OPTi93X_DOUBLE("FM Playback Switch", 0, OPTi931_FM_LEFT_INPUT, OPTi931_FM_RIGHT_INPUT, 7, 7, 1, 1),
OPTi93X_DOUBLE("FM Playback Volume", 0, OPTi931_FM_LEFT_INPUT, OPTi931_FM_RIGHT_INPUT, 0, 0, 15, 1), OPTi93X_DOUBLE("FM Playback Volume", 0, OPTi931_FM_LEFT_INPUT, OPTi931_FM_RIGHT_INPUT, 1, 1, 15, 1),
OPTi93X_DOUBLE("Line Playback Switch", 0, OPTi93X_LINE_LEFT_INPUT, OPTi93X_LINE_RIGHT_INPUT, 7, 7, 1, 1), OPTi93X_DOUBLE("Line Playback Switch", 0, OPTi93X_LINE_LEFT_INPUT, OPTi93X_LINE_RIGHT_INPUT, 7, 7, 1, 1),
OPTi93X_DOUBLE("Line Playback Volume", 0, OPTi93X_LINE_LEFT_INPUT, OPTi93X_LINE_RIGHT_INPUT, 0, 0, 15, 1), OPTi93X_DOUBLE("Line Playback Volume", 0, OPTi93X_LINE_LEFT_INPUT, OPTi93X_LINE_RIGHT_INPUT, 1, 1, 15, 1),
OPTi93X_DOUBLE("Mic Playback Switch", 0, OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 7, 7, 1, 1), OPTi93X_DOUBLE("Mic Playback Switch", 0, OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 7, 7, 1, 1),
OPTi93X_DOUBLE("Mic Playback Volume", 0, OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 0, 0, 15, 1), OPTi93X_DOUBLE("Mic Playback Volume", 0, OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 1, 1, 15, 1),
OPTi93X_DOUBLE("Mic Boost", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 5, 5, 1, 1), OPTi93X_DOUBLE("Mic Boost", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 5, 5, 1, 1),
OPTi93X_DOUBLE("CD Playback Switch", 0, OPTi93X_CD_LEFT_INPUT, OPTi93X_CD_RIGHT_INPUT, 7, 7, 1, 1), OPTi93X_DOUBLE("CD Playback Switch", 0, OPTi93X_CD_LEFT_INPUT, OPTi93X_CD_RIGHT_INPUT, 7, 7, 1, 1),
OPTi93X_DOUBLE("CD Playback Volume", 0, OPTi93X_CD_LEFT_INPUT, OPTi93X_CD_RIGHT_INPUT, 0, 0, 15, 1), OPTi93X_DOUBLE("CD Playback Volume", 0, OPTi93X_CD_LEFT_INPUT, OPTi93X_CD_RIGHT_INPUT, 1, 1, 15, 1),
OPTi93X_DOUBLE("Aux Playback Switch", 0, OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 7, 7, 1, 1), OPTi93X_DOUBLE("Aux Playback Switch", 0, OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 7, 7, 1, 1),
OPTi93X_DOUBLE("Aux Playback Volume", 0, OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 0, 0, 15, 1), OPTi93X_DOUBLE("Aux Playback Volume", 0, OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 1, 1, 15, 1),
OPTi93X_DOUBLE("Capture Volume", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 0, 0, 15, 0), OPTi93X_DOUBLE("Capture Volume", 0, OPTi93X_MIXOUT_LEFT, OPTi93X_MIXOUT_RIGHT, 0, 0, 15, 0),
{ {
iface: SNDRV_CTL_ELEM_IFACE_MIXER, iface: SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -1647,7 +1657,6 @@ int snd_opti93x_mixer(opti93x_t *chip) ...@@ -1647,7 +1657,6 @@ int snd_opti93x_mixer(opti93x_t *chip)
static int __init snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip) static int __init snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip)
{ {
int i, err; int i, err;
static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
#ifndef OPTi93X #ifndef OPTi93X
for (i = OPTi9XX_HW_82C928; i < OPTi9XX_HW_82C930; i++) { for (i = OPTi9XX_HW_82C928; i < OPTi9XX_HW_82C930; i++) {
...@@ -1655,7 +1664,7 @@ static int __init snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip) ...@@ -1655,7 +1664,7 @@ static int __init snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip)
if ((err = snd_opti9xx_init(chip, i)) < 0) if ((err = snd_opti9xx_init(chip, i)) < 0)
return err; return err;
chip->mc_base_size = opti9xx_mc_size[i];
if (check_region(chip->mc_base, chip->mc_base_size)) if (check_region(chip->mc_base, chip->mc_base_size))
continue; continue;
...@@ -1671,7 +1680,7 @@ static int __init snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip) ...@@ -1671,7 +1680,7 @@ static int __init snd_card_opti9xx_detect(snd_card_t *card, opti9xx_t *chip)
if ((err = snd_opti9xx_init(chip, i)) < 0) if ((err = snd_opti9xx_init(chip, i)) < 0)
return err; return err;
chip->mc_base_size = opti9xx_mc_size[i];
if (check_region(chip->mc_base, chip->mc_base_size)) if (check_region(chip->mc_base, chip->mc_base_size))
continue; continue;
...@@ -1903,7 +1912,7 @@ static void snd_card_opti9xx_free(snd_card_t *card) ...@@ -1903,7 +1912,7 @@ static void snd_card_opti9xx_free(snd_card_t *card)
static int __init snd_card_opti9xx_probe(void) static int __init snd_card_opti9xx_probe(void)
{ {
static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1}; static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
static long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x310, -1}; static long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x330, -1};
#ifdef OPTi93X #ifdef OPTi93X
static int possible_irqs[] = {5, 9, 10, 11, 7, -1}; static int possible_irqs[] = {5, 9, 10, 11, 7, -1};
#else #else
......
...@@ -18,7 +18,7 @@ snd-es968-objs := es968.o ...@@ -18,7 +18,7 @@ snd-es968-objs := es968.o
# Toplevel Module Dependency # Toplevel Module Dependency
obj-$(CONFIG_SND_ALS100) += snd-sb16-dsp.o snd-sb-common.o obj-$(CONFIG_SND_ALS100) += snd-sb16-dsp.o snd-sb-common.o
obj-$(CONFIG_SND_CMI8330) += snd-sb16-dsp.o snd-sb-common.o obj-$(CONFIG_SND_CMI8330) += snd-sb16-dsp.o snd-sb-common.o
obj-$(CONFIG_SND_DT0197H) += snd-sb16-dsp.o snd-sb-common.o obj-$(CONFIG_SND_DT019X) += snd-sb16-dsp.o snd-sb-common.o
obj-$(CONFIG_SND_SB8) += snd-sb8.o snd-sb8-dsp.o snd-sb-common.o obj-$(CONFIG_SND_SB8) += snd-sb8.o snd-sb8-dsp.o snd-sb-common.o
obj-$(CONFIG_SND_SB16) += snd-sb16.o snd-sb16-dsp.o snd-sb-common.o obj-$(CONFIG_SND_SB16) += snd-sb16.o snd-sb16-dsp.o snd-sb-common.o
obj-$(CONFIG_SND_SBAWE) += snd-sbawe.o snd-sb16-dsp.o snd-sb-common.o obj-$(CONFIG_SND_SBAWE) += snd-sbawe.o snd-sb16-dsp.o snd-sb-common.o
......
...@@ -220,6 +220,8 @@ static struct isapnp_card_id snd_sb16_pnpids[] __devinitdata = { ...@@ -220,6 +220,8 @@ static struct isapnp_card_id snd_sb16_pnpids[] __devinitdata = {
/* Note: This card has also a CTL0051:StereoEnhance device!!! */ /* Note: This card has also a CTL0051:StereoEnhance device!!! */
ISAPNP_SBAWE('C','T','L',0x0045,0x0031,0x0021), ISAPNP_SBAWE('C','T','L',0x0045,0x0031,0x0021),
/* Sound Blaster AWE 32 PnP */ /* Sound Blaster AWE 32 PnP */
ISAPNP_SBAWE('C','T','L',0x0046,0x0031,0x0021),
/* Sound Blaster AWE 32 PnP */
ISAPNP_SBAWE('C','T','L',0x0047,0x0031,0x0021), ISAPNP_SBAWE('C','T','L',0x0047,0x0031,0x0021),
/* Sound Blaster AWE 32 PnP */ /* Sound Blaster AWE 32 PnP */
ISAPNP_SBAWE('C','T','L',0x0048,0x0031,0x0021), ISAPNP_SBAWE('C','T','L',0x0048,0x0031,0x0021),
......
...@@ -166,6 +166,9 @@ static int snd_sbdsp_probe(sb_t * chip) ...@@ -166,6 +166,9 @@ static int snd_sbdsp_probe(sb_t * chip)
case SB_HW_ALS4000: case SB_HW_ALS4000:
str = "16 (ALS-4000)"; str = "16 (ALS-4000)";
break; break;
case SB_HW_DT019X:
str = "(DT019X/ALS007)";
break;
default: default:
return -ENODEV; return -ENODEV;
} }
......
...@@ -194,6 +194,98 @@ static int snd_sbmixer_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ ...@@ -194,6 +194,98 @@ static int snd_sbmixer_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
return change; return change;
} }
/*
* DT-019x / ALS-007 capture/input switch
*/
static int snd_dt019x_input_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo)
{
static char *texts[5] = {
"CD", "Mic", "Line", "Synth", "Master"
};
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 5;
if (uinfo->value.enumerated.item > 4)
uinfo->value.enumerated.item = 4;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
}
static int snd_dt019x_input_sw_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
sb_t *sb = snd_kcontrol_chip(kcontrol);
unsigned long flags;
unsigned char oval;
spin_lock_irqsave(&sb->mixer_lock, flags);
oval = snd_sbmixer_read(sb, SB_DT019X_CAPTURE_SW);
spin_unlock_irqrestore(&sb->mixer_lock, flags);
switch (oval & 0x07) {
case SB_DT019X_CAP_CD:
ucontrol->value.enumerated.item[0] = 0;
break;
case SB_DT019X_CAP_MIC:
ucontrol->value.enumerated.item[0] = 1;
break;
case SB_DT019X_CAP_LINE:
ucontrol->value.enumerated.item[0] = 2;
break;
case SB_DT019X_CAP_MAIN:
ucontrol->value.enumerated.item[0] = 4;
break;
/* To record the synth on these cards you must record the main. */
/* Thus SB_DT019X_CAP_SYNTH == SB_DT019X_CAP_MAIN and would cause */
/* duplicate case labels if left uncommented. */
/* case SB_DT019X_CAP_SYNTH:
* ucontrol->value.enumerated.item[0] = 3;
* break;
*/
default:
ucontrol->value.enumerated.item[0] = 4;
break;
}
return 0;
}
static int snd_dt019x_input_sw_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
{
sb_t *sb = snd_kcontrol_chip(kcontrol);
unsigned long flags;
int change;
unsigned char nval, oval;
if (ucontrol->value.enumerated.item[0] > 4)
return -EINVAL;
switch (ucontrol->value.enumerated.item[0]) {
case 0:
nval = SB_DT019X_CAP_CD;
break;
case 1:
nval = SB_DT019X_CAP_MIC;
break;
case 2:
nval = SB_DT019X_CAP_LINE;
break;
case 3:
nval = SB_DT019X_CAP_SYNTH;
break;
case 4:
nval = SB_DT019X_CAP_MAIN;
break;
default:
nval = SB_DT019X_CAP_MAIN;
}
spin_lock_irqsave(&sb->mixer_lock, flags);
oval = snd_sbmixer_read(sb, SB_DT019X_CAPTURE_SW);
change = nval != oval;
if (change)
snd_sbmixer_write(sb, SB_DT019X_CAPTURE_SW, nval);
spin_unlock_irqrestore(&sb->mixer_lock, flags);
return change;
}
/* /*
* SBPRO input multiplexer * SBPRO input multiplexer
*/ */
...@@ -422,6 +514,44 @@ static unsigned char snd_sb16_init_values[][2] = { ...@@ -422,6 +514,44 @@ static unsigned char snd_sb16_init_values[][2] = {
{ SB_DSP4_SPEAKER_DEV, 0 }, { SB_DSP4_SPEAKER_DEV, 0 },
}; };
#define DT019X_CONTROLS (sizeof(snd_dt019x_controls)/sizeof(snd_kcontrol_new_t))
static snd_kcontrol_new_t snd_dt019x_controls[] = {
SB_DOUBLE("Master Playback Volume", SB_DT019X_MASTER_DEV, SB_DT019X_MASTER_DEV, 4,0, 15),
SB_DOUBLE("PCM Playback Volume", SB_DT019X_PCM_DEV, SB_DT019X_PCM_DEV, 4,0, 15),
SB_DOUBLE("Synth Playback Volume", SB_DT019X_SYNTH_DEV, SB_DT019X_SYNTH_DEV, 4,0, 15),
SB_DOUBLE("CD Playback Volume", SB_DT019X_CD_DEV, SB_DT019X_CD_DEV, 4,0, 15),
SB_SINGLE("Mic Playback Volume", SB_DT019X_MIC_DEV, 4, 7),
SB_SINGLE("PC Speaker Volume", SB_DT019X_SPKR_DEV, 0, 7),
SB_DOUBLE("Line Playback Volume", SB_DT019X_LINE_DEV, SB_DT019X_LINE_DEV, 4,0, 15),
SB_SINGLE("Mic Playback Switch", SB_DT019X_OUTPUT_SW1, 0, 1),
SB_DOUBLE("CD Playback Switch", SB_DT019X_OUTPUT_SW1, SB_DT019X_OUTPUT_SW1, 2,1, 1),
SB_DOUBLE("Line Playback Switch", SB_DT019X_OUTPUT_SW1, SB_DT019X_OUTPUT_SW1, 4,3, 1),
SB_DOUBLE("PCM Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 2,1, 1),
SB_DOUBLE("Synth Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 4,3, 1),
{
iface: SNDRV_CTL_ELEM_IFACE_MIXER,
name: "Capture Source",
info: snd_dt019x_input_sw_info,
get: snd_dt019x_input_sw_get,
put: snd_dt019x_input_sw_put,
},
};
#define DT019X_INIT_VALUES (sizeof(snd_dt019x_init_values)/sizeof(unsigned char)/2)
static unsigned char snd_dt019x_init_values[][2] = {
{ SB_DT019X_MASTER_DEV, 0 },
{ SB_DT019X_PCM_DEV, 0 },
{ SB_DT019X_SYNTH_DEV, 0 },
{ SB_DT019X_CD_DEV, 0 },
{ SB_DT019X_MIC_DEV, 0 }, /* Includes PC-speaker in high nibble */
{ SB_DT019X_LINE_DEV, 0 },
{ SB_DT019X_OUTPUT_SW1, 0 },
{ SB_DT019X_OUTPUT_SW2, 0 },
{ SB_DT019X_CAPTURE_SW, 0x06 },
};
static int snd_sbmixer_init(sb_t *chip, static int snd_sbmixer_init(sb_t *chip,
snd_kcontrol_new_t *controls, snd_kcontrol_new_t *controls,
int controls_count, int controls_count,
...@@ -490,6 +620,12 @@ int snd_sbmixer_new(sb_t *chip) ...@@ -490,6 +620,12 @@ int snd_sbmixer_new(sb_t *chip)
"CTL1745")) < 0) "CTL1745")) < 0)
return err; return err;
break; break;
case SB_HW_DT019X:
if ((err = snd_sbmixer_init(chip,
snd_dt019x_controls, DT019X_CONTROLS,
snd_dt019x_init_values, DT019X_INIT_VALUES,
"DT019X")) < 0)
break;
default: default:
strcpy(card->mixername, "???"); strcpy(card->mixername, "???");
} }
......
...@@ -165,12 +165,11 @@ typedef struct { ...@@ -165,12 +165,11 @@ typedef struct {
static int build_via_table(viadev_t *dev, snd_pcm_substream_t *substream, static int build_via_table(viadev_t *dev, snd_pcm_substream_t *substream,
struct pci_dev *pci) struct pci_dev *pci)
{ {
int i, pages, size; int i, size;
struct snd_sg_buf *sgbuf = snd_magic_cast(snd_pcm_sgbuf_t, substream->dma_private, return -EINVAL); struct snd_sg_buf *sgbuf = snd_magic_cast(snd_pcm_sgbuf_t, substream->dma_private, return -EINVAL);
if (dev->table) { if (dev->table) {
pages = snd_pcm_sgbuf_pages(dev->tbl_entries * 8); snd_free_pci_pages(pci, PAGE_ALIGN(dev->tbl_entries * 8), dev->table, dev->table_addr);
snd_free_pci_pages(pci, pages << PAGE_SHIFT, dev->table, dev->table_addr);
dev->table = NULL; dev->table = NULL;
} }
...@@ -187,8 +186,7 @@ static int build_via_table(viadev_t *dev, snd_pcm_substream_t *substream, ...@@ -187,8 +186,7 @@ static int build_via_table(viadev_t *dev, snd_pcm_substream_t *substream,
/* the start of each lists must be aligned to 8 bytes, /* the start of each lists must be aligned to 8 bytes,
* but the kernel pages are much bigger, so we don't care * but the kernel pages are much bigger, so we don't care
*/ */
pages = snd_pcm_sgbuf_pages(dev->tbl_entries * 8); dev->table = (u32*)snd_malloc_pci_pages(pci, PAGE_ALIGN(dev->tbl_entries * 8), &dev->table_addr);
dev->table = (u32*)snd_malloc_pci_pages(pci, pages << PAGE_SHIFT, &dev->table_addr);
if (! dev->table) if (! dev->table)
return -ENOMEM; return -ENOMEM;
...@@ -214,7 +212,7 @@ static void clean_via_table(viadev_t *dev, snd_pcm_substream_t *substream, ...@@ -214,7 +212,7 @@ static void clean_via_table(viadev_t *dev, snd_pcm_substream_t *substream,
struct pci_dev *pci) struct pci_dev *pci)
{ {
if (dev->table) { if (dev->table) {
snd_free_pci_pages(pci, snd_pcm_sgbuf_pages(dev->tbl_entries * 8) << PAGE_SHIFT, dev->table, dev->table_addr); snd_free_pci_pages(pci, PAGE_ALIGN(dev->tbl_entries * 8), dev->table, dev->table_addr);
dev->table = NULL; dev->table = NULL;
} }
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/control.h> #include <sound/control.h>
#include <sound/info.h> #include <sound/info.h>
......
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