Commit 4d6dcf60 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA update

  - documentation
  - control API - added multi-elements to reduce memory usage
  - improved preallocation of DMA buffers
  - CS46xx driver - added support for secondary codec
  - HDSP driver - big update
    - firmware is loaded with hdsptool now
  - pmac driver updates (fixed oops and beep stuff)
  - VIA82xx driver updated
  - ymfpci driver updated 
  - drivers updated to new PnP layer
    - wavefront, ad1816a, cs423x, es18xx, interwave, opl3sa2, cmi8330
    
parent b1d7a6ca
...@@ -223,6 +223,13 @@ ...@@ -223,6 +223,13 @@
#define AC97_YMF753_DIT_CTRL2 0x66 /* DIT Control 2 */ #define AC97_YMF753_DIT_CTRL2 0x66 /* DIT Control 2 */
#define AC97_YMF753_3D_MODE_SEL 0x68 /* 3D Mode Select */ #define AC97_YMF753_3D_MODE_SEL 0x68 /* 3D Mode Select */
/* specific - C-Media */
#define AC97_CM9738_VENDOR_CTRL 0x5a
#define AC97_CM9739_MULTI_CHAN 0x64
#define AC97_CM9739_SPDIF_IN_STATUS 0x68 /* 32bit */
#define AC97_CM9739_SPDIF_CTRL 0x6c
/* ac97->scaps */ /* ac97->scaps */
#define AC97_SCAP_AUDIO (1<<0) /* audio AC'97 codec */ #define AC97_SCAP_AUDIO (1<<0) /* audio AC'97 codec */
#define AC97_SCAP_MODEM (1<<1) /* modem AC'97 codec */ #define AC97_SCAP_MODEM (1<<1) /* modem AC'97 codec */
...@@ -259,6 +266,9 @@ struct _snd_ac97 { ...@@ -259,6 +266,9 @@ struct _snd_ac97 {
void (*private_free) (ac97_t *ac97); void (*private_free) (ac97_t *ac97);
/* --- */ /* --- */
snd_card_t *card; snd_card_t *card;
struct pci_dev *pci; /* assigned PCI device - used for quirks */
unsigned short subsystem_vendor;
unsigned short subsystem_device;
spinlock_t reg_lock; spinlock_t reg_lock;
unsigned short num; /* number of codec: 0 = primary, 1 = secondary */ unsigned short num; /* number of codec: 0 = primary, 1 = secondary */
unsigned short addr; /* physical address of codec [0-3] */ unsigned short addr; /* physical address of codec [0-3] */
...@@ -280,6 +290,7 @@ struct _snd_ac97 { ...@@ -280,6 +290,7 @@ struct _snd_ac97 {
unsigned short chained[3]; // 0 = C34, 1 = C79, 2 = C69 unsigned short chained[3]; // 0 = C34, 1 = C79, 2 = C69
unsigned short id[3]; // codec IDs (lower 16-bit word) unsigned short id[3]; // codec IDs (lower 16-bit word)
unsigned short pcmreg[3]; // PCM registers unsigned short pcmreg[3]; // PCM registers
unsigned short codec_cfg[3]; // CODEC_CFG bits
struct semaphore mutex; struct semaphore mutex;
} ad18xx; } ad18xx;
} spec; } spec;
...@@ -327,6 +338,6 @@ struct ac97_quirk { ...@@ -327,6 +338,6 @@ struct ac97_quirk {
int type; int type;
}; };
int snd_ac97_tune_hardware(ac97_t *ac97, struct pci_dev *pci, struct ac97_quirk *quirk); int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk);
#endif /* __SOUND_AC97_CODEC_H */ #endif /* __SOUND_AC97_CODEC_H */
...@@ -681,7 +681,7 @@ struct sndrv_timer_tread { ...@@ -681,7 +681,7 @@ struct sndrv_timer_tread {
* * * *
****************************************************************************/ ****************************************************************************/
#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 1) #define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2)
struct sndrv_ctl_card_info { struct sndrv_ctl_card_info {
int card; /* card number */ int card; /* card number */
...@@ -726,7 +726,8 @@ enum sndrv_ctl_elem_iface { ...@@ -726,7 +726,8 @@ enum sndrv_ctl_elem_iface {
#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */ #define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */ #define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */ #define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
#define SNDRV_CTL_ELEM_ACCESS_INDIRECT (1<<31) /* indirect access */ #define SNDRV_CTL_ELEM_ACCESS_DINDIRECT (1<<30) /* indirect access for matrix dimensions in the info structure */
#define SNDRV_CTL_ELEM_ACCESS_INDIRECT (1<<31) /* indirect access for element value in the value structure */
/* for further details see the ACPI and PCI power management specification */ /* for further details see the ACPI and PCI power management specification */
#define SNDRV_CTL_POWER_D0 0x0000 /* full On */ #define SNDRV_CTL_POWER_D0 0x0000 /* full On */
...@@ -778,7 +779,11 @@ struct sndrv_ctl_elem_info { ...@@ -778,7 +779,11 @@ struct sndrv_ctl_elem_info {
} enumerated; } enumerated;
unsigned char reserved[128]; unsigned char reserved[128];
} value; } value;
unsigned char reserved[64]; union {
unsigned short d[4]; /* dimensions */
unsigned short *d_ptr; /* indirect */
} dimen;
unsigned char reserved[64-4*sizeof(unsigned short)];
}; };
struct sndrv_ctl_elem_value { struct sndrv_ctl_elem_value {
......
...@@ -49,24 +49,30 @@ typedef struct _snd_kcontrol_new { ...@@ -49,24 +49,30 @@ typedef struct _snd_kcontrol_new {
unsigned char *name; /* ASCII name of item */ unsigned char *name; /* ASCII name of item */
unsigned int index; /* index of item */ unsigned int index; /* index of item */
unsigned int access; /* access rights */ unsigned int access; /* access rights */
unsigned int count; /* count of same elements */
snd_kcontrol_info_t *info; snd_kcontrol_info_t *info;
snd_kcontrol_get_t *get; snd_kcontrol_get_t *get;
snd_kcontrol_put_t *put; snd_kcontrol_put_t *put;
unsigned long private_value; unsigned long private_value;
} snd_kcontrol_new_t; } snd_kcontrol_new_t;
struct _snd_kcontrol { typedef struct _snd_kcontrol_volatile {
struct list_head list; /* list of controls */
snd_ctl_elem_id_t id;
snd_ctl_file_t *owner; /* locked */ snd_ctl_file_t *owner; /* locked */
pid_t owner_pid; pid_t owner_pid;
unsigned int access; /* access rights */ unsigned int access; /* access rights */
} snd_kcontrol_volatile_t;
struct _snd_kcontrol {
struct list_head list; /* list of controls */
snd_ctl_elem_id_t id;
unsigned int count; /* count of same elements */
snd_kcontrol_info_t *info; snd_kcontrol_info_t *info;
snd_kcontrol_get_t *get; snd_kcontrol_get_t *get;
snd_kcontrol_put_t *put; snd_kcontrol_put_t *put;
unsigned long private_value; unsigned long private_value;
void *private_data; void *private_data;
void (*private_free)(snd_kcontrol_t *kcontrol); void (*private_free)(snd_kcontrol_t *kcontrol);
snd_kcontrol_volatile_t vd[0]; /* volatile data */
}; };
#define snd_kcontrol(n) list_entry(n, snd_kcontrol_t, list) #define snd_kcontrol(n) list_entry(n, snd_kcontrol_t, list)
...@@ -100,7 +106,7 @@ typedef int (*snd_kctl_ioctl_func_t) (snd_card_t * card, ...@@ -100,7 +106,7 @@ typedef int (*snd_kctl_ioctl_func_t) (snd_card_t * card,
void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id); void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id);
snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol); snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol, unsigned int access);
snd_kcontrol_t *snd_ctl_new1(snd_kcontrol_new_t * kcontrolnew, void * private_data); snd_kcontrol_t *snd_ctl_new1(snd_kcontrol_new_t * kcontrolnew, void * private_data);
void snd_ctl_free_one(snd_kcontrol_t * kcontrol); void snd_ctl_free_one(snd_kcontrol_t * kcontrol);
int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol); int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol);
...@@ -117,4 +123,33 @@ int snd_ctl_unregister(snd_card_t *card); ...@@ -117,4 +123,33 @@ int snd_ctl_unregister(snd_card_t *card);
int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn); int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn);
int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn); int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn);
static inline unsigned int snd_ctl_get_ioffnum(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id)
{
return id->numid - kctl->id.numid;
}
static inline unsigned int snd_ctl_get_ioffidx(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id)
{
return id->index - kctl->id.index;
}
static inline unsigned int snd_ctl_get_ioff(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id)
{
if (id->numid) {
return snd_ctl_get_ioffnum(kctl, id);
} else {
return snd_ctl_get_ioffidx(kctl, id);
}
}
static inline snd_ctl_elem_id_t *snd_ctl_build_ioff(snd_ctl_elem_id_t *dst_id,
snd_kcontrol_t *src_kctl,
unsigned int offset)
{
*dst_id = src_kctl->id;
dst_id->index += offset;
dst_id->numid += offset;
return dst_id;
}
#endif /* __SOUND_CONTROL_H */ #endif /* __SOUND_CONTROL_H */
...@@ -1730,6 +1730,7 @@ struct _snd_cs46xx { ...@@ -1730,6 +1730,7 @@ struct _snd_cs46xx {
void (*amplifier_ctrl)(cs46xx_t *, int); void (*amplifier_ctrl)(cs46xx_t *, int);
void (*active_ctrl)(cs46xx_t *, int); void (*active_ctrl)(cs46xx_t *, int);
void (*mixer_init)(cs46xx_t *); void (*mixer_init)(cs46xx_t *);
struct pci_dev *acpi_dev; struct pci_dev *acpi_dev;
int acpi_port; int acpi_port;
snd_kcontrol_t *eapd_switch; /* for amplifier hack */ snd_kcontrol_t *eapd_switch; /* for amplifier hack */
...@@ -1749,6 +1750,7 @@ struct _snd_cs46xx { ...@@ -1749,6 +1750,7 @@ struct _snd_cs46xx {
dsp_spos_instance_t * dsp_spos_instance; dsp_spos_instance_t * dsp_spos_instance;
snd_pcm_t *pcm_rear; snd_pcm_t *pcm_rear;
snd_pcm_t *pcm_center_lfe;
snd_pcm_t *pcm_iec958; snd_pcm_t *pcm_iec958;
#else /* for compatibility */ #else /* for compatibility */
cs46xx_pcm_t *playback_pcm; cs46xx_pcm_t *playback_pcm;
...@@ -1764,6 +1766,7 @@ int snd_cs46xx_create(snd_card_t *card, ...@@ -1764,6 +1766,7 @@ int snd_cs46xx_create(snd_card_t *card,
int snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t **rpcm); int snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t **rpcm); int snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t **rpcm); int snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **rpcm);
int snd_cs46xx_mixer(cs46xx_t *chip); int snd_cs46xx_mixer(cs46xx_t *chip);
int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi); int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi);
int snd_cs46xx_start_dsp(cs46xx_t *chip); int snd_cs46xx_start_dsp(cs46xx_t *chip);
......
This diff is collapsed.
...@@ -52,17 +52,18 @@ ...@@ -52,17 +52,18 @@
#define DSP_MAX_TASK_DESC 50 #define DSP_MAX_TASK_DESC 50
#define DSP_MAX_PCM_CHANNELS 32 #define DSP_MAX_PCM_CHANNELS 32
#define DSP_MAX_SRC_NR 6 #define DSP_MAX_SRC_NR 14
#define DSP_PCM_MAIN_CHANNEL 1 #define DSP_PCM_MAIN_CHANNEL 1
#define DSP_PCM_REAR_CHANNEL 2 #define DSP_PCM_REAR_CHANNEL 2
#define DSP_PCM_CENTER_CHANNEL 3 #define DSP_PCM_CENTER_LFE_CHANNEL 3
#define DSP_PCM_LFE_CHANNEL 4 #define DSP_PCM_S71_CHANNEL 4 /* surround 7.1 */
#define DSP_IEC958_CHANNEL 5 #define DSP_IEC958_CHANNEL 5
#define DSP_SPDIF_STATUS_OUTPUT_ENABLED 1 #define DSP_SPDIF_STATUS_OUTPUT_ENABLED 1
#define DSP_SPDIF_STATUS_PLAYBACK_OPEN 2 #define DSP_SPDIF_STATUS_PLAYBACK_OPEN 2
#define DSP_SPDIF_STATUS_HW_ENABLED 4 #define DSP_SPDIF_STATUS_HW_ENABLED 4
#define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8
struct _dsp_module_desc_t; struct _dsp_module_desc_t;
...@@ -157,9 +158,12 @@ typedef struct _dsp_spos_instance_t { ...@@ -157,9 +158,12 @@ typedef struct _dsp_spos_instance_t {
u16 dac_volume_right; u16 dac_volume_right;
u16 dac_volume_left; u16 dac_volume_left;
/* Rear PCM playback mixer */ /* Rear/surround PCM playback mixer */
dsp_scb_descriptor_t * rear_mix_scb; dsp_scb_descriptor_t * rear_mix_scb;
/* Center/LFE mixer */
dsp_scb_descriptor_t * center_lfe_mix_scb;
int npcm_channels; int npcm_channels;
int nsrc_scb; int nsrc_scb;
pcm_channel_descriptor_t pcm_channels[DSP_MAX_PCM_CHANNELS]; pcm_channel_descriptor_t pcm_channels[DSP_MAX_PCM_CHANNELS];
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#ifndef __CS46XX_DSP_TASK_TYPES_H__ #ifndef __CS46XX_DSP_TASK_TYPES_H__
#define __CS46XX_DSP_TASK_TYPES_H__ #define __CS46XX_DSP_TASK_TYPES_H__
#include "cs46xx_dsp_scb_types.h"
/********************************************************************************************* /*********************************************************************************************
Example hierarchy of stream control blocks in the SP Example hierarchy of stream control blocks in the SP
...@@ -54,7 +56,7 @@ Ptr____Call (c) ...@@ -54,7 +56,7 @@ Ptr____Call (c)
#define HFG_CONTEXT_SWITCH_MODE 0x0002 #define HFG_CONTEXT_SWITCH_MODE 0x0002
#define HFG_CONTEXT_SWITCH_MODE_BIT 1 #define HFG_CONTEXT_SWITCH_MODE_BIT 1
#define MAX_FG_STACK_SIZE 32 // THESE NEED TO BE COMPUTED PROPERLY #define MAX_FG_STACK_SIZE 32 /* THESE NEED TO BE COMPUTED PROPERLY */
#define MAX_MG_STACK_SIZE 16 #define MAX_MG_STACK_SIZE 16
#define MAX_BG_STACK_SIZE 9 #define MAX_BG_STACK_SIZE 9
#define MAX_HFG_STACK_SIZE 4 #define MAX_HFG_STACK_SIZE 4
...@@ -74,64 +76,84 @@ typedef struct _hf_save_area_t { ...@@ -74,64 +76,84 @@ typedef struct _hf_save_area_t {
u32 r54_save; u32 r54_save;
u32 r98_save; u32 r98_save;
u16 status_save; ___DSP_DUAL_16BIT_ALLOC(
u16 ind_save; status_save,
ind_save
)
u16 rci1_save; ___DSP_DUAL_16BIT_ALLOC(
u16 rci0_save; rci1_save,
rci0_save
)
u32 r32_save; u32 r32_save;
u32 r76_save; u32 r76_save;
u32 rsd2_save; u32 rsd2_save;
u16 rsi2_save; /* See TaskTreeParameterBlock for ___DSP_DUAL_16BIT_ALLOC(
rsi2_save, /* See TaskTreeParameterBlock for
remainder of registers */ remainder of registers */
u16 rsa2Save; rsa2Save
)
/* saved as part of HFG context */ /* saved as part of HFG context */
} hf_save_area_t; } hf_save_area_t;
/* Task link data structure */ /* Task link data structure */
typedef struct _tree_link_t { typedef struct _tree_link_t {
___DSP_DUAL_16BIT_ALLOC(
/* Pointer to sibling task control block */ /* Pointer to sibling task control block */
u16 next_scb; next_scb,
/* Pointer to child task control block */ /* Pointer to child task control block */
u16 sub_ptr; sub_ptr
)
___DSP_DUAL_16BIT_ALLOC(
/* Pointer to code entry point */ /* Pointer to code entry point */
u16 entry_point; entry_point,
/* Pointer to local data */ /* Pointer to local data */
u16 this_spb; this_spb
)
} tree_link_t; } tree_link_t;
typedef struct _task_tree_data_t { typedef struct _task_tree_data_t {
___DSP_DUAL_16BIT_ALLOC(
/* Initial tock count; controls task tree execution rate */ /* Initial tock count; controls task tree execution rate */
u16 tock_count_limit; tock_count_limit,
/* Tock down counter */ /* Tock down counter */
u16 tock_count; tock_count
)
/* Add to ActiveCount when TockCountLimit reached: /* Add to ActiveCount when TockCountLimit reached:
Subtract on task tree termination */ Subtract on task tree termination */
u16 active_tncrement; ___DSP_DUAL_16BIT_ALLOC(
active_tncrement,
/* Number of pending activations for task tree */ /* Number of pending activations for task tree */
u16 active_count; active_count
)
___DSP_DUAL_16BIT_ALLOC(
/* BitNumber to enable modification of correct bit in ActiveTaskFlags */ /* BitNumber to enable modification of correct bit in ActiveTaskFlags */
u16 active_bit; active_bit,
/* Pointer to OS location for indicating current activity on task level */ /* Pointer to OS location for indicating current activity on task level */
u16 active_task_flags_ptr; active_task_flags_ptr
)
/* Data structure for controlling movement of memory blocks:- /* Data structure for controlling movement of memory blocks:-
currently unused */ currently unused */
u16 mem_upd_ptr; ___DSP_DUAL_16BIT_ALLOC(
mem_upd_ptr,
/* Data structure for controlling synchronous link update */ /* Data structure for controlling synchronous link update */
u16 link_upd_ptr; link_upd_ptr
)
___DSP_DUAL_16BIT_ALLOC(
/* Save area for remainder of full context. */ /* Save area for remainder of full context. */
u16 save_area; save_area,
/* Address of start of local stack for data storage */ /* Address of start of local stack for data storage */
u16 data_stack_base_ptr; data_stack_base_ptr
)
} task_tree_data_t; } task_tree_data_t;
...@@ -140,12 +162,16 @@ typedef struct _task_tree_data_t { ...@@ -140,12 +162,16 @@ typedef struct _task_tree_data_t {
typedef struct _interval_timer_data_t typedef struct _interval_timer_data_t
{ {
/* These data items have the same relative locations to those */ /* These data items have the same relative locations to those */
u16 interval_timer_period; ___DSP_DUAL_16BIT_ALLOC(
u16 itd_unused; interval_timer_period,
itd_unused
)
/* used for this data in the SPOS control block for SPOS 1.0 */ /* used for this data in the SPOS control block for SPOS 1.0 */
u16 num_FG_ticks_this_interval; ___DSP_DUAL_16BIT_ALLOC(
u16 num_intervals; num_FG_ticks_this_interval,
num_intervals
)
} interval_timer_data_t; } interval_timer_data_t;
...@@ -155,23 +181,35 @@ typedef struct _task_tree_context_block_t { ...@@ -155,23 +181,35 @@ typedef struct _task_tree_context_block_t {
/* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for /* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for
The access to the context switch (call or interrupt), and 1 spare that The access to the context switch (call or interrupt), and 1 spare that
users should never use. This last may be required by the system */ users should never use. This last may be required by the system */
u16 stack1; ___DSP_DUAL_16BIT_ALLOC(
u16 stack0; stack1,
u16 stack3; stack0
u16 stack2; )
u16 stack5; ___DSP_DUAL_16BIT_ALLOC(
u16 stack4; stack3,
u16 stack7; stack2
u16 stack6; )
u16 stack9; ___DSP_DUAL_16BIT_ALLOC(
u16 stack8; stack5,
stack4
)
___DSP_DUAL_16BIT_ALLOC(
stack7,
stack6
)
___DSP_DUAL_16BIT_ALLOC(
stack9,
stack8
)
u32 saverfe; u32 saverfe;
/* Value may be overwriten by stack save algorithm. /* Value may be overwriten by stack save algorithm.
Retain the size of the stack data saved here if used */ Retain the size of the stack data saved here if used */
u16 reserved1; ___DSP_DUAL_16BIT_ALLOC(
u16 stack_size; reserved1,
stack_size
)
u32 saverba; /* (HFG) */ u32 saverba; /* (HFG) */
u32 saverdc; u32 saverdc;
u32 savers_config_23; /* (HFG) */ u32 savers_config_23; /* (HFG) */
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#endif #endif
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h>
#define SNDRV_CARDS 8 /* number of supported soundcards - don't change - minor numbers */ #define SNDRV_CARDS 8 /* number of supported soundcards - don't change - minor numbers */
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
#define NUM_G 64 /* use all channels */ #define NUM_G 64 /* use all channels */
#define NUM_FXSENDS 4 #define NUM_FXSENDS 4
#define EMU10K1_DMA_MASK 0x1fffffffUL #define EMU10K1_DMA_MASK 0x7fffffffUL /* 31bit */
#define AUDIGY_DMA_MASK 0xffffffffUL #define AUDIGY_DMA_MASK 0xffffffffUL /* 32bit */
#define TMEMSIZE 256*1024 #define TMEMSIZE 256*1024
#define TMEMSIZEREG 4 #define TMEMSIZEREG 4
...@@ -818,9 +818,6 @@ typedef struct { ...@@ -818,9 +818,6 @@ typedef struct {
unsigned char send_routing[3][8]; unsigned char send_routing[3][8];
unsigned char send_volume[3][8]; unsigned char send_volume[3][8];
unsigned short attn[3]; unsigned short attn[3];
snd_kcontrol_t *ctl_send_routing;
snd_kcontrol_t *ctl_send_volume;
snd_kcontrol_t *ctl_attn;
emu10k1_pcm_t *epcm; emu10k1_pcm_t *epcm;
} emu10k1_pcm_mixer_t; } emu10k1_pcm_mixer_t;
...@@ -980,6 +977,9 @@ struct _snd_emu10k1 { ...@@ -980,6 +977,9 @@ struct _snd_emu10k1 {
emu10k1_voice_t voices[64]; emu10k1_voice_t voices[64];
emu10k1_pcm_mixer_t pcm_mixer[32]; emu10k1_pcm_mixer_t pcm_mixer[32];
snd_kcontrol_t *ctl_send_routing;
snd_kcontrol_t *ctl_send_volume;
snd_kcontrol_t *ctl_attn;
void (*hwvol_interrupt)(emu10k1_t *emu, unsigned int status); void (*hwvol_interrupt)(emu10k1_t *emu, unsigned int status);
void (*capture_interrupt)(emu10k1_t *emu, unsigned int status); void (*capture_interrupt)(emu10k1_t *emu, unsigned int status);
......
#ifndef __SOUND_HDSP_H
#define __SOUND_HDSP_H
/*
* Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define HDSP_MATRIX_MIXER_SIZE 2048
typedef enum {
Digiface,
Multiface,
Undefined,
} HDSP_IO_Type;
typedef struct _snd_hdsp_peak_rms hdsp_peak_rms_t;
struct _snd_hdsp_peak_rms {
unsigned int playback_peaks[26];
unsigned int input_peaks[26];
unsigned int output_peaks[28];
unsigned long long playback_rms[26];
unsigned long long input_rms[26];
};
#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, hdsp_peak_rms_t)
typedef struct _snd_hdsp_config_info hdsp_config_info_t;
struct _snd_hdsp_config_info {
unsigned char pref_sync_ref;
unsigned char wordclock_sync_check;
unsigned char spdif_sync_check;
unsigned char adatsync_sync_check;
unsigned char adat_sync_check[3];
unsigned char spdif_in;
unsigned char spdif_out;
unsigned char spdif_professional;
unsigned char spdif_emphasis;
unsigned char spdif_nonaudio;
unsigned int spdif_sample_rate;
unsigned int system_sample_rate;
unsigned int autosync_sample_rate;
unsigned char system_clock_mode;
unsigned char clock_source;
unsigned char autosync_ref;
unsigned char line_out;
unsigned char passthru;
};
#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdsp_config_info_t)
typedef struct _snd_hdsp_firmware hdsp_firmware_t;
struct _snd_hdsp_firmware {
unsigned long firmware_data[24413];
};
#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, hdsp_firmware_t)
typedef struct _snd_hdsp_version hdsp_version_t;
struct _snd_hdsp_version {
HDSP_IO_Type io_type;
unsigned short firmware_rev;
};
#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, hdsp_version_t)
typedef struct _snd_hdsp_mixer hdsp_mixer_t;
struct _snd_hdsp_mixer {
unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
};
#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, hdsp_mixer_t)
#endif /* __SOUND_HDSP_H */
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#ifdef MODULE #ifdef MODULE
#define MODULE_GENERIC_STRING(name, string) \ #define MODULE_GENERIC_STRING(name, string) \
static const char __module_generic_string_##name [] \ static const char __module_generic_string_##name [] \
__attribute__ ((section(".modstring"))) = #name "=" string; __attribute__ ((unused, __section__(".modstring"))) = #name "=" string;
#else #else
#define MODULE_GENERIC_STRING(name, string) #define MODULE_GENERIC_STRING(name, string)
#endif #endif
......
...@@ -174,19 +174,4 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t off ...@@ -174,19 +174,4 @@ static inline dma_addr_t snd_sgbuf_get_addr(struct snd_sg_buf *sgbuf, size_t off
} }
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
/*
* wrappers
*/
#ifdef CONFIG_PCI
#if defined(__i386__) || defined(__ppc__) || defined(__x86_64__)
#define HACK_PCI_ALLOC_CONSISTENT
/* a hack for 2.4/5 kernels for better allocation of large buffers */
void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,
dma_addr_t *dma_handle);
#endif /* arch */
#endif /* CONFIG_PCI */
#endif /* __SOUND_MEMALLOC_H */ #endif /* __SOUND_MEMALLOC_H */
...@@ -230,7 +230,8 @@ ...@@ -230,7 +230,8 @@
#define OPL3_HW_OPL3_FM801 0x0303 /* FM801 */ #define OPL3_HW_OPL3_FM801 0x0303 /* FM801 */
#define OPL3_HW_OPL3_CS4281 0x0304 /* CS4281 */ #define OPL3_HW_OPL3_CS4281 0x0304 /* CS4281 */
#define OPL3_HW_OPL3_PC98 0x0305 /* PC9800 */ #define OPL3_HW_OPL3_PC98 0x0305 /* PC9800 */
#define OPL3_HW_OPL4 0x0400 #define OPL3_HW_OPL4 0x0400 /* YMF278B/YMF295 */
#define OPL3_HW_OPL4_ML 0x0401 /* YMF704/YMF721 */
#define OPL3_HW_MASK 0xff00 #define OPL3_HW_MASK 0xff00
#define MAX_OPL2_VOICES 9 #define MAX_OPL2_VOICES 9
......
...@@ -98,12 +98,12 @@ struct _snd_wavefront { ...@@ -98,12 +98,12 @@ struct _snd_wavefront {
struct _snd_wavefront_card { struct _snd_wavefront_card {
snd_wavefront_t wavefront; snd_wavefront_t wavefront;
#ifdef __ISAPNP__ #ifdef CONFIG_PNP
struct isapnp_dev *wss; struct pnp_dev *wss;
struct isapnp_dev *ctrl; struct pnp_dev *ctrl;
struct isapnp_dev *mpu; struct pnp_dev *mpu;
struct isapnp_dev *synth; struct pnp_dev *synth;
#endif /* CONFIG_ISAPNP */ #endif /* CONFIG_PNP */
}; };
extern void snd_wavefront_internal_interrupt (snd_wavefront_card_t *card); extern void snd_wavefront_internal_interrupt (snd_wavefront_card_t *card);
......
...@@ -403,10 +403,6 @@ struct _snd_trident_pcm_mixer { ...@@ -403,10 +403,6 @@ struct _snd_trident_pcm_mixer {
unsigned char rvol; /* rear volume */ unsigned char rvol; /* rear volume */
unsigned char cvol; /* center volume */ unsigned char cvol; /* center volume */
unsigned char pad; unsigned char pad;
snd_kcontrol_t *ctl_vol; /* front volume */
snd_kcontrol_t *ctl_pan; /* pan */
snd_kcontrol_t *ctl_rvol; /* rear volume */
snd_kcontrol_t *ctl_cvol; /* center volume */
}; };
struct _snd_trident { struct _snd_trident {
...@@ -458,6 +454,10 @@ struct _snd_trident { ...@@ -458,6 +454,10 @@ struct _snd_trident {
unsigned int musicvol_wavevol; unsigned int musicvol_wavevol;
snd_trident_pcm_mixer_t pcm_mixer[32]; snd_trident_pcm_mixer_t pcm_mixer[32];
snd_kcontrol_t *ctl_vol; /* front volume */
snd_kcontrol_t *ctl_pan; /* pan */
snd_kcontrol_t *ctl_rvol; /* rear volume */
snd_kcontrol_t *ctl_cvol; /* center volume */
spinlock_t reg_lock; spinlock_t reg_lock;
......
...@@ -174,6 +174,28 @@ ...@@ -174,6 +174,28 @@
#define YDSXG_CAPTURE_VOICES 2 #define YDSXG_CAPTURE_VOICES 2
#define YDSXG_EFFECT_VOICES 5 #define YDSXG_EFFECT_VOICES 5
#define YMFPCI_LEGACY_SBEN (1 << 0) /* soundblaster enable */
#define YMFPCI_LEGACY_FMEN (1 << 1) /* OPL3 enable */
#define YMFPCI_LEGACY_JPEN (1 << 2) /* joystick enable */
#define YMFPCI_LEGACY_MEN (1 << 3) /* MPU401 enable */
#define YMFPCI_LEGACY_MIEN (1 << 4) /* MPU RX irq enable */
#define YMFPCI_LEGACY_IOBITS (1 << 5) /* i/o bits range, 0 = 16bit, 1 =10bit */
#define YMFPCI_LEGACY_SDMA (3 << 6) /* SB DMA select */
#define YMFPCI_LEGACY_SBIRQ (7 << 8) /* SB IRQ select */
#define YMFPCI_LEGACY_MPUIRQ (7 << 11) /* MPU IRQ select */
#define YMFPCI_LEGACY_SIEN (1 << 14) /* serialized IRQ */
#define YMFPCI_LEGACY_LAD (1 << 15) /* legacy audio disable */
#define YMFPCI_LEGACY2_FMIO (3 << 0) /* OPL3 i/o address (724/740) */
#define YMFPCI_LEGACY2_SBIO (3 << 2) /* SB i/o address (724/740) */
#define YMFPCI_LEGACY2_MPUIO (3 << 4) /* MPU401 i/o address (724/740) */
#define YMFPCI_LEGACY2_JSIO (3 << 6) /* joystick i/o address (724/740) */
#define YMFPCI_LEGACY2_MAIM (1 << 8) /* MPU401 ack intr mask */
#define YMFPCI_LEGACY2_SMOD (3 << 11) /* SB DMA mode */
#define YMFPCI_LEGACY2_SBVER (3 << 13) /* SB version select */
#define YMFPCI_LEGACY2_IMOD (1 << 15) /* legacy IRQ mode */
/* SIEN:IMOD 0:0 = legacy irq, 0:1 = INTA, 1:0 = serialized IRQ */
/* /*
* *
*/ */
...@@ -283,6 +305,8 @@ struct _snd_ymfpci { ...@@ -283,6 +305,8 @@ struct _snd_ymfpci {
unsigned long reg_area_phys; unsigned long reg_area_phys;
unsigned long reg_area_virt; unsigned long reg_area_virt;
struct resource *res_reg_area; struct resource *res_reg_area;
struct resource *fm_res;
struct resource *mpu_res;
unsigned short old_legacy_ctrl; unsigned short old_legacy_ctrl;
unsigned int joystick_port; unsigned int joystick_port;
......
...@@ -17,7 +17,7 @@ snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \ ...@@ -17,7 +17,7 @@ snd-pcm-objs := pcm.o pcm_native.o pcm_lib.o pcm_timer.o pcm_misc.o \
snd-page-alloc-objs := memalloc.o snd-page-alloc-objs := memalloc.o
ifeq ($(CONFIG_PCI),y) ifeq ($(CONFIG_PCI),y)
snd-page-alloc-objs += sgbuf.o memory_wrapper.o snd-page-alloc-objs += sgbuf.o
endif endif
snd-rawmidi-objs := rawmidi.o snd-rawmidi-objs := rawmidi.o
......
This diff is collapsed.
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/time.h> #include <linux/time.h>
...@@ -1032,6 +1033,7 @@ static void snd_info_device_fill_inode(struct inode *inode, int fill) ...@@ -1032,6 +1033,7 @@ static void snd_info_device_fill_inode(struct inode *inode, int fill)
static inline void snd_info_device_entry_prepare(struct proc_dir_entry *de, snd_info_entry_t *entry) static inline void snd_info_device_entry_prepare(struct proc_dir_entry *de, snd_info_entry_t *entry)
{ {
de->fill_inode = snd_info_device_fill_inode; de->fill_inode = snd_info_device_fill_inode;
de->ops = &snd_info_device_inode_operations;
} }
#else #else
static inline void snd_info_device_entry_prepare(struct proc_dir_entry *de, snd_info_entry_t *entry) static inline void snd_info_device_entry_prepare(struct proc_dir_entry *de, snd_info_entry_t *entry)
...@@ -1067,9 +1069,6 @@ snd_info_entry_t *snd_info_create_device(const char *name, unsigned int number, ...@@ -1067,9 +1069,6 @@ snd_info_entry_t *snd_info_create_device(const char *name, unsigned int number,
p = create_proc_entry(entry->name, entry->mode, snd_proc_dev); p = create_proc_entry(entry->name, entry->mode, snd_proc_dev);
if (p) { if (p) {
snd_info_device_entry_prepare(p, entry); snd_info_device_entry_prepare(p, entry);
#ifdef LINUX_2_2
p->ops = &snd_info_device_inode_operations;
#endif
} else { } else {
up(&info_mutex); up(&info_mutex);
snd_info_free_entry(entry); snd_info_free_entry(entry);
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/compat.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/pcm.h> #include <sound/pcm.h>
#include "ioctl32.h" #include "ioctl32.h"
...@@ -137,10 +136,15 @@ struct sndrv_pcm_channel_info32 { ...@@ -137,10 +136,15 @@ struct sndrv_pcm_channel_info32 {
COPY(step);\ COPY(step);\
} }
struct timeval32 {
s32 tv_sec;
s32 tv_usec;
} __attribute__((packed));
struct sndrv_pcm_status32 { struct sndrv_pcm_status32 {
s32 state; s32 state;
struct compat_timespec trigger_tstamp; struct timeval32 trigger_tstamp;
struct compat_timespec tstamp; struct timeval32 tstamp;
u32 appl_ptr; u32 appl_ptr;
u32 hw_ptr; u32 hw_ptr;
s32 delay; s32 delay;
...@@ -155,9 +159,9 @@ struct sndrv_pcm_status32 { ...@@ -155,9 +159,9 @@ struct sndrv_pcm_status32 {
{\ {\
COPY(state);\ COPY(state);\
COPY(trigger_tstamp.tv_sec);\ COPY(trigger_tstamp.tv_sec);\
COPY(trigger_tstamp.tv_nsec);\ COPY(trigger_tstamp.tv_usec);\
COPY(tstamp.tv_sec);\ COPY(tstamp.tv_sec);\
COPY(tstamp.tv_nsec);\ COPY(tstamp.tv_usec);\
COPY(appl_ptr);\ COPY(appl_ptr);\
COPY(hw_ptr);\ COPY(hw_ptr);\
COPY(delay);\ COPY(delay);\
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/compat.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/rawmidi.h> #include <sound/rawmidi.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -43,9 +42,14 @@ struct sndrv_rawmidi_params32 { ...@@ -43,9 +42,14 @@ struct sndrv_rawmidi_params32 {
COPY(no_active_sensing);\ COPY(no_active_sensing);\
} }
struct timeval32 {
s32 tv_sec;
s32 tv_usec;
} __attribute__((packed));
struct sndrv_rawmidi_status32 { struct sndrv_rawmidi_status32 {
s32 stream; s32 stream;
struct compat_timespec tstamp; struct timeval32 tstamp;
u32 avail; u32 avail;
u32 xruns; u32 xruns;
unsigned char reserved[16]; unsigned char reserved[16];
...@@ -55,7 +59,7 @@ struct sndrv_rawmidi_status32 { ...@@ -55,7 +59,7 @@ struct sndrv_rawmidi_status32 {
{\ {\
COPY(stream);\ COPY(stream);\
COPY(tstamp.tv_sec);\ COPY(tstamp.tv_sec);\
COPY(tstamp.tv_nsec);\ COPY(tstamp.tv_usec);\
COPY(avail);\ COPY(avail);\
COPY(xruns);\ COPY(xruns);\
} }
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/compat.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/timer.h> #include <sound/timer.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -32,7 +31,7 @@ struct sndrv_timer_info32 { ...@@ -32,7 +31,7 @@ struct sndrv_timer_info32 {
s32 card; s32 card;
unsigned char id[64]; unsigned char id[64];
unsigned char name[80]; unsigned char name[80];
u32 reserved0; u32 ticks;
u32 resolution; u32 resolution;
unsigned char reserved[64]; unsigned char reserved[64];
}; };
...@@ -43,11 +42,17 @@ struct sndrv_timer_info32 { ...@@ -43,11 +42,17 @@ struct sndrv_timer_info32 {
COPY(card);\ COPY(card);\
memcpy(dst->id, src->id, sizeof(src->id));\ memcpy(dst->id, src->id, sizeof(src->id));\
memcpy(dst->name, src->name, sizeof(src->name));\ memcpy(dst->name, src->name, sizeof(src->name));\
COPY(ticks);\
COPY(resolution);\ COPY(resolution);\
} }
struct timeval32 {
s32 tv_sec;
s32 tv_usec;
};
struct sndrv_timer_status32 { struct sndrv_timer_status32 {
struct compat_timespec tstamp; struct timeval32 tstamp;
u32 resolution; u32 resolution;
u32 lost; u32 lost;
u32 overrun; u32 overrun;
...@@ -58,7 +63,7 @@ struct sndrv_timer_status32 { ...@@ -58,7 +63,7 @@ struct sndrv_timer_status32 {
#define CVT_sndrv_timer_status()\ #define CVT_sndrv_timer_status()\
{\ {\
COPY(tstamp.tv_sec);\ COPY(tstamp.tv_sec);\
COPY(tstamp.tv_nsec);\ COPY(tstamp.tv_usec);\
COPY(resolution);\ COPY(resolution);\
COPY(lost);\ COPY(lost);\
COPY(overrun);\ COPY(overrun);\
......
...@@ -36,6 +36,20 @@ MODULE_DESCRIPTION("Memory allocator for ALSA system."); ...@@ -36,6 +36,20 @@ MODULE_DESCRIPTION("Memory allocator for ALSA system.");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* so far, pre-defined allocation is only for hammerfall cards... */
/* #define ENABLE_PREALLOC */
#ifdef ENABLE_PREALLOC
#ifndef SNDRV_CARDS
#define SNDRV_CARDS 8
#endif
static int enable[8] = {[0 ... (SNDRV_CARDS-1)] = 1};
MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable cards to allocate buffers.");
#endif
/* /*
*/ */
...@@ -50,6 +64,8 @@ struct snd_mem_list { ...@@ -50,6 +64,8 @@ struct snd_mem_list {
struct list_head list; struct list_head list;
}; };
/* id for pre-allocated buffers */
#define SNDRV_DMA_DEVICE_UNUSED (unsigned int)-1
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
#define __ASTRING__(x) #x #define __ASTRING__(x) #x
...@@ -63,23 +79,74 @@ struct snd_mem_list { ...@@ -63,23 +79,74 @@ struct snd_mem_list {
#define snd_assert(expr, args...) /**/ #define snd_assert(expr, args...) /**/
#endif #endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
#ifdef CONFIG_PCI
#if defined(__i386__) || defined(__ppc__) || defined(__x86_64__)
#define HACK_PCI_ALLOC_CONSISTENT
/*
* A hack to allocate large buffers via pci_alloc_consistent()
*
* since pci_alloc_consistent always tries GFP_DMA when the requested
* pci memory region is below 32bit, it happens quite often that even
* 2 order of pages cannot be allocated.
*
* so in the following, we allocate at first without dma_mask, so that
* allocation will be done without GFP_DMA. if the area doesn't match
* with the requested region, then realloate with the original dma_mask
* again.
*/
void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,
dma_addr_t *dma_handle)
{
void *ret;
u64 dma_mask;
unsigned long rmask;
if (hwdev == NULL)
return pci_alloc_consistent(hwdev, size, dma_handle);
dma_mask = hwdev->dma_mask;
rmask = ~((unsigned long)dma_mask);
hwdev->dma_mask = 0xffffffff; /* do without masking */
ret = pci_alloc_consistent(hwdev, size, dma_handle);
hwdev->dma_mask = dma_mask; /* restore */
if (ret) {
/* obtained address is out of range? */
if (((unsigned long)*dma_handle + size - 1) & rmask) {
/* reallocate with the proper mask */
pci_free_consistent(hwdev, size, ret, *dma_handle);
ret = pci_alloc_consistent(hwdev, size, dma_handle);
}
} else {
/* wish to success now with the proper mask... */
if (dma_mask != 0xffffffff)
ret = pci_alloc_consistent(hwdev, size, dma_handle);
}
return ret;
}
/* redefine pci_alloc_consistent for some architectures */ /* redefine pci_alloc_consistent for some architectures */
#ifdef HACK_PCI_ALLOC_CONSISTENT
#undef pci_alloc_consistent #undef pci_alloc_consistent
#define pci_alloc_consistent snd_pci_hack_alloc_consistent #define pci_alloc_consistent snd_pci_hack_alloc_consistent
#endif
#endif /* arch */
#endif /* CONFIG_PCI */
#endif /* LINUX >= 2.4.0 */
/* /*
* compare the two devices * compare the two devices
* returns non-zero if matched. * returns non-zero if matched.
*/ */
static int compare_device(const struct snd_dma_device *a, const struct snd_dma_device *b) static int compare_device(const struct snd_dma_device *a, const struct snd_dma_device *b, int allow_unused)
{ {
if (a->type != b->type) if (a->type != b->type)
return 0; return 0;
if (a->id != b->id) if (a->id != b->id) {
if (! allow_unused || (a->id != SNDRV_DMA_DEVICE_UNUSED && b->id != SNDRV_DMA_DEVICE_UNUSED))
return 0; return 0;
}
switch (a->type) { switch (a->type) {
case SNDRV_DMA_TYPE_CONTINUOUS: case SNDRV_DMA_TYPE_CONTINUOUS:
#ifdef CONFIG_ISA #ifdef CONFIG_ISA
...@@ -138,7 +205,7 @@ int snd_dma_alloc_pages(const struct snd_dma_device *dev, size_t size, ...@@ -138,7 +205,7 @@ int snd_dma_alloc_pages(const struct snd_dma_device *dev, size_t size,
#endif #endif
#ifdef CONFIG_SBUS #ifdef CONFIG_SBUS
case SNDRV_DMA_TYPE_SBUS: case SNDRV_DMA_TYPE_SBUS:
dmab->area = snd_malloc_sbus_pages(dev->dev.sbus, size, &dmab->addr); dmab->area = snd_malloc_pci_pages(dev->dev.sbus, size, &dmab->addr);
break; break;
#endif #endif
default: default:
...@@ -181,7 +248,7 @@ void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer ...@@ -181,7 +248,7 @@ void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer
#endif #endif
#ifdef CONFIG_SBUS #ifdef CONFIG_SBUS
case SNDRV_DMA_TYPE_SBUS: case SNDRV_DMA_TYPE_SBUS:
snd_free_sbus_pages(dev->dev.sbus, dmab->bytes, dmab->area, dmab->addr); snd_free_sbus_pages(dev->dev.sbus, dmab->size, dmab->are, dmab->addr);
break; break;
#endif #endif
default: default:
...@@ -193,14 +260,14 @@ void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer ...@@ -193,14 +260,14 @@ void snd_dma_free_pages(const struct snd_dma_device *dev, struct snd_dma_buffer
/* /*
* search for the device * search for the device
*/ */
static struct snd_mem_list *mem_list_find(const struct snd_dma_device *dev) static struct snd_mem_list *mem_list_find(const struct snd_dma_device *dev, int allow_unused)
{ {
struct list_head *p; struct list_head *p;
struct snd_mem_list *mem; struct snd_mem_list *mem;
list_for_each(p, &mem_list_head) { list_for_each(p, &mem_list_head) {
mem = list_entry(p, struct snd_mem_list, list); mem = list_entry(p, struct snd_mem_list, list);
if (compare_device(&mem->dev, dev)) if (compare_device(&mem->dev, dev, allow_unused))
return mem; return mem;
} }
return NULL; return NULL;
...@@ -224,9 +291,10 @@ size_t snd_dma_get_reserved(const struct snd_dma_device *dev, struct snd_dma_buf ...@@ -224,9 +291,10 @@ size_t snd_dma_get_reserved(const struct snd_dma_device *dev, struct snd_dma_buf
snd_assert(dev && dmab, return 0); snd_assert(dev && dmab, return 0);
down(&list_mutex); down(&list_mutex);
mem = mem_list_find(dev); mem = mem_list_find(dev, 1);
if (mem) { if (mem) {
mem->used = 1; mem->used = 1;
mem->dev = *dev;
*dmab = mem->buffer; *dmab = mem->buffer;
up(&list_mutex); up(&list_mutex);
return dmab->bytes; return dmab->bytes;
...@@ -250,7 +318,7 @@ int snd_dma_free_reserved(const struct snd_dma_device *dev) ...@@ -250,7 +318,7 @@ int snd_dma_free_reserved(const struct snd_dma_device *dev)
snd_assert(dev, return -EINVAL); snd_assert(dev, return -EINVAL);
down(&list_mutex); down(&list_mutex);
mem = mem_list_find(dev); mem = mem_list_find(dev, 0);
if (mem) if (mem)
mem->used = 0; mem->used = 0;
up(&list_mutex); up(&list_mutex);
...@@ -277,7 +345,7 @@ int snd_dma_set_reserved(const struct snd_dma_device *dev, struct snd_dma_buffer ...@@ -277,7 +345,7 @@ int snd_dma_set_reserved(const struct snd_dma_device *dev, struct snd_dma_buffer
snd_assert(dev, return -EINVAL); snd_assert(dev, return -EINVAL);
down(&list_mutex); down(&list_mutex);
mem = mem_list_find(dev); mem = mem_list_find(dev, 0);
if (mem) { if (mem) {
snd_dma_free_pages(dev, &mem->buffer); snd_dma_free_pages(dev, &mem->buffer);
if (! dmab || ! dmab->bytes) { if (! dmab || ! dmab->bytes) {
...@@ -293,6 +361,10 @@ int snd_dma_set_reserved(const struct snd_dma_device *dev, struct snd_dma_buffer ...@@ -293,6 +361,10 @@ int snd_dma_set_reserved(const struct snd_dma_device *dev, struct snd_dma_buffer
return 0; return 0;
} }
mem = kmalloc(sizeof(*mem), GFP_KERNEL); mem = kmalloc(sizeof(*mem), GFP_KERNEL);
if (! mem) {
up(&list_mutex);
return -ENOMEM;
}
mem->dev = *dev; mem->dev = *dev;
list_add(&mem->list, &mem_list_head); list_add(&mem->list, &mem_list_head);
} }
...@@ -712,6 +784,85 @@ void snd_free_sbus_pages(struct sbus_dev *sdev, ...@@ -712,6 +784,85 @@ void snd_free_sbus_pages(struct sbus_dev *sdev,
#endif /* CONFIG_SBUS */ #endif /* CONFIG_SBUS */
#ifdef ENABLE_PREALLOC
/*
* allocation of buffers for pre-defined devices
*/
/* FIXME: for pci only - other bus? */
struct prealloc_dev {
unsigned short vendor;
unsigned short device;
unsigned long dma_mask;
unsigned int size;
unsigned int buffers;
};
#define HAMMERFALL_BUFFER_SIZE (16*1024*4*(26+1))
static struct prealloc_dev prealloc_devices[] __initdata = {
{
/* hammerfall */
.vendor = 0x10ee,
.device = 0x3fc4,
.dma_mask = 0xffffffff,
.size = HAMMERFALL_BUFFER_SIZE,
.buffers = 2
},
{
/* HDSP */
.vendor = 0x10ee,
.device = 0x3fc5,
.dma_mask = 0xffffffff,
.size = HAMMERFALL_BUFFER_SIZE,
.buffers = 2
},
{ }, /* terminator */
};
static void __init preallocate_cards(void)
{
struct pci_dev *pci;
int card;
card = 0;
pci_for_each_dev(pci) {
struct prealloc_dev *dev;
if (card >= SNDRV_CARDS)
break;
for (dev = prealloc_devices; dev->vendor; dev++) {
unsigned int i;
if (dev->vendor != pci->vendor || dev->device != pci->device)
continue;
if (! enable[card++])
continue;
if (pci_set_dma_mask(pci, dev->dma_mask) < 0) {
printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", dev->dma_mask, dev->vendor, dev->device);
continue;
}
for (i = 0; i < dev->buffers; i++) {
struct snd_dma_device dma;
struct snd_dma_buffer buf;
snd_dma_device_pci(&dma, pci, SNDRV_DMA_DEVICE_UNUSED);
memset(&buf, 0, sizeof(buf));
snd_dma_alloc_pages(&dma, dev->size, &buf);
if (buf.bytes) {
if (snd_dma_set_reserved(&dma, &buf) < 0) {
printk(KERN_WARNING "snd-page-alloc: cannot reserve buffer\n");
snd_dma_free_pages(&dma, &buf);
}
} else
printk(KERN_WARNING "snd-page-alloc: cannot allocate buffer pages (size = %d)\n", dev->size);
}
}
}
}
#endif
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
/* /*
* proc file interface * proc file interface
...@@ -735,6 +886,9 @@ static int snd_mem_proc_read(char *page, char **start, off_t off, ...@@ -735,6 +886,9 @@ static int snd_mem_proc_read(char *page, char **start, off_t off,
static int __init snd_mem_init(void) static int __init snd_mem_init(void)
{ {
create_proc_read_entry("driver/snd-page-alloc", 0, 0, snd_mem_proc_read, NULL); create_proc_read_entry("driver/snd-page-alloc", 0, 0, snd_mem_proc_read, NULL);
#ifdef ENABLE_PREALLOC
preallocate_cards();
#endif
return 0; return 0;
} }
...@@ -774,9 +928,6 @@ EXPORT_SYMBOL(snd_malloc_pci_page); ...@@ -774,9 +928,6 @@ EXPORT_SYMBOL(snd_malloc_pci_page);
EXPORT_SYMBOL(snd_free_pci_pages); EXPORT_SYMBOL(snd_free_pci_pages);
EXPORT_SYMBOL(snd_malloc_sgbuf_pages); EXPORT_SYMBOL(snd_malloc_sgbuf_pages);
EXPORT_SYMBOL(snd_free_sgbuf_pages); EXPORT_SYMBOL(snd_free_sgbuf_pages);
#ifdef HACK_PCI_ALLOC_CONSISTENT
EXPORT_SYMBOL(snd_pci_hack_alloc_consistent);
#endif
#endif #endif
#ifdef CONFIG_SBUS #ifdef CONFIG_SBUS
EXPORT_SYMBOL(snd_malloc_sbus_pages); EXPORT_SYMBOL(snd_malloc_sbus_pages);
......
/*
* Copyright (c) by Jaroslav Kysela <perex@suse.cz>
* Takashi Iwai <tiwai@suse.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <linux/config.h>
#include <linux/pci.h>
#include <sound/memalloc.h>
#ifdef HACK_PCI_ALLOC_CONSISTENT
/*
* A dirty hack... when the kernel code is fixed this should be removed.
*
* since pci_alloc_consistent always tries GFP_DMA when the requested
* pci memory region is below 32bit, it happens quite often that even
* 2 order of pages cannot be allocated.
*
* so in the following, we allocate at first without dma_mask, so that
* allocation will be done without GFP_DMA. if the area doesn't match
* with the requested region, then realloate with the original dma_mask
* again.
*/
void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,
dma_addr_t *dma_handle)
{
void *ret;
u64 dma_mask;
unsigned long rmask;
if (hwdev == NULL)
return pci_alloc_consistent(hwdev, size, dma_handle);
dma_mask = hwdev->dma_mask;
rmask = ~((unsigned long)dma_mask);
hwdev->dma_mask = 0xffffffff; /* do without masking */
ret = pci_alloc_consistent(hwdev, size, dma_handle);
hwdev->dma_mask = dma_mask; /* restore */
if (ret) {
/* obtained address is out of range? */
if (((unsigned long)*dma_handle + size - 1) & rmask) {
/* reallocate with the proper mask */
pci_free_consistent(hwdev, size, ret, *dma_handle);
ret = pci_alloc_consistent(hwdev, size, dma_handle);
}
} else {
/* wish to success now with the proper mask... */
if (dma_mask != 0xffffffff)
ret = pci_alloc_consistent(hwdev, size, dma_handle);
}
return ret;
}
#endif /* HACK_PCI_ALLOC_CONSISTENT */
...@@ -204,6 +204,8 @@ static int snd_mixer_oss_get_recsrc(snd_mixer_oss_file_t *fmixer) ...@@ -204,6 +204,8 @@ static int snd_mixer_oss_get_recsrc(snd_mixer_oss_file_t *fmixer)
static int snd_mixer_oss_set_recsrc(snd_mixer_oss_file_t *fmixer, int recsrc) static int snd_mixer_oss_set_recsrc(snd_mixer_oss_file_t *fmixer, int recsrc)
{ {
snd_mixer_oss_t *mixer = fmixer->mixer; snd_mixer_oss_t *mixer = fmixer->mixer;
snd_mixer_oss_slot_t *pslot;
int chn, active;
int result = 0; int result = 0;
if (mixer == NULL) if (mixer == NULL)
...@@ -214,9 +216,7 @@ static int snd_mixer_oss_set_recsrc(snd_mixer_oss_file_t *fmixer, int recsrc) ...@@ -214,9 +216,7 @@ static int snd_mixer_oss_set_recsrc(snd_mixer_oss_file_t *fmixer, int recsrc)
mixer->put_recsrc(fmixer, ffz(~recsrc)); mixer->put_recsrc(fmixer, ffz(~recsrc));
mixer->get_recsrc(fmixer, &result); mixer->get_recsrc(fmixer, &result);
result = 1 << result; result = 1 << result;
} else { }
snd_mixer_oss_slot_t *pslot;
int chn, active;
for (chn = 0; chn < 31; chn++) { for (chn = 0; chn < 31; chn++) {
pslot = &mixer->slots[chn]; pslot = &mixer->slots[chn];
if (pslot->put_recsrc) { if (pslot->put_recsrc) {
...@@ -224,6 +224,7 @@ static int snd_mixer_oss_set_recsrc(snd_mixer_oss_file_t *fmixer, int recsrc) ...@@ -224,6 +224,7 @@ static int snd_mixer_oss_set_recsrc(snd_mixer_oss_file_t *fmixer, int recsrc)
pslot->put_recsrc(fmixer, pslot, active); pslot->put_recsrc(fmixer, pslot, active);
} }
} }
if (! result) {
for (chn = 0; chn < 31; chn++) { for (chn = 0; chn < 31; chn++) {
pslot = &mixer->slots[chn]; pslot = &mixer->slots[chn];
if (pslot->get_recsrc) { if (pslot->get_recsrc) {
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#endif #endif
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/time.h> #include <linux/time.h>
...@@ -930,8 +931,8 @@ static int snd_pcm_oss_set_rate(snd_pcm_oss_file_t *pcm_oss_file, int rate) ...@@ -930,8 +931,8 @@ static int snd_pcm_oss_set_rate(snd_pcm_oss_file_t *pcm_oss_file, int rate)
runtime = substream->runtime; runtime = substream->runtime;
if (rate < 1000) if (rate < 1000)
rate = 1000; rate = 1000;
else if (rate > 48000) else if (rate > 192000)
rate = 48000; rate = 192000;
if (runtime->oss.rate != rate) { if (runtime->oss.rate != rate) {
runtime->oss.params = 1; runtime->oss.params = 1;
runtime->oss.rate = rate; runtime->oss.rate = rate;
......
...@@ -1711,7 +1711,7 @@ int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, ...@@ -1711,7 +1711,7 @@ int snd_pcm_hw_param_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
* snd_pcm_hw_param_choose * snd_pcm_hw_param_choose
* *
* Choose one configuration from configuration space defined by PARAMS * Choose one configuration from configuration space defined by PARAMS
* The configuration choosen is that obtained fixing in this order: * The configuration chosen is that obtained fixing in this order:
* first access, first format, first subformat, min channels, * first access, first format, first subformat, min channels,
* min rate, min period time, max buffer size, min tick time * min rate, min period time, max buffer size, min tick time
*/ */
...@@ -2119,6 +2119,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream, ...@@ -2119,6 +2119,7 @@ static snd_pcm_sframes_t snd_pcm_lib_write1(snd_pcm_substream_t *substream,
spin_lock_irq(&runtime->lock); spin_lock_irq(&runtime->lock);
switch (runtime->status->state) { switch (runtime->status->state) {
case SNDRV_PCM_STATE_XRUN: case SNDRV_PCM_STATE_XRUN:
case SNDRV_PCM_STATE_DRAINING:
state = ERROR; state = ERROR;
goto _end_loop; goto _end_loop;
case SNDRV_PCM_STATE_SUSPENDED: case SNDRV_PCM_STATE_SUSPENDED:
...@@ -2377,6 +2378,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void ...@@ -2377,6 +2378,7 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void
snd_pcm_uframes_t cont; snd_pcm_uframes_t cont;
if (runtime->sleep_min == 0 && runtime->status->state == SNDRV_PCM_STATE_RUNNING) if (runtime->sleep_min == 0 && runtime->status->state == SNDRV_PCM_STATE_RUNNING)
snd_pcm_update_hw_ptr(substream); snd_pcm_update_hw_ptr(substream);
__draining:
avail = snd_pcm_capture_avail(runtime); avail = snd_pcm_capture_avail(runtime);
if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) { if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {
if (avail < runtime->xfer_align) { if (avail < runtime->xfer_align) {
...@@ -2418,6 +2420,8 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void ...@@ -2418,6 +2420,8 @@ static snd_pcm_sframes_t snd_pcm_lib_read1(snd_pcm_substream_t *substream, void
case SNDRV_PCM_STATE_SUSPENDED: case SNDRV_PCM_STATE_SUSPENDED:
state = SUSPENDED; state = SUSPENDED;
goto _end_loop; goto _end_loop;
case SNDRV_PCM_STATE_DRAINING:
goto __draining;
default: default:
break; break;
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/version.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -31,11 +31,7 @@ ...@@ -31,11 +31,7 @@
#if defined(CONFIG_RTC) || defined(CONFIG_RTC_MODULE) #if defined(CONFIG_RTC) || defined(CONFIG_RTC_MODULE)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 12) /* FIXME: which 2.2.x kernel? */
#include <linux/rtc.h>
#else
#include <linux/mc146818rtc.h> #include <linux/mc146818rtc.h>
#endif
#define RTC_FREQ 1024 /* default frequency */ #define RTC_FREQ 1024 /* default frequency */
#define NANO_SEC 1000000000L /* 10^9 in sec */ #define NANO_SEC 1000000000L /* 10^9 in sec */
......
...@@ -78,7 +78,7 @@ static int snd_seq_iwffff_copy_env_from_stream(__u32 req_stype, ...@@ -78,7 +78,7 @@ static int snd_seq_iwffff_copy_env_from_stream(__u32 req_stype,
while (1) { while (1) {
if (*len < (long)sizeof(__u32)) if (*len < (long)sizeof(__u32))
return -EINVAL; return -EINVAL;
if (copy_from_user(&stype, data, sizeof(stype))) if (copy_from_user(&stype, *data, sizeof(stype)))
return -EFAULT; return -EFAULT;
if (stype == IWFFFF_STRU_WAVE) if (stype == IWFFFF_STRU_WAVE)
return 0; return 0;
......
...@@ -593,6 +593,7 @@ send_synth_event(seq_oss_devinfo_t *dp, snd_seq_event_t *ev, int dev) ...@@ -593,6 +593,7 @@ send_synth_event(seq_oss_devinfo_t *dp, snd_seq_event_t *ev, int dev)
break; break;
} }
snd_seq_oss_readq_put_timestamp(dp->readq, ev->time.tick, dp->seq_mode);
snd_seq_oss_readq_put_event(dp->readq, &ossev); snd_seq_oss_readq_put_event(dp->readq, &ossev);
return 0; return 0;
......
...@@ -235,14 +235,14 @@ int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock, ...@@ -235,14 +235,14 @@ int snd_seq_cell_alloc(pool_t *pool, snd_seq_event_cell_t **cellp, int nonblock,
while (pool->free == NULL && ! nonblock && ! pool->closing) { while (pool->free == NULL && ! nonblock && ! pool->closing) {
spin_unlock(&pool->lock); spin_unlock(&pool->lock);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0) #ifdef LINUX_2_2
/* change semaphore to allow other clients /* change semaphore to allow other clients
to access device file */ to access device file */
if (file) if (file)
up(&semaphore_of(file)); up(&semaphore_of(file));
#endif #endif
interruptible_sleep_on(&pool->output_sleep); interruptible_sleep_on(&pool->output_sleep);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0) #ifdef LINUX_2_2
/* restore semaphore again */ /* restore semaphore again */
if (file) if (file)
down(&semaphore_of(file)); down(&semaphore_of(file));
......
...@@ -200,6 +200,7 @@ static int midisynth_subscribe(void *private_data, snd_seq_port_subscribe_t *inf ...@@ -200,6 +200,7 @@ static int midisynth_subscribe(void *private_data, snd_seq_port_subscribe_t *inf
snd_rawmidi_kernel_release(&msynth->input_rfile); snd_rawmidi_kernel_release(&msynth->input_rfile);
return err; return err;
} }
snd_midi_event_reset_encode(msynth->parser);
runtime->event = snd_midi_input_event; runtime->event = snd_midi_input_event;
runtime->private_data = msynth; runtime->private_data = msynth;
snd_rawmidi_kernel_read(msynth->input_rfile.input, NULL, 0); snd_rawmidi_kernel_read(msynth->input_rfile.input, NULL, 0);
...@@ -236,6 +237,7 @@ static int midisynth_use(void *private_data, snd_seq_port_subscribe_t *info) ...@@ -236,6 +237,7 @@ static int midisynth_use(void *private_data, snd_seq_port_subscribe_t *info)
snd_rawmidi_kernel_release(&msynth->output_rfile); snd_rawmidi_kernel_release(&msynth->output_rfile);
return err; return err;
} }
snd_midi_event_reset_decode(msynth->parser);
return 0; return 0;
} }
......
...@@ -561,7 +561,7 @@ sysex(snd_midi_op_t *ops, void *private, unsigned char *buf, int len, snd_midi_c ...@@ -561,7 +561,7 @@ sysex(snd_midi_op_t *ops, void *private, unsigned char *buf, int len, snd_midi_c
} else if (buf[5] == 0x00 && buf[6] == 0x04) { } else if (buf[5] == 0x00 && buf[6] == 0x04) {
/* master volume */ /* master volume */
parsed = SNDRV_MIDI_SYSEX_GS_REVERB_MODE; parsed = SNDRV_MIDI_SYSEX_GS_MASTER_VOLUME;
chset->gs_master_volume = buf[7]; chset->gs_master_volume = buf[7];
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/version.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/time.h> #include <linux/time.h>
...@@ -345,6 +346,8 @@ static int __init alsa_sound_init(void) ...@@ -345,6 +346,8 @@ static int __init alsa_sound_init(void)
#ifdef CONFIG_DEVFS_FS #ifdef CONFIG_DEVFS_FS
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
devfs_handle = devfs_mk_dir(NULL, "snd", 3, NULL); devfs_handle = devfs_mk_dir(NULL, "snd", 3, NULL);
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,5,67)
devfs_handle = devfs_mk_dir(NULL, "snd", NULL);
#else #else
devfs_handle = devfs_mk_dir("snd"); devfs_handle = devfs_mk_dir("snd");
#endif #endif
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
#include <linux/jiffies.h> #include <linux/jiffies.h>
......
...@@ -470,7 +470,7 @@ int snd_opl3_create(snd_card_t * card, ...@@ -470,7 +470,7 @@ int snd_opl3_create(snd_card_t * card,
case OPL3_HW_OPL4: case OPL3_HW_OPL4:
opl3->max_voices = MAX_OPL3_VOICES; opl3->max_voices = MAX_OPL3_VOICES;
snd_assert(opl3->r_port != 0, snd_opl3_free(opl3); return -ENODEV); snd_assert(opl3->r_port != 0, snd_opl3_free(opl3); return -ENODEV);
opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, 0x00); /* Enter OPL2 mode */ opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, OPL3_OPL3_ENABLE); /* Enter OPL3 mode */
} }
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, opl3, &ops)) < 0) { if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, opl3, &ops)) < 0) {
snd_opl3_free(opl3); snd_opl3_free(opl3);
......
...@@ -70,8 +70,6 @@ int snd_opl3_synth_setup(opl3_t * opl3) ...@@ -70,8 +70,6 @@ int snd_opl3_synth_setup(opl3_t * opl3)
opl3->use_time = 0; opl3->use_time = 0;
opl3->connection_reg = 0x00; opl3->connection_reg = 0x00;
if (opl3->hardware >= OPL3_HW_OPL3) { if (opl3->hardware >= OPL3_HW_OPL3) {
/* Enter OPL3 mode */
opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, OPL3_OPL3_ENABLE);
/* Clear 4-op connections */ /* Clear 4-op connections */
opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT,
opl3->connection_reg); opl3->connection_reg);
...@@ -197,7 +195,7 @@ static int snd_opl3_synth_create_port(opl3_t * opl3) ...@@ -197,7 +195,7 @@ static int snd_opl3_synth_create_port(opl3_t * opl3)
callbacks.private_data = opl3; callbacks.private_data = opl3;
opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8; opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
sprintf(name, "OPL%i Port", opl_ver); sprintf(name, "OPL%i FM Port", opl_ver);
opl3->chset->client = opl3->seq_client; opl3->chset->client = opl3->seq_client;
opl3->chset->port = snd_seq_event_port_attach(opl3->seq_client, &callbacks, opl3->chset->port = snd_seq_event_port_attach(opl3->seq_client, &callbacks,
......
...@@ -220,9 +220,6 @@ void snd_opl3_reset(opl3_t * opl3) ...@@ -220,9 +220,6 @@ void snd_opl3_reset(opl3_t * opl3)
opl3->command(opl3, opl3_reg, 0x00); /* Note off */ opl3->command(opl3, opl3_reg, 0x00); /* Note off */
} }
if (opl3->hardware >= OPL3_HW_OPL3)
opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, 0x00); /* Enter OPL2 mode */
opl3->max_voices = MAX_OPL2_VOICES; opl3->max_voices = MAX_OPL2_VOICES;
opl3->fm_mode = SNDRV_DM_FM_MODE_OPL2; opl3->fm_mode = SNDRV_DM_FM_MODE_OPL2;
...@@ -426,14 +423,9 @@ static int snd_opl3_set_mode(opl3_t * opl3, int mode) ...@@ -426,14 +423,9 @@ static int snd_opl3_set_mode(opl3_t * opl3, int mode)
if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3)) if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3))
return -EINVAL; return -EINVAL;
if (mode == SNDRV_DM_FM_MODE_OPL3) { opl3->fm_mode = mode;
opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, OPL3_OPL3_ENABLE); /* Enter OPL3 mode */ if (opl3->hardware >= OPL3_HW_OPL3)
opl3->fm_mode = SNDRV_DM_FM_MODE_OPL3;
opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, 0x00); /* Clear 4-op connections */ opl3->command(opl3, OPL3_RIGHT | OPL3_REG_CONNECTION_SELECT, 0x00); /* Clear 4-op connections */
} else {
opl3->command(opl3, OPL3_RIGHT | OPL3_REG_MODE, 0x00); /* Enter OPL2 mode */
opl3->fm_mode = SNDRV_DM_FM_MODE_OPL2;
}
return 0; return 0;
} }
......
...@@ -425,7 +425,7 @@ int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active) ...@@ -425,7 +425,7 @@ int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active)
chip = snd_magic_cast(cs8427_t, cs8427->private_data, return -ENXIO); chip = snd_magic_cast(cs8427_t, cs8427->private_data, return -ENXIO);
if (active) if (active)
memcpy(chip->playback.pcm_status, chip->playback.def_status, 24); memcpy(chip->playback.pcm_status, chip->playback.def_status, 24);
chip->playback.pcm_ctl->access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE; chip->playback.pcm_ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
snd_ctl_notify(cs8427->bus->card, SNDRV_CTL_EVENT_MASK_VALUE | snd_ctl_notify(cs8427->bus->card, SNDRV_CTL_EVENT_MASK_VALUE |
SNDRV_CTL_EVENT_MASK_INFO, &chip->playback.pcm_ctl->id); SNDRV_CTL_EVENT_MASK_INFO, &chip->playback.pcm_ctl->id);
return 0; return 0;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* 2002-05-12 Tomas Kasparek another code cleanup * 2002-05-12 Tomas Kasparek another code cleanup
*/ */
/* $Id: uda1341.c,v 1.7 2003/02/13 19:19:19 perex Exp $ */ /* $Id: uda1341.c,v 1.8 2003/03/20 16:45:59 perex Exp $ */
#include <sound/driver.h> #include <sound/driver.h>
#include <linux/module.h> #include <linux/module.h>
......
...@@ -41,9 +41,10 @@ config SND_CS4236 ...@@ -41,9 +41,10 @@ config SND_CS4236
config SND_PC98_CS4232 config SND_PC98_CS4232
tristate "NEC PC9800 CS4232 driver" tristate "NEC PC9800 CS4232 driver"
depends on SND depends on SND && PC9800
help help
Say 'Y' or 'M' to include support for NEC PC-9801/PC-9821 sound cards Say 'Y' or 'M' to include support for NEC PC-9801/PC-9821 on-board
soundchip based on CS4232.
config SND_ES968 config SND_ES968
tristate "Generic ESS ES968 driver" tristate "Generic ESS ES968 driver"
......
This diff is collapsed.
...@@ -100,15 +100,15 @@ struct snd_card_als100 { ...@@ -100,15 +100,15 @@ struct snd_card_als100 {
static struct pnp_card_device_id snd_als100_pnpids[] __devinitdata = { static struct pnp_card_device_id snd_als100_pnpids[] __devinitdata = {
/* ALS100 - PRO16PNP */ /* ALS100 - PRO16PNP */
{ .id = "ALS0001", .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" }, } }, { .id = "ALS0001", .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } } },
/* ALS110 - MF1000 - Digimate 3D Sound */ /* ALS110 - MF1000 - Digimate 3D Sound */
{ .id = "ALS0110", .devs = { { "@@@1001" }, { "@X@1001" }, { "@H@1001" }, } }, { .id = "ALS0110", .devs = { { "@@@1001" }, { "@X@1001" }, { "@H@1001" } } },
/* ALS120 */ /* ALS120 */
{ .id = "ALS0120", .devs = { { "@@@2001" }, { "@X@2001" }, { "@H@2001" }, } }, { .id = "ALS0120", .devs = { { "@@@2001" }, { "@X@2001" }, { "@H@2001" } } },
/* ALS200 */ /* ALS200 */
{ .id = "ALS0200", .devs = { { "@@@0020" }, { "@X@0020" }, { "@H@0001" }, } }, { .id = "ALS0200", .devs = { { "@@@0020" }, { "@X@0020" }, { "@H@0001" } } },
/* RTL3000 */ /* RTL3000 */
{ .id = "RTL3000", .devs = { { "@@@2001" }, { "@X@2001" }, { "@H@2001" }, } }, { .id = "RTL3000", .devs = { { "@@@2001" }, { "@X@2001" }, { "@H@2001" } } },
{ .id = "", } /* end */ { .id = "", } /* end */
}; };
...@@ -116,13 +116,14 @@ MODULE_DEVICE_TABLE(pnp_card, snd_als100_pnpids); ...@@ -116,13 +116,14 @@ MODULE_DEVICE_TABLE(pnp_card, snd_als100_pnpids);
#define DRIVER_NAME "snd-card-als100" #define DRIVER_NAME "snd-card-als100"
static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *acard, static int __devinit snd_card_als100_pnp(int dev, struct snd_card_als100 *acard,
struct pnp_card_link *card, struct pnp_card_link *card,
const struct pnp_card_device_id *id) const struct pnp_card_device_id *id)
{ {
struct pnp_dev *pdev; struct pnp_dev *pdev;
struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
int err; int err;
if (!cfg) if (!cfg)
return -ENOMEM; return -ENOMEM;
acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
...@@ -146,11 +147,11 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca ...@@ -146,11 +147,11 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca
pnp_resource_change(&cfg->dma_resource[1], dma16[dev], 1); pnp_resource_change(&cfg->dma_resource[1], dma16[dev], 1);
if (irq[dev] != SNDRV_AUTO_IRQ) if (irq[dev] != SNDRV_AUTO_IRQ)
pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
printk(KERN_ERR PFX "AUDIO pnp configure failure\n"); snd_printk(KERN_ERR PFX "AUDIO pnp configure failure\n");
kfree(cfg); kfree(cfg);
return err; return err;
} }
...@@ -167,7 +168,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca ...@@ -167,7 +168,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca
if (mpu_irq[dev] != SNDRV_AUTO_IRQ) if (mpu_irq[dev] != SNDRV_AUTO_IRQ)
pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1); pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "MPU401 the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "MPU401 the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) if (err < 0)
goto __mpu_error; goto __mpu_error;
...@@ -177,7 +178,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca ...@@ -177,7 +178,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca
__mpu_error: __mpu_error:
if (pdev) { if (pdev) {
pnp_release_card_device(pdev); pnp_release_card_device(pdev);
printk(KERN_ERR PFX "MPU401 pnp configure failure, skipping\n"); snd_printk(KERN_ERR PFX "MPU401 pnp configure failure, skipping\n");
} }
acard->devmpu = NULL; acard->devmpu = NULL;
mpu_port[dev] = -1; mpu_port[dev] = -1;
...@@ -189,7 +190,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca ...@@ -189,7 +190,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca
if (fm_port[dev] != SNDRV_AUTO_PORT) if (fm_port[dev] != SNDRV_AUTO_PORT)
pnp_resource_change(&cfg->port_resource[0], fm_port[dev], 4); pnp_resource_change(&cfg->port_resource[0], fm_port[dev], 4);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "OPL3 the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "OPL3 the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) if (err < 0)
goto __fm_error; goto __fm_error;
...@@ -198,7 +199,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca ...@@ -198,7 +199,7 @@ static int __devinit snd_card_als100_isapnp(int dev, struct snd_card_als100 *aca
__fm_error: __fm_error:
if (pdev) { if (pdev) {
pnp_release_card_device(pdev); pnp_release_card_device(pdev);
printk(KERN_ERR PFX "OPL3 pnp configure failure, skipping\n"); snd_printk(KERN_ERR PFX "OPL3 pnp configure failure, skipping\n");
} }
acard->devopl = NULL; acard->devopl = NULL;
fm_port[dev] = -1; fm_port[dev] = -1;
...@@ -223,7 +224,7 @@ static int __init snd_card_als100_probe(int dev, ...@@ -223,7 +224,7 @@ static int __init snd_card_als100_probe(int dev,
return -ENOMEM; return -ENOMEM;
acard = (struct snd_card_als100 *)card->private_data; acard = (struct snd_card_als100 *)card->private_data;
if ((error = snd_card_als100_isapnp(dev, acard, pcard, pid))) { if ((error = snd_card_als100_pnp(dev, acard, pcard, pid))) {
snd_card_free(card); snd_card_free(card);
return error; return error;
} }
...@@ -253,14 +254,14 @@ static int __init snd_card_als100_probe(int dev, ...@@ -253,14 +254,14 @@ static int __init snd_card_als100_probe(int dev,
mpu_port[dev], 0, mpu_port[dev], 0,
mpu_irq[dev], SA_INTERRUPT, mpu_irq[dev], SA_INTERRUPT,
NULL) < 0) NULL) < 0)
printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]); snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
} }
if (fm_port[dev] > 0) { if (fm_port[dev] > 0) {
if (snd_opl3_create(card, if (snd_opl3_create(card,
fm_port[dev], fm_port[dev] + 2, fm_port[dev], fm_port[dev] + 2,
OPL3_HW_AUTO, 0, &opl3) < 0) { OPL3_HW_AUTO, 0, &opl3) < 0) {
printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n", snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n",
fm_port[dev], fm_port[dev] + 2); fm_port[dev], fm_port[dev] + 2);
} else { } else {
if ((error = snd_opl3_timer_new(opl3, 0, 1)) < 0) { if ((error = snd_opl3_timer_new(opl3, 0, 1)) < 0) {
...@@ -328,7 +329,7 @@ static int __init alsa_card_als100_init(void) ...@@ -328,7 +329,7 @@ static int __init alsa_card_als100_init(void)
cards += pnp_register_card_driver(&als100_pnpc_driver); cards += pnp_register_card_driver(&als100_pnpc_driver);
#ifdef MODULE #ifdef MODULE
if (!cards) if (!cards)
printk(KERN_ERR "no ALS100 based soundcards found\n"); snd_printk(KERN_ERR "no ALS100 based soundcards found\n");
#endif #endif
return cards ? 0 : -ENODEV; return cards ? 0 : -ENODEV;
} }
......
...@@ -132,7 +132,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_azt2320_pnpids); ...@@ -132,7 +132,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_azt2320_pnpids);
#define DRIVER_NAME "snd-card-azt2320" #define DRIVER_NAME "snd-card-azt2320"
static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acard, static int __devinit snd_card_azt2320_pnp(int dev, struct snd_card_azt2320 *acard,
struct pnp_card_link *card, struct pnp_card_link *card,
const struct pnp_card_device_id *id) const struct pnp_card_device_id *id)
{ {
...@@ -168,11 +168,11 @@ static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acar ...@@ -168,11 +168,11 @@ static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acar
if (irq[dev] != SNDRV_AUTO_IRQ) if (irq[dev] != SNDRV_AUTO_IRQ)
pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
printk(KERN_ERR PFX "AUDIO pnp configure failure\n"); snd_printk(KERN_ERR PFX "AUDIO pnp configure failure\n");
kfree(cfg); kfree(cfg);
return err; return err;
} }
...@@ -191,7 +191,7 @@ static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acar ...@@ -191,7 +191,7 @@ static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acar
if (mpu_irq[dev] != SNDRV_AUTO_IRQ) if (mpu_irq[dev] != SNDRV_AUTO_IRQ)
pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1); pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "MPU401 the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "MPU401 the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) if (err < 0)
goto __mpu_error; goto __mpu_error;
...@@ -201,7 +201,7 @@ static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acar ...@@ -201,7 +201,7 @@ static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acar
__mpu_error: __mpu_error:
if (pdev) { if (pdev) {
pnp_release_card_device(pdev); pnp_release_card_device(pdev);
printk(KERN_ERR PFX "MPU401 pnp configure failure, skipping\n"); snd_printk(KERN_ERR PFX "MPU401 pnp configure failure, skipping\n");
} }
acard->devmpu = NULL; acard->devmpu = NULL;
mpu_port[dev] = -1; mpu_port[dev] = -1;
...@@ -212,13 +212,13 @@ static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acar ...@@ -212,13 +212,13 @@ static int __init snd_card_azt2320_isapnp(int dev, struct snd_card_azt2320 *acar
} }
/* same of snd_sbdsp_command by Jaroslav Kysela */ /* same of snd_sbdsp_command by Jaroslav Kysela */
static int __init snd_card_azt2320_command(unsigned long port, unsigned char val) static int __devinit snd_card_azt2320_command(unsigned long port, unsigned char val)
{ {
int i; int i;
unsigned long limit; unsigned long limit;
limit = jiffies + HZ / 10; limit = jiffies + HZ / 10;
for (i = 50000; i && (limit - jiffies) > 0; i--) for (i = 50000; i && time_after(limit, jiffies); i--)
if (!(inb(port + 0x0c) & 0x80)) { if (!(inb(port + 0x0c) & 0x80)) {
outb(val, port + 0x0c); outb(val, port + 0x0c);
return 0; return 0;
...@@ -226,7 +226,7 @@ static int __init snd_card_azt2320_command(unsigned long port, unsigned char val ...@@ -226,7 +226,7 @@ static int __init snd_card_azt2320_command(unsigned long port, unsigned char val
return -EBUSY; return -EBUSY;
} }
static int __init snd_card_azt2320_enable_wss(unsigned long port) static int __devinit snd_card_azt2320_enable_wss(unsigned long port)
{ {
int error; int error;
...@@ -239,7 +239,7 @@ static int __init snd_card_azt2320_enable_wss(unsigned long port) ...@@ -239,7 +239,7 @@ static int __init snd_card_azt2320_enable_wss(unsigned long port)
return 0; return 0;
} }
static int __init snd_card_azt2320_probe(int dev, static int __devinit snd_card_azt2320_probe(int dev,
struct pnp_card_link *pcard, struct pnp_card_link *pcard,
const struct pnp_card_device_id *pid) const struct pnp_card_device_id *pid)
{ {
...@@ -254,7 +254,7 @@ static int __init snd_card_azt2320_probe(int dev, ...@@ -254,7 +254,7 @@ static int __init snd_card_azt2320_probe(int dev,
return -ENOMEM; return -ENOMEM;
acard = (struct snd_card_azt2320 *)card->private_data; acard = (struct snd_card_azt2320 *)card->private_data;
if ((error = snd_card_azt2320_isapnp(dev, acard, pcard, pid))) { if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) {
snd_card_free(card); snd_card_free(card);
return error; return error;
} }
...@@ -291,15 +291,14 @@ static int __init snd_card_azt2320_probe(int dev, ...@@ -291,15 +291,14 @@ static int __init snd_card_azt2320_probe(int dev,
mpu_port[dev], 0, mpu_port[dev], 0,
mpu_irq[dev], SA_INTERRUPT, mpu_irq[dev], SA_INTERRUPT,
NULL) < 0) NULL) < 0)
printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
mpu_port[dev]);
} }
if (fm_port[dev] > 0) { if (fm_port[dev] > 0) {
if (snd_opl3_create(card, if (snd_opl3_create(card,
fm_port[dev], fm_port[dev] + 2, fm_port[dev], fm_port[dev] + 2,
OPL3_HW_AUTO, 0, &opl3) < 0) { OPL3_HW_AUTO, 0, &opl3) < 0) {
printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n", snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n",
fm_port[dev], fm_port[dev] + 2); fm_port[dev], fm_port[dev] + 2);
} else { } else {
if ((error = snd_opl3_timer_new(opl3, 1, 2)) < 0) { if ((error = snd_opl3_timer_new(opl3, 1, 2)) < 0) {
...@@ -326,7 +325,7 @@ static int __init snd_card_azt2320_probe(int dev, ...@@ -326,7 +325,7 @@ static int __init snd_card_azt2320_probe(int dev,
return 0; return 0;
} }
static int __init snd_azt2320_pnp_detect(struct pnp_card_link *card, static int __devinit snd_azt2320_pnp_detect(struct pnp_card_link *card,
const struct pnp_card_device_id *id) const struct pnp_card_device_id *id)
{ {
static int dev; static int dev;
...@@ -335,7 +334,7 @@ static int __init snd_azt2320_pnp_detect(struct pnp_card_link *card, ...@@ -335,7 +334,7 @@ static int __init snd_azt2320_pnp_detect(struct pnp_card_link *card,
for ( ; dev < SNDRV_CARDS; dev++) { for ( ; dev < SNDRV_CARDS; dev++) {
if (!enable[dev]) if (!enable[dev])
continue; continue;
res = snd_card_azt2320_probe(dev,card,id); res = snd_card_azt2320_probe(dev, card, id);
if (res < 0) if (res < 0)
return res; return res;
dev++; dev++;
...@@ -364,15 +363,10 @@ static int __init alsa_card_azt2320_init(void) ...@@ -364,15 +363,10 @@ static int __init alsa_card_azt2320_init(void)
{ {
int cards = 0; int cards = 0;
#ifdef __ISAPNP__
cards += isapnp_probe_cards(snd_azt2320_pnpids, snd_azt2320_isapnp_detect);
#else
printk(KERN_ERR PFX "you have to enable ISA PnP support.\n");
#endif
cards += pnp_register_card_driver(&azt2320_pnpc_driver); cards += pnp_register_card_driver(&azt2320_pnpc_driver);
#ifdef MODULE #ifdef MODULE
if (!cards) if (!cards)
printk(KERN_ERR "no AZT2320 based soundcards found\n"); snd_printk(KERN_ERR "no AZT2320 based soundcards found\n");
#endif #endif
return cards ? 0 : -ENODEV; return cards ? 0 : -ENODEV;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -102,7 +102,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_dt019x_pnpids); ...@@ -102,7 +102,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_dt019x_pnpids);
#define DRIVER_NAME "snd-card-dt019x" #define DRIVER_NAME "snd-card-dt019x"
static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard, static int __devinit snd_card_dt019x_pnp(int dev, struct snd_card_dt019x *acard,
struct pnp_card_link *card, struct pnp_card_link *card,
const struct pnp_card_device_id *pid) const struct pnp_card_device_id *pid)
{ {
...@@ -133,10 +133,10 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard, ...@@ -133,10 +133,10 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard,
pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "DT-019X AUDIO the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "DT-019X AUDIO the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
printk(KERN_ERR PFX "DT-019X AUDIO pnp configure failure\n"); snd_printk(KERN_ERR PFX "DT-019X AUDIO pnp configure failure\n");
kfree(cfg); kfree(cfg);
return err; return err;
} }
...@@ -156,7 +156,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard, ...@@ -156,7 +156,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard,
if (mpu_irq[dev] != SNDRV_AUTO_IRQ) if (mpu_irq[dev] != SNDRV_AUTO_IRQ)
pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1); pnp_resource_change(&cfg->irq_resource[0], mpu_irq[dev], 1);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "DT-019X MPU401 the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "DT-019X MPU401 the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) if (err < 0)
goto __mpu_error; goto __mpu_error;
...@@ -168,7 +168,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard, ...@@ -168,7 +168,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard,
__mpu_error: __mpu_error:
if (pdev) { if (pdev) {
pnp_release_card_device(pdev); pnp_release_card_device(pdev);
printk(KERN_ERR PFX "DT-019X MPU401 pnp configure failure, skipping\n"); snd_printk(KERN_ERR PFX "DT-019X MPU401 pnp configure failure, skipping\n");
} }
acard->devmpu = NULL; acard->devmpu = NULL;
mpu_port[dev] = -1; mpu_port[dev] = -1;
...@@ -180,7 +180,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard, ...@@ -180,7 +180,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard,
if (fm_port[dev] != SNDRV_AUTO_PORT) if (fm_port[dev] != SNDRV_AUTO_PORT)
pnp_resource_change(&cfg->port_resource[0], fm_port[dev], 4); pnp_resource_change(&cfg->port_resource[0], fm_port[dev], 4);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "DT-019X OPL3 the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "DT-019X OPL3 the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) if (err < 0)
goto __fm_error; goto __fm_error;
...@@ -190,7 +190,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard, ...@@ -190,7 +190,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard,
__fm_error: __fm_error:
if (pdev) { if (pdev) {
pnp_release_card_device(pdev); pnp_release_card_device(pdev);
printk(KERN_ERR PFX "DT-019X OPL3 pnp configure failure, skipping\n"); snd_printk(KERN_ERR PFX "DT-019X OPL3 pnp configure failure, skipping\n");
} }
acard->devopl = NULL; acard->devopl = NULL;
fm_port[dev] = -1; fm_port[dev] = -1;
...@@ -200,7 +200,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard, ...@@ -200,7 +200,7 @@ static int __init snd_card_dt019x_isapnp(int dev, struct snd_card_dt019x *acard,
return 0; return 0;
} }
static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, const struct pnp_card_device_id *pid) static int __devinit snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, const struct pnp_card_device_id *pid)
{ {
int error; int error;
sb_t *chip; sb_t *chip;
...@@ -213,7 +213,7 @@ static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, co ...@@ -213,7 +213,7 @@ static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, co
return -ENOMEM; return -ENOMEM;
acard = (struct snd_card_dt019x *)card->private_data; acard = (struct snd_card_dt019x *)card->private_data;
if ((error = snd_card_dt019x_isapnp(dev, acard, pcard, pid))) { if ((error = snd_card_dt019x_pnp(dev, acard, pcard, pid))) {
snd_card_free(card); snd_card_free(card);
return error; return error;
} }
...@@ -246,8 +246,7 @@ static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, co ...@@ -246,8 +246,7 @@ static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, co
mpu_irq[dev], mpu_irq[dev],
SA_INTERRUPT, SA_INTERRUPT,
NULL) < 0) NULL) < 0)
printk(KERN_ERR PFX "no MPU-401 device at 0x%lx ?\n", snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx ?\n", mpu_port[dev]);
mpu_port[dev]);
} }
if (fm_port[dev] > 0) { if (fm_port[dev] > 0) {
...@@ -255,7 +254,7 @@ static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, co ...@@ -255,7 +254,7 @@ static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, co
fm_port[dev], fm_port[dev],
fm_port[dev] + 2, fm_port[dev] + 2,
OPL3_HW_AUTO, 0, &opl3) < 0) { OPL3_HW_AUTO, 0, &opl3) < 0) {
printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx ?\n", snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx ?\n",
fm_port[dev], fm_port[dev] + 2); fm_port[dev], fm_port[dev] + 2);
} else { } else {
if ((error = snd_opl3_timer_new(opl3, 0, 1)) < 0) { if ((error = snd_opl3_timer_new(opl3, 0, 1)) < 0) {
...@@ -282,7 +281,7 @@ static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, co ...@@ -282,7 +281,7 @@ static int __init snd_card_dt019x_probe(int dev, struct pnp_card_link *pcard, co
return 0; return 0;
} }
static int __init snd_dt019x_pnp_probe(struct pnp_card_link *card, static int __devinit snd_dt019x_pnp_probe(struct pnp_card_link *card,
const struct pnp_card_device_id *pid) const struct pnp_card_device_id *pid)
{ {
static int dev; static int dev;
...@@ -323,7 +322,7 @@ static int __init alsa_card_dt019x_init(void) ...@@ -323,7 +322,7 @@ static int __init alsa_card_dt019x_init(void)
#ifdef MODULE #ifdef MODULE
if (!cards) if (!cards)
printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n"); snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n");
#endif #endif
return cards ? 0 : -ENODEV; return cards ? 0 : -ENODEV;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -90,7 +90,7 @@ static void snd_card_es968_interrupt(int irq, void *dev_id, ...@@ -90,7 +90,7 @@ static void snd_card_es968_interrupt(int irq, void *dev_id,
} }
} }
static int __devinit snd_card_es968_isapnp(int dev, struct snd_card_es968 *acard, static int __devinit snd_card_es968_pnp(int dev, struct snd_card_es968 *acard,
struct pnp_card_link *card, struct pnp_card_link *card,
const struct pnp_card_device_id *id) const struct pnp_card_device_id *id)
{ {
...@@ -117,10 +117,10 @@ static int __devinit snd_card_es968_isapnp(int dev, struct snd_card_es968 *acard ...@@ -117,10 +117,10 @@ static int __devinit snd_card_es968_isapnp(int dev, struct snd_card_es968 *acard
if (irq[dev] != SNDRV_AUTO_IRQ) if (irq[dev] != SNDRV_AUTO_IRQ)
pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
printk(KERN_ERR PFX "AUDIO pnp configure failure\n"); snd_printk(KERN_ERR PFX "AUDIO pnp configure failure\n");
return err; return err;
} }
port[dev] = pnp_port_start(pdev, 0); port[dev] = pnp_port_start(pdev, 0);
...@@ -144,7 +144,7 @@ static int __init snd_card_es968_probe(int dev, ...@@ -144,7 +144,7 @@ static int __init snd_card_es968_probe(int dev,
sizeof(struct snd_card_es968))) == NULL) sizeof(struct snd_card_es968))) == NULL)
return -ENOMEM; return -ENOMEM;
acard = (struct snd_card_es968 *)card->private_data; acard = (struct snd_card_es968 *)card->private_data;
if ((error = snd_card_es968_isapnp(dev, acard, pcard, pid))) { if ((error = snd_card_es968_pnp(dev, acard, pcard, pid))) {
snd_card_free(card); snd_card_free(card);
return error; return error;
} }
...@@ -223,7 +223,12 @@ static struct pnp_card_driver es968_pnpc_driver = { ...@@ -223,7 +223,12 @@ static struct pnp_card_driver es968_pnpc_driver = {
static int __init alsa_card_es968_init(void) static int __init alsa_card_es968_init(void)
{ {
return (pnp_register_card_driver(&es968_pnpc_driver) ? 0 : -ENODEV); int res = pnp_register_card_driver(&es968_pnpc_driver);
#ifdef MODULE
if (res == 0)
snd_printk(KERN_ERR "no ES968 based soundcards found\n");
#endif
return res < 0 ? res : 0;
} }
static void __exit alsa_card_es968_exit(void) static void __exit alsa_card_es968_exit(void)
......
...@@ -103,9 +103,9 @@ MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); ...@@ -103,9 +103,9 @@ MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(enable, "Enable SoundBlaster 16 soundcard."); MODULE_PARM_DESC(enable, "Enable SoundBlaster 16 soundcard.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
#ifdef CONFIG_PNP #ifdef CONFIG_PNP
MODULE_PARM(pnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(isapnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(pnp, "PnP detection for specified soundcard."); MODULE_PARM_DESC(isapnp, "PnP detection for specified soundcard.");
MODULE_PARM_SYNTAX(pnp, SNDRV_ISAPNP_DESC); MODULE_PARM_SYNTAX(isapnp, SNDRV_ISAPNP_DESC);
#endif #endif
MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
MODULE_PARM_DESC(port, "Port # for SB16 driver."); MODULE_PARM_DESC(port, "Port # for SB16 driver.");
...@@ -261,7 +261,7 @@ static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard, ...@@ -261,7 +261,7 @@ static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard,
const struct pnp_card_device_id *id) const struct pnp_card_device_id *id)
{ {
struct pnp_dev *pdev; struct pnp_dev *pdev;
struct pnp_resource_table * cfg = kmalloc(GFP_ATOMIC, sizeof(struct pnp_resource_table)); struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
int err; int err;
if (!cfg) if (!cfg)
...@@ -293,11 +293,11 @@ static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard, ...@@ -293,11 +293,11 @@ static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard,
pnp_resource_change(&cfg->dma_resource[1], dma16[dev], 1); pnp_resource_change(&cfg->dma_resource[1], dma16[dev], 1);
if (irq[dev] != SNDRV_AUTO_IRQ) if (irq[dev] != SNDRV_AUTO_IRQ)
pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1);
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if (pnp_manual_config_dev(pdev, cfg, 0) < 0)
printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "AUDIO the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
printk(KERN_ERR PFX "AUDIO pnp configure failure\n"); snd_printk(KERN_ERR PFX "AUDIO pnp configure failure\n");
kfree(cfg); kfree(cfg);
return err; return err;
} }
...@@ -325,18 +325,18 @@ static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard, ...@@ -325,18 +325,18 @@ static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard,
pnp_resource_change(&cfg->port_resource[2], awe_port[dev] + 0x800, 4); pnp_resource_change(&cfg->port_resource[2], awe_port[dev] + 0x800, 4);
} }
if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0) if ((pnp_manual_config_dev(pdev, cfg, 0)) < 0)
printk(KERN_ERR PFX "WaveTable the requested resources are invalid, using auto config\n"); snd_printk(KERN_ERR PFX "WaveTable the requested resources are invalid, using auto config\n");
err = pnp_activate_dev(pdev); err = pnp_activate_dev(pdev);
if (err < 0) { if (err < 0) {
goto __wt_error; goto __wt_error;
} }
awe_port[dev] = pnp_port_start(pdev, 0); awe_port[dev] = pnp_port_start(pdev, 0);
snd_printdd("pnp SB16: wavetable port=0x%lx\n", pdev->resource[0].start); snd_printdd("pnp SB16: wavetable port=0x%lx\n", pnp_port_start(pdev, 0));
} else { } else {
__wt_error: __wt_error:
if (pdev) { if (pdev) {
pnp_release_card_device(pdev); pnp_release_card_device(pdev);
printk(KERN_ERR PFX "WaveTable pnp configure failure\n"); snd_printk(KERN_ERR PFX "WaveTable pnp configure failure\n");
} }
acard->devwt = NULL; acard->devwt = NULL;
awe_port[dev] = -1; awe_port[dev] = -1;
...@@ -386,21 +386,21 @@ static int __init snd_sb16_probe(int dev, ...@@ -386,21 +386,21 @@ static int __init snd_sb16_probe(int dev,
if (xirq == SNDRV_AUTO_IRQ) { if (xirq == SNDRV_AUTO_IRQ) {
if ((xirq = snd_legacy_find_free_irq(possible_irqs)) < 0) { if ((xirq = snd_legacy_find_free_irq(possible_irqs)) < 0) {
snd_card_free(card); snd_card_free(card);
printk(KERN_ERR PFX "unable to find a free IRQ\n"); snd_printk(KERN_ERR PFX "unable to find a free IRQ\n");
return -EBUSY; return -EBUSY;
} }
} }
if (xdma8 == SNDRV_AUTO_DMA) { if (xdma8 == SNDRV_AUTO_DMA) {
if ((xdma8 = snd_legacy_find_free_dma(possible_dmas8)) < 0) { if ((xdma8 = snd_legacy_find_free_dma(possible_dmas8)) < 0) {
snd_card_free(card); snd_card_free(card);
printk(KERN_ERR PFX "unable to find a free 8-bit DMA\n"); snd_printk(KERN_ERR PFX "unable to find a free 8-bit DMA\n");
return -EBUSY; return -EBUSY;
} }
} }
if (xdma16 == SNDRV_AUTO_DMA) { if (xdma16 == SNDRV_AUTO_DMA) {
if ((xdma16 = snd_legacy_find_free_dma(possible_dmas16)) < 0) { if ((xdma16 = snd_legacy_find_free_dma(possible_dmas16)) < 0) {
snd_card_free(card); snd_card_free(card);
printk(KERN_ERR PFX "unable to find a free 16-bit DMA\n"); snd_printk(KERN_ERR PFX "unable to find a free 16-bit DMA\n");
return -EBUSY; return -EBUSY;
} }
} }
...@@ -460,7 +460,7 @@ static int __init snd_sb16_probe(int dev, ...@@ -460,7 +460,7 @@ static int __init snd_sb16_probe(int dev,
if (snd_opl3_create(card, fm_port[dev], fm_port[dev] + 2, if (snd_opl3_create(card, fm_port[dev], fm_port[dev] + 2,
OPL3_HW_OPL3, fm_port[dev] == port[dev], OPL3_HW_OPL3, fm_port[dev] == port[dev],
&opl3) < 0) { &opl3) < 0) {
printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n", snd_printk(KERN_ERR PFX "no OPL device at 0x%lx-0x%lx\n",
fm_port[dev], fm_port[dev] + 2); fm_port[dev], fm_port[dev] + 2);
} else { } else {
#ifdef SNDRV_SBAWE_EMU8000 #ifdef SNDRV_SBAWE_EMU8000
...@@ -488,7 +488,7 @@ static int __init snd_sb16_probe(int dev, ...@@ -488,7 +488,7 @@ static int __init snd_sb16_probe(int dev,
chip->csp = xcsp->private_data; chip->csp = xcsp->private_data;
chip->hardware = SB_HW_16CSP; chip->hardware = SB_HW_16CSP;
} else { } else {
printk(KERN_INFO PFX "warning - CSP chip not detected on soundcard #%i\n", dev + 1); snd_printk(KERN_INFO PFX "warning - CSP chip not detected on soundcard #%i\n", dev + 1);
} }
} }
#endif #endif
...@@ -496,7 +496,7 @@ static int __init snd_sb16_probe(int dev, ...@@ -496,7 +496,7 @@ static int __init snd_sb16_probe(int dev,
if (awe_port[dev] > 0) { if (awe_port[dev] > 0) {
if (snd_emu8000_new(card, 1, awe_port[dev], if (snd_emu8000_new(card, 1, awe_port[dev],
seq_ports[dev], NULL) < 0) { seq_ports[dev], NULL) < 0) {
printk(KERN_ERR PFX "fatal error - EMU-8000 synthesizer not detected at 0x%lx\n", awe_port[dev]); snd_printk(KERN_ERR PFX "fatal error - EMU-8000 synthesizer not detected at 0x%lx\n", awe_port[dev]);
snd_card_free(card); snd_card_free(card);
return -ENXIO; return -ENXIO;
} }
...@@ -578,8 +578,6 @@ static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *card, ...@@ -578,8 +578,6 @@ static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *card,
return -ENODEV; return -ENODEV;
} }
#endif
static void __devexit snd_sb16_pnp_remove(struct pnp_card_link * pcard) static void __devexit snd_sb16_pnp_remove(struct pnp_card_link * pcard)
{ {
snd_card_t *card = (snd_card_t *) pnp_get_card_drvdata(pcard); snd_card_t *card = (snd_card_t *) pnp_get_card_drvdata(pcard);
...@@ -596,6 +594,8 @@ static struct pnp_card_driver sb16_pnpc_driver = { ...@@ -596,6 +594,8 @@ static struct pnp_card_driver sb16_pnpc_driver = {
.remove = __devexit_p(snd_sb16_pnp_remove), .remove = __devexit_p(snd_sb16_pnp_remove),
}; };
#endif /* CONFIG_PNP */
static int __init alsa_card_sb16_init(void) static int __init alsa_card_sb16_init(void)
{ {
int dev, cards = 0; int dev, cards = 0;
...@@ -614,7 +614,7 @@ static int __init alsa_card_sb16_init(void) ...@@ -614,7 +614,7 @@ static int __init alsa_card_sb16_init(void)
continue; continue;
} }
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "Sound Blaster 16+ soundcard #%i not found at 0x%lx or device busy\n", dev, port[dev]); snd_printk(KERN_ERR "Sound Blaster 16+ soundcard #%i not found at 0x%lx or device busy\n", dev, port[dev]);
#endif #endif
} }
/* legacy auto configured cards */ /* legacy auto configured cards */
...@@ -626,11 +626,11 @@ static int __init alsa_card_sb16_init(void) ...@@ -626,11 +626,11 @@ static int __init alsa_card_sb16_init(void)
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "Sound Blaster 16 soundcard not found or device busy\n"); snd_printk(KERN_ERR "Sound Blaster 16 soundcard not found or device busy\n");
#ifdef SNDRV_SBAWE_EMU8000 #ifdef SNDRV_SBAWE_EMU8000
printk(KERN_ERR "In case, if you have non-AWE card, try snd-sb16 module\n"); snd_printk(KERN_ERR "In case, if you have non-AWE card, try snd-sb16 module\n");
#else #else
printk(KERN_ERR "In case, if you have AWE card, try snd-sbawe module\n"); snd_printk(KERN_ERR "In case, if you have AWE card, try snd-sbawe module\n");
#endif #endif
#endif #endif
return -ENODEV; return -ENODEV;
...@@ -655,7 +655,7 @@ module_exit(alsa_card_sb16_exit) ...@@ -655,7 +655,7 @@ module_exit(alsa_card_sb16_exit)
#ifndef MODULE #ifndef MODULE
/* format is: snd-sb16=enable,index,id,pnp, /* format is: snd-sb16=enable,index,id,isapnp,
port,mpu_port,fm_port, port,mpu_port,fm_port,
irq,dma8,dma16, irq,dma8,dma16,
mic_agc,csp, mic_agc,csp,
......
...@@ -143,13 +143,13 @@ static int __init snd_sb8_probe(int dev) ...@@ -143,13 +143,13 @@ static int __init snd_sb8_probe(int dev)
if ((err = snd_opl3_create(card, chip->port + 8, 0, if ((err = snd_opl3_create(card, chip->port + 8, 0,
OPL3_HW_AUTO, 1, OPL3_HW_AUTO, 1,
&opl3)) < 0) { &opl3)) < 0) {
printk(KERN_ERR "sb8: no OPL device at 0x%lx\n", chip->port + 8); snd_printk(KERN_ERR "sb8: no OPL device at 0x%lx\n", chip->port + 8);
} }
} else { } else {
if ((err = snd_opl3_create(card, chip->port, chip->port + 2, if ((err = snd_opl3_create(card, chip->port, chip->port + 2,
OPL3_HW_AUTO, 1, OPL3_HW_AUTO, 1,
&opl3)) < 0) { &opl3)) < 0) {
printk(KERN_ERR "sb8: no OPL device at 0x%lx-0x%lx\n", snd_printk(KERN_ERR "sb8: no OPL device at 0x%lx-0x%lx\n",
chip->port, chip->port + 2); chip->port, chip->port + 2);
} }
} }
...@@ -210,7 +210,7 @@ static int __init alsa_card_sb8_init(void) ...@@ -210,7 +210,7 @@ static int __init alsa_card_sb8_init(void)
cards += snd_legacy_auto_probe(possible_ports, snd_card_sb8_legacy_auto_probe); cards += snd_legacy_auto_probe(possible_ports, snd_card_sb8_legacy_auto_probe);
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n"); snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n");
#endif #endif
return -ENODEV; return -ENODEV;
} }
......
...@@ -306,7 +306,7 @@ static int __init alsa_card_sgalaxy_init(void) ...@@ -306,7 +306,7 @@ static int __init alsa_card_sgalaxy_init(void)
} }
if (!cards) { if (!cards) {
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n"); snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n");
#endif #endif
return -ENODEV; return -ENODEV;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -48,3 +48,5 @@ ...@@ -48,3 +48,5 @@
#define AC97_ID_ALC650 0x414c4720 #define AC97_ID_ALC650 0x414c4720
#define AC97_ID_YMF753 0x594d4803 #define AC97_ID_YMF753 0x594d4803
#define AC97_ID_VT1616 0x49434551 #define AC97_ID_VT1616 0x49434551
#define AC97_ID_CM9738 0x434d4941
#define AC97_ID_CM9739 0x434d4961
This diff is collapsed.
...@@ -40,3 +40,4 @@ int patch_ad1885(ac97_t * ac97); ...@@ -40,3 +40,4 @@ int patch_ad1885(ac97_t * ac97);
int patch_ad1886(ac97_t * ac97); int patch_ad1886(ac97_t * ac97);
int patch_ad1980(ac97_t * ac97); int patch_ad1980(ac97_t * ac97);
int patch_alc650(ac97_t * ac97); int patch_alc650(ac97_t * ac97);
int patch_cm9739(ac97_t * ac97);
...@@ -375,24 +375,27 @@ static int snd_ali_codec_ready( ali_t *codec, ...@@ -375,24 +375,27 @@ static int snd_ali_codec_ready( ali_t *codec,
unsigned int port, unsigned int port,
int sched ) int sched )
{ {
signed long end_time; unsigned long end_time;
unsigned int res;
end_time = jiffies + 10 * (HZ >> 2); end_time = jiffies + 10 * (HZ >> 2);
do { do {
if (!(snd_ali_5451_peek(codec,port) & 0x8000)) res = snd_ali_5451_peek(codec,port);
if (! (res & 0x8000))
return 0; return 0;
if (sched) { if (sched) {
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1); schedule_timeout(1);
} }
} while (end_time - (signed long)jiffies >= 0); } while (time_after_eq(end_time, jiffies));
snd_printk("ali_codec_ready: codec is not ready.\n "); snd_ali_5451_poke(codec, port, res & ~0x8000);
snd_printdd("ali_codec_ready: codec is not ready.\n ");
return -EIO; return -EIO;
} }
static int snd_ali_stimer_ready(ali_t *codec, int sched) static int snd_ali_stimer_ready(ali_t *codec, int sched)
{ {
signed long end_time; unsigned long end_time;
unsigned long dwChk1,dwChk2; unsigned long dwChk1,dwChk2;
dwChk1 = snd_ali_5451_peek(codec, ALI_STIMER); dwChk1 = snd_ali_5451_peek(codec, ALI_STIMER);
...@@ -407,7 +410,7 @@ static int snd_ali_stimer_ready(ali_t *codec, int sched) ...@@ -407,7 +410,7 @@ static int snd_ali_stimer_ready(ali_t *codec, int sched)
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1); schedule_timeout(1);
} }
} while (end_time - (signed long)jiffies >= 0); } while (time_after_eq(end_time, jiffies));
snd_printk("ali_stimer_read: stimer is not ready.\n"); snd_printk("ali_stimer_read: stimer is not ready.\n");
return -EIO; return -EIO;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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