18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Driver for Digigram VX222 PCI soundcards 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de> 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#ifndef __VX222_H 98c2ecf20Sopenharmony_ci#define __VX222_H 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#include <sound/vx_core.h> 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_cistruct snd_vx222 { 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci struct vx_core core; 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci /* h/w config; for PLX and for DSP */ 188c2ecf20Sopenharmony_ci struct pci_dev *pci; 198c2ecf20Sopenharmony_ci unsigned long port[2]; 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci unsigned int regCDSP; /* current CDSP register */ 228c2ecf20Sopenharmony_ci unsigned int regCFG; /* current CFG register */ 238c2ecf20Sopenharmony_ci unsigned int regSELMIC; /* current SELMIC reg. (for VX222 Mic) */ 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci int input_level[2]; /* input level for vx222 mic */ 268c2ecf20Sopenharmony_ci int mic_level; /* mic level for vx222 mic */ 278c2ecf20Sopenharmony_ci}; 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci#define to_vx222(x) container_of(x, struct snd_vx222, core) 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci/* we use a lookup table with 148 values, see vx_mixer.c */ 328c2ecf20Sopenharmony_ci#define VX2_AKM_LEVEL_MAX 0x93 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ciextern const struct snd_vx_ops vx222_ops; 358c2ecf20Sopenharmony_ciextern const struct snd_vx_ops vx222_old_ops; 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci/* Offset of registers with base equal to portDSP. */ 388c2ecf20Sopenharmony_ci#define VX_RESET_DMA_REGISTER_OFFSET 0x00000008 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci/* Constants used to access the INTCSR register. */ 418c2ecf20Sopenharmony_ci#define VX_INTCSR_VALUE 0x00000001 428c2ecf20Sopenharmony_ci#define VX_PCI_INTERRUPT_MASK 0x00000040 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci/* Constants used to access the CDSP register (0x20). */ 458c2ecf20Sopenharmony_ci#define VX_CDSP_TEST1_MASK 0x00000080 468c2ecf20Sopenharmony_ci#define VX_CDSP_TOR1_MASK 0x00000040 478c2ecf20Sopenharmony_ci#define VX_CDSP_TOR2_MASK 0x00000020 488c2ecf20Sopenharmony_ci#define VX_CDSP_RESERVED0_0_MASK 0x00000010 498c2ecf20Sopenharmony_ci#define VX_CDSP_CODEC_RESET_MASK 0x00000008 508c2ecf20Sopenharmony_ci#define VX_CDSP_VALID_IRQ_MASK 0x00000004 518c2ecf20Sopenharmony_ci#define VX_CDSP_TEST0_MASK 0x00000002 528c2ecf20Sopenharmony_ci#define VX_CDSP_DSP_RESET_MASK 0x00000001 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ci#define VX_CDSP_GPIO_OUT_MASK 0x00000060 558c2ecf20Sopenharmony_ci#define VX_GPIO_OUT_BIT_OFFSET 5 // transform output to bit 0 and 1 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci/* Constants used to access the CFG register (0x24). */ 588c2ecf20Sopenharmony_ci#define VX_CFG_SYNCDSP_MASK 0x00000080 598c2ecf20Sopenharmony_ci#define VX_CFG_RESERVED0_0_MASK 0x00000040 608c2ecf20Sopenharmony_ci#define VX_CFG_RESERVED1_0_MASK 0x00000020 618c2ecf20Sopenharmony_ci#define VX_CFG_RESERVED2_0_MASK 0x00000010 628c2ecf20Sopenharmony_ci#define VX_CFG_DATAIN_SEL_MASK 0x00000008 // 0 (ana), 1 (UER) 638c2ecf20Sopenharmony_ci#define VX_CFG_RESERVED3_0_MASK 0x00000004 648c2ecf20Sopenharmony_ci#define VX_CFG_RESERVED4_0_MASK 0x00000002 658c2ecf20Sopenharmony_ci#define VX_CFG_CLOCKIN_SEL_MASK 0x00000001 // 0 (internal), 1 (AES/EBU) 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci/* Constants used to access the STATUS register (0x30). */ 688c2ecf20Sopenharmony_ci#define VX_STATUS_DATA_XICOR_MASK 0x00000080 698c2ecf20Sopenharmony_ci#define VX_STATUS_VAL_TEST1_MASK 0x00000040 708c2ecf20Sopenharmony_ci#define VX_STATUS_VAL_TEST0_MASK 0x00000020 718c2ecf20Sopenharmony_ci#define VX_STATUS_RESERVED0_MASK 0x00000010 728c2ecf20Sopenharmony_ci#define VX_STATUS_VAL_TOR1_MASK 0x00000008 738c2ecf20Sopenharmony_ci#define VX_STATUS_VAL_TOR0_MASK 0x00000004 748c2ecf20Sopenharmony_ci#define VX_STATUS_LEVEL_IN_MASK 0x00000002 // 6 dBu (0), 22 dBu (1) 758c2ecf20Sopenharmony_ci#define VX_STATUS_MEMIRQ_MASK 0x00000001 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci#define VX_STATUS_GPIO_IN_MASK 0x0000000C 788c2ecf20Sopenharmony_ci#define VX_GPIO_IN_BIT_OFFSET 0 // leave input as bit 2 and 3 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci/* Constants used to access the MICRO INPUT SELECT register (0x40). */ 818c2ecf20Sopenharmony_ci#define MICRO_SELECT_INPUT_NORM 0x00 828c2ecf20Sopenharmony_ci#define MICRO_SELECT_INPUT_MUTE 0x01 838c2ecf20Sopenharmony_ci#define MICRO_SELECT_INPUT_LIMIT 0x02 848c2ecf20Sopenharmony_ci#define MICRO_SELECT_INPUT_MASK 0x03 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci#define MICRO_SELECT_PREAMPLI_G_0 0x00 878c2ecf20Sopenharmony_ci#define MICRO_SELECT_PREAMPLI_G_1 0x04 888c2ecf20Sopenharmony_ci#define MICRO_SELECT_PREAMPLI_G_2 0x08 898c2ecf20Sopenharmony_ci#define MICRO_SELECT_PREAMPLI_G_3 0x0C 908c2ecf20Sopenharmony_ci#define MICRO_SELECT_PREAMPLI_MASK 0x0C 918c2ecf20Sopenharmony_ci#define MICRO_SELECT_PREAMPLI_OFFSET 2 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define MICRO_SELECT_RAISE_COMPR 0x10 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci#define MICRO_SELECT_NOISE_T_52DB 0x00 968c2ecf20Sopenharmony_ci#define MICRO_SELECT_NOISE_T_42DB 0x20 978c2ecf20Sopenharmony_ci#define MICRO_SELECT_NOISE_T_32DB 0x40 988c2ecf20Sopenharmony_ci#define MICRO_SELECT_NOISE_T_MASK 0x60 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci#define MICRO_SELECT_PHANTOM_ALIM 0x80 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci#endif /* __VX222_H */ 104