Symbol: ichdev
sound/pci/intel8x0.c
1041
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
1043
ichdev->physbuf = runtime->dma_addr;
sound/pci/intel8x0.c
1044
ichdev->size = snd_pcm_lib_buffer_bytes(substream);
sound/pci/intel8x0.c
1045
ichdev->fragsize = snd_pcm_lib_period_bytes(substream);
sound/pci/intel8x0.c
1046
if (ichdev->ichd == ICHD_PCMOUT) {
sound/pci/intel8x0.c
1049
ichdev->pos_shift = (runtime->sample_bits > 16) ? 2 : 1;
sound/pci/intel8x0.c
1051
snd_intel8x0_setup_periods(chip, ichdev);
sound/pci/intel8x0.c
1052
ichdev->prepared = 1;
sound/pci/intel8x0.c
1059
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
1066
civ = igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV);
sound/pci/intel8x0.c
1067
ptr1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb);
sound/pci/intel8x0.c
1068
position = ichdev->position;
sound/pci/intel8x0.c
1073
if (civ != igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV))
sound/pci/intel8x0.c
1084
if (ptr1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb))
sound/pci/intel8x0.c
1087
ptr = ichdev->last_pos;
sound/pci/intel8x0.c
1089
ptr1 <<= ichdev->pos_shift;
sound/pci/intel8x0.c
1090
ptr = ichdev->fragsize1 - ptr1;
sound/pci/intel8x0.c
1092
if (ptr < ichdev->last_pos) {
sound/pci/intel8x0.c
1094
pos_base = position / ichdev->fragsize1;
sound/pci/intel8x0.c
1095
last_base = ichdev->last_pos / ichdev->fragsize1;
sound/pci/intel8x0.c
1100
ptr = ichdev->last_pos;
sound/pci/intel8x0.c
1103
ichdev->last_pos = ptr;
sound/pci/intel8x0.c
1104
if (ptr >= ichdev->size)
sound/pci/intel8x0.c
1160
static int snd_intel8x0_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev)
sound/pci/intel8x0.c
1166
ichdev->substream = substream;
sound/pci/intel8x0.c
1168
runtime->hw.rates = ichdev->pcm->rates;
sound/pci/intel8x0.c
1177
runtime->private_data = ichdev;
sound/pci/intel8x0.c
2677
struct ichdev *ichdev = &chip->ichd[i];
sound/pci/intel8x0.c
2678
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
2679
if (! ichdev->substream || ! ichdev->suspended)
sound/pci/intel8x0.c
2681
if (ichdev->ichd == ICHD_PCMOUT)
sound/pci/intel8x0.c
2682
snd_intel8x0_setup_pcm_out(chip, ichdev->substream->runtime);
sound/pci/intel8x0.c
2683
iputdword(chip, port + ICH_REG_OFF_BDBAR, ichdev->bdbar_addr);
sound/pci/intel8x0.c
2684
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi);
sound/pci/intel8x0.c
2685
iputbyte(chip, port + ICH_REG_OFF_CIV, ichdev->civ);
sound/pci/intel8x0.c
2686
iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
sound/pci/intel8x0.c
2700
struct ichdev *ichdev;
sound/pci/intel8x0.c
2718
ichdev = &chip->ichd[ICHD_PCMOUT];
sound/pci/intel8x0.c
2719
ichdev->physbuf = subs->dma_buffer.addr;
sound/pci/intel8x0.c
2720
ichdev->size = ichdev->fragsize = INTEL8X0_TESTBUF_SIZE;
sound/pci/intel8x0.c
2721
ichdev->substream = NULL; /* don't process interrupts */
sound/pci/intel8x0.c
2729
snd_intel8x0_setup_periods(chip, ichdev);
sound/pci/intel8x0.c
2730
port = ichdev->reg_offset;
sound/pci/intel8x0.c
2738
iputdword(chip, ICHREG(ALI_DMACR), 1 << ichdev->ali_slot);
sound/pci/intel8x0.c
2746
civ = igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV);
sound/pci/intel8x0.c
2747
pos1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb);
sound/pci/intel8x0.c
2752
if (civ == igetbyte(chip, ichdev->reg_offset + ICH_REG_OFF_CIV) &&
sound/pci/intel8x0.c
2753
pos1 == igetword(chip, ichdev->reg_offset + ichdev->roff_picb))
sound/pci/intel8x0.c
2759
pos = ichdev->fragsize1;
sound/pci/intel8x0.c
2760
pos -= pos1 << ichdev->pos_shift;
sound/pci/intel8x0.c
2761
pos += ichdev->position;
sound/pci/intel8x0.c
2767
iputdword(chip, ICHREG(ALI_DMACR), 1 << (ichdev->ali_slot + 16));
sound/pci/intel8x0.c
2773
while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH))
sound/pci/intel8x0.c
2934
struct ichdev *ichdev;
sound/pci/intel8x0.c
3028
ichdev = &chip->ichd[i];
sound/pci/intel8x0.c
3029
ichdev->ichd = i;
sound/pci/intel8x0.c
3030
ichdev->reg_offset = tbl[i].offset;
sound/pci/intel8x0.c
3031
ichdev->int_sta_mask = tbl[i].int_sta_mask;
sound/pci/intel8x0.c
3034
ichdev->roff_sr = ICH_REG_OFF_PICB;
sound/pci/intel8x0.c
3035
ichdev->roff_picb = ICH_REG_OFF_SR;
sound/pci/intel8x0.c
3037
ichdev->roff_sr = ICH_REG_OFF_SR;
sound/pci/intel8x0.c
3038
ichdev->roff_picb = ICH_REG_OFF_PICB;
sound/pci/intel8x0.c
3041
ichdev->ali_slot = (ichdev->reg_offset - 0x40) / 0x10;
sound/pci/intel8x0.c
3043
ichdev->pos_shift = (device_type == DEVICE_SIS) ? 0 : 1;
sound/pci/intel8x0.c
3058
ichdev = &chip->ichd[i];
sound/pci/intel8x0.c
3059
ichdev->bdbar = ((__le32 *)chip->bdbars->area) +
sound/pci/intel8x0.c
3061
ichdev->bdbar_addr = chip->bdbars->addr +
sound/pci/intel8x0.c
3063
int_sta_masks |= ichdev->int_sta_mask;
sound/pci/intel8x0.c
351
struct ichdev ichd[6];
sound/pci/intel8x0.c
706
static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ichdev)
sound/pci/intel8x0.c
709
__le32 *bdbar = ichdev->bdbar;
sound/pci/intel8x0.c
710
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
712
iputdword(chip, port + ICH_REG_OFF_BDBAR, ichdev->bdbar_addr);
sound/pci/intel8x0.c
713
if (ichdev->size == ichdev->fragsize) {
sound/pci/intel8x0.c
714
ichdev->ack_reload = ichdev->ack = 2;
sound/pci/intel8x0.c
715
ichdev->fragsize1 = ichdev->fragsize >> 1;
sound/pci/intel8x0.c
717
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf);
sound/pci/intel8x0.c
719
ichdev->fragsize1 >> ichdev->pos_shift);
sound/pci/intel8x0.c
720
bdbar[idx + 2] = cpu_to_le32(ichdev->physbuf + (ichdev->size >> 1));
sound/pci/intel8x0.c
722
ichdev->fragsize1 >> ichdev->pos_shift);
sound/pci/intel8x0.c
724
ichdev->frags = 2;
sound/pci/intel8x0.c
726
ichdev->ack_reload = ichdev->ack = 1;
sound/pci/intel8x0.c
727
ichdev->fragsize1 = ichdev->fragsize;
sound/pci/intel8x0.c
729
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf +
sound/pci/intel8x0.c
730
(((idx >> 1) * ichdev->fragsize) %
sound/pci/intel8x0.c
731
ichdev->size));
sound/pci/intel8x0.c
733
ichdev->fragsize >> ichdev->pos_shift);
sound/pci/intel8x0.c
739
ichdev->frags = ichdev->size / ichdev->fragsize;
sound/pci/intel8x0.c
741
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi = ICH_REG_LVI_MASK);
sound/pci/intel8x0.c
742
ichdev->civ = 0;
sound/pci/intel8x0.c
744
ichdev->lvi_frag = ICH_REG_LVI_MASK % ichdev->frags;
sound/pci/intel8x0.c
745
ichdev->position = 0;
sound/pci/intel8x0.c
749
ichdev->lvi_frag, ichdev->frags, ichdev->fragsize,
sound/pci/intel8x0.c
750
ichdev->fragsize1);
sound/pci/intel8x0.c
753
iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
sound/pci/intel8x0.c
760
static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev)
sound/pci/intel8x0.c
762
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
766
if (!(ichdev->prepared || chip->in_measurement) || ichdev->suspended)
sound/pci/intel8x0.c
770
status = igetbyte(chip, port + ichdev->roff_sr);
sound/pci/intel8x0.c
774
} else if (civ == ichdev->civ) {
sound/pci/intel8x0.c
776
ichdev->civ++;
sound/pci/intel8x0.c
777
ichdev->civ &= ICH_REG_LVI_MASK;
sound/pci/intel8x0.c
779
step = civ - ichdev->civ;
sound/pci/intel8x0.c
782
ichdev->civ = civ;
sound/pci/intel8x0.c
785
ichdev->position += step * ichdev->fragsize1;
sound/pci/intel8x0.c
787
ichdev->position %= ichdev->size;
sound/pci/intel8x0.c
788
ichdev->lvi += step;
sound/pci/intel8x0.c
789
ichdev->lvi &= ICH_REG_LVI_MASK;
sound/pci/intel8x0.c
790
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi);
sound/pci/intel8x0.c
792
ichdev->lvi_frag++;
sound/pci/intel8x0.c
793
ichdev->lvi_frag %= ichdev->frags;
sound/pci/intel8x0.c
794
ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf + ichdev->lvi_frag * ichdev->fragsize1);
sound/pci/intel8x0.c
798
ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2],
sound/pci/intel8x0.c
799
ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port),
sound/pci/intel8x0.c
802
if (--ichdev->ack == 0) {
sound/pci/intel8x0.c
803
ichdev->ack = ichdev->ack_reload;
sound/pci/intel8x0.c
808
if (ack && ichdev->substream) {
sound/pci/intel8x0.c
809
snd_pcm_period_elapsed(ichdev->substream);
sound/pci/intel8x0.c
811
iputbyte(chip, port + ichdev->roff_sr,
sound/pci/intel8x0.c
818
struct ichdev *ichdev;
sound/pci/intel8x0.c
837
ichdev = &chip->ichd[i];
sound/pci/intel8x0.c
838
if (status & ichdev->int_sta_mask)
sound/pci/intel8x0.c
839
snd_intel8x0_update(chip, ichdev);
sound/pci/intel8x0.c
855
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
857
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
861
ichdev->suspended = 0;
sound/pci/intel8x0.c
866
ichdev->last_pos = ichdev->position;
sound/pci/intel8x0.c
869
ichdev->suspended = 1;
sound/pci/intel8x0.c
883
while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH)) ;
sound/pci/intel8x0.c
893
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
894
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0.c
903
ichdev->suspended = 0;
sound/pci/intel8x0.c
909
fifo = igetdword(chip, fiforeg[ichdev->ali_slot / 4]);
sound/pci/intel8x0.c
910
fifo &= ~(0xff << (ichdev->ali_slot % 4));
sound/pci/intel8x0.c
911
fifo |= 0x83 << (ichdev->ali_slot % 4);
sound/pci/intel8x0.c
912
iputdword(chip, fiforeg[ichdev->ali_slot / 4], fifo);
sound/pci/intel8x0.c
915
val &= ~(1 << (ichdev->ali_slot + 16)); /* clear PAUSE flag */
sound/pci/intel8x0.c
917
iputdword(chip, ICHREG(ALI_DMACR), val | (1 << ichdev->ali_slot));
sound/pci/intel8x0.c
920
ichdev->suspended = 1;
sound/pci/intel8x0.c
925
iputdword(chip, ICHREG(ALI_DMACR), val | (1 << (ichdev->ali_slot + 16)));
sound/pci/intel8x0.c
937
igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ichdev->int_sta_mask);
sound/pci/intel8x0.c
949
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
953
if (ichdev->pcm_open_flag) {
sound/pci/intel8x0.c
954
snd_ac97_pcm_close(ichdev->pcm);
sound/pci/intel8x0.c
955
ichdev->pcm_open_flag = 0;
sound/pci/intel8x0.c
956
ichdev->prepared = 0;
sound/pci/intel8x0.c
958
err = snd_ac97_pcm_open(ichdev->pcm, params_rate(hw_params),
sound/pci/intel8x0.c
960
ichdev->pcm->r[dbl].slots);
sound/pci/intel8x0.c
962
ichdev->pcm_open_flag = 1;
sound/pci/intel8x0.c
964
if (ichdev->ichd == ICHD_PCMOUT && chip->spdif_idx < 0)
sound/pci/intel8x0.c
965
snd_ac97_set_rate(ichdev->pcm->r[0].codec[0], AC97_SPDIF,
sound/pci/intel8x0.c
973
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0.c
975
if (ichdev->pcm_open_flag) {
sound/pci/intel8x0.c
976
snd_ac97_pcm_close(ichdev->pcm);
sound/pci/intel8x0.c
977
ichdev->pcm_open_flag = 0;
sound/pci/intel8x0.c
978
ichdev->prepared = 0;
sound/pci/intel8x0m.c
1094
struct ichdev *ichdev;
sound/pci/intel8x0m.c
1134
ichdev = &chip->ichd[i];
sound/pci/intel8x0m.c
1135
ichdev->ichd = i;
sound/pci/intel8x0m.c
1136
ichdev->reg_offset = tbl[i].offset;
sound/pci/intel8x0m.c
1137
ichdev->int_sta_mask = tbl[i].int_sta_mask;
sound/pci/intel8x0m.c
1140
ichdev->roff_sr = ICH_REG_OFF_PICB;
sound/pci/intel8x0m.c
1141
ichdev->roff_picb = ICH_REG_OFF_SR;
sound/pci/intel8x0m.c
1143
ichdev->roff_sr = ICH_REG_OFF_SR;
sound/pci/intel8x0m.c
1144
ichdev->roff_picb = ICH_REG_OFF_PICB;
sound/pci/intel8x0m.c
1147
ichdev->ali_slot = (ichdev->reg_offset - 0x40) / 0x10;
sound/pci/intel8x0m.c
1164
ichdev = &chip->ichd[i];
sound/pci/intel8x0m.c
1165
ichdev->bdbar = ((__le32 *)chip->bdbars->area) + (i * ICH_MAX_FRAGS * 2);
sound/pci/intel8x0m.c
1166
ichdev->bdbar_addr = chip->bdbars->addr + (i * sizeof(u32) * ICH_MAX_FRAGS * 2);
sound/pci/intel8x0m.c
1167
int_sta_masks |= ichdev->int_sta_mask;
sound/pci/intel8x0m.c
176
struct ichdev ichd[2];
sound/pci/intel8x0m.c
418
static void snd_intel8x0m_setup_periods(struct intel8x0m *chip, struct ichdev *ichdev)
sound/pci/intel8x0m.c
421
__le32 *bdbar = ichdev->bdbar;
sound/pci/intel8x0m.c
422
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0m.c
424
iputdword(chip, port + ICH_REG_OFF_BDBAR, ichdev->bdbar_addr);
sound/pci/intel8x0m.c
425
if (ichdev->size == ichdev->fragsize) {
sound/pci/intel8x0m.c
426
ichdev->ack_reload = ichdev->ack = 2;
sound/pci/intel8x0m.c
427
ichdev->fragsize1 = ichdev->fragsize >> 1;
sound/pci/intel8x0m.c
429
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf);
sound/pci/intel8x0m.c
431
ichdev->fragsize1 >> chip->pcm_pos_shift);
sound/pci/intel8x0m.c
432
bdbar[idx + 2] = cpu_to_le32(ichdev->physbuf + (ichdev->size >> 1));
sound/pci/intel8x0m.c
434
ichdev->fragsize1 >> chip->pcm_pos_shift);
sound/pci/intel8x0m.c
436
ichdev->frags = 2;
sound/pci/intel8x0m.c
438
ichdev->ack_reload = ichdev->ack = 1;
sound/pci/intel8x0m.c
439
ichdev->fragsize1 = ichdev->fragsize;
sound/pci/intel8x0m.c
441
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf + (((idx >> 1) * ichdev->fragsize) % ichdev->size));
sound/pci/intel8x0m.c
443
ichdev->fragsize >> chip->pcm_pos_shift);
sound/pci/intel8x0m.c
449
ichdev->frags = ichdev->size / ichdev->fragsize;
sound/pci/intel8x0m.c
451
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi = ICH_REG_LVI_MASK);
sound/pci/intel8x0m.c
452
ichdev->civ = 0;
sound/pci/intel8x0m.c
454
ichdev->lvi_frag = ICH_REG_LVI_MASK % ichdev->frags;
sound/pci/intel8x0m.c
455
ichdev->position = 0;
sound/pci/intel8x0m.c
459
ichdev->lvi_frag, ichdev->frags, ichdev->fragsize,
sound/pci/intel8x0m.c
460
ichdev->fragsize1);
sound/pci/intel8x0m.c
463
iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
sound/pci/intel8x0m.c
470
static inline void snd_intel8x0m_update(struct intel8x0m *chip, struct ichdev *ichdev)
sound/pci/intel8x0m.c
472
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0m.c
477
if (civ == ichdev->civ) {
sound/pci/intel8x0m.c
479
ichdev->civ++;
sound/pci/intel8x0m.c
480
ichdev->civ &= ICH_REG_LVI_MASK;
sound/pci/intel8x0m.c
482
step = civ - ichdev->civ;
sound/pci/intel8x0m.c
485
ichdev->civ = civ;
sound/pci/intel8x0m.c
488
ichdev->position += step * ichdev->fragsize1;
sound/pci/intel8x0m.c
489
ichdev->position %= ichdev->size;
sound/pci/intel8x0m.c
490
ichdev->lvi += step;
sound/pci/intel8x0m.c
491
ichdev->lvi &= ICH_REG_LVI_MASK;
sound/pci/intel8x0m.c
492
iputbyte(chip, port + ICH_REG_OFF_LVI, ichdev->lvi);
sound/pci/intel8x0m.c
494
ichdev->lvi_frag++;
sound/pci/intel8x0m.c
495
ichdev->lvi_frag %= ichdev->frags;
sound/pci/intel8x0m.c
496
ichdev->bdbar[ichdev->lvi * 2] = cpu_to_le32(ichdev->physbuf +
sound/pci/intel8x0m.c
497
ichdev->lvi_frag *
sound/pci/intel8x0m.c
498
ichdev->fragsize1);
sound/pci/intel8x0m.c
502
ichdev->lvi * 2, ichdev->bdbar[ichdev->lvi * 2],
sound/pci/intel8x0m.c
503
ichdev->bdbar[ichdev->lvi * 2 + 1], inb(ICH_REG_OFF_PIV + port),
sound/pci/intel8x0m.c
506
if (--ichdev->ack == 0) {
sound/pci/intel8x0m.c
507
ichdev->ack = ichdev->ack_reload;
sound/pci/intel8x0m.c
511
if (ack && ichdev->substream) {
sound/pci/intel8x0m.c
513
snd_pcm_period_elapsed(ichdev->substream);
sound/pci/intel8x0m.c
516
iputbyte(chip, port + ichdev->roff_sr, ICH_FIFOE | ICH_BCIS | ICH_LVBCI);
sound/pci/intel8x0m.c
522
struct ichdev *ichdev;
sound/pci/intel8x0m.c
537
ichdev = &chip->ichd[i];
sound/pci/intel8x0m.c
538
if (status & ichdev->int_sta_mask)
sound/pci/intel8x0m.c
539
snd_intel8x0m_update(chip, ichdev);
sound/pci/intel8x0m.c
555
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0m.c
557
unsigned long port = ichdev->reg_offset;
sound/pci/intel8x0m.c
580
while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH)) ;
sound/pci/intel8x0m.c
590
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0m.c
593
ptr1 = igetword(chip, ichdev->reg_offset + ichdev->roff_picb) << chip->pcm_pos_shift;
sound/pci/intel8x0m.c
595
ptr = ichdev->fragsize1 - ptr1;
sound/pci/intel8x0m.c
598
ptr += ichdev->position;
sound/pci/intel8x0m.c
599
if (ptr >= ichdev->size)
sound/pci/intel8x0m.c
608
struct ichdev *ichdev = get_ichdev(substream);
sound/pci/intel8x0m.c
610
ichdev->physbuf = runtime->dma_addr;
sound/pci/intel8x0m.c
611
ichdev->size = snd_pcm_lib_buffer_bytes(substream);
sound/pci/intel8x0m.c
612
ichdev->fragsize = snd_pcm_lib_period_bytes(substream);
sound/pci/intel8x0m.c
613
snd_ac97_write(ichdev->ac97, AC97_LINE1_RATE, runtime->rate);
sound/pci/intel8x0m.c
614
snd_ac97_write(ichdev->ac97, AC97_LINE1_LEVEL, 0);
sound/pci/intel8x0m.c
615
snd_intel8x0m_setup_periods(chip, ichdev);
sound/pci/intel8x0m.c
641
static int snd_intel8x0m_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev)
sound/pci/intel8x0m.c
652
ichdev->substream = substream;
sound/pci/intel8x0m.c
658
runtime->private_data = ichdev;