hal2              103 sound/mips/hal2.c static u32 hal2_i_read32(struct snd_hal2 *hal2, u16 addr)
hal2              106 sound/mips/hal2.c 	struct hal2_ctl_regs *regs = hal2->ctl_regs;
hal2              117 sound/mips/hal2.c static void hal2_i_write16(struct snd_hal2 *hal2, u16 addr, u16 val)
hal2              119 sound/mips/hal2.c 	struct hal2_ctl_regs *regs = hal2->ctl_regs;
hal2              129 sound/mips/hal2.c static void hal2_i_write32(struct snd_hal2 *hal2, u16 addr, u32 val)
hal2              131 sound/mips/hal2.c 	struct hal2_ctl_regs *regs = hal2->ctl_regs;
hal2              141 sound/mips/hal2.c static void hal2_i_setbit16(struct snd_hal2 *hal2, u16 addr, u16 bit)
hal2              143 sound/mips/hal2.c 	struct hal2_ctl_regs *regs = hal2->ctl_regs;
hal2              155 sound/mips/hal2.c static void hal2_i_clearbit16(struct snd_hal2 *hal2, u16 addr, u16 bit)
hal2              157 sound/mips/hal2.c 	struct hal2_ctl_regs *regs = hal2->ctl_regs;
hal2              189 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_kcontrol_chip(kcontrol);
hal2              195 sound/mips/hal2.c 		tmp = hal2_i_read32(hal2, H2I_DAC_C2);
hal2              205 sound/mips/hal2.c 		tmp = hal2_i_read32(hal2, H2I_ADC_C2);
hal2              221 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_kcontrol_chip(kcontrol);
hal2              230 sound/mips/hal2.c 		old = hal2_i_read32(hal2, H2I_DAC_C2);
hal2              239 sound/mips/hal2.c 		hal2_i_write32(hal2, H2I_DAC_C2, new);
hal2              242 sound/mips/hal2.c 		old = hal2_i_read32(hal2, H2I_ADC_C2);
hal2              246 sound/mips/hal2.c 		hal2_i_write32(hal2, H2I_ADC_C2, new);
hal2              274 sound/mips/hal2.c static int hal2_mixer_create(struct snd_hal2 *hal2)
hal2              279 sound/mips/hal2.c 	hal2_i_write32(hal2, H2I_DAC_C2,
hal2              282 sound/mips/hal2.c 	hal2_i_write32(hal2, H2I_ADC_C2, 0);
hal2              284 sound/mips/hal2.c 	err = snd_ctl_add(hal2->card,
hal2              285 sound/mips/hal2.c 			  snd_ctl_new1(&hal2_ctrl_headphone, hal2));
hal2              289 sound/mips/hal2.c 	err = snd_ctl_add(hal2->card,
hal2              290 sound/mips/hal2.c 			  snd_ctl_new1(&hal2_ctrl_mic, hal2));
hal2              299 sound/mips/hal2.c 	struct snd_hal2 *hal2 = dev_id;
hal2              303 sound/mips/hal2.c 	if (hal2->dac.pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_INT) {
hal2              304 sound/mips/hal2.c 		snd_pcm_period_elapsed(hal2->dac.substream);
hal2              307 sound/mips/hal2.c 	if (hal2->adc.pbus.pbus->pbdma_ctrl & HPC3_PDMACTRL_INT) {
hal2              308 sound/mips/hal2.c 		snd_pcm_period_elapsed(hal2->adc.substream);
hal2              333 sound/mips/hal2.c static void hal2_set_dac_rate(struct snd_hal2 *hal2)
hal2              335 sound/mips/hal2.c 	unsigned int master = hal2->dac.master;
hal2              336 sound/mips/hal2.c 	int inc = hal2->dac.inc;
hal2              337 sound/mips/hal2.c 	int mod = hal2->dac.mod;
hal2              339 sound/mips/hal2.c 	hal2_i_write16(hal2, H2I_BRES1_C1, (master == 44100) ? 1 : 0);
hal2              340 sound/mips/hal2.c 	hal2_i_write32(hal2, H2I_BRES1_C2,
hal2              344 sound/mips/hal2.c static void hal2_set_adc_rate(struct snd_hal2 *hal2)
hal2              346 sound/mips/hal2.c 	unsigned int master = hal2->adc.master;
hal2              347 sound/mips/hal2.c 	int inc = hal2->adc.inc;
hal2              348 sound/mips/hal2.c 	int mod = hal2->adc.mod;
hal2              350 sound/mips/hal2.c 	hal2_i_write16(hal2, H2I_BRES2_C1, (master == 44100) ? 1 : 0);
hal2              351 sound/mips/hal2.c 	hal2_i_write32(hal2, H2I_BRES2_C2,
hal2              355 sound/mips/hal2.c static void hal2_setup_dac(struct snd_hal2 *hal2)
hal2              358 sound/mips/hal2.c 	struct hal2_pbus *pbus = &hal2->dac.pbus;
hal2              365 sound/mips/hal2.c 	sample_size = 2 * hal2->dac.voices;
hal2              375 sound/mips/hal2.c 	hal2_i_clearbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECTX);
hal2              377 sound/mips/hal2.c 	hal2_set_dac_rate(hal2);
hal2              379 sound/mips/hal2.c 	hal2_i_clearbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECTX);
hal2              381 sound/mips/hal2.c 	hal2_i_setbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));
hal2              383 sound/mips/hal2.c 	hal2_i_write16(hal2, H2I_DAC_C1, (pbus->pbusnr << H2I_C1_DMA_SHIFT)
hal2              385 sound/mips/hal2.c 			| (hal2->dac.voices << H2I_C1_DATAT_SHIFT));
hal2              388 sound/mips/hal2.c static void hal2_setup_adc(struct snd_hal2 *hal2)
hal2              391 sound/mips/hal2.c 	struct hal2_pbus *pbus = &hal2->adc.pbus;
hal2              393 sound/mips/hal2.c 	sample_size = 2 * hal2->adc.voices;
hal2              400 sound/mips/hal2.c 	hal2_i_clearbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECR);
hal2              402 sound/mips/hal2.c 	hal2_set_adc_rate(hal2);
hal2              404 sound/mips/hal2.c 	hal2_i_clearbit16(hal2, H2I_DMA_END, H2I_DMA_END_CODECR);
hal2              406 sound/mips/hal2.c 	hal2_i_setbit16(hal2, H2I_DMA_DRV, (1 << pbus->pbusnr));
hal2              408 sound/mips/hal2.c 	hal2_i_write16(hal2, H2I_ADC_C1, (pbus->pbusnr << H2I_C1_DMA_SHIFT)
hal2              410 sound/mips/hal2.c 			| (hal2->adc.voices << H2I_C1_DATAT_SHIFT));
hal2              413 sound/mips/hal2.c static void hal2_start_dac(struct snd_hal2 *hal2)
hal2              415 sound/mips/hal2.c 	struct hal2_pbus *pbus = &hal2->dac.pbus;
hal2              417 sound/mips/hal2.c 	pbus->pbus->pbdma_dptr = hal2->dac.desc_dma;
hal2              420 sound/mips/hal2.c 	hal2_i_setbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECTX);
hal2              423 sound/mips/hal2.c static void hal2_start_adc(struct snd_hal2 *hal2)
hal2              425 sound/mips/hal2.c 	struct hal2_pbus *pbus = &hal2->adc.pbus;
hal2              427 sound/mips/hal2.c 	pbus->pbus->pbdma_dptr = hal2->adc.desc_dma;
hal2              430 sound/mips/hal2.c 	hal2_i_setbit16(hal2, H2I_DMA_PORT_EN, H2I_DMA_PORT_EN_CODECR);
hal2              433 sound/mips/hal2.c static inline void hal2_stop_dac(struct snd_hal2 *hal2)
hal2              435 sound/mips/hal2.c 	hal2->dac.pbus.pbus->pbdma_ctrl = HPC3_PDMACTRL_LD;
hal2              439 sound/mips/hal2.c static inline void hal2_stop_adc(struct snd_hal2 *hal2)
hal2              441 sound/mips/hal2.c 	hal2->adc.pbus.pbus->pbdma_ctrl = HPC3_PDMACTRL_LD;
hal2              444 sound/mips/hal2.c static int hal2_alloc_dmabuf(struct snd_hal2 *hal2, struct hal2_codec *codec)
hal2              446 sound/mips/hal2.c 	struct device *dev = hal2->card->dev;
hal2              479 sound/mips/hal2.c static void hal2_free_dmabuf(struct snd_hal2 *hal2, struct hal2_codec *codec)
hal2              481 sound/mips/hal2.c 	struct device *dev = hal2->card->dev;
hal2              528 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              533 sound/mips/hal2.c 	err = hal2_alloc_dmabuf(hal2, &hal2->dac);
hal2              541 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              543 sound/mips/hal2.c 	hal2_free_dmabuf(hal2, &hal2->dac);
hal2              549 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              551 sound/mips/hal2.c 	struct hal2_codec *dac = &hal2->dac;
hal2              561 sound/mips/hal2.c 	hal2_setup_dac(hal2);
hal2              567 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              571 sound/mips/hal2.c 		hal2_start_dac(hal2);
hal2              574 sound/mips/hal2.c 		hal2_stop_dac(hal2);
hal2              585 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              586 sound/mips/hal2.c 	struct hal2_codec *dac = &hal2->dac;
hal2              595 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              596 sound/mips/hal2.c 	unsigned char *buf = hal2->dac.buffer + rec->hw_data;
hal2              599 sound/mips/hal2.c 	dma_cache_sync(hal2->card->dev, buf, bytes, DMA_TO_DEVICE);
hal2              605 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              606 sound/mips/hal2.c 	struct hal2_codec *dac = &hal2->dac;
hal2              616 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              617 sound/mips/hal2.c 	struct hal2_codec *adc = &hal2->adc;
hal2              622 sound/mips/hal2.c 	err = hal2_alloc_dmabuf(hal2, adc);
hal2              630 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              632 sound/mips/hal2.c 	hal2_free_dmabuf(hal2, &hal2->adc);
hal2              638 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              640 sound/mips/hal2.c 	struct hal2_codec *adc = &hal2->adc;
hal2              650 sound/mips/hal2.c 	hal2_setup_adc(hal2);
hal2              656 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              660 sound/mips/hal2.c 		hal2_start_adc(hal2);
hal2              663 sound/mips/hal2.c 		hal2_stop_adc(hal2);
hal2              674 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              675 sound/mips/hal2.c 	struct hal2_codec *adc = &hal2->adc;
hal2              684 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              685 sound/mips/hal2.c 	unsigned char *buf = hal2->adc.buffer + rec->hw_data;
hal2              687 sound/mips/hal2.c 	dma_cache_sync(hal2->card->dev, buf, bytes, DMA_FROM_DEVICE);
hal2              693 sound/mips/hal2.c 	struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream);
hal2              694 sound/mips/hal2.c 	struct hal2_codec *adc = &hal2->adc;
hal2              725 sound/mips/hal2.c static int hal2_pcm_create(struct snd_hal2 *hal2)
hal2              731 sound/mips/hal2.c 	err = snd_pcm_new(hal2->card, "SGI HAL2 Audio", 0, 1, 1, &pcm);
hal2              735 sound/mips/hal2.c 	pcm->private_data = hal2;
hal2              752 sound/mips/hal2.c 	struct snd_hal2 *hal2 = device->device_data;
hal2              754 sound/mips/hal2.c 	free_irq(SGI_HPCDMA_IRQ, hal2);
hal2              755 sound/mips/hal2.c 	kfree(hal2);
hal2              770 sound/mips/hal2.c static int hal2_detect(struct snd_hal2 *hal2)
hal2              776 sound/mips/hal2.c 	hal2_write(0, &hal2->ctl_regs->isr);
hal2              780 sound/mips/hal2.c 		   &hal2->ctl_regs->isr);
hal2              783 sound/mips/hal2.c 	hal2_i_write16(hal2, H2I_RELAY_C, H2I_RELAY_C_STATE);
hal2              784 sound/mips/hal2.c 	rev = hal2_read(&hal2->ctl_regs->rev);
hal2              800 sound/mips/hal2.c 	struct snd_hal2 *hal2;
hal2              804 sound/mips/hal2.c 	hal2 = kzalloc(sizeof(*hal2), GFP_KERNEL);
hal2              805 sound/mips/hal2.c 	if (!hal2)
hal2              808 sound/mips/hal2.c 	hal2->card = card;
hal2              811 sound/mips/hal2.c 			"SGI HAL2", hal2)) {
hal2              813 sound/mips/hal2.c 		kfree(hal2);
hal2              817 sound/mips/hal2.c 	hal2->ctl_regs = (struct hal2_ctl_regs *)hpc3->pbus_extregs[0];
hal2              818 sound/mips/hal2.c 	hal2->aes_regs = (struct hal2_aes_regs *)hpc3->pbus_extregs[1];
hal2              819 sound/mips/hal2.c 	hal2->vol_regs = (struct hal2_vol_regs *)hpc3->pbus_extregs[2];
hal2              820 sound/mips/hal2.c 	hal2->syn_regs = (struct hal2_syn_regs *)hpc3->pbus_extregs[3];
hal2              822 sound/mips/hal2.c 	if (hal2_detect(hal2) < 0) {
hal2              823 sound/mips/hal2.c 		kfree(hal2);
hal2              827 sound/mips/hal2.c 	hal2_init_codec(&hal2->dac, hpc3, 0);
hal2              828 sound/mips/hal2.c 	hal2_init_codec(&hal2->adc, hpc3, 1);
hal2              853 sound/mips/hal2.c 	hpc3->pbus_dmacfg[hal2->dac.pbus.pbusnr][0] = 0x8208844;
hal2              854 sound/mips/hal2.c 	hpc3->pbus_dmacfg[hal2->adc.pbus.pbusnr][0] = 0x8208844;
hal2              856 sound/mips/hal2.c 	err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, hal2, &hal2_ops);
hal2              858 sound/mips/hal2.c 		free_irq(SGI_HPCDMA_IRQ, hal2);
hal2              859 sound/mips/hal2.c 		kfree(hal2);
hal2              862 sound/mips/hal2.c 	*rchip = hal2;