sound/pci/intel8x0.c
1003
if (civ != igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV))
sound/pci/intel8x0.c
1014
if (ptr1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb))
sound/pci/intel8x0.c
1017
ptr = ichdev->last_pos;
sound/pci/intel8x0.c
1019
ptr1 <<= ichdev->pos_shift;
sound/pci/intel8x0.c
1020
ptr = ichdev->fragsize1 - ptr1;
sound/pci/intel8x0.c
1022
if (ptr < ichdev->last_pos) {
sound/pci/intel8x0.c
1024
pos_base = position / ichdev->fragsize1;
sound/pci/intel8x0.c
1025
last_base = ichdev->last_pos / ichdev->fragsize1;
sound/pci/intel8x0.c
1030
ptr = ichdev->last_pos;
sound/pci/intel8x0.c
1033
ichdev->last_pos = ptr;
sound/pci/intel8x0.c
1034
if (ptr >= ichdev->size)
sound/pci/intel8x0.c
1090
static int snd_intel8x0_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev)
sound/pci/intel8x0.c
1096
ichdev->substream = substream;
sound/pci/intel8x0.c
1098
runtime->hw.rates = ichdev->pcm->rates;
sound/pci/intel8x0.c
1107
runtime->private_data = ichdev;
sound/pci/intel8x0.c
2607
struct ichdev *ichdev = &chip->ichd[i];
sound/pci/intel8x0.c
2608
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
2609
if (! ichdev->substream || ! ichdev->suspended)
sound/pci/intel8x0.c
2611
if (ichdev->ichd == ICHD_PCMOUT)
sound/pci/intel8x0.c
2612
snd_intel8x0_setup_pcm_out(chip, ichdev->substream->runtime);
sound/pci/intel8x0.c
2613
iputdword(chip, port + ICH_REG_OFF_BDBAR, ichdev->bdbar_addr);
sound/pci/intel8x0.c
2614
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi);
sound/pci/intel8x0.c
2615
iputbyte(chip, port + ICH_REG_OFF_CIV, ichdev->civ);
sound/pci/intel8x0.c
2616
iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
sound/pci/intel8x0.c
2630
struct ichdev *ichdev;
sound/pci/intel8x0.c
2648
ichdev = &chip->ichd[ICHD_PCMOUT];
sound/pci/intel8x0.c
2649
ichdev->physbuf = subs->dma_buffer.addr;
sound/pci/intel8x0.c
2650
ichdev->size = ichdev->fragsize = INTEL8X0_TESTBUF_SIZE;
sound/pci/intel8x0.c
2651
ichdev->substream = NULL; /* don't process interrupts */
sound/pci/intel8x0.c
2659
snd_intel8x0_setup_periods(chip, ichdev);
sound/pci/intel8x0.c
2660
port = ichdev->reg_offset;
sound/pci/intel8x0.c
2668
iputdword(chip, ICHREG(ALI_DMACR), 1 << ichdev->ali_slot);
sound/pci/intel8x0.c
2676
civ = igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV);
sound/pci/intel8x0.c
2677
pos1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb);
sound/pci/intel8x0.c
2682
if (civ == igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV) &&
sound/pci/intel8x0.c
2683
pos1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb))
sound/pci/intel8x0.c
2689
pos = ichdev->fragsize1;
sound/pci/intel8x0.c
2690
pos -= pos1 << ichdev->pos_shift;
sound/pci/intel8x0.c
2691
pos += ichdev->position;
sound/pci/intel8x0.c
2697
iputdword(chip, ICHREG(ALI_DMACR), 1 << (ichdev->ali_slot + 16));
sound/pci/intel8x0.c
2703
while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH))
sound/pci/intel8x0.c
2864
struct ichdev *ichdev;
sound/pci/intel8x0.c
2958
ichdev = &chip->ichd[i];
sound/pci/intel8x0.c
2959
ichdev->ichd = i;
sound/pci/intel8x0.c
2960
ichdev->reg_offset = tbl[i].offset;
sound/pci/intel8x0.c
2961
ichdev->int_sta_mask = tbl[i].int_sta_mask;
sound/pci/intel8x0.c
2964
ichdev->roff_sr = ICH_REG_OFF_PICB;
sound/pci/intel8x0.c
2965
ichdev->roff_picb = ICH_REG_OFF_SR;
sound/pci/intel8x0.c
2967
ichdev->roff_sr = ICH_REG_OFF_SR;
sound/pci/intel8x0.c
2968
ichdev->roff_picb = ICH_REG_OFF_PICB;
sound/pci/intel8x0.c
2971
ichdev->ali_slot = (ichdev->reg_offset - 0x40) / 0x10;
sound/pci/intel8x0.c
2973
ichdev->pos_shift = (device_type == DEVICE_SIS) ? 0 : 1;
sound/pci/intel8x0.c
2988
ichdev = &chip->ichd[i];
sound/pci/intel8x0.c
2989
ichdev->bdbar = ((__le32 *)chip->bdbars->area) +
sound/pci/intel8x0.c
2991
ichdev->bdbar_addr = chip->bdbars->addr +
sound/pci/intel8x0.c
2993
int_sta_masks |= ichdev->int_sta_mask;
sound/pci/intel8x0.c
351
struct ichdev ichd[6];
sound/pci/intel8x0.c
636
static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ichdev)
sound/pci/intel8x0.c
639
__le32 *bdbar = ichdev->bdbar;
sound/pci/intel8x0.c
640
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
642
iputdword(chip, port + ICH_REG_OFF_BDBAR, ichdev->bdbar_addr);
sound/pci/intel8x0.c
643
if (ichdev->size == ichdev->fragsize) {
sound/pci/intel8x0.c
644
ichdev->ack_reload = ichdev->ack = 2;
sound/pci/intel8x0.c
645
ichdev->fragsize1 = ichdev->fragsize >> 1;
sound/pci/intel8x0.c
647
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf);
sound/pci/intel8x0.c
649
ichdev->fragsize1 >> ichdev->pos_shift);
sound/pci/intel8x0.c
650
bdbar[idx + 2] = cpu_to_le32(ichdev->physbuf + (ichdev->size >> 1));
sound/pci/intel8x0.c
652
ichdev->fragsize1 >> ichdev->pos_shift);
sound/pci/intel8x0.c
654
ichdev->frags = 2;
sound/pci/intel8x0.c
656
ichdev->ack_reload = ichdev->ack = 1;
sound/pci/intel8x0.c
657
ichdev->fragsize1 = ichdev->fragsize;
sound/pci/intel8x0.c
659
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf +
sound/pci/intel8x0.c
660
(((idx >> 1) * ichdev->fragsize) %
sound/pci/intel8x0.c
661
ichdev->size));
sound/pci/intel8x0.c
663
ichdev->fragsize >> ichdev->pos_shift);
sound/pci/intel8x0.c
669
ichdev->frags = ichdev->size / ichdev->fragsize;
sound/pci/intel8x0.c
671
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi = ICH_REG_LVI_MASK);
sound/pci/intel8x0.c
672
ichdev->civ = 0;
sound/pci/intel8x0.c
674
ichdev->lvi_frag = ICH_REG_LVI_MASK % ichdev->frags;
sound/pci/intel8x0.c
675
ichdev->position = 0;
sound/pci/intel8x0.c
679
ichdev->lvi_frag, ichdev->frags, ichdev->fragsize,
sound/pci/intel8x0.c
680
ichdev->fragsize1);
sound/pci/intel8x0.c
683
iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
sound/pci/intel8x0.c
690
static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev)
sound/pci/intel8x0.c
692
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
696
if (!(ichdev->prepared || chip->in_measurement) || ichdev->suspended)
sound/pci/intel8x0.c
700
status = igetbyte(chip, port + ichdev->roff_sr);
sound/pci/intel8x0.c
704
} else if (civ == ichdev->civ) {
sound/pci/intel8x0.c
706
ichdev->civ++;
sound/pci/intel8x0.c
707
ichdev->civ &= ICH_REG_LVI_MASK;
sound/pci/intel8x0.c
709
step = civ - ichdev->civ;
sound/pci/intel8x0.c
712
ichdev->civ = civ;
sound/pci/intel8x0.c
715
ichdev->position += step * ichdev->fragsize1;
sound/pci/intel8x0.c
717
ichdev->position %= ichdev->size;
sound/pci/intel8x0.c
718
ichdev->lvi += step;
sound/pci/intel8x0.c
719
ichdev->lvi &= ICH_REG_LVI_MASK;
sound/pci/intel8x0.c
720
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi);
sound/pci/intel8x0.c
722
ichdev->lvi_frag++;
sound/pci/intel8x0.c
723
ichdev->lvi_frag %= ichdev->frags;
sound/pci/intel8x0.c
724
ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf + ichdev->lvi_frag * ichdev->fragsize1);
sound/pci/intel8x0.c
728
ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2],
sound/pci/intel8x0.c
729
ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port),
sound/pci/intel8x0.c
732
if (--ichdev->ack == 0) {
sound/pci/intel8x0.c
733
ichdev->ack = ichdev->ack_reload;
sound/pci/intel8x0.c
738
if (ack && ichdev->substream) {
sound/pci/intel8x0.c
739
snd_pcm_period_elapsed(ichdev->substream);
sound/pci/intel8x0.c
741
iputbyte(chip, port + ichdev->roff_sr,
sound/pci/intel8x0.c
748
struct ichdev *ichdev;
sound/pci/intel8x0.c
767
ichdev = &chip->ichd[i];
sound/pci/intel8x0.c
768
if (status & ichdev->int_sta_mask)
sound/pci/intel8x0.c
769
snd_intel8x0_update(chip, ichdev);
sound/pci/intel8x0.c
785
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
787
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
791
ichdev->suspended = 0;
sound/pci/intel8x0.c
796
ichdev->last_pos = ichdev->position;
sound/pci/intel8x0.c
799
ichdev->suspended = 1;
sound/pci/intel8x0.c
813
while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH)) ;
sound/pci/intel8x0.c
823
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
824
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
833
ichdev->suspended = 0;
sound/pci/intel8x0.c
839
fifo = igetdword(chip, fiforeg[ichdev->ali_slot / 4]);
sound/pci/intel8x0.c
840
fifo &= ~(0xff << (ichdev->ali_slot % 4));
sound/pci/intel8x0.c
841
fifo |= 0x83 << (ichdev->ali_slot % 4);
sound/pci/intel8x0.c
842
iputdword(chip, fiforeg[ichdev->ali_slot / 4], fifo);
sound/pci/intel8x0.c
845
val &= ~(1 << (ichdev->ali_slot + 16)); /* clear PAUSE flag */
sound/pci/intel8x0.c
847
iputdword(chip, ICHREG(ALI_DMACR), val | (1 << ichdev->ali_slot));
sound/pci/intel8x0.c
850
ichdev->suspended = 1;
sound/pci/intel8x0.c
855
iputdword(chip, ICHREG(ALI_DMACR), val | (1 << (ichdev->ali_slot + 16)));
sound/pci/intel8x0.c
867
igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ichdev->int_sta_mask);
sound/pci/intel8x0.c
879
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
883
if (ichdev->pcm_open_flag) {
sound/pci/intel8x0.c
884
snd_ac97_pcm_close(ichdev->pcm);
sound/pci/intel8x0.c
885
ichdev->pcm_open_flag = 0;
sound/pci/intel8x0.c
886
ichdev->prepared = 0;
sound/pci/intel8x0.c
888
err = snd_ac97_pcm_open(ichdev->pcm, params_rate(hw_params),
sound/pci/intel8x0.c
890
ichdev->pcm->r[dbl].slots);
sound/pci/intel8x0.c
892
ichdev->pcm_open_flag = 1;
sound/pci/intel8x0.c
894
if (ichdev->ichd == ICHD_PCMOUT && chip->spdif_idx < 0)
sound/pci/intel8x0.c
895
snd_ac97_set_rate(ichdev->pcm->r[0].codec[0], AC97_SPDIF,
sound/pci/intel8x0.c
903
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
905
if (ichdev->pcm_open_flag) {
sound/pci/intel8x0.c
906
snd_ac97_pcm_close(ichdev->pcm);
sound/pci/intel8x0.c
907
ichdev->pcm_open_flag = 0;
sound/pci/intel8x0.c
908
ichdev->prepared = 0;
sound/pci/intel8x0.c
971
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
973
ichdev->physbuf = runtime->dma_addr;
sound/pci/intel8x0.c
974
ichdev->size = snd_pcm_lib_buffer_bytes(substream);
sound/pci/intel8x0.c
975
ichdev->fragsize = snd_pcm_lib_period_bytes(substream);
sound/pci/intel8x0.c
976
if (ichdev->ichd == ICHD_PCMOUT) {
sound/pci/intel8x0.c
979
ichdev->pos_shift = (runtime->sample_bits > 16) ? 2 : 1;
sound/pci/intel8x0.c
981
snd_intel8x0_setup_periods(chip, ichdev);
sound/pci/intel8x0.c
982
ichdev->prepared = 1;
sound/pci/intel8x0.c
989
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
996
civ = igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV);
sound/pci/intel8x0.c
997
ptr1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb);
sound/pci/intel8x0.c
998
position = ichdev->position;
sound/pci/intel8x0m.c
1042
struct ichdev *ichdev;
sound/pci/intel8x0m.c
1082
ichdev = &chip->ichd[i];
sound/pci/intel8x0m.c
1083
ichdev->ichd = i;
sound/pci/intel8x0m.c
1084
ichdev->reg_offset = tbl[i].offset;
sound/pci/intel8x0m.c
1085
ichdev->int_sta_mask = tbl[i].int_sta_mask;
sound/pci/intel8x0m.c
1088
ichdev->roff_sr = ICH_REG_OFF_PICB;
sound/pci/intel8x0m.c
1089
ichdev->roff_picb = ICH_REG_OFF_SR;
sound/pci/intel8x0m.c
1091
ichdev->roff_sr = ICH_REG_OFF_SR;
sound/pci/intel8x0m.c
1092
ichdev->roff_picb = ICH_REG_OFF_PICB;
sound/pci/intel8x0m.c
1095
ichdev->ali_slot = (ichdev->reg_offset - 0x40) / 0x10;
sound/pci/intel8x0m.c
1112
ichdev = &chip->ichd[i];
sound/pci/intel8x0m.c
1113
ichdev->bdbar = ((__le32 *)chip->bdbars->area) + (i * ICH_MAX_FRAGS * 2);
sound/pci/intel8x0m.c
1114
ichdev->bdbar_addr = chip->bdbars->addr + (i * sizeof(u32) * ICH_MAX_FRAGS * 2);
sound/pci/intel8x0m.c
1115
int_sta_masks |= ichdev->int_sta_mask;
sound/pci/intel8x0m.c
176
struct ichdev ichd[2];
sound/pci/intel8x0m.c
366
static void snd_intel8x0m_setup_periods(struct intel8x0m *chip, struct ichdev *ichdev)
sound/pci/intel8x0m.c
369
__le32 *bdbar = ichdev->bdbar;
sound/pci/intel8x0m.c
370
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0m.c
372
iputdword(chip, port + ICH_REG_OFF_BDBAR, ichdev->bdbar_addr);
sound/pci/intel8x0m.c
373
if (ichdev->size == ichdev->fragsize) {
sound/pci/intel8x0m.c
374
ichdev->ack_reload = ichdev->ack = 2;
sound/pci/intel8x0m.c
375
ichdev->fragsize1 = ichdev->fragsize >> 1;
sound/pci/intel8x0m.c
377
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf);
sound/pci/intel8x0m.c
379
ichdev->fragsize1 >> chip->pcm_pos_shift);
sound/pci/intel8x0m.c
380
bdbar[idx + 2] = cpu_to_le32(ichdev->physbuf + (ichdev->size >> 1));
sound/pci/intel8x0m.c
382
ichdev->fragsize1 >> chip->pcm_pos_shift);
sound/pci/intel8x0m.c
384
ichdev->frags = 2;
sound/pci/intel8x0m.c
386
ichdev->ack_reload = ichdev->ack = 1;
sound/pci/intel8x0m.c
387
ichdev->fragsize1 = ichdev->fragsize;
sound/pci/intel8x0m.c
389
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf + (((idx >> 1) * ichdev->fragsize) % ichdev->size));
sound/pci/intel8x0m.c
391
ichdev->fragsize >> chip->pcm_pos_shift);
sound/pci/intel8x0m.c
397
ichdev->frags = ichdev->size / ichdev->fragsize;
sound/pci/intel8x0m.c
399
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi = ICH_REG_LVI_MASK);
sound/pci/intel8x0m.c
400
ichdev->civ = 0;
sound/pci/intel8x0m.c
402
ichdev->lvi_frag = ICH_REG_LVI_MASK % ichdev->frags;
sound/pci/intel8x0m.c
403
ichdev->position = 0;
sound/pci/intel8x0m.c
407
ichdev->lvi_frag, ichdev->frags, ichdev->fragsize,
sound/pci/intel8x0m.c
408
ichdev->fragsize1);
sound/pci/intel8x0m.c
411
iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
sound/pci/intel8x0m.c
418
static inline void snd_intel8x0m_update(struct intel8x0m *chip, struct ichdev *ichdev)
sound/pci/intel8x0m.c
420
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0m.c
425
if (civ == ichdev->civ) {
sound/pci/intel8x0m.c
427
ichdev->civ++;
sound/pci/intel8x0m.c
428
ichdev->civ &= ICH_REG_LVI_MASK;
sound/pci/intel8x0m.c
430
step = civ - ichdev->civ;
sound/pci/intel8x0m.c
433
ichdev->civ = civ;
sound/pci/intel8x0m.c
436
ichdev->position += step * ichdev->fragsize1;
sound/pci/intel8x0m.c
437
ichdev->position %= ichdev->size;
sound/pci/intel8x0m.c
438
ichdev->lvi += step;
sound/pci/intel8x0m.c
439
ichdev->lvi &= ICH_REG_LVI_MASK;
sound/pci/intel8x0m.c
440
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi);
sound/pci/intel8x0m.c
442
ichdev->lvi_frag++;
sound/pci/intel8x0m.c
443
ichdev->lvi_frag %= ichdev->frags;
sound/pci/intel8x0m.c
444
ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf +
sound/pci/intel8x0m.c
445
ichdev->lvi_frag *
sound/pci/intel8x0m.c
446
ichdev->fragsize1);
sound/pci/intel8x0m.c
450
ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2],
sound/pci/intel8x0m.c
451
ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port),
sound/pci/intel8x0m.c
454
if (--ichdev->ack == 0) {
sound/pci/intel8x0m.c
455
ichdev->ack = ichdev->ack_reload;
sound/pci/intel8x0m.c
459
if (ack && ichdev->substream) {
sound/pci/intel8x0m.c
461
snd_pcm_period_elapsed(ichdev->substream);
sound/pci/intel8x0m.c
464
iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
sound/pci/intel8x0m.c
470
struct ichdev *ichdev;
sound/pci/intel8x0m.c
485
ichdev = &chip->ichd[i];
sound/pci/intel8x0m.c
486
if (status & ichdev->int_sta_mask)
sound/pci/intel8x0m.c
487
snd_intel8x0m_update(chip, ichdev);
sound/pci/intel8x0m.c
503
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0m.c
505
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0m.c
528
while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH)) ;
sound/pci/intel8x0m.c
538
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0m.c
541
ptr1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << chip->pcm_pos_shift;
sound/pci/intel8x0m.c
543
ptr = ichdev->fragsize1 - ptr1;
sound/pci/intel8x0m.c
546
ptr += ichdev->position;
sound/pci/intel8x0m.c
547
if (ptr >= ichdev->size)
sound/pci/intel8x0m.c
556
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0m.c
558
ichdev->physbuf = runtime->dma_addr;
sound/pci/intel8x0m.c
559
ichdev->size = snd_pcm_lib_buffer_bytes(substream);
sound/pci/intel8x0m.c
560
ichdev->fragsize = snd_pcm_lib_period_bytes(substream);
sound/pci/intel8x0m.c
561
snd_ac97_write(ichdev->ac97, AC97_LINE1_RATE, runtime->rate);
sound/pci/intel8x0m.c
562
snd_ac97_write(ichdev->ac97, AC97_LINE1_LEVEL, 0);
sound/pci/intel8x0m.c
563
snd_intel8x0m_setup_periods(chip, ichdev);
sound/pci/intel8x0m.c
589
static int snd_intel8x0m_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev)
sound/pci/intel8x0m.c
600
ichdev->substream = substream;
sound/pci/intel8x0m.c
606
runtime->private_data = ichdev;