Commit a270c7b7 authored by Jaroslav Kysela's avatar Jaroslav Kysela Committed by Jaroslav Kysela

[PATCH] ALSA update [10/12] - 2002/09/16

  - OSS mixer emulation
    - save the current volume values permanently
  - PCM midlevel
    - fixed 64bit division on non-ix86 32bit architectures
    - exported snd_pcm_new_stream()
  - PCI DMA allocation
    - fixes and updates
  - PCM Scatter-Gather code
    - don't set runtime->dma_bytes if runtime is null
  - CMI8330 - fix nor non-IsaPnP build
  - CMIPCI - added "Mic As Center/LFE" switch for model 039 or later
  - more initialization of structs in C99 style
  - intel8x0 - fixes for nvidia nforce
  - Maestro3 - added quirk for CF72 toughbook
  - VIA82xx - reset codec only when it's not ready
  - USB Audio
    - fixed oops at unloading if non-intialized substream exists
    - show interface number in proc files
    - clean up and fixed the parser of audio streams
parent 04c401f6
......@@ -46,6 +46,7 @@ struct _snd_oss_mixer_slot {
unsigned long private_value;
void *private_data;
void (*private_free)(snd_mixer_oss_slot_t *slot);
int volume[2];
};
struct _snd_oss_mixer {
......@@ -65,7 +66,6 @@ struct _snd_oss_mixer {
};
struct _snd_oss_file {
int volume[32][2];
snd_card_t *card;
snd_mixer_oss_t *mixer;
};
......
......@@ -460,6 +460,7 @@ void snd_pcm_lock(int unlock);
int snd_pcm_new(snd_card_t * card, char *id, int device,
int playback_count, int capture_count,
snd_pcm_t **rpcm);
int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count);
int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree);
......@@ -526,7 +527,7 @@ static inline void divl(u_int32_t high, u_int32_t low,
int c = 32;
while (n > 0xffffffffU) {
q1 <<= 1;
if (n > d) {
if (n >= d) {
n -= d;
q1 |= 1;
}
......
/* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "0.9.0rc3"
#define CONFIG_SND_DATE " (Wed Sep 11 18:36:14 2002 UTC)"
#define CONFIG_SND_DATE " (Mon Sep 16 18:05:43 2002 UTC)"
......@@ -538,43 +538,3 @@ int copy_from_user_toio(unsigned long dst, const void *src, size_t count)
return 0;
#endif
}
#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.
*/
#undef pci_alloc_consistent
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);
if (ret && ((*dma_handle + size - 1) & rmask)) {
pci_free_consistent(hwdev, size, ret, *dma_handle);
ret = 0;
}
hwdev->dma_mask = dma_mask; /* restore */
if (! ret)
ret = pci_alloc_consistent(hwdev, size, dma_handle);
return ret;
}
#endif /* hack */
......@@ -253,8 +253,8 @@ static int snd_mixer_oss_get_volume(snd_mixer_oss_file_t *fmixer, int slot)
if (mixer == NULL || slot > 30)
return -EIO;
pslot = &mixer->slots[slot];
left = fmixer->volume[slot][0];
right = fmixer->volume[slot][1];
left = pslot->volume[0];
right = pslot->volume[1];
if (pslot->get_volume)
result = pslot->get_volume(fmixer, pslot, &left, &right);
if (!pslot->stereo)
......@@ -262,8 +262,8 @@ static int snd_mixer_oss_get_volume(snd_mixer_oss_file_t *fmixer, int slot)
snd_assert(left >= 0 && left <= 100, return -EIO);
snd_assert(right >= 0 && right <= 100, return -EIO);
if (result >= 0) {
fmixer->volume[slot][0] = left;
fmixer->volume[slot][1] = right;
pslot->volume[0] = left;
pslot->volume[1] = right;
result = (left & 0xff) | ((right & 0xff) << 8);
}
return result;
......@@ -284,13 +284,13 @@ static int snd_mixer_oss_set_volume(snd_mixer_oss_file_t *fmixer,
if (right > 100)
right = 100;
if (!pslot->stereo)
left = right = left;
right = left;
if (pslot->put_volume)
result = pslot->put_volume(fmixer, pslot, left, right);
if (result < 0)
return result;
fmixer->volume[slot][0] = left;
fmixer->volume[slot][1] = right;
pslot->volume[0] = left;
pslot->volume[1] = right;
return (left & 0xff) | ((right & 0xff) << 8);
}
......@@ -409,6 +409,7 @@ static long snd_mixer_oss_conv(long val, long omin, long omax, long nmin, long n
return ((nrange * (val - omin)) + (orange / 2)) / orange + nmin;
}
/* convert from alsa native to oss values (0-100) */
static long snd_mixer_oss_conv1(long val, long min, long max, int *old)
{
if (val == snd_mixer_oss_conv(*old, 0, 100, min, max))
......@@ -416,6 +417,7 @@ static long snd_mixer_oss_conv1(long val, long min, long max, int *old)
return snd_mixer_oss_conv(val, min, max, 0, 100);
}
/* convert from oss to alsa native values */
static long snd_mixer_oss_conv2(long val, long min, long max)
{
return snd_mixer_oss_conv(val, 0, 100, min, max);
......@@ -502,9 +504,9 @@ static void snd_mixer_oss_get_volume1_vol(snd_mixer_oss_file_t *fmixer,
snd_runtime_check(!kctl->info(kctl, &uinfo), return);
snd_runtime_check(!kctl->get(kctl, &uctl), return);
snd_runtime_check(uinfo.type != SNDRV_CTL_ELEM_TYPE_BOOLEAN || uinfo.value.integer.min != 0 || uinfo.value.integer.max != 1, return);
*left = snd_mixer_oss_conv1(uctl.value.integer.value[0], uinfo.value.integer.min, uinfo.value.integer.max, &fmixer->volume[pslot->number][0]);
*left = snd_mixer_oss_conv1(uctl.value.integer.value[0], uinfo.value.integer.min, uinfo.value.integer.max, &pslot->volume[0]);
if (uinfo.count > 1)
*right = snd_mixer_oss_conv1(uctl.value.integer.value[1], uinfo.value.integer.min, uinfo.value.integer.max, &fmixer->volume[pslot->number][1]);
*right = snd_mixer_oss_conv1(uctl.value.integer.value[1], uinfo.value.integer.min, uinfo.value.integer.max, &pslot->volume[1]);
}
static void snd_mixer_oss_get_volume1_sw(snd_mixer_oss_file_t *fmixer,
......
......@@ -541,12 +541,10 @@ static int snd_pcm_substream_proc_done(snd_pcm_substream_t *substream)
return 0;
}
static int snd_pcm_new_stream(snd_pcm_t *pcm,
snd_pcm_str_t *pstr,
int substream_count,
int stream)
int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count)
{
int idx, err;
snd_pcm_str_t *pstr = &pcm->streams[stream];
snd_pcm_substream_t *substream, *prev;
#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
......@@ -614,11 +612,11 @@ int snd_pcm_new(snd_card_t * card, char *id, int device,
if (id) {
strncpy(pcm->id, id, sizeof(pcm->id) - 1);
}
if ((err = snd_pcm_new_stream(pcm, &pcm->streams[SNDRV_PCM_STREAM_PLAYBACK], playback_count, SNDRV_PCM_STREAM_PLAYBACK)) < 0) {
if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK, playback_count)) < 0) {
snd_pcm_free(pcm);
return err;
}
if ((err = snd_pcm_new_stream(pcm, &pcm->streams[SNDRV_PCM_STREAM_CAPTURE], capture_count, SNDRV_PCM_STREAM_CAPTURE)) < 0) {
if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_CAPTURE, capture_count)) < 0) {
snd_pcm_free(pcm);
return err;
}
......@@ -974,6 +972,7 @@ module_exit(alsa_pcm_exit)
EXPORT_SYMBOL(snd_pcm_lock);
EXPORT_SYMBOL(snd_pcm_devices);
EXPORT_SYMBOL(snd_pcm_new);
EXPORT_SYMBOL(snd_pcm_new_stream);
EXPORT_SYMBOL(snd_pcm_notify);
EXPORT_SYMBOL(snd_pcm_open_substream);
EXPORT_SYMBOL(snd_pcm_release_substream);
......
......@@ -110,7 +110,8 @@ int snd_pcm_sgbuf_alloc(snd_pcm_substream_t *substream, size_t size)
if (pages < sgbuf->pages) {
/* release unsed pages */
sgbuf_shrink(sgbuf, pages);
substream->runtime->dma_bytes = size;
if (substream->runtime)
substream->runtime->dma_bytes = size;
return 1; /* changed */
} else if (pages > sgbuf->tblsize) {
/* bigger than existing one. reallocate the table. */
......@@ -136,7 +137,8 @@ int snd_pcm_sgbuf_alloc(snd_pcm_substream_t *substream, size_t size)
changed = 1;
}
sgbuf->size = size;
substream->runtime->dma_bytes = size;
if (substream->runtime)
substream->runtime->dma_bytes = size;
return changed;
}
......
......@@ -59,3 +59,49 @@ void snd_wrapper_vfree(void *obj)
vfree(obj);
}
#endif
/* check the condition in <sound/core.h> !! */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
#if defined(__i386__) || defined(__ppc__) || defined(__x86_64__)
#include <linux/pci.h>
/*
* 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);
if (ret && ((*dma_handle + size - 1) & rmask)) {
pci_free_consistent(hwdev, size, ret, *dma_handle);
ret = 0;
}
hwdev->dma_mask = dma_mask; /* restore */
if (! ret)
ret = pci_alloc_consistent(hwdev, size, dma_handle);
return ret;
}
#endif
#endif
......@@ -46,6 +46,11 @@
#include <sound/driver.h>
#include <linux/init.h>
#include <linux/slab.h>
#ifndef LINUX_ISAPNP_H
#include <linux/isapnp.h>
#define isapnp_card pci_bus
#define isapnp_dev pci_dev
#endif
#include <sound/core.h>
#include <sound/ad1848.h>
#include <sound/sb.h>
......
......@@ -257,6 +257,7 @@ MODULE_PARM_SYNTAX(snd_fm_port, SNDRV_ENABLED ",allows:{{-1},{0x388},{0x3c8},{0x
#define CM_REG_MISC 0x27
#define CM_XGPO1 0x20
// #define CM_XGPBIO 0x04
#define CM_MIC_CENTER_LFE 0x04 /* mic as center/lfe out? (model 039 or later?) */
#define CM_SPDIF_INVERSE 0x04 /* spdif input phase inverse (model 037) */
#define CM_SPDVALID 0x02 /* spdif input valid check */
#define CM_DMAUTO 0x01
......@@ -2257,6 +2258,7 @@ static snd_kcontrol_new_t snd_cmipci_extra_mixer_switches[] __devinitdata = {
DEFINE_MIXER_SWITCH("Line-In As Bass", line_bass),
DEFINE_MIXER_SWITCH("IEC958 In Select", spdif_in_sel2),
DEFINE_MIXER_SWITCH("IEC958 In Phase Inverse", spdi_phase2),
DEFINE_MIXER_SWITCH("Mic As Center/LFE", spdi_phase), /* same bit as spdi_phase */
};
/* card control switches */
......
......@@ -692,20 +692,20 @@ static int snd_emu10k1_fx8010_playback_copy(snd_pcm_substream_t *substream,
static snd_pcm_hardware_t snd_emu10k1_fx8010_playback =
{
info: (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
/* SNDRV_PCM_INFO_MMAP_VALID | */ SNDRV_PCM_INFO_PAUSE),
formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
rates: SNDRV_PCM_RATE_48000,
rate_min: 48000,
rate_max: 48000,
channels_min: 1,
channels_max: 1,
buffer_bytes_max: (128*1024),
period_bytes_min: 1024,
period_bytes_max: (128*1024),
periods_min: 1,
periods_max: 1024,
fifo_size: 0,
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_48000,
.rate_min = 48000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 1,
.buffer_bytes_max = (128*1024),
.period_bytes_min = 1024,
.period_bytes_max = (128*1024),
.periods_min = 1,
.periods_max = 1024,
.fifo_size = 0,
};
static int snd_emu10k1_fx8010_playback_open(snd_pcm_substream_t * substream)
......
......@@ -1363,45 +1363,45 @@ static snd_pcm_uframes_t snd_es1968_pcm_pointer(snd_pcm_substream_t *substream)
}
static snd_pcm_hardware_t snd_es1968_playback = {
info: (SNDRV_PCM_INFO_MMAP |
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
/*SNDRV_PCM_INFO_PAUSE |*/
SNDRV_PCM_INFO_RESUME),
formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
rate_min: 4000,
rate_max: 48000,
channels_min: 1,
channels_max: 2,
buffer_bytes_max: 65536,
period_bytes_min: 256,
period_bytes_max: 65536,
periods_min: 1,
periods_max: 1024,
fifo_size: 0,
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
.rate_min = 4000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 2,
.buffer_bytes_max = 65536,
.period_bytes_min = 256,
.period_bytes_max = 65536,
.periods_min = 1,
.periods_max = 1024,
.fifo_size = 0,
};
static snd_pcm_hardware_t snd_es1968_capture = {
info: (SNDRV_PCM_INFO_NONINTERLEAVED |
.info = (SNDRV_PCM_INFO_NONINTERLEAVED |
SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
/*SNDRV_PCM_INFO_PAUSE |*/
SNDRV_PCM_INFO_RESUME),
formats: /*SNDRV_PCM_FMTBIT_U8 |*/ SNDRV_PCM_FMTBIT_S16_LE,
rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
rate_min: 4000,
rate_max: 48000,
channels_min: 1,
channels_max: 2,
buffer_bytes_max: 65536,
period_bytes_min: 256,
period_bytes_max: 65536,
periods_min: 1,
periods_max: 1024,
fifo_size: 0,
.formats = /*SNDRV_PCM_FMTBIT_U8 |*/ SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
.rate_min = 4000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 2,
.buffer_bytes_max = 65536,
.period_bytes_min = 256,
.period_bytes_max = 65536,
.periods_min = 1,
.periods_max = 1024,
.fifo_size = 0,
};
/* *************************
......
......@@ -1186,7 +1186,7 @@ static void snd_ice1712_set_pro_rate(ice1712_t *ice, snd_pcm_substream_t *substr
{
unsigned long flags;
unsigned int rate;
unsigned char val, tmp;
unsigned char val, tmp, tmp2;
spin_lock_irqsave(&ice->reg_lock, flags);
if (inb(ICEMT(ice, PLAYBACK_CONTROL)) & (ICE1712_CAPTURE_START_SHADOW|
......@@ -1224,17 +1224,25 @@ static void snd_ice1712_set_pro_rate(ice1712_t *ice, snd_pcm_substream_t *substr
case ICE1712_SUBDEVICE_DELTA44:
case ICE1712_SUBDEVICE_AUDIOPHILE:
spin_unlock_irqrestore(&ice->reg_lock, flags);
snd_ice1712_ak4524_reset(ice, 1);
down(&ice->gpio_mutex);
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
if (val == 15 || val == 11 || val == 7) {
tmp |= ICE1712_DELTA_DFS;
} else {
tmp &= ~ICE1712_DELTA_DFS;
}
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
up(&ice->gpio_mutex);
snd_ice1712_ak4524_reset(ice, 0);
tmp2 = tmp;
tmp2 &= ~ICE1712_DELTA_DFS;
if (val == 15 || val == 11 || val == 7)
tmp2 |= ICE1712_DELTA_DFS;
if (tmp != tmp2) {
snd_ice1712_ak4524_reset(ice, 1);
down(&ice->gpio_mutex);
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
if (val == 15 || val == 11 || val == 7)
tmp |= ICE1712_DELTA_DFS;
else
tmp &= ~ICE1712_DELTA_DFS;
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
up(&ice->gpio_mutex);
snd_ice1712_ak4524_reset(ice, 0);
}
return;
}
__end:
......
......@@ -2147,7 +2147,8 @@ static int __devinit snd_intel8x0_create(snd_card_t * card,
chip->pci = pci;
chip->irq = -1;
snd_intel8x0_proc_init(chip);
if (pci_resource_flags(pci, 2) & IORESOURCE_MEM) { /* ICH4 and higher */
if (chip->device_type == DEVICE_INTEL_ICH4 &&
(pci_resource_flags(pci, 2) & IORESOURCE_MEM)) { /* ICH4 and higher */
chip->mmio = chip->bm_mmio = 1;
chip->addr = pci_resource_start(pci, 2);
sprintf(chip->ac97_name, "%s - AC'97", card->shortname);
......
......@@ -779,6 +779,7 @@ typedef struct snd_m3 m3_t;
/* quirk lists */
struct m3_quirk {
const char *name; /* device name */
u16 vendor, device; /* subsystem ids */
int amp_gpio; /* gpio pin # for external amp, -1 = default */
int irda_workaround; /* non-zero if avoid to touch 0x10 on GPIO_DIRECTION
......@@ -918,23 +919,33 @@ MODULE_DEVICE_TABLE(pci, snd_m3_ids);
static struct m3_quirk m3_quirk_list[] = {
/* panasonic CF-28 "toughbook" */
{
vendor: 0x10f7,
device: 0x833e,
amp_gpio: 0x0d,
.name = "Panasonic CF-28",
.vendor = 0x10f7,
.device = 0x833e,
.amp_gpio = 0x0d,
},
/* panasonic CF-72 "toughbook" */
{
.name = "Panasonic CF-72",
.vendor = 0x10f7,
.device = 0x833d,
.amp_gpio = 0x0d,
},
/* Dell Inspiron 4000 */
{
vendor: 0x1028,
device: 0x00b0,
amp_gpio: -1,
irda_workaround: 1,
.name = "Dell Inspiron 4000",
.vendor = 0x1028,
.device = 0x00b0,
.amp_gpio = -1,
.irda_workaround = 1,
},
/* Dell Inspiron 8000 */
{
vendor: 0x1028,
device: 0x00a4,
amp_gpio: -1,
irda_workaround: 1,
.name = "Dell Insprion 8000",
.vendor = 0x1028,
.device = 0x00a4,
.amp_gpio = -1,
.irda_workaround = 1,
},
/* FIXME: Inspiron 8100 and 8200 ids should be here, too */
/* END */
......@@ -1581,44 +1592,44 @@ snd_m3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static snd_pcm_hardware_t snd_m3_playback =
{
info: (SNDRV_PCM_INFO_MMAP |
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
/*SNDRV_PCM_INFO_PAUSE |*/
SNDRV_PCM_INFO_RESUME),
formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
rate_min: 8000,
rate_max: 48000,
channels_min: 1,
channels_max: 2,
buffer_bytes_max: (512*1024),
period_bytes_min: 64,
period_bytes_max: (512*1024),
periods_min: 1,
periods_max: 1024,
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 2,
.buffer_bytes_max = (512*1024),
.period_bytes_min = 64,
.period_bytes_max = (512*1024),
.periods_min = 1,
.periods_max = 1024,
};
static snd_pcm_hardware_t snd_m3_capture =
{
info: (SNDRV_PCM_INFO_MMAP |
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
/*SNDRV_PCM_INFO_PAUSE |*/
SNDRV_PCM_INFO_RESUME),
formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
rates: SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
rate_min: 8000,
rate_max: 48000,
channels_min: 1,
channels_max: 2,
buffer_bytes_max: (512*1024),
period_bytes_min: 64,
period_bytes_max: (512*1024),
periods_min: 1,
periods_max: 1024,
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 2,
.buffer_bytes_max = (512*1024),
.period_bytes_min = 64,
.period_bytes_max = (512*1024),
.periods_min = 1,
.periods_max = 1024,
};
......@@ -2547,6 +2558,7 @@ snd_m3_create(snd_card_t *card, struct pci_dev *pci,
for (quirk = m3_quirk_list; quirk->vendor; quirk++) {
if (subsystem_vendor == quirk->vendor &&
subsystem_device == quirk->device) {
printk(KERN_INFO "maestro3: enabled hack for '%s'\n", quirk->name);
chip->quirk = quirk;
break;
}
......
......@@ -751,46 +751,46 @@ snd_nm256_capture_update(nm256_t *chip)
*/
static snd_pcm_hardware_t snd_nm256_playback =
{
info:
.info =
#ifdef __i386__
SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID|
#endif
SNDRV_PCM_INFO_INTERLEAVED |
/*SNDRV_PCM_INFO_PAUSE |*/
SNDRV_PCM_INFO_RESUME,
formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
rates: SNDRV_PCM_RATE_KNOT/*24k*/ | SNDRV_PCM_RATE_8000_48000,
rate_min: 8000,
rate_max: 48000,
channels_min: 1,
channels_max: 2,
periods_min: 2,
periods_max: 1024,
buffer_bytes_max: 128 * 1024,
period_bytes_min: 256,
period_bytes_max: 128 * 1024,
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_KNOT/*24k*/ | SNDRV_PCM_RATE_8000_48000,
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 2,
.periods_min = 2,
.periods_max = 1024,
.buffer_bytes_max = 128 * 1024,
.period_bytes_min = 256,
.period_bytes_max = 128 * 1024,
};
static snd_pcm_hardware_t snd_nm256_capture =
{
info:
.info =
#ifdef __i386__
SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID|
#endif
SNDRV_PCM_INFO_INTERLEAVED |
/*SNDRV_PCM_INFO_PAUSE |*/
SNDRV_PCM_INFO_RESUME,
formats: SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
rates: SNDRV_PCM_RATE_KNOT/*24k*/ | SNDRV_PCM_RATE_8000_48000,
rate_min: 8000,
rate_max: 48000,
channels_min: 1,
channels_max: 2,
periods_min: 2,
periods_max: 1024,
buffer_bytes_max: 128 * 1024,
period_bytes_min: 256,
period_bytes_max: 128 * 1024,
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_KNOT/*24k*/ | SNDRV_PCM_RATE_8000_48000,
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
.channels_max = 2,
.periods_min = 2,
.periods_max = 1024,
.buffer_bytes_max = 128 * 1024,
.period_bytes_min = 256,
.period_bytes_max = 128 * 1024,
};
......
......@@ -25,7 +25,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: hammerfall_mem.c,v 1.2 2002/06/19 08:52:11 perex Exp $
$Id: hammerfall_mem.c,v 1.3 2002/09/12 09:03:28 tiwai Exp $
Tue Oct 17 2000 Jaroslav Kysela <perex@suse.cz>
......@@ -93,11 +93,6 @@ static hammerfall_buf_t hammerfall_buffers[NBUFS];
undesirable.
*/
/* remove hack for pci_alloc_consistent to avoid dependecy on snd module */
#ifdef HACK_PCI_ALLOC_CONSISTENT
#undef pci_alloc_consistent
#endif
static void *hammerfall_malloc_pages(struct pci_dev *pci,
unsigned long size,
dma_addr_t *dmaaddr)
......
......@@ -977,20 +977,22 @@ static int __devinit snd_via82xx_chip_init(via82xx_t *chip)
/* disable all legacy ports */
pci_write_config_byte(chip->pci, 0x42, 0);
#endif
/* deassert ACLink reset, force SYNC */
pci_write_config_byte(chip->pci, 0x41, 0xe0);
udelay(100);
/* deassert ACLink reset, force SYNC (warm AC'97 reset) */
pci_write_config_byte(chip->pci, 0x41, 0x60);
udelay(2);
/* pci_write_config_byte(chip->pci, 0x41, 0x00);
udelay(100);
*/
/* ACLink on, deassert ACLink reset, VSR, SGD data out */
/* note - FM data out has trouble with non VRA codecs !! */
pci_write_config_byte(chip->pci, 0x41, 0xcc);
udelay(100);
pci_read_config_byte(chip->pci, 0x40, &pval);
if (! (pval & 0x01)) { /* codec not ready? */
/* deassert ACLink reset, force SYNC */
pci_write_config_byte(chip->pci, 0x41, 0xe0);
udelay(100);
/* deassert ACLink reset, force SYNC (warm AC'97 reset) */
pci_write_config_byte(chip->pci, 0x41, 0x60);
udelay(2);
/* pci_write_config_byte(chip->pci, 0x41, 0x00);
udelay(100);
*/
/* ACLink on, deassert ACLink reset, VSR, SGD data out */
/* note - FM data out has trouble with non VRA codecs !! */
pci_write_config_byte(chip->pci, 0x41, 0xcc);
udelay(100);
}
/* Make sure VRA is enabled, in case we didn't do a
* complete codec reset, above */
......
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