Commit 7dcf8717 authored by Jaroslav Kysela's avatar Jaroslav Kysela

Merge suse.cz:/home/perex/bk/linux-sound/linux-2.5

into suse.cz:/home/perex/bk/linux-sound/linux-sound
parents f0fdf5f8 904baa87
...@@ -611,6 +611,8 @@ Module parameters ...@@ -611,6 +611,8 @@ Module parameters
* Digigram VX442 * Digigram VX442
omni - Omni I/O support for MidiMan M-Audio Delta44/66 omni - Omni I/O support for MidiMan M-Audio Delta44/66
cs8427_timeout - reset timeout for the CS8427 chip (S/PDIF transciever)
in msec resolution, default value is 500 (0.5 sec)
Module supports up to 8 cards and autoprobe. Note: The consumer part Module supports up to 8 cards and autoprobe. Note: The consumer part
is not used with all Envy24 based cards (for example in the MidiMan Delta is not used with all Envy24 based cards (for example in the MidiMan Delta
......
Proc Files of ALSA Drivers
==========================
Takashi Iwai <tiwai@suse.de>
General
-------
ALSA has its own proc tree, /proc/asound. Many useful information are
found in this tree. When you encounter a problem and need debugging,
check the files listed in the following sections.
Each card has its subtree cardX, where X is from 0 to 7. The
card-specific files are stored in the card* subdirectories.
Global Information
------------------
cards
Shows the list of currently configured ALSA drivers,
index, the id string, short and long descriptions.
version
Shows the version string and compile date.
modules
Lists the module of each card
devices
Lists the ALSA native device mappings.
meminfo
Shows the status of allocated pages via ALSA drivers.
Appears only when CONFIG_SND_DEBUG=y.
hwdep
Lists the currently available hwdep devices in format of
<card>-<device>: <name>
pcm
Lists the currently available PCM devices in format of
<card>-<device>: <id>: <name> : <sub-streams>
timer
Lists the currently available timer devices
oss/devices
Lists the OSS device mappings.
oss/sndstat
Provides the output compatible with /dev/sndstat.
You can symlink this to /dev/sndstat.
Card Specific Files
-------------------
The card-specific files are found in /proc/asound/card* directories.
Some drivers (e.g. cmipci) have their own proc entries for the
register dump, etc (e.g. /proc/asound/card*/cmipci shows the register
dump). These files would be really helpful for debugging.
When PCM devices are available on this card, you can see directories
like pcm0p or pcm1c. They hold the PCM information for each PCM
stream. The number after 'pcm' is the PCM device number from 0, and
the last 'p' or 'c' means playback or capture direction. The files in
this subtree is described later.
The status of MIDI I/O is found in midi* files. It shows the device
name and the received/transmitted bytes through the MIDI device.
When the card is equipped with AC97 codecs, there are codec97#*
subdirectories (desribed later).
When the OSS mixer emulation is enabled (and the module is loaded),
oss_mixer file appears here, too. This shows the current mapping of
OSS mixer elements to the ALSA control elements. You can change the
mapping by writing to this device. Read OSS-Emulation.txt for
details.
PCM Proc Files
--------------
card*/pcm*/info
The general information of this PCM device: card #, device #,
substreams, etc.
card*/pcm*/xrun_debug
This file appears when CONFIG_SND_DEBUG=y.
This shows the status of xrun (= buffer overrun/xrun) debug of
ALSA PCM middle layer, as an integer from 0 to 2. The value
can be changed by writing to this file, such as
# cat 2 > /proc/asound/card0/pcm0p/xrun_debug
When this value is greater than 0, the driver will show the
messages to kernel log when an xrun is detected. The debug
message is shown also when the invalid H/W pointer is detected
at the update of periods (usually called from the interrupt
handler).
When this value is greater than 1, the driver will show the
stack trace additionally. This may help the debugging.
card*/pcm*/sub*/info
The general information of this PCM sub-stream.
card*/pcm*/sub*/status
The current status of this PCM sub-stream, elapsed time,
H/W position, etc.
card*/pcm*/sub*/hw_params
The hardware parameters set for this sub-stream.
card*/pcm*/sub*/sw_params
The soft parameters set for this sub-stream.
card*/pcm*/sub*/prealloc
The buffer pre-allocation information.
AC97 Codec Information
----------------------
card*/codec97#*/ac97#?-?
Shows the general information of this AC97 codec chip, such as
name, capabilities, set up.
card*/codec97#0/ac97#?-?+regs
Shows the AC97 register dump. Useful for debugging.
Sequencer Information
---------------------
seq/drivers
Lists the currently available ALSA sequencer drivers.
seq/clients
Shows the list of currently available sequencer clinets and
ports. The connection status and the running status are shown
in this file, too.
seq/queues
Lists the currently allocated/running sequener queues.
seq/timer
Lists the currently allocated/running sequencer timers.
seq/oss
Lists the OSS-compatible sequencer stuffs.
Help For Debugging?
-------------------
When the problem is related with PCM, first try to turn on xrun_debug
mode. This will give you the kernel messages when and where xrun
happened.
If it's really a bug, report it with the following information
- the name of the driver/card, show in /proc/asound/cards
- the reigster dump, if available (e.g. card*/cmipci)
when it's a PCM problem,
- set-up of PCM, shown in hw_parms, sw_params, and status in the PCM
sub-stream directory
when it's a mixer problem,
- AC97 proc files, codec97#*/* files
for USB audio/midi,
- output of lsusb -v
- stream* files in card directory
The ALSA bug-tracking system is found at:
https://bugtrack.alsa-project.org/alsa-bug/
...@@ -460,7 +460,7 @@ static inline int ac97_is_modem(ac97_t * ac97) ...@@ -460,7 +460,7 @@ static inline int ac97_is_modem(ac97_t * ac97)
} }
static inline int ac97_is_rev22(ac97_t * ac97) static inline int ac97_is_rev22(ac97_t * ac97)
{ {
return (ac97->ext_id & AC97_EI_REV_MASK) == AC97_EI_REV_22; return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22;
} }
static inline int ac97_can_amap(ac97_t * ac97) static inline int ac97_can_amap(ac97_t * ac97)
{ {
......
...@@ -187,7 +187,8 @@ ...@@ -187,7 +187,8 @@
#define CS8427_VER8427A 0x71 #define CS8427_VER8427A 0x71
int snd_cs8427_detect(snd_i2c_bus_t *bus, unsigned char addr); int snd_cs8427_detect(snd_i2c_bus_t *bus, unsigned char addr);
int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, snd_i2c_device_t **r_cs8427); int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr,
unsigned int reset_timeout, snd_i2c_device_t **r_cs8427);
void snd_cs8427_reset(snd_i2c_device_t *cs8427); void snd_cs8427_reset(snd_i2c_device_t *cs8427);
int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val); int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val);
int snd_cs8427_reg_read(snd_i2c_device_t *device, unsigned char reg); int snd_cs8427_reg_read(snd_i2c_device_t *device, unsigned char reg);
......
...@@ -428,7 +428,7 @@ struct _snd_pcm_str { ...@@ -428,7 +428,7 @@ struct _snd_pcm_str {
snd_info_entry_t *proc_root; snd_info_entry_t *proc_root;
snd_info_entry_t *proc_info_entry; snd_info_entry_t *proc_info_entry;
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
unsigned int xrun_debug: 1; unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */
snd_info_entry_t *proc_xrun_debug_entry; snd_info_entry_t *proc_xrun_debug_entry;
#endif #endif
}; };
......
/* include/version.h. Generated by configure. */ /* include/version.h. Generated by configure. */
#define CONFIG_SND_VERSION "1.0.3" #define CONFIG_SND_VERSION "1.0.4rc1"
#define CONFIG_SND_DATE " (Mon Mar 01 10:12:14 2004 UTC)" #define CONFIG_SND_DATE " (Mon Mar 29 11:52:31 2004 UTC)"
...@@ -88,8 +88,18 @@ struct ioctl32_mapper timer_mappers[] = { ...@@ -88,8 +88,18 @@ struct ioctl32_mapper timer_mappers[] = {
{ SNDRV_TIMER_IOCTL_INFO32, AP(timer_info) }, { SNDRV_TIMER_IOCTL_INFO32, AP(timer_info) },
MAP_COMPAT(SNDRV_TIMER_IOCTL_PARAMS), MAP_COMPAT(SNDRV_TIMER_IOCTL_PARAMS),
{ SNDRV_TIMER_IOCTL_STATUS32, AP(timer_status) }, { SNDRV_TIMER_IOCTL_STATUS32, AP(timer_status) },
#if 0
/* ** FIXME **
* The following four entries are disabled because they conflict
* with the TCOC* definitions.
* Unfortunately, the current ioctl32 wrapper uses a single
* hash table for all devices. Once when the wrapper is fixed
* with the table based on devices, they'll be back again.
*/
MAP_COMPAT(SNDRV_TIMER_IOCTL_START), MAP_COMPAT(SNDRV_TIMER_IOCTL_START),
MAP_COMPAT(SNDRV_TIMER_IOCTL_STOP), MAP_COMPAT(SNDRV_TIMER_IOCTL_STOP),
MAP_COMPAT(SNDRV_TIMER_IOCTL_CONTINUE), MAP_COMPAT(SNDRV_TIMER_IOCTL_CONTINUE),
MAP_COMPAT(SNDRV_TIMER_IOCTL_PAUSE),
#endif
{ 0 }, { 0 },
}; };
...@@ -403,7 +403,7 @@ static void snd_pcm_xrun_debug_write(snd_info_entry_t *entry, snd_info_buffer_t ...@@ -403,7 +403,7 @@ static void snd_pcm_xrun_debug_write(snd_info_entry_t *entry, snd_info_buffer_t
snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data; snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data;
char line[64]; char line[64];
if (!snd_info_get_line(buffer, line, sizeof(line))) if (!snd_info_get_line(buffer, line, sizeof(line)))
pstr->xrun_debug = !!simple_strtoul(line, NULL, 10); pstr->xrun_debug = simple_strtoul(line, NULL, 10);
} }
#endif #endif
......
...@@ -167,7 +167,8 @@ static inline int snd_pcm_update_hw_ptr_post(snd_pcm_substream_t *substream, ...@@ -167,7 +167,8 @@ static inline int snd_pcm_update_hw_ptr_post(snd_pcm_substream_t *substream,
substream->pcm->card->number, substream->pcm->card->number,
substream->pcm->device, substream->pcm->device,
substream->stream ? 'c' : 'p'); substream->stream ? 'c' : 'p');
dump_stack(); if (substream->pstr->xrun_debug > 1)
dump_stack();
} }
#endif #endif
return -EPIPE; return -EPIPE;
...@@ -194,8 +195,11 @@ static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream ...@@ -194,8 +195,11 @@ static inline int snd_pcm_update_hw_ptr_interrupt(snd_pcm_substream_t *substream
if (delta > 0) { if (delta > 0) {
if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
if (runtime->periods > 1) if (runtime->periods > 1 && substream->pstr->xrun_debug) {
snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
if (substream->pstr->xrun_debug > 1)
dump_stack();
}
#endif #endif
return 0; return 0;
} }
...@@ -232,8 +236,11 @@ int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream) ...@@ -232,8 +236,11 @@ int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream)
if (delta > 0) { if (delta > 0) {
if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) {
#ifdef CONFIG_SND_DEBUG #ifdef CONFIG_SND_DEBUG
if (runtime->periods > 2) if (runtime->periods > 2 && substream->pstr->xrun_debug) {
snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2);
if (substream->pstr->xrun_debug > 1)
dump_stack();
}
#endif #endif
return 0; return 0;
} }
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
*/ */
/* Greatest common divisor */ /* Greatest common divisor */
static int gcd(int a, int b) static unsigned long gcd(unsigned long a, unsigned long b)
{ {
int r; unsigned long r;
if (a < b) { if (a < b) {
r = a; r = a;
a = b; a = b;
...@@ -49,7 +49,7 @@ static int gcd(int a, int b) ...@@ -49,7 +49,7 @@ static int gcd(int a, int b)
void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream) void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream)
{ {
unsigned int rate, mult, fsize, l; unsigned long rate, mult, fsize, l;
snd_pcm_runtime_t *runtime = substream->runtime; snd_pcm_runtime_t *runtime = substream->runtime;
mult = 1000000000; mult = 1000000000;
...@@ -67,7 +67,11 @@ void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream) ...@@ -67,7 +67,11 @@ void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream)
mult /= 2; mult /= 2;
rate /= 2; rate /= 2;
} }
snd_assert(rate != 0, return); if (rate == 0) {
snd_printk(KERN_ERR "pcm timer resolution out of range (rate = %u, period_size = %lu)\n", runtime->rate, runtime->period_size);
runtime->timer_resolution = -1;
return;
}
runtime->timer_resolution = mult * fsize / rate; runtime->timer_resolution = mult * fsize / rate;
} }
......
...@@ -50,6 +50,7 @@ typedef struct { ...@@ -50,6 +50,7 @@ typedef struct {
typedef struct { typedef struct {
unsigned char regmap[0x14]; /* map of first 1 + 13 registers */ unsigned char regmap[0x14]; /* map of first 1 + 13 registers */
unsigned int rate; unsigned int rate;
unsigned int reset_timeout;
cs8427_stream_t playback; cs8427_stream_t playback;
cs8427_stream_t capture; cs8427_stream_t capture;
} cs8427_t; } cs8427_t;
...@@ -163,6 +164,7 @@ static void snd_cs8427_free(snd_i2c_device_t *device) ...@@ -163,6 +164,7 @@ static void snd_cs8427_free(snd_i2c_device_t *device)
int snd_cs8427_create(snd_i2c_bus_t *bus, int snd_cs8427_create(snd_i2c_bus_t *bus,
unsigned char addr, unsigned char addr,
unsigned int reset_timeout,
snd_i2c_device_t **r_cs8427) snd_i2c_device_t **r_cs8427)
{ {
static unsigned char initvals1[] = { static unsigned char initvals1[] = {
...@@ -256,6 +258,9 @@ int snd_cs8427_create(snd_i2c_bus_t *bus, ...@@ -256,6 +258,9 @@ int snd_cs8427_create(snd_i2c_bus_t *bus,
snd_i2c_unlock(bus); snd_i2c_unlock(bus);
/* turn on run bit and rock'n'roll */ /* turn on run bit and rock'n'roll */
if (reset_timeout < 1)
reset_timeout = 1;
chip->reset_timeout = reset_timeout;
snd_cs8427_reset(device); snd_cs8427_reset(device);
#if 0 // it's nice for read tests #if 0 // it's nice for read tests
...@@ -301,7 +306,7 @@ void snd_cs8427_reset(snd_i2c_device_t *cs8427) ...@@ -301,7 +306,7 @@ void snd_cs8427_reset(snd_i2c_device_t *cs8427)
snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, chip->regmap[CS8427_REG_CLOCKSOURCE]); snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, chip->regmap[CS8427_REG_CLOCKSOURCE]);
udelay(200); udelay(200);
snd_i2c_unlock(cs8427->bus); snd_i2c_unlock(cs8427->bus);
end_time = jiffies + HZ / 2; end_time = jiffies + chip->reset_timeout;
while (time_after_eq(end_time, jiffies)) { while (time_after_eq(end_time, jiffies)) {
snd_i2c_lock(cs8427->bus); snd_i2c_lock(cs8427->bus);
data = snd_cs8427_reg_read(cs8427, CS8427_REG_RECVERRORS); data = snd_cs8427_reg_read(cs8427, CS8427_REG_RECVERRORS);
...@@ -309,7 +314,7 @@ void snd_cs8427_reset(snd_i2c_device_t *cs8427) ...@@ -309,7 +314,7 @@ void snd_cs8427_reset(snd_i2c_device_t *cs8427)
if (!(data & CS8427_UNLOCK)) if (!(data & CS8427_UNLOCK))
break; break;
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ/100); schedule_timeout(1);
} }
snd_i2c_lock(cs8427->bus); snd_i2c_lock(cs8427->bus);
chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~CS8427_RXDMASK; chip->regmap[CS8427_REG_CLOCKSOURCE] &= ~CS8427_RXDMASK;
......
...@@ -396,11 +396,14 @@ static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned sho ...@@ -396,11 +396,14 @@ static int snd_ac97_ad18xx_update_pcm_bits(ac97_t *ac97, int codec, unsigned sho
ac97->spec.ad18xx.pcmreg[codec] = new; ac97->spec.ad18xx.pcmreg[codec] = new;
spin_unlock(&ac97->reg_lock); spin_unlock(&ac97->reg_lock);
/* select single codec */ /* select single codec */
ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); ac97->bus->write(ac97, AC97_AD_SERIAL_CFG,
(ac97->regs[AC97_AD_SERIAL_CFG] & ~0x7000) |
ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
/* update PCM bits */ /* update PCM bits */
ac97->bus->write(ac97, AC97_PCM, new); ac97->bus->write(ac97, AC97_PCM, new);
/* select all codecs */ /* select all codecs */
ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000); ac97->bus->write(ac97, AC97_AD_SERIAL_CFG,
ac97->regs[AC97_AD_SERIAL_CFG] | 0x7000);
} else } else
spin_unlock(&ac97->reg_lock); spin_unlock(&ac97->reg_lock);
up(&ac97->spec.ad18xx.mutex); up(&ac97->spec.ad18xx.mutex);
...@@ -2032,11 +2035,12 @@ void snd_ac97_resume(ac97_t *ac97) ...@@ -2032,11 +2035,12 @@ void snd_ac97_resume(ac97_t *ac97)
if (! ac97->spec.ad18xx.id[codec]) if (! ac97->spec.ad18xx.id[codec])
continue; continue;
/* select single codec */ /* select single codec */
ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000,
ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
ac97->bus->write(ac97, AC97_AD_CODEC_CFG, ac97->spec.ad18xx.codec_cfg[codec]); ac97->bus->write(ac97, AC97_AD_CODEC_CFG, ac97->spec.ad18xx.codec_cfg[codec]);
} }
/* select all codecs */ /* select all codecs */
ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
} }
/* restore ac97 status */ /* restore ac97 status */
...@@ -2055,12 +2059,13 @@ void snd_ac97_resume(ac97_t *ac97) ...@@ -2055,12 +2059,13 @@ void snd_ac97_resume(ac97_t *ac97)
if (! ac97->spec.ad18xx.id[codec]) if (! ac97->spec.ad18xx.id[codec])
continue; continue;
/* select single codec */ /* select single codec */
ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000,
ac97->spec.ad18xx.unchained[codec] | ac97->spec.ad18xx.chained[codec]);
/* update PCM bits */ /* update PCM bits */
ac97->bus->write(ac97, AC97_PCM, ac97->spec.ad18xx.pcmreg[codec]); ac97->bus->write(ac97, AC97_PCM, ac97->spec.ad18xx.pcmreg[codec]);
} }
/* select all codecs */ /* select all codecs */
ac97->bus->write(ac97, AC97_AD_SERIAL_CFG, 0x7000); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
continue; continue;
} else if (i == AC97_AD_TEST || } else if (i == AC97_AD_TEST ||
i == AC97_AD_CODEC_CFG || i == AC97_AD_CODEC_CFG ||
......
...@@ -562,8 +562,11 @@ int patch_conexant(ac97_t * ac97) ...@@ -562,8 +562,11 @@ int patch_conexant(ac97_t * ac97)
*/ */
int patch_ad1819(ac97_t * ac97) int patch_ad1819(ac97_t * ac97)
{ {
unsigned short scfg;
// patch for Analog Devices // patch for Analog Devices
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, 0x7000); /* select all codecs */ scfg = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG);
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x7000); /* select all codecs */
return 0; return 0;
} }
...@@ -572,7 +575,7 @@ static unsigned short patch_ad1881_unchained(ac97_t * ac97, int idx, unsigned sh ...@@ -572,7 +575,7 @@ static unsigned short patch_ad1881_unchained(ac97_t * ac97, int idx, unsigned sh
unsigned short val; unsigned short val;
// test for unchained codec // test for unchained codec
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, mask); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, mask);
snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000); /* ID0C, ID1C, SDIE = off */ snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0000); /* ID0C, ID1C, SDIE = off */
val = snd_ac97_read(ac97, AC97_VENDOR_ID2); val = snd_ac97_read(ac97, AC97_VENDOR_ID2);
if ((val & 0xff40) != 0x5340) if ((val & 0xff40) != 0x5340)
...@@ -588,7 +591,7 @@ static int patch_ad1881_chained1(ac97_t * ac97, int idx, unsigned short codec_bi ...@@ -588,7 +591,7 @@ static int patch_ad1881_chained1(ac97_t * ac97, int idx, unsigned short codec_bi
static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 }; static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 };
unsigned short val; unsigned short val;
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, cfg_bits[idx]); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, cfg_bits[idx]);
snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0004); // SDIE snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0004); // SDIE
val = snd_ac97_read(ac97, AC97_VENDOR_ID2); val = snd_ac97_read(ac97, AC97_VENDOR_ID2);
if ((val & 0xff40) != 0x5340) if ((val & 0xff40) != 0x5340)
...@@ -611,7 +614,8 @@ static void patch_ad1881_chained(ac97_t * ac97, int unchained_idx, int cidx1, in ...@@ -611,7 +614,8 @@ static void patch_ad1881_chained(ac97_t * ac97, int unchained_idx, int cidx1, in
if (cidx1 < 0 && cidx2 < 0) if (cidx1 < 0 && cidx2 < 0)
return; return;
// test for chained codecs // test for chained codecs
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[unchained_idx]); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000,
ac97->spec.ad18xx.unchained[unchained_idx]);
snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0002); // ID1C snd_ac97_write_cache(ac97, AC97_AD_CODEC_CFG, 0x0002); // ID1C
ac97->spec.ad18xx.codec_cfg[unchained_idx] = 0x0002; ac97->spec.ad18xx.codec_cfg[unchained_idx] = 0x0002;
if (cidx1 >= 0) { if (cidx1 >= 0) {
...@@ -634,10 +638,13 @@ int patch_ad1881(ac97_t * ac97) ...@@ -634,10 +638,13 @@ int patch_ad1881(ac97_t * ac97)
// patch for Analog Devices // patch for Analog Devices
unsigned short codecs[3]; unsigned short codecs[3];
unsigned short val;
int idx, num; int idx, num;
init_MUTEX(&ac97->spec.ad18xx.mutex); init_MUTEX(&ac97->spec.ad18xx.mutex);
val = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG);
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, val);
codecs[0] = patch_ad1881_unchained(ac97, 0, (1<<12)); codecs[0] = patch_ad1881_unchained(ac97, 0, (1<<12));
codecs[1] = patch_ad1881_unchained(ac97, 1, (1<<14)); codecs[1] = patch_ad1881_unchained(ac97, 1, (1<<14));
codecs[2] = patch_ad1881_unchained(ac97, 2, (1<<13)); codecs[2] = patch_ad1881_unchained(ac97, 2, (1<<13));
...@@ -659,7 +666,7 @@ int patch_ad1881(ac97_t * ac97) ...@@ -659,7 +666,7 @@ int patch_ad1881(ac97_t * ac97)
__end: __end:
/* select all codecs */ /* select all codecs */
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, 0x7000); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
/* check if only one codec is present */ /* check if only one codec is present */
for (idx = num = 0; idx < 3; idx++) for (idx = num = 0; idx < 3; idx++)
if (ac97->spec.ad18xx.id[idx]) if (ac97->spec.ad18xx.id[idx])
...@@ -1003,6 +1010,7 @@ int patch_ad1985(ac97_t * ac97) ...@@ -1003,6 +1010,7 @@ int patch_ad1985(ac97_t * ac97)
{ {
unsigned short misc; unsigned short misc;
patch_ad1881(ac97);
ac97->build_ops = &patch_ad1985_build_ops; ac97->build_ops = &patch_ad1985_build_ops;
misc = snd_ac97_read(ac97, AC97_AD_MISC); misc = snd_ac97_read(ac97, AC97_AD_MISC);
/* switch front/surround line-out/hp-out */ /* switch front/surround line-out/hp-out */
......
...@@ -89,7 +89,7 @@ static unsigned char rate_reg_tables[2][4][9] = { ...@@ -89,7 +89,7 @@ static unsigned char rate_reg_tables[2][4][9] = {
0xff, /* slot 6 */ 0xff, /* slot 6 */
AC97_PCM_LFE_DAC_RATE, /* slot 7 */ AC97_PCM_LFE_DAC_RATE, /* slot 7 */
AC97_PCM_LFE_DAC_RATE, /* slot 8 */ AC97_PCM_LFE_DAC_RATE, /* slot 8 */
AC97_PCM_FRONT_DAC_RATE, /* slot 9 */ 0xff, /* slot 9 */
AC97_PCM_FRONT_DAC_RATE, /* slot 10 */ AC97_PCM_FRONT_DAC_RATE, /* slot 10 */
AC97_PCM_FRONT_DAC_RATE, /* slot 11 */ AC97_PCM_FRONT_DAC_RATE, /* slot 11 */
}, },
...@@ -140,7 +140,7 @@ static unsigned char rate_reg_tables[2][4][9] = { ...@@ -140,7 +140,7 @@ static unsigned char rate_reg_tables[2][4][9] = {
0xff, /* slot 6 */ 0xff, /* slot 6 */
AC97_PCM_LFE_DAC_RATE, /* slot 7 */ AC97_PCM_LFE_DAC_RATE, /* slot 7 */
AC97_PCM_LFE_DAC_RATE, /* slot 8 */ AC97_PCM_LFE_DAC_RATE, /* slot 8 */
AC97_PCM_FRONT_DAC_RATE, /* slot 9 */ 0xff, /* slot 9 */
AC97_PCM_FRONT_DAC_RATE, /* slot 10 */ AC97_PCM_FRONT_DAC_RATE, /* slot 10 */
AC97_PCM_FRONT_DAC_RATE, /* slot 11 */ AC97_PCM_FRONT_DAC_RATE, /* slot 11 */
} }
......
...@@ -241,12 +241,13 @@ static void snd_ac97_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buff ...@@ -241,12 +241,13 @@ static void snd_ac97_proc_read(snd_info_entry_t *entry, snd_info_buffer_t * buff
for (idx = 0; idx < 3; idx++) for (idx = 0; idx < 3; idx++)
if (ac97->spec.ad18xx.id[idx]) { if (ac97->spec.ad18xx.id[idx]) {
/* select single codec */ /* select single codec */
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000,
ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]);
snd_ac97_proc_read_main(ac97, buffer, idx); snd_ac97_proc_read_main(ac97, buffer, idx);
snd_iprintf(buffer, "\n\n"); snd_iprintf(buffer, "\n\n");
} }
/* select all codecs */ /* select all codecs */
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, 0x7000); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
up(&ac97->spec.ad18xx.mutex); up(&ac97->spec.ad18xx.mutex);
snd_iprintf(buffer, "\nAD18XX configuration\n"); snd_iprintf(buffer, "\nAD18XX configuration\n");
...@@ -285,11 +286,12 @@ static void snd_ac97_proc_regs_read(snd_info_entry_t *entry, ...@@ -285,11 +286,12 @@ static void snd_ac97_proc_regs_read(snd_info_entry_t *entry,
for (idx = 0; idx < 3; idx++) for (idx = 0; idx < 3; idx++)
if (ac97->spec.ad18xx.id[idx]) { if (ac97->spec.ad18xx.id[idx]) {
/* select single codec */ /* select single codec */
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000,
ac97->spec.ad18xx.unchained[idx] | ac97->spec.ad18xx.chained[idx]);
snd_ac97_proc_regs_read_main(ac97, buffer, idx); snd_ac97_proc_regs_read_main(ac97, buffer, idx);
} }
/* select all codecs */ /* select all codecs */
snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, 0x7000); snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, 0x7000);
up(&ac97->spec.ad18xx.mutex); up(&ac97->spec.ad18xx.mutex);
} else { } else {
snd_ac97_proc_regs_read_main(ac97, buffer, 0); snd_ac97_proc_regs_read_main(ac97, buffer, 0);
......
...@@ -51,7 +51,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ ...@@ -51,7 +51,7 @@ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
static int thinkpad[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; static int thinkpad[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0}; static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for the CS46xx soundcard."); MODULE_PARM_DESC(index, "Index value for the CS46xx soundcard.");
...@@ -70,7 +70,7 @@ MODULE_PARM_DESC(thinkpad, "Force to enable Thinkpad's CLKRUN control."); ...@@ -70,7 +70,7 @@ MODULE_PARM_DESC(thinkpad, "Force to enable Thinkpad's CLKRUN control.");
MODULE_PARM_SYNTAX(thinkpad, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); MODULE_PARM_SYNTAX(thinkpad, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
MODULE_PARM(mmap_valid, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(mmap_valid, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); MODULE_PARM_DESC(mmap_valid, "Support OSS mmap.");
MODULE_PARM_SYNTAX(mmap_valid, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); MODULE_PARM_SYNTAX(mmap_valid, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
static struct pci_device_id snd_cs46xx_ids[] = { static struct pci_device_id snd_cs46xx_ids[] = {
{ 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */ { 0x1013, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CS4280 */
...@@ -219,7 +219,7 @@ module_exit(alsa_card_cs46xx_exit) ...@@ -219,7 +219,7 @@ module_exit(alsa_card_cs46xx_exit)
#ifndef MODULE #ifndef MODULE
/* format is: snd-cs46xx=enable,index,id */ /* format is: snd-cs46xx=enable,index,id,mmap_valid,external_amp,thinkpad */
static int __init alsa_card_cs46xx_setup(char *str) static int __init alsa_card_cs46xx_setup(char *str)
{ {
...@@ -229,7 +229,10 @@ static int __init alsa_card_cs46xx_setup(char *str) ...@@ -229,7 +229,10 @@ static int __init alsa_card_cs46xx_setup(char *str)
return 0; return 0;
(void)(get_option(&str,&enable[nr_dev]) == 2 && (void)(get_option(&str,&enable[nr_dev]) == 2 &&
get_option(&str,&index[nr_dev]) == 2 && get_option(&str,&index[nr_dev]) == 2 &&
get_id(&str,&id[nr_dev]) == 2); get_id(&str,&id[nr_dev]) == 2 &&
get_option(&str,&mmap_valid[nr_dev]) == 2 &&
get_option(&str,&external_amp[nr_dev]) == 2 &&
get_option(&str,&thinkpad[nr_dev]) == 2);
nr_dev++; nr_dev++;
return 1; return 1;
} }
......
...@@ -90,6 +90,7 @@ static unsigned char ap_cs8427_codec_select(ice1712_t *ice) ...@@ -90,6 +90,7 @@ static unsigned char ap_cs8427_codec_select(ice1712_t *ice)
tmp |= ICE1712_DELTA_1010LT_CCLK | ICE1712_DELTA_1010LT_CS_CS8427; tmp |= ICE1712_DELTA_1010LT_CCLK | ICE1712_DELTA_1010LT_CS_CS8427;
break; break;
case ICE1712_SUBDEVICE_AUDIOPHILE: case ICE1712_SUBDEVICE_AUDIOPHILE:
case ICE1712_SUBDEVICE_DELTA410:
tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC; tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC;
tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL; tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL;
break; break;
...@@ -112,6 +113,7 @@ static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp) ...@@ -112,6 +113,7 @@ static void ap_cs8427_codec_deassert(ice1712_t *ice, unsigned char tmp)
tmp |= ICE1712_DELTA_1010LT_CS_NONE; tmp |= ICE1712_DELTA_1010LT_CS_NONE;
break; break;
case ICE1712_SUBDEVICE_AUDIOPHILE: case ICE1712_SUBDEVICE_AUDIOPHILE:
case ICE1712_SUBDEVICE_DELTA410:
tmp |= ICE1712_DELTA_AP_CS_DIGITAL; tmp |= ICE1712_DELTA_AP_CS_DIGITAL;
break; break;
case ICE1712_SUBDEVICE_VX442: case ICE1712_SUBDEVICE_VX442:
......
...@@ -82,6 +82,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ ...@@ -82,6 +82,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static int omni[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0}; /* Delta44 & 66 Omni I/O support */ static int omni[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0}; /* Delta44 & 66 Omni I/O support */
static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transciever reset timeout value in msec */
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for ICE1712 soundcard."); MODULE_PARM_DESC(index, "Index value for ICE1712 soundcard.");
...@@ -95,6 +96,9 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); ...@@ -95,6 +96,9 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(omni, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(omni, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(omni, "Enable Midiman M-Audio Delta Omni I/O support."); MODULE_PARM_DESC(omni, "Enable Midiman M-Audio Delta Omni I/O support.");
MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC); MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
MODULE_PARM(cs8427_timeout, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(cs8427_timeout, "Define reset timeout for cs8427 chip in msec resolution.");
MODULE_PARM_SYNTAX(cs8427_timeout, SNDRV_ENABLED ", allows:{{1,1000}},default=500,skill:advanced");
#ifndef PCI_VENDOR_ID_ICE #ifndef PCI_VENDOR_ID_ICE
#define PCI_VENDOR_ID_ICE 0x1412 #define PCI_VENDOR_ID_ICE 0x1412
...@@ -386,7 +390,9 @@ int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr) ...@@ -386,7 +390,9 @@ int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr)
{ {
int err; int err;
if ((err = snd_cs8427_create(ice->i2c, addr, &ice->cs8427)) < 0) { if ((err = snd_cs8427_create(ice->i2c, addr,
(ice->cs8427_timeout * HZ) / 1000,
&ice->cs8427)) < 0) {
snd_printk("CS8427 initialization failed\n"); snd_printk("CS8427 initialization failed\n");
return err; return err;
} }
...@@ -1505,10 +1511,10 @@ static void snd_ice1712_mixer_free_ac97(ac97_t *ac97) ...@@ -1505,10 +1511,10 @@ static void snd_ice1712_mixer_free_ac97(ac97_t *ac97)
static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice) static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice)
{ {
int err; int err;
ac97_t ac97;
ac97_bus_t bus, *pbus;
if (ice_has_con_ac97(ice)) { if (ice_has_con_ac97(ice)) {
ac97_bus_t bus, *pbus;
ac97_t ac97;
memset(&bus, 0, sizeof(bus)); memset(&bus, 0, sizeof(bus));
bus.write = snd_ice1712_ac97_write; bus.write = snd_ice1712_ac97_write;
bus.read = snd_ice1712_ac97_read; bus.read = snd_ice1712_ac97_read;
...@@ -1527,8 +1533,6 @@ static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice) ...@@ -1527,8 +1533,6 @@ static int __devinit snd_ice1712_ac97_mixer(ice1712_t * ice)
} }
if (! (ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) { if (! (ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) {
ac97_bus_t bus, *pbus;
ac97_t ac97;
memset(&bus, 0, sizeof(bus)); memset(&bus, 0, sizeof(bus));
bus.write = snd_ice1712_pro_ac97_write; bus.write = snd_ice1712_pro_ac97_write;
bus.read = snd_ice1712_pro_ac97_read; bus.read = snd_ice1712_pro_ac97_read;
...@@ -2404,6 +2408,7 @@ static int snd_ice1712_dev_free(snd_device_t *device) ...@@ -2404,6 +2408,7 @@ static int snd_ice1712_dev_free(snd_device_t *device)
static int __devinit snd_ice1712_create(snd_card_t * card, static int __devinit snd_ice1712_create(snd_card_t * card,
struct pci_dev *pci, struct pci_dev *pci,
int omni, int omni,
int cs8427_timeout,
ice1712_t ** r_ice1712) ice1712_t ** r_ice1712)
{ {
ice1712_t *ice; ice1712_t *ice;
...@@ -2428,6 +2433,11 @@ static int __devinit snd_ice1712_create(snd_card_t * card, ...@@ -2428,6 +2433,11 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
if (ice == NULL) if (ice == NULL)
return -ENOMEM; return -ENOMEM;
ice->omni = omni ? 1 : 0; ice->omni = omni ? 1 : 0;
if (cs8427_timeout < 1)
cs8427_timeout = 1;
else if (cs8427_timeout > 1000)
cs8427_timeout = 1000;
ice->cs8427_timeout = cs8427_timeout;
spin_lock_init(&ice->reg_lock); spin_lock_init(&ice->reg_lock);
init_MUTEX(&ice->gpio_mutex); init_MUTEX(&ice->gpio_mutex);
init_MUTEX(&ice->open_mutex); init_MUTEX(&ice->open_mutex);
...@@ -2547,7 +2557,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, ...@@ -2547,7 +2557,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
strcpy(card->driver, "ICE1712"); strcpy(card->driver, "ICE1712");
strcpy(card->shortname, "ICEnsemble ICE1712"); strcpy(card->shortname, "ICEnsemble ICE1712");
if ((err = snd_ice1712_create(card, pci, omni[dev], &ice)) < 0) { if ((err = snd_ice1712_create(card, pci, omni[dev], cs8427_timeout[dev], &ice)) < 0) {
snd_card_free(card); snd_card_free(card);
return err; return err;
} }
......
...@@ -346,6 +346,7 @@ struct _snd_ice1712 { ...@@ -346,6 +346,7 @@ struct _snd_ice1712 {
snd_i2c_bus_t *i2c; /* I2C bus */ snd_i2c_bus_t *i2c; /* I2C bus */
snd_i2c_device_t *cs8404; /* CS8404A I2C device */ snd_i2c_device_t *cs8404; /* CS8404A I2C device */
snd_i2c_device_t *cs8427; /* CS8427 I2C device */ snd_i2c_device_t *cs8427; /* CS8427 I2C device */
unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */
snd_i2c_device_t *i2cdevs[2]; /* additional i2c devices */ snd_i2c_device_t *i2cdevs[2]; /* additional i2c devices */
struct ice1712_gpio { struct ice1712_gpio {
......
...@@ -96,7 +96,7 @@ MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect)."); ...@@ -96,7 +96,7 @@ MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (0 = auto-detect).");
MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:0"); MODULE_PARM_SYNTAX(ac97_clock, SNDRV_ENABLED ",default:0");
MODULE_PARM(ac97_quirk, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(ac97_quirk, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware.");
MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,3}},dialog:list,default:-1"); MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,4}},dialog:list,default:-1");
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(joystick, "Enable joystick for Intel i8x0 soundcard."); MODULE_PARM_DESC(joystick, "Enable joystick for Intel i8x0 soundcard.");
...@@ -824,19 +824,16 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs ...@@ -824,19 +824,16 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs
spin_lock(&chip->reg_lock); spin_lock(&chip->reg_lock);
status = igetdword(chip, chip->int_sta_reg); status = igetdword(chip, chip->int_sta_reg);
if ((status & chip->int_sta_mask) == 0) { if ((status & chip->int_sta_mask) == 0) {
static int err_count = 10;
if (status) { if (status) {
/* ack */ /* ack */
iputdword(chip, chip->int_sta_reg, status); iputdword(chip, chip->int_sta_reg, status);
/* some Nforce[2] boards have problems when
IRQ_NONE is returned here.
*/
if (chip->device_type != DEVICE_NFORCE) if (chip->device_type != DEVICE_NFORCE)
status ^= igetdword(chip, chip->int_sta_reg); status = 0;
} }
spin_unlock(&chip->reg_lock); spin_unlock(&chip->reg_lock);
if (chip->device_type != DEVICE_NFORCE && status && err_count) {
err_count--;
snd_printd("intel8x0: unknown IRQ bits 0x%x (sta_mask=0x%x)\n",
status, chip->int_sta_mask);
}
return IRQ_RETVAL(status); return IRQ_RETVAL(status);
} }
...@@ -1689,6 +1686,12 @@ static struct ac97_pcm ac97_pcm_defs[] __devinitdata = { ...@@ -1689,6 +1686,12 @@ static struct ac97_pcm ac97_pcm_defs[] __devinitdata = {
}; };
static struct ac97_quirk ac97_quirks[] __devinitdata = { static struct ac97_quirk ac97_quirks[] __devinitdata = {
{
.vendor = 0x0e11,
.device = 0x00b8,
.name = "Compaq Evo D510C",
.type = AC97_TUNE_HP_ONLY
},
{ {
.vendor = 0x1014, .vendor = 0x1014,
.device = 0x1f00, .device = 0x1f00,
...@@ -2739,6 +2742,7 @@ static int __devinit snd_intel8x0_joystick_probe(struct pci_dev *pci, ...@@ -2739,6 +2742,7 @@ static int __devinit snd_intel8x0_joystick_probe(struct pci_dev *pci,
pci_read_config_word(pci, 0xe6, &val); pci_read_config_word(pci, 0xe6, &val);
#ifdef SUPPORT_JOYSTICK #ifdef SUPPORT_JOYSTICK
val &= ~0x100;
if (joystick[dev]) { if (joystick[dev]) {
if (! request_region(ich_gameport.io, 8, "ICH gameport")) { if (! request_region(ich_gameport.io, 8, "ICH gameport")) {
printk(KERN_WARNING "intel8x0: cannot grab gameport 0x%x\n", ich_gameport.io); printk(KERN_WARNING "intel8x0: cannot grab gameport 0x%x\n", ich_gameport.io);
...@@ -2751,6 +2755,7 @@ static int __devinit snd_intel8x0_joystick_probe(struct pci_dev *pci, ...@@ -2751,6 +2755,7 @@ static int __devinit snd_intel8x0_joystick_probe(struct pci_dev *pci,
} }
#endif #endif
#ifdef SUPPORT_MIDI #ifdef SUPPORT_MIDI
val &= ~0x20;
if (mpu_port[dev] > 0) { if (mpu_port[dev] > 0) {
if (mpu_port[dev] == 0x300 || mpu_port[dev] == 0x330) { if (mpu_port[dev] == 0x300 || mpu_port[dev] == 0x330) {
u8 b; u8 b;
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <pcmcia/ciscode.h> #include <pcmcia/ciscode.h>
#include <pcmcia/cisreg.h> #include <pcmcia/cisreg.h>
#include "pdaudiocf.h" #include "pdaudiocf.h"
#define SNDRV_GET_ID
#include <sound/initval.h> #include <sound/initval.h>
/* /*
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <sound/core.h> #include <sound/core.h>
#include <sound/info.h> #include <sound/info.h>
#include "pdaudiocf.h" #include "pdaudiocf.h"
#define SNDRV_GET_ID
#include <sound/initval.h> #include <sound/initval.h>
/* /*
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <sound/driver.h> #include <sound/driver.h>
#include <sound/core.h> #include <sound/core.h>
#include "pdaudiocf.h" #include "pdaudiocf.h"
#define SNDRV_GET_ID
#include <sound/initval.h> #include <sound/initval.h>
/* /*
......
...@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL"); ...@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL");
static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
static int enable = 1; /* static int enable = 1; */
#ifdef PMAC_SUPPORT_PCM_BEEP #ifdef PMAC_SUPPORT_PCM_BEEP
static int enable_beep = 1; static int enable_beep = 1;
#endif #endif
...@@ -47,9 +47,9 @@ MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC); ...@@ -47,9 +47,9 @@ MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
MODULE_PARM(id, "s"); MODULE_PARM(id, "s");
MODULE_PARM_DESC(id, "ID string for " CHIP_NAME " soundchip."); MODULE_PARM_DESC(id, "ID string for " CHIP_NAME " soundchip.");
MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC); MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
MODULE_PARM(enable, "i"); /* MODULE_PARM(enable, "i");
MODULE_PARM_DESC(enable, "Enable this soundchip."); MODULE_PARM_DESC(enable, "Enable this soundchip.");
MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); */
#ifdef PMAC_SUPPORT_PCM_BEEP #ifdef PMAC_SUPPORT_PCM_BEEP
MODULE_PARM(enable_beep, "i"); MODULE_PARM(enable_beep, "i");
MODULE_PARM_DESC(enable_beep, "Enable beep using PCM."); MODULE_PARM_DESC(enable_beep, "Enable beep using PCM.");
...@@ -183,6 +183,8 @@ module_exit(alsa_card_pmac_exit) ...@@ -183,6 +183,8 @@ module_exit(alsa_card_pmac_exit)
static int __init alsa_card_pmac_setup(char *str) static int __init alsa_card_pmac_setup(char *str)
{ {
int __attribute__ ((__unused__)) enable = 1;
(void)(get_option(&str,&enable) == 2 && (void)(get_option(&str,&enable) == 2 &&
get_option(&str,&index) == 2 && get_option(&str,&index) == 2 &&
get_id(&str,&id) == 2 get_id(&str,&id) == 2
......
This diff is collapsed.
...@@ -207,7 +207,6 @@ void snd_usbmidi_disconnect(struct list_head *p, struct usb_driver *driver); ...@@ -207,7 +207,6 @@ void snd_usbmidi_disconnect(struct list_head *p, struct usb_driver *driver);
* (conditional for compatibility with the older API) * (conditional for compatibility with the older API)
*/ */
#ifndef get_iface_desc #ifndef get_iface_desc
#define get_iface(cfg, num) ((cfg)->interface[(num)])
#define get_iface_desc(iface) (&(iface)->desc) #define get_iface_desc(iface) (&(iface)->desc)
#define get_endpoint(alt,ep) (&(alt)->endpoint[ep].desc) #define get_endpoint(alt,ep) (&(alt)->endpoint[ep].desc)
#define get_ep_desc(ep) (&(ep)->desc) #define get_ep_desc(ep) (&(ep)->desc)
......
...@@ -714,7 +714,6 @@ void snd_usbmidi_disconnect(struct list_head* p, struct usb_driver *driver) ...@@ -714,7 +714,6 @@ void snd_usbmidi_disconnect(struct list_head* p, struct usb_driver *driver)
if (ep->in && ep->in->urb) if (ep->in && ep->in->urb)
usb_unlink_urb(ep->in->urb); usb_unlink_urb(ep->in->urb);
} }
usb_driver_release_interface(driver, umidi->iface);
} }
static void snd_usbmidi_rawmidi_free(snd_rawmidi_t* rmidi) static void snd_usbmidi_rawmidi_free(snd_rawmidi_t* rmidi)
......
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