Bugzilla – Attachment 49026 Details for
Bug 115253
No sound on Amilo M1437G notebook (hda-intel)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Equivalent patch to SUSE kernel tree
alsa-hda-intel-fix.diff (text/plain), 8.28 KB, created by
Takashi Iwai
on 2005-09-07 09:40:04 UTC
(
hide
)
Description:
Equivalent patch to SUSE kernel tree
Filename:
MIME Type:
Creator:
Takashi Iwai
Created:
2005-09-07 09:40:04 UTC
Size:
8.28 KB
patch
obsolete
>--- linux/sound/pci/hda/hda_codec.h 11 Aug 2005 09:55:46 -0000 1.11 >+++ linux/sound/pci/hda/hda_codec.h 7 Sep 2005 08:40:19 -0000 1.12 >@@ -505,6 +505,7 @@ > struct hda_pcm { > char *name; > struct hda_pcm_stream stream[2]; >+ unsigned int is_modem; /* modem codec? */ > }; > > /* codec information */ >--- linux/sound/pci/hda/hda_intel.c 24 Aug 2005 13:09:36 -0000 1.21 >+++ linux/sound/pci/hda/hda_intel.c 7 Sep 2005 08:40:19 -0000 1.23 >@@ -62,7 +62,7 @@ > module_param_array(model, charp, NULL, 0444); > MODULE_PARM_DESC(model, "Use the given board model."); > module_param_array(position_fix, int, NULL, 0444); >-MODULE_PARM_DESC(position_fix, "Fix DMA pointer (0 = FIFO size, 1 = none, 2 = POSBUF)."); >+MODULE_PARM_DESC(position_fix, "Fix DMA pointer (0 = auto, 1 = none, 2 = POSBUF, 3 = FIFO size)."); > > MODULE_LICENSE("GPL"); > MODULE_SUPPORTED_DEVICE("{{Intel, ICH6}," >@@ -164,7 +164,9 @@ > /* max buffer size - no h/w limit, you can increase as you like */ > #define AZX_MAX_BUF_SIZE (1024*1024*1024) > /* max number of PCM devics per card */ >-#define AZX_MAX_PCMS 8 >+#define AZX_MAX_AUDIO_PCMS 6 >+#define AZX_MAX_MODEM_PCMS 2 >+#define AZX_MAX_PCMS (AZX_MAX_AUDIO_PCMS + AZX_MAX_MODEM_PCMS) > > /* RIRB int mask: overrun[2], response[0] */ > #define RIRB_INT_RESPONSE 0x01 >@@ -211,9 +213,10 @@ > > /* position fix mode */ > enum { >- POS_FIX_FIFO, >+ POS_FIX_AUTO, > POS_FIX_NONE, >- POS_FIX_POSBUF >+ POS_FIX_POSBUF, >+ POS_FIX_FIFO, > }; > > /* Defines for ATI HD Audio support in SB450 south bridge */ >@@ -243,6 +246,7 @@ > unsigned int fragsize; /* size of each period in bytes */ > unsigned int frags; /* number for period in the play buffer */ > unsigned int fifo_size; /* FIFO size */ >+ unsigned int last_pos; /* last updated period position */ > > void __iomem *sd_addr; /* stream descriptor pointer */ > >@@ -256,6 +260,7 @@ > > unsigned int opened: 1; > unsigned int running: 1; >+ unsigned int period_updating: 1; > }; > > /* CORB/RIRB */ >@@ -724,11 +729,9 @@ > /* initialize the codec command I/O */ > azx_init_cmd_io(chip); > >- if (chip->position_fix == POS_FIX_POSBUF) { >- /* program the position buffer */ >- azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr); >- azx_writel(chip, DPUBASE, upper_32bit(chip->posbuf.addr)); >- } >+ /* program the position buffer */ >+ azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr); >+ azx_writel(chip, DPUBASE, upper_32bit(chip->posbuf.addr)); > > /* For ATI SB450 azalia HD audio, we need to enable snoop */ > if (chip->driver_type == AZX_DRIVER_ATI) { >@@ -763,9 +766,11 @@ > if (status & azx_dev->sd_int_sta_mask) { > azx_sd_writeb(azx_dev, SD_STS, SD_INT_MASK); > if (azx_dev->substream && azx_dev->running) { >+ azx_dev->period_updating = 1; > spin_unlock(&chip->reg_lock); > snd_pcm_period_elapsed(azx_dev->substream); > spin_lock(&chip->reg_lock); >+ azx_dev->period_updating = 0; > } > } > } >@@ -866,11 +871,9 @@ > /* upper BDL address */ > azx_sd_writel(azx_dev, SD_BDLPU, upper_32bit(azx_dev->bdl_addr)); > >- if (chip->position_fix == POS_FIX_POSBUF) { >- /* enable the position buffer */ >- if (! (azx_readl(chip, DPLBASE) & ICH6_DPLBASE_ENABLE)) >- azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr | ICH6_DPLBASE_ENABLE); >- } >+ /* enable the position buffer */ >+ if (! (azx_readl(chip, DPLBASE) & ICH6_DPLBASE_ENABLE)) >+ azx_writel(chip, DPLBASE, (u32)chip->posbuf.addr | ICH6_DPLBASE_ENABLE); > > /* set the interrupt enable bits in the descriptor control register */ > azx_sd_writel(azx_dev, SD_CTL, azx_sd_readl(azx_dev, SD_CTL) | SD_INT_MASK); >@@ -1078,6 +1081,7 @@ > azx_dev->fifo_size = azx_sd_readw(azx_dev, SD_FIFOSIZE) + 1; > else > azx_dev->fifo_size = 0; >+ azx_dev->last_pos = 0; > > return hinfo->ops.prepare(hinfo, apcm->codec, azx_dev->stream_tag, > azx_dev->format_val, substream); >@@ -1133,6 +1137,26 @@ > pos = azx_sd_readl(azx_dev, SD_LPIB); > if (chip->position_fix == POS_FIX_FIFO) > pos += azx_dev->fifo_size; >+ else if (chip->position_fix == POS_FIX_AUTO && azx_dev->period_updating) { >+ /* check the validity of DMA position */ >+ unsigned int diff = 0; >+ azx_dev->last_pos += azx_dev->fragsize; >+ if (azx_dev->last_pos > pos) >+ diff = azx_dev->last_pos - pos; >+ if (azx_dev->last_pos >= azx_dev->bufsize) { >+ if (pos < azx_dev->fragsize) >+ diff = 0; >+ azx_dev->last_pos = 0; >+ } >+ if (diff > 0 && diff <= azx_dev->fifo_size) >+ pos += azx_dev->fifo_size; >+ else { >+ snd_printdd(KERN_INFO "hda_intel: DMA position fix %d, switching to posbuf\n", diff); >+ chip->position_fix = POS_FIX_POSBUF; >+ pos = *azx_dev->posbuf; >+ } >+ azx_dev->period_updating = 0; >+ } > } > if (pos >= azx_dev->bufsize) > pos = 0; >@@ -1203,12 +1227,33 @@ > if ((err = snd_hda_build_pcms(chip->bus)) < 0) > return err; > >+ /* create audio PCMs */ > pcm_dev = 0; > list_for_each(p, &chip->bus->codec_list) { > codec = list_entry(p, struct hda_codec, list); > for (c = 0; c < codec->num_pcms; c++) { >- if (pcm_dev >= AZX_MAX_PCMS) { >- snd_printk(KERN_ERR SFX "Too many PCMs\n"); >+ if (codec->pcm_info[c].is_modem) >+ continue; /* create later */ >+ if (pcm_dev >= AZX_MAX_AUDIO_PCMS) { >+ snd_printk(KERN_ERR SFX "Too many audio PCMs\n"); >+ return -EINVAL; >+ } >+ err = create_codec_pcm(chip, codec, &codec->pcm_info[c], pcm_dev); >+ if (err < 0) >+ return err; >+ pcm_dev++; >+ } >+ } >+ >+ /* create modem PCMs */ >+ pcm_dev = AZX_MAX_AUDIO_PCMS; >+ list_for_each(p, &chip->bus->codec_list) { >+ codec = list_entry(p, struct hda_codec, list); >+ for (c = 0; c < codec->num_pcms; c++) { >+ if (! codec->pcm_info[c].is_modem) >+ continue; /* already created */ >+ if (pcm_dev >= AZX_MAX_MODEM_PCMS) { >+ snd_printk(KERN_ERR SFX "Too many modem PCMs\n"); > return -EINVAL; > } > err = create_codec_pcm(chip, codec, &codec->pcm_info[c], pcm_dev); >@@ -1244,8 +1289,7 @@ > azx_dev_t *azx_dev = &chip->azx_dev[i]; > azx_dev->bdl = (u32 *)(chip->bdl.area + off); > azx_dev->bdl_addr = chip->bdl.addr + off; >- if (chip->position_fix == POS_FIX_POSBUF) >- azx_dev->posbuf = (volatile u32 *)(chip->posbuf.area + i * 8); >+ azx_dev->posbuf = (volatile u32 *)(chip->posbuf.area + i * 8); > /* offset: SDI0=0x80, SDI1=0xa0, ... SDO3=0x160 */ > azx_dev->sd_addr = chip->remap_addr + (0x20 * i + 0x80); > /* int mask: SDI0=0x01, SDI1=0x02, ... SDO3=0x80 */ >@@ -1437,13 +1481,11 @@ > snd_printk(KERN_ERR SFX "cannot allocate BDL\n"); > goto errout; > } >- if (chip->position_fix == POS_FIX_POSBUF) { >- /* allocate memory for the position buffer */ >- if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), >- chip->num_streams * 8, &chip->posbuf)) < 0) { >- snd_printk(KERN_ERR SFX "cannot allocate posbuf\n"); >- goto errout; >- } >+ /* allocate memory for the position buffer */ >+ if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), >+ chip->num_streams * 8, &chip->posbuf)) < 0) { >+ snd_printk(KERN_ERR SFX "cannot allocate posbuf\n"); >+ goto errout; > } > /* allocate CORB/RIRB */ > if ((err = azx_alloc_cmd_io(chip)) < 0) >--- linux/sound/pci/hda/hda_proc.c 10 Jun 2005 17:08:38 -0000 1.4 >+++ linux/sound/pci/hda/hda_proc.c 7 Sep 2005 08:40:19 -0000 1.5 >@@ -207,6 +207,8 @@ > snd_iprintf(buffer, "Vendor Id: 0x%x\n", codec->vendor_id); > snd_iprintf(buffer, "Subsystem Id: 0x%x\n", codec->subsystem_id); > snd_iprintf(buffer, "Revision Id: 0x%x\n", codec->revision_id); >+ if (! codec->afg) >+ return; > snd_iprintf(buffer, "Default PCM: "); > print_pcm_caps(buffer, codec, codec->afg); > snd_iprintf(buffer, "Default Amp-In caps: "); >--- linux/sound/pci/hda/patch_realtek.c 23 Aug 2005 19:01:12 -0000 1.28 >+++ linux/sound/pci/hda/patch_realtek.c 5 Sep 2005 10:55:43 -0000 1.29 >@@ -1526,6 +1526,7 @@ > /* Back 3 jack, front 2 jack (Internal add Aux-In) */ > { .pci_subvendor = 0x1025, .pci_subdevice = 0xe310, .config = ALC880_3ST }, > { .pci_subvendor = 0x104d, .pci_subdevice = 0x81d6, .config = ALC880_3ST }, >+ { .pci_subvendor = 0x104d, .pci_subdevice = 0x81a0, .config = ALC880_3ST }, > > /* Back 3 jack plus 1 SPDIF out jack, front 2 jack */ > { .modelname = "3stack-digout", .config = ALC880_3ST_DIG }, >--- linux/sound/pci/hda/patch_si3054.c 11 Aug 2005 10:09:37 -0000 1.1 >+++ linux/sound/pci/hda/patch_si3054.c 7 Sep 2005 08:40:19 -0000 1.2 >@@ -214,6 +214,7 @@ > info->name = "Si3054 Modem"; > info->stream[SNDRV_PCM_STREAM_PLAYBACK] = si3054_pcm; > info->stream[SNDRV_PCM_STREAM_CAPTURE] = si3054_pcm; >+ info->is_modem = 1; > return 0; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 115253
:
48969
|
49025
| 49026 |
49056
|
50720
|
50820