Lines Matching refs:s
156 static struct snd_dma_buffer *get_dmabuf(struct soundscape *s, in get_dmabuf() argument
162 s->chip->card->dev, in get_dmabuf()
199 static void sscape_write(struct soundscape *s, enum GA_REG reg, in sscape_write() argument
204 spin_lock_irqsave(&s->lock, flags); in sscape_write()
205 sscape_write_unsafe(s->io_base, reg, val); in sscape_write()
206 spin_unlock_irqrestore(&s->lock, flags); in sscape_write()
364 static int obp_startup_ack(struct soundscape *s, unsigned timeout) in obp_startup_ack() argument
372 spin_lock_irqsave(&s->lock, flags); in obp_startup_ack()
373 x = host_read_unsafe(s->io_base); in obp_startup_ack()
374 spin_unlock_irqrestore(&s->lock, flags); in obp_startup_ack()
391 static int host_startup_ack(struct soundscape *s, unsigned timeout) in host_startup_ack() argument
399 spin_lock_irqsave(&s->lock, flags); in host_startup_ack()
400 x = host_read_unsafe(s->io_base); in host_startup_ack()
401 spin_unlock_irqrestore(&s->lock, flags); in host_startup_ack()
414 static int upload_dma_data(struct soundscape *s, const unsigned char *data, in upload_dma_data() argument
422 if (!get_dmabuf(s, &dma, PAGE_ALIGN(32 * 1024))) in upload_dma_data()
425 spin_lock_irqsave(&s->lock, flags); in upload_dma_data()
430 val = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in upload_dma_data()
431 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, val & 0x3f); in upload_dma_data()
436 val = (s->chip->dma1 << 4) | DMA_8BIT; in upload_dma_data()
437 sscape_write_unsafe(s->io_base, GA_DMAA_REG, val); in upload_dma_data()
438 sscape_write_unsafe(s->io_base, GA_DMAB_REG, 0x20); in upload_dma_data()
443 val = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in upload_dma_data()
444 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, val | 0x80); in upload_dma_data()
458 snd_dma_program(s->chip->dma1, dma.addr, len, DMA_MODE_WRITE); in upload_dma_data()
459 sscape_start_dma_unsafe(s->io_base, GA_DMAA_REG); in upload_dma_data()
460 if (!sscape_wait_dma_unsafe(s->io_base, GA_DMAA_REG, 5000)) { in upload_dma_data()
464 spin_unlock_irqrestore(&s->lock, flags); in upload_dma_data()
473 set_host_mode_unsafe(s->io_base); in upload_dma_data()
474 outb(0x0, s->io_base); in upload_dma_data()
479 val = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in upload_dma_data()
480 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, val | 0x40); in upload_dma_data()
481 spin_unlock_irqrestore(&s->lock, flags); in upload_dma_data()
489 if (!obp_startup_ack(s, 5000)) { in upload_dma_data()
493 } else if (!host_startup_ack(s, 5000)) { in upload_dma_data()
503 sscape_write(s, GA_DMAA_REG, (s->ic_type == IC_OPUS ? 0x40 : 0x70)); in upload_dma_data()
596 register struct soundscape *s = get_card_soundscape(card); in sscape_midi_get() local
599 spin_lock_irqsave(&s->lock, flags); in sscape_midi_get()
600 uctl->value.integer.value[0] = s->midi_vol; in sscape_midi_get()
601 spin_unlock_irqrestore(&s->lock, flags); in sscape_midi_get()
610 struct soundscape *s = get_card_soundscape(card); in sscape_midi_put() local
615 spin_lock_irqsave(&s->lock, flags); in sscape_midi_put()
622 set_host_mode_unsafe(s->io_base); in sscape_midi_put()
630 if (s->midi_vol == new_val) { in sscape_midi_put()
634 change = host_write_ctrl_unsafe(s->io_base, CMD_SET_MIDI_VOL, 100) in sscape_midi_put()
635 && host_write_ctrl_unsafe(s->io_base, new_val, 100) in sscape_midi_put()
636 && host_write_ctrl_unsafe(s->io_base, CMD_XXX_MIDI_VOL, 100) in sscape_midi_put()
637 && host_write_ctrl_unsafe(s->io_base, new_val, 100); in sscape_midi_put()
638 s->midi_vol = new_val; in sscape_midi_put()
644 set_midi_mode_unsafe(s->io_base); in sscape_midi_put()
646 spin_unlock_irqrestore(&s->lock, flags); in sscape_midi_put()
686 static int detect_sscape(struct soundscape *s, long wss_io) in detect_sscape() argument
692 spin_lock_irqsave(&s->lock, flags); in detect_sscape()
699 if ((inb(HOST_CTRL_IO(s->io_base)) & 0x78) != 0) in detect_sscape()
702 d = inb(ODIE_ADDR_IO(s->io_base)) & 0xf0; in detect_sscape()
707 s->ic_type = IC_ODIE; in detect_sscape()
709 s->ic_type = IC_OPUS; in detect_sscape()
713 outb(0xfa, ODIE_ADDR_IO(s->io_base)); in detect_sscape()
714 if ((inb(ODIE_ADDR_IO(s->io_base)) & 0x9f) != 0x0a) in detect_sscape()
717 outb(0xfe, ODIE_ADDR_IO(s->io_base)); in detect_sscape()
718 if ((inb(ODIE_ADDR_IO(s->io_base)) & 0x9f) != 0x0e) in detect_sscape()
721 outb(0xfe, ODIE_ADDR_IO(s->io_base)); in detect_sscape()
722 d = inb(ODIE_DATA_IO(s->io_base)); in detect_sscape()
723 if (s->type != SSCAPE_VIVO && (d & 0x9f) != 0x0e) in detect_sscape()
726 if (s->ic_type == IC_OPUS) in detect_sscape()
727 activate_ad1845_unsafe(s->io_base); in detect_sscape()
729 if (s->type == SSCAPE_VIVO) in detect_sscape()
732 d = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in detect_sscape()
733 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d | 0xc0); in detect_sscape()
739 spin_unlock_irqrestore(&s->lock, flags); in detect_sscape()
741 spin_lock_irqsave(&s->lock, flags); in detect_sscape()
750 d = sscape_read_unsafe(s->io_base, GA_HMCTL_REG) & 0x3f; in detect_sscape()
751 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d); in detect_sscape()
754 s->type = MEDIA_FX; in detect_sscape()
756 d = sscape_read_unsafe(s->io_base, GA_HMCTL_REG); in detect_sscape()
757 sscape_write_unsafe(s->io_base, GA_HMCTL_REG, d | 0xc0); in detect_sscape()
762 spin_unlock_irqrestore(&s->lock, flags); in detect_sscape()
764 spin_lock_irqsave(&s->lock, flags); in detect_sscape()
773 spin_unlock_irqrestore(&s->lock, flags); in detect_sscape()