1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2d0ce9946SClemens Ladisch #ifndef OXYGEN_REGS_H_INCLUDED 3d0ce9946SClemens Ladisch #define OXYGEN_REGS_H_INCLUDED 4d0ce9946SClemens Ladisch 5d0ce9946SClemens Ladisch /* recording channel A */ 6d0ce9946SClemens Ladisch #define OXYGEN_DMA_A_ADDRESS 0x00 /* 32-bit base address */ 7d0ce9946SClemens Ladisch #define OXYGEN_DMA_A_COUNT 0x04 /* buffer counter (dwords) */ 8d0ce9946SClemens Ladisch #define OXYGEN_DMA_A_TCOUNT 0x06 /* interrupt counter (dwords) */ 9d0ce9946SClemens Ladisch 10d0ce9946SClemens Ladisch /* recording channel B */ 11d0ce9946SClemens Ladisch #define OXYGEN_DMA_B_ADDRESS 0x08 12d0ce9946SClemens Ladisch #define OXYGEN_DMA_B_COUNT 0x0c 13d0ce9946SClemens Ladisch #define OXYGEN_DMA_B_TCOUNT 0x0e 14d0ce9946SClemens Ladisch 15d0ce9946SClemens Ladisch /* recording channel C */ 16d0ce9946SClemens Ladisch #define OXYGEN_DMA_C_ADDRESS 0x10 17d0ce9946SClemens Ladisch #define OXYGEN_DMA_C_COUNT 0x14 18d0ce9946SClemens Ladisch #define OXYGEN_DMA_C_TCOUNT 0x16 19d0ce9946SClemens Ladisch 20d0ce9946SClemens Ladisch /* SPDIF playback channel */ 21d0ce9946SClemens Ladisch #define OXYGEN_DMA_SPDIF_ADDRESS 0x18 22d0ce9946SClemens Ladisch #define OXYGEN_DMA_SPDIF_COUNT 0x1c 23d0ce9946SClemens Ladisch #define OXYGEN_DMA_SPDIF_TCOUNT 0x1e 24d0ce9946SClemens Ladisch 25d0ce9946SClemens Ladisch /* multichannel playback channel */ 26d0ce9946SClemens Ladisch #define OXYGEN_DMA_MULTICH_ADDRESS 0x20 27c2353a08SClemens Ladisch #define OXYGEN_DMA_MULTICH_COUNT 0x24 /* 24 bits */ 28c2353a08SClemens Ladisch #define OXYGEN_DMA_MULTICH_TCOUNT 0x28 /* 24 bits */ 29d0ce9946SClemens Ladisch 30d0ce9946SClemens Ladisch /* AC'97 (front panel) playback channel */ 31d0ce9946SClemens Ladisch #define OXYGEN_DMA_AC97_ADDRESS 0x30 32d0ce9946SClemens Ladisch #define OXYGEN_DMA_AC97_COUNT 0x34 33d0ce9946SClemens Ladisch #define OXYGEN_DMA_AC97_TCOUNT 0x36 34d0ce9946SClemens Ladisch 35d0ce9946SClemens Ladisch /* all registers 0x00..0x36 return current position on read */ 36d0ce9946SClemens Ladisch 37d0ce9946SClemens Ladisch #define OXYGEN_DMA_STATUS 0x40 /* 1 = running, 0 = stop */ 38d0ce9946SClemens Ladisch #define OXYGEN_CHANNEL_A 0x01 39d0ce9946SClemens Ladisch #define OXYGEN_CHANNEL_B 0x02 40d0ce9946SClemens Ladisch #define OXYGEN_CHANNEL_C 0x04 41d0ce9946SClemens Ladisch #define OXYGEN_CHANNEL_SPDIF 0x08 42d0ce9946SClemens Ladisch #define OXYGEN_CHANNEL_MULTICH 0x10 43d0ce9946SClemens Ladisch #define OXYGEN_CHANNEL_AC97 0x20 44d0ce9946SClemens Ladisch 45c2353a08SClemens Ladisch #define OXYGEN_DMA_PAUSE 0x41 /* 1 = pause */ 46c2353a08SClemens Ladisch /* OXYGEN_CHANNEL_* */ 47c2353a08SClemens Ladisch 48d0ce9946SClemens Ladisch #define OXYGEN_DMA_RESET 0x42 49d0ce9946SClemens Ladisch /* OXYGEN_CHANNEL_* */ 50d0ce9946SClemens Ladisch 51d0ce9946SClemens Ladisch #define OXYGEN_PLAY_CHANNELS 0x43 52d0ce9946SClemens Ladisch #define OXYGEN_PLAY_CHANNELS_MASK 0x03 53d0ce9946SClemens Ladisch #define OXYGEN_PLAY_CHANNELS_2 0x00 54d0ce9946SClemens Ladisch #define OXYGEN_PLAY_CHANNELS_4 0x01 55d0ce9946SClemens Ladisch #define OXYGEN_PLAY_CHANNELS_6 0x02 56d0ce9946SClemens Ladisch #define OXYGEN_PLAY_CHANNELS_8 0x03 57c2353a08SClemens Ladisch #define OXYGEN_DMA_A_BURST_MASK 0x04 58c2353a08SClemens Ladisch #define OXYGEN_DMA_A_BURST_8 0x00 /* dwords */ 59c2353a08SClemens Ladisch #define OXYGEN_DMA_A_BURST_16 0x04 60c2353a08SClemens Ladisch #define OXYGEN_DMA_MULTICH_BURST_MASK 0x08 61c2353a08SClemens Ladisch #define OXYGEN_DMA_MULTICH_BURST_8 0x00 62c2353a08SClemens Ladisch #define OXYGEN_DMA_MULTICH_BURST_16 0x08 63d0ce9946SClemens Ladisch 64d0ce9946SClemens Ladisch #define OXYGEN_INTERRUPT_MASK 0x44 65d0ce9946SClemens Ladisch /* OXYGEN_CHANNEL_* */ 66c2353a08SClemens Ladisch #define OXYGEN_INT_SPDIF_IN_DETECT 0x0100 67c2353a08SClemens Ladisch #define OXYGEN_INT_MCU 0x0200 68c2353a08SClemens Ladisch #define OXYGEN_INT_2WIRE 0x0400 69d0ce9946SClemens Ladisch #define OXYGEN_INT_GPIO 0x0800 70c2353a08SClemens Ladisch #define OXYGEN_INT_MCB 0x2000 71c2353a08SClemens Ladisch #define OXYGEN_INT_AC97 0x4000 72d0ce9946SClemens Ladisch 73d0ce9946SClemens Ladisch #define OXYGEN_INTERRUPT_STATUS 0x46 74d0ce9946SClemens Ladisch /* OXYGEN_CHANNEL_* amd OXYGEN_INT_* */ 75d0ce9946SClemens Ladisch #define OXYGEN_INT_MIDI 0x1000 76d0ce9946SClemens Ladisch 77d0ce9946SClemens Ladisch #define OXYGEN_MISC 0x48 78c2353a08SClemens Ladisch #define OXYGEN_MISC_WRITE_PCI_SUBID 0x01 79c2353a08SClemens Ladisch #define OXYGEN_MISC_LATENCY_3F 0x02 80c2353a08SClemens Ladisch #define OXYGEN_MISC_REC_C_FROM_SPDIF 0x04 81c2353a08SClemens Ladisch #define OXYGEN_MISC_REC_B_FROM_AC97 0x08 82c2353a08SClemens Ladisch #define OXYGEN_MISC_REC_A_FROM_MULTICH 0x10 83c2353a08SClemens Ladisch #define OXYGEN_MISC_PCI_MEM_W_1_CLOCK 0x20 84d0ce9946SClemens Ladisch #define OXYGEN_MISC_MIDI 0x40 85c2353a08SClemens Ladisch #define OXYGEN_MISC_CRYSTAL_MASK 0x80 86c2353a08SClemens Ladisch #define OXYGEN_MISC_CRYSTAL_24576 0x00 87c2353a08SClemens Ladisch #define OXYGEN_MISC_CRYSTAL_27 0x80 /* MHz */ 88d0ce9946SClemens Ladisch 89d0ce9946SClemens Ladisch #define OXYGEN_REC_FORMAT 0x4a 90d0ce9946SClemens Ladisch #define OXYGEN_REC_FORMAT_A_MASK 0x03 91d0ce9946SClemens Ladisch #define OXYGEN_REC_FORMAT_A_SHIFT 0 92d0ce9946SClemens Ladisch #define OXYGEN_REC_FORMAT_B_MASK 0x0c 93d0ce9946SClemens Ladisch #define OXYGEN_REC_FORMAT_B_SHIFT 2 94d0ce9946SClemens Ladisch #define OXYGEN_REC_FORMAT_C_MASK 0x30 95d0ce9946SClemens Ladisch #define OXYGEN_REC_FORMAT_C_SHIFT 4 96d0ce9946SClemens Ladisch #define OXYGEN_FORMAT_16 0x00 97d0ce9946SClemens Ladisch #define OXYGEN_FORMAT_24 0x01 98d0ce9946SClemens Ladisch #define OXYGEN_FORMAT_32 0x02 99d0ce9946SClemens Ladisch 100d0ce9946SClemens Ladisch #define OXYGEN_PLAY_FORMAT 0x4b 101d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_FORMAT_MASK 0x03 102d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_FORMAT_SHIFT 0 103d0ce9946SClemens Ladisch #define OXYGEN_MULTICH_FORMAT_MASK 0x0c 104d0ce9946SClemens Ladisch #define OXYGEN_MULTICH_FORMAT_SHIFT 2 105d0ce9946SClemens Ladisch /* OXYGEN_FORMAT_* */ 106d0ce9946SClemens Ladisch 107d0ce9946SClemens Ladisch #define OXYGEN_REC_CHANNELS 0x4c 108c2353a08SClemens Ladisch #define OXYGEN_REC_CHANNELS_MASK 0x07 109c2353a08SClemens Ladisch #define OXYGEN_REC_CHANNELS_2_2_2 0x00 /* DMA A, B, C */ 110c2353a08SClemens Ladisch #define OXYGEN_REC_CHANNELS_4_2_2 0x01 111c2353a08SClemens Ladisch #define OXYGEN_REC_CHANNELS_6_0_2 0x02 112c2353a08SClemens Ladisch #define OXYGEN_REC_CHANNELS_6_2_0 0x03 113c2353a08SClemens Ladisch #define OXYGEN_REC_CHANNELS_8_0_0 0x04 114d0ce9946SClemens Ladisch 115d0ce9946SClemens Ladisch #define OXYGEN_FUNCTION 0x50 116c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_CLOCK_MASK 0x01 117c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_CLOCK_PLL 0x00 118c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_CLOCK_CRYSTAL 0x01 119d0ce9946SClemens Ladisch #define OXYGEN_FUNCTION_RESET_CODEC 0x02 120c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_RESET_POL 0x04 121c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_PWDN 0x08 122c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_PWDN_EN 0x10 123c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_PWDN_POL 0x20 124c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_2WIRE_SPI_MASK 0x40 125c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_SPI 0x00 126c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_2WIRE 0x40 127c2353a08SClemens Ladisch #define OXYGEN_FUNCTION_ENABLE_SPI_4_5 0x80 /* 0 = EEPROM */ 128d0ce9946SClemens Ladisch 129d0ce9946SClemens Ladisch #define OXYGEN_I2S_MULTICH_FORMAT 0x60 130c2353a08SClemens Ladisch #define OXYGEN_I2S_RATE_MASK 0x0007 /* LRCK */ 131d0ce9946SClemens Ladisch #define OXYGEN_RATE_32000 0x0000 132d0ce9946SClemens Ladisch #define OXYGEN_RATE_44100 0x0001 133d0ce9946SClemens Ladisch #define OXYGEN_RATE_48000 0x0002 134d0ce9946SClemens Ladisch #define OXYGEN_RATE_64000 0x0003 135d0ce9946SClemens Ladisch #define OXYGEN_RATE_88200 0x0004 136d0ce9946SClemens Ladisch #define OXYGEN_RATE_96000 0x0005 137d0ce9946SClemens Ladisch #define OXYGEN_RATE_176400 0x0006 138d0ce9946SClemens Ladisch #define OXYGEN_RATE_192000 0x0007 13905855ba3SClemens Ladisch #define OXYGEN_I2S_FORMAT_MASK 0x0008 14005855ba3SClemens Ladisch #define OXYGEN_I2S_FORMAT_I2S 0x0000 14105855ba3SClemens Ladisch #define OXYGEN_I2S_FORMAT_LJUST 0x0008 142c2353a08SClemens Ladisch #define OXYGEN_I2S_MCLK_MASK 0x0030 /* MCLK/LRCK */ 1435b8bf2a5SClemens Ladisch #define OXYGEN_I2S_MCLK_SHIFT 4 1445b8bf2a5SClemens Ladisch #define MCLK_128 0 1455b8bf2a5SClemens Ladisch #define MCLK_256 1 1465b8bf2a5SClemens Ladisch #define MCLK_512 2 1475b8bf2a5SClemens Ladisch #define OXYGEN_I2S_MCLK(f) (((f) & 3) << OXYGEN_I2S_MCLK_SHIFT) 14805855ba3SClemens Ladisch #define OXYGEN_I2S_BITS_MASK 0x00c0 14905855ba3SClemens Ladisch #define OXYGEN_I2S_BITS_16 0x0000 15005855ba3SClemens Ladisch #define OXYGEN_I2S_BITS_20 0x0040 15105855ba3SClemens Ladisch #define OXYGEN_I2S_BITS_24 0x0080 15205855ba3SClemens Ladisch #define OXYGEN_I2S_BITS_32 0x00c0 153c2353a08SClemens Ladisch #define OXYGEN_I2S_MASTER 0x0100 154c2353a08SClemens Ladisch #define OXYGEN_I2S_BCLK_MASK 0x0600 /* BCLK/LRCK */ 155c2353a08SClemens Ladisch #define OXYGEN_I2S_BCLK_64 0x0000 156c2353a08SClemens Ladisch #define OXYGEN_I2S_BCLK_128 0x0200 157c2353a08SClemens Ladisch #define OXYGEN_I2S_BCLK_256 0x0400 158c2353a08SClemens Ladisch #define OXYGEN_I2S_MUTE_MCLK 0x0800 159d0ce9946SClemens Ladisch 160d0ce9946SClemens Ladisch #define OXYGEN_I2S_A_FORMAT 0x62 161d0ce9946SClemens Ladisch #define OXYGEN_I2S_B_FORMAT 0x64 162d0ce9946SClemens Ladisch #define OXYGEN_I2S_C_FORMAT 0x66 16305855ba3SClemens Ladisch /* like OXYGEN_I2S_MULTICH_FORMAT */ 164d0ce9946SClemens Ladisch 165d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_CONTROL 0x70 166d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_OUT_ENABLE 0x00000002 167c2353a08SClemens Ladisch #define OXYGEN_SPDIF_LOOPBACK 0x00000004 /* in to out */ 168c2353a08SClemens Ladisch #define OXYGEN_SPDIF_SENSE_MASK 0x00000008 169c2353a08SClemens Ladisch #define OXYGEN_SPDIF_LOCK_MASK 0x00000010 170c2353a08SClemens Ladisch #define OXYGEN_SPDIF_RATE_MASK 0x00000020 171c2353a08SClemens Ladisch #define OXYGEN_SPDIF_SPDVALID 0x00000040 172c2353a08SClemens Ladisch #define OXYGEN_SPDIF_SENSE_PAR 0x00000200 173c2353a08SClemens Ladisch #define OXYGEN_SPDIF_LOCK_PAR 0x00000400 174c2353a08SClemens Ladisch #define OXYGEN_SPDIF_SENSE_STATUS 0x00000800 175c2353a08SClemens Ladisch #define OXYGEN_SPDIF_LOCK_STATUS 0x00001000 176c2353a08SClemens Ladisch #define OXYGEN_SPDIF_SENSE_INT 0x00002000 /* r/wc */ 177c2353a08SClemens Ladisch #define OXYGEN_SPDIF_LOCK_INT 0x00004000 /* r/wc */ 178c2353a08SClemens Ladisch #define OXYGEN_SPDIF_RATE_INT 0x00008000 /* r/wc */ 179c2353a08SClemens Ladisch #define OXYGEN_SPDIF_IN_CLOCK_MASK 0x00010000 180c2353a08SClemens Ladisch #define OXYGEN_SPDIF_IN_CLOCK_96 0x00000000 /* <= 96 kHz */ 181c2353a08SClemens Ladisch #define OXYGEN_SPDIF_IN_CLOCK_192 0x00010000 /* > 96 kHz */ 182d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_OUT_RATE_MASK 0x07000000 183d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_OUT_RATE_SHIFT 24 184d0ce9946SClemens Ladisch /* OXYGEN_RATE_* << OXYGEN_SPDIF_OUT_RATE_SHIFT */ 185d0ce9946SClemens Ladisch 186d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_OUTPUT_BITS 0x74 187d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_NONAUDIO 0x00000002 188d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_C 0x00000004 189d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_PREEMPHASIS 0x00000008 190d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_CATEGORY_MASK 0x000007f0 191d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_CATEGORY_SHIFT 4 192d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_ORIGINAL 0x00000800 193d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_CS_RATE_MASK 0x0000f000 194d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_CS_RATE_SHIFT 12 195d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_V 0x00010000 /* 0 = valid */ 196d0ce9946SClemens Ladisch 197d0ce9946SClemens Ladisch #define OXYGEN_SPDIF_INPUT_BITS 0x78 198d0ce9946SClemens Ladisch /* 32 bits, IEC958_AES_* */ 199d0ce9946SClemens Ladisch 200c2353a08SClemens Ladisch #define OXYGEN_EEPROM_CONTROL 0x80 201c2353a08SClemens Ladisch #define OXYGEN_EEPROM_ADDRESS_MASK 0x7f 202c2353a08SClemens Ladisch #define OXYGEN_EEPROM_DIR_MASK 0x80 203c2353a08SClemens Ladisch #define OXYGEN_EEPROM_DIR_READ 0x00 204c2353a08SClemens Ladisch #define OXYGEN_EEPROM_DIR_WRITE 0x80 205c2353a08SClemens Ladisch 206c2353a08SClemens Ladisch #define OXYGEN_EEPROM_STATUS 0x81 207c2353a08SClemens Ladisch #define OXYGEN_EEPROM_VALID 0x40 208c2353a08SClemens Ladisch #define OXYGEN_EEPROM_BUSY 0x80 209c2353a08SClemens Ladisch 210c2353a08SClemens Ladisch #define OXYGEN_EEPROM_DATA 0x82 /* 16 bits */ 211c2353a08SClemens Ladisch 212d0ce9946SClemens Ladisch #define OXYGEN_2WIRE_CONTROL 0x90 213d0ce9946SClemens Ladisch #define OXYGEN_2WIRE_DIR_MASK 0x01 214c2353a08SClemens Ladisch #define OXYGEN_2WIRE_DIR_WRITE 0x00 215c2353a08SClemens Ladisch #define OXYGEN_2WIRE_DIR_READ 0x01 216d0ce9946SClemens Ladisch #define OXYGEN_2WIRE_ADDRESS_MASK 0xfe /* slave device address */ 217d0ce9946SClemens Ladisch #define OXYGEN_2WIRE_ADDRESS_SHIFT 1 218d0ce9946SClemens Ladisch 219d0ce9946SClemens Ladisch #define OXYGEN_2WIRE_MAP 0x91 /* address, 8 bits */ 220d0ce9946SClemens Ladisch #define OXYGEN_2WIRE_DATA 0x92 /* data, 16 bits */ 221d0ce9946SClemens Ladisch 222d0ce9946SClemens Ladisch #define OXYGEN_2WIRE_BUS_STATUS 0x94 223c2353a08SClemens Ladisch #define OXYGEN_2WIRE_BUSY 0x0001 224c2353a08SClemens Ladisch #define OXYGEN_2WIRE_LENGTH_MASK 0x0002 225c2353a08SClemens Ladisch #define OXYGEN_2WIRE_LENGTH_8 0x0000 226c2353a08SClemens Ladisch #define OXYGEN_2WIRE_LENGTH_16 0x0002 227c2353a08SClemens Ladisch #define OXYGEN_2WIRE_MANUAL_READ 0x0004 /* 0 = auto read */ 228c2353a08SClemens Ladisch #define OXYGEN_2WIRE_WRITE_MAP_ONLY 0x0008 229c2353a08SClemens Ladisch #define OXYGEN_2WIRE_SLAVE_AD_MASK 0x0030 /* AD0, AD1 */ 230c2353a08SClemens Ladisch #define OXYGEN_2WIRE_INTERRUPT_MASK 0x0040 /* 0 = int. if not responding */ 231c2353a08SClemens Ladisch #define OXYGEN_2WIRE_SLAVE_NO_RESPONSE 0x0080 232c2353a08SClemens Ladisch #define OXYGEN_2WIRE_SPEED_MASK 0x0100 233c2353a08SClemens Ladisch #define OXYGEN_2WIRE_SPEED_STANDARD 0x0000 234c2353a08SClemens Ladisch #define OXYGEN_2WIRE_SPEED_FAST 0x0100 235c2353a08SClemens Ladisch #define OXYGEN_2WIRE_CLOCK_SYNC 0x0200 236c2353a08SClemens Ladisch #define OXYGEN_2WIRE_BUS_RESET 0x0400 237d0ce9946SClemens Ladisch 238d0ce9946SClemens Ladisch #define OXYGEN_SPI_CONTROL 0x98 239d0ce9946SClemens Ladisch #define OXYGEN_SPI_BUSY 0x01 /* read */ 240c2353a08SClemens Ladisch #define OXYGEN_SPI_TRIGGER 0x01 /* write */ 241d0ce9946SClemens Ladisch #define OXYGEN_SPI_DATA_LENGTH_MASK 0x02 242d0ce9946SClemens Ladisch #define OXYGEN_SPI_DATA_LENGTH_2 0x00 243d0ce9946SClemens Ladisch #define OXYGEN_SPI_DATA_LENGTH_3 0x02 2445ea310ffSClemens Ladisch #define OXYGEN_SPI_CLOCK_MASK 0x0c 245c2353a08SClemens Ladisch #define OXYGEN_SPI_CLOCK_160 0x00 /* ns */ 2465ea310ffSClemens Ladisch #define OXYGEN_SPI_CLOCK_320 0x04 2475ea310ffSClemens Ladisch #define OXYGEN_SPI_CLOCK_640 0x08 2485ea310ffSClemens Ladisch #define OXYGEN_SPI_CLOCK_1280 0x0c 249d0ce9946SClemens Ladisch #define OXYGEN_SPI_CODEC_MASK 0x70 /* 0..5 */ 250d0ce9946SClemens Ladisch #define OXYGEN_SPI_CODEC_SHIFT 4 251c2353a08SClemens Ladisch #define OXYGEN_SPI_CEN_MASK 0x80 252c2353a08SClemens Ladisch #define OXYGEN_SPI_CEN_LATCH_CLOCK_LO 0x00 253c2353a08SClemens Ladisch #define OXYGEN_SPI_CEN_LATCH_CLOCK_HI 0x80 254d0ce9946SClemens Ladisch 255d0ce9946SClemens Ladisch #define OXYGEN_SPI_DATA1 0x99 256d0ce9946SClemens Ladisch #define OXYGEN_SPI_DATA2 0x9a 257d0ce9946SClemens Ladisch #define OXYGEN_SPI_DATA3 0x9b 258d0ce9946SClemens Ladisch 259d0ce9946SClemens Ladisch #define OXYGEN_MPU401 0xa0 260d0ce9946SClemens Ladisch 261c2353a08SClemens Ladisch #define OXYGEN_MPU401_CONTROL 0xa2 262c2353a08SClemens Ladisch #define OXYGEN_MPU401_LOOPBACK 0x01 /* TXD to RXD */ 263c2353a08SClemens Ladisch 264d0ce9946SClemens Ladisch #define OXYGEN_GPI_DATA 0xa4 265c2353a08SClemens Ladisch /* bits 0..5 = pin XGPI0..XGPI5 */ 266d0ce9946SClemens Ladisch 267d0ce9946SClemens Ladisch #define OXYGEN_GPI_INTERRUPT_MASK 0xa5 268c2353a08SClemens Ladisch /* bits 0..5, 1 = enable */ 269d0ce9946SClemens Ladisch 270d0ce9946SClemens Ladisch #define OXYGEN_GPIO_DATA 0xa6 271c2353a08SClemens Ladisch /* bits 0..9 */ 272d0ce9946SClemens Ladisch 273d0ce9946SClemens Ladisch #define OXYGEN_GPIO_CONTROL 0xa8 274c2353a08SClemens Ladisch /* bits 0..9, 0 = input, 1 = output */ 275c2353a08SClemens Ladisch #define OXYGEN_GPIO1_XSLAVE_RDY 0x8000 276d0ce9946SClemens Ladisch 277d0ce9946SClemens Ladisch #define OXYGEN_GPIO_INTERRUPT_MASK 0xaa 278c2353a08SClemens Ladisch /* bits 0..9, 1 = enable */ 279d0ce9946SClemens Ladisch 280c2353a08SClemens Ladisch #define OXYGEN_DEVICE_SENSE 0xac 281c2353a08SClemens Ladisch #define OXYGEN_HEAD_PHONE_DETECT 0x01 282c2353a08SClemens Ladisch #define OXYGEN_HEAD_PHONE_MASK 0x06 283c2353a08SClemens Ladisch #define OXYGEN_HEAD_PHONE_PASSIVE_SPK 0x00 284c2353a08SClemens Ladisch #define OXYGEN_HEAD_PHONE_HP 0x02 285c2353a08SClemens Ladisch #define OXYGEN_HEAD_PHONE_ACTIVE_SPK 0x04 286c2353a08SClemens Ladisch 287c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_DATA 0xb0 288c2353a08SClemens Ladisch 289c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_MAP 0xb2 290c2353a08SClemens Ladisch 291c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_STATUS 0xb3 292c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_BUSY 0x01 293c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_LENGTH_MASK 0x06 294c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_LENGTH_1 0x00 295c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_LENGTH_2 0x02 296c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_LENGTH_3 0x04 297c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_WRITE 0x08 /* r/wc */ 298c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_READ 0x10 /* r/wc */ 299c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_DRV_XACT_FAIL 0x20 /* r/wc */ 300c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_RESET 0x40 301c2353a08SClemens Ladisch 302c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_CONTROL 0xb4 303c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_DRV_ACK 0x01 304c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_DRV_XACT 0x02 305c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_INT_MASK 0x04 306c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_SYNC_MASK 0x08 307c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_SYNC_RDY_PIN 0x00 308c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_SYNC_DATA 0x08 309c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_ADDRESS_MASK 0x30 310c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_ADDRESS_10 0x00 311c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_ADDRESS_12 0x10 312c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_ADDRESS_14 0x20 313c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_ADDRESS_16 0x30 314c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_INT_POL 0x40 315c2353a08SClemens Ladisch #define OXYGEN_MCU_2WIRE_SYNC_ENABLE 0x80 316d0ce9946SClemens Ladisch 317d0ce9946SClemens Ladisch #define OXYGEN_PLAY_ROUTING 0xc0 318c2353a08SClemens Ladisch #define OXYGEN_PLAY_MUTE01 0x0001 319c2353a08SClemens Ladisch #define OXYGEN_PLAY_MUTE23 0x0002 320c2353a08SClemens Ladisch #define OXYGEN_PLAY_MUTE45 0x0004 321c2353a08SClemens Ladisch #define OXYGEN_PLAY_MUTE67 0x0008 322079e0cb7SRoman Volkov #define OXYGEN_PLAY_MUTE_MASK 0x000f 323c2353a08SClemens Ladisch #define OXYGEN_PLAY_MULTICH_MASK 0x0010 324c2353a08SClemens Ladisch #define OXYGEN_PLAY_MULTICH_I2S_DAC 0x0000 325c2353a08SClemens Ladisch #define OXYGEN_PLAY_MULTICH_AC97 0x0010 326c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_MASK 0x00e0 327c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_SPDIF 0x0000 328c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_MULTICH_01 0x0020 329c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_MULTICH_23 0x0040 330c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_MULTICH_45 0x0060 331c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_MULTICH_67 0x0080 332c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_REC_A 0x00a0 333c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_REC_B 0x00c0 334c2353a08SClemens Ladisch #define OXYGEN_PLAY_SPDIF_I2S_ADC_3 0x00e0 335d0ce9946SClemens Ladisch #define OXYGEN_PLAY_DAC0_SOURCE_MASK 0x0300 336c2353a08SClemens Ladisch #define OXYGEN_PLAY_DAC0_SOURCE_SHIFT 8 3375a256f86SClemens Ladisch #define OXYGEN_PLAY_DAC1_SOURCE_MASK 0x0c00 338c2353a08SClemens Ladisch #define OXYGEN_PLAY_DAC1_SOURCE_SHIFT 10 339d0ce9946SClemens Ladisch #define OXYGEN_PLAY_DAC2_SOURCE_MASK 0x3000 340c2353a08SClemens Ladisch #define OXYGEN_PLAY_DAC2_SOURCE_SHIFT 12 3415a256f86SClemens Ladisch #define OXYGEN_PLAY_DAC3_SOURCE_MASK 0xc000 342c2353a08SClemens Ladisch #define OXYGEN_PLAY_DAC3_SOURCE_SHIFT 14 343d0ce9946SClemens Ladisch 344d0ce9946SClemens Ladisch #define OXYGEN_REC_ROUTING 0xc2 345c2353a08SClemens Ladisch #define OXYGEN_MUTE_I2S_ADC_1 0x01 346c2353a08SClemens Ladisch #define OXYGEN_MUTE_I2S_ADC_2 0x02 347c2353a08SClemens Ladisch #define OXYGEN_MUTE_I2S_ADC_3 0x04 348c2353a08SClemens Ladisch #define OXYGEN_REC_A_ROUTE_MASK 0x08 349c2353a08SClemens Ladisch #define OXYGEN_REC_A_ROUTE_I2S_ADC_1 0x00 350c2353a08SClemens Ladisch #define OXYGEN_REC_A_ROUTE_AC97_0 0x08 351c2353a08SClemens Ladisch #define OXYGEN_REC_B_ROUTE_MASK 0x10 352c2353a08SClemens Ladisch #define OXYGEN_REC_B_ROUTE_I2S_ADC_2 0x00 353c2353a08SClemens Ladisch #define OXYGEN_REC_B_ROUTE_AC97_1 0x10 354c2353a08SClemens Ladisch #define OXYGEN_REC_C_ROUTE_MASK 0x20 355c2353a08SClemens Ladisch #define OXYGEN_REC_C_ROUTE_SPDIF 0x00 356c2353a08SClemens Ladisch #define OXYGEN_REC_C_ROUTE_I2S_ADC_3 0x20 357d0ce9946SClemens Ladisch 358d0ce9946SClemens Ladisch #define OXYGEN_ADC_MONITOR 0xc3 359c2353a08SClemens Ladisch #define OXYGEN_ADC_MONITOR_A 0x01 360c2353a08SClemens Ladisch #define OXYGEN_ADC_MONITOR_A_HALF_VOL 0x02 361c2353a08SClemens Ladisch #define OXYGEN_ADC_MONITOR_B 0x04 362c2353a08SClemens Ladisch #define OXYGEN_ADC_MONITOR_B_HALF_VOL 0x08 363c2353a08SClemens Ladisch #define OXYGEN_ADC_MONITOR_C 0x10 364c2353a08SClemens Ladisch #define OXYGEN_ADC_MONITOR_C_HALF_VOL 0x20 365d0ce9946SClemens Ladisch 366d0ce9946SClemens Ladisch #define OXYGEN_A_MONITOR_ROUTING 0xc4 367c9946b2cSClemens Ladisch #define OXYGEN_A_MONITOR_ROUTE_0_MASK 0x03 368c9946b2cSClemens Ladisch #define OXYGEN_A_MONITOR_ROUTE_0_SHIFT 0 369c9946b2cSClemens Ladisch #define OXYGEN_A_MONITOR_ROUTE_1_MASK 0x0c 370c9946b2cSClemens Ladisch #define OXYGEN_A_MONITOR_ROUTE_1_SHIFT 2 371c9946b2cSClemens Ladisch #define OXYGEN_A_MONITOR_ROUTE_2_MASK 0x30 372c9946b2cSClemens Ladisch #define OXYGEN_A_MONITOR_ROUTE_2_SHIFT 4 373c9946b2cSClemens Ladisch #define OXYGEN_A_MONITOR_ROUTE_3_MASK 0xc0 374c9946b2cSClemens Ladisch #define OXYGEN_A_MONITOR_ROUTE_3_SHIFT 6 375d0ce9946SClemens Ladisch 376d0ce9946SClemens Ladisch #define OXYGEN_AC97_CONTROL 0xd0 377c2353a08SClemens Ladisch #define OXYGEN_AC97_COLD_RESET 0x0001 378c2353a08SClemens Ladisch #define OXYGEN_AC97_SUSPENDED 0x0002 /* read */ 379c2353a08SClemens Ladisch #define OXYGEN_AC97_RESUME 0x0002 /* write */ 380c2353a08SClemens Ladisch #define OXYGEN_AC97_CLOCK_DISABLE 0x0004 381c2353a08SClemens Ladisch #define OXYGEN_AC97_NO_CODEC_0 0x0008 382d0ce9946SClemens Ladisch #define OXYGEN_AC97_CODEC_0 0x0010 383d0ce9946SClemens Ladisch #define OXYGEN_AC97_CODEC_1 0x0020 384d0ce9946SClemens Ladisch 385d0ce9946SClemens Ladisch #define OXYGEN_AC97_INTERRUPT_MASK 0xd2 386c2353a08SClemens Ladisch #define OXYGEN_AC97_INT_READ_DONE 0x01 387c2353a08SClemens Ladisch #define OXYGEN_AC97_INT_WRITE_DONE 0x02 388c2353a08SClemens Ladisch #define OXYGEN_AC97_INT_CODEC_0 0x10 389c2353a08SClemens Ladisch #define OXYGEN_AC97_INT_CODEC_1 0x20 390d0ce9946SClemens Ladisch 391d0ce9946SClemens Ladisch #define OXYGEN_AC97_INTERRUPT_STATUS 0xd3 392c2353a08SClemens Ladisch /* OXYGEN_AC97_INT_* */ 393d0ce9946SClemens Ladisch 394d0ce9946SClemens Ladisch #define OXYGEN_AC97_OUT_CONFIG 0xd4 395c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_SLOT3 0x00000001 396c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_SLOT3_VSR 0x00000002 397c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_SLOT4 0x00000010 398c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_SLOT4_VSR 0x00000020 399c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_FRONTL 0x00000100 400c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_FRONTR 0x00000200 401c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_SIDEL 0x00000400 402c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_SIDER 0x00000800 403c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_CENTER 0x00001000 404c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_BASE 0x00002000 405c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_REARL 0x00004000 406c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_REARR 0x00008000 407d0ce9946SClemens Ladisch 408d0ce9946SClemens Ladisch #define OXYGEN_AC97_IN_CONFIG 0xd8 409c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINEL 0x00000001 410c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINEL_VSR 0x00000002 411c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINEL_16 0x00000000 412c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINEL_18 0x00000004 413c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINEL_20 0x00000008 414c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINER 0x00000010 415c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINER_VSR 0x00000020 416c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINER_16 0x00000000 417c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINER_18 0x00000040 418c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC1_LINER_20 0x00000080 419c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_LINEL 0x00000100 420c2353a08SClemens Ladisch #define OXYGEN_AC97_CODEC0_LINER 0x00000200 421d0ce9946SClemens Ladisch 422d0ce9946SClemens Ladisch #define OXYGEN_AC97_REGS 0xdc 423d0ce9946SClemens Ladisch #define OXYGEN_AC97_REG_DATA_MASK 0x0000ffff 424d0ce9946SClemens Ladisch #define OXYGEN_AC97_REG_ADDR_MASK 0x007f0000 425d0ce9946SClemens Ladisch #define OXYGEN_AC97_REG_ADDR_SHIFT 16 426d0ce9946SClemens Ladisch #define OXYGEN_AC97_REG_DIR_MASK 0x00800000 427d0ce9946SClemens Ladisch #define OXYGEN_AC97_REG_DIR_WRITE 0x00000000 428d0ce9946SClemens Ladisch #define OXYGEN_AC97_REG_DIR_READ 0x00800000 429d0ce9946SClemens Ladisch #define OXYGEN_AC97_REG_CODEC_MASK 0x01000000 430d0ce9946SClemens Ladisch #define OXYGEN_AC97_REG_CODEC_SHIFT 24 431d0ce9946SClemens Ladisch 432c2353a08SClemens Ladisch #define OXYGEN_TEST 0xe0 433c2353a08SClemens Ladisch #define OXYGEN_TEST_RAM_SUCCEEDED 0x01 434c2353a08SClemens Ladisch #define OXYGEN_TEST_PLAYBACK_RAM 0x02 435c2353a08SClemens Ladisch #define OXYGEN_TEST_RECORD_RAM 0x04 436c2353a08SClemens Ladisch #define OXYGEN_TEST_PLL 0x08 437c2353a08SClemens Ladisch #define OXYGEN_TEST_2WIRE_LOOPBACK 0x10 438c2353a08SClemens Ladisch 439d0ce9946SClemens Ladisch #define OXYGEN_DMA_FLUSH 0xe1 440d0ce9946SClemens Ladisch /* OXYGEN_CHANNEL_* */ 441d0ce9946SClemens Ladisch 442d0ce9946SClemens Ladisch #define OXYGEN_CODEC_VERSION 0xe4 443de0074eeSClemens Ladisch #define OXYGEN_CODEC_ID_MASK 0x07 444d0ce9946SClemens Ladisch 445d0ce9946SClemens Ladisch #define OXYGEN_REVISION 0xe6 446de0074eeSClemens Ladisch #define OXYGEN_PACKAGE_ID_MASK 0x0007 447de0074eeSClemens Ladisch #define OXYGEN_PACKAGE_ID_8786 0x0004 448de0074eeSClemens Ladisch #define OXYGEN_PACKAGE_ID_8787 0x0006 449de0074eeSClemens Ladisch #define OXYGEN_PACKAGE_ID_8788 0x0007 450c2353a08SClemens Ladisch #define OXYGEN_REVISION_MASK 0xfff8 451de0074eeSClemens Ladisch #define OXYGEN_REVISION_2 0x0008 452c2353a08SClemens Ladisch 453c2353a08SClemens Ladisch #define OXYGEN_OFFSIN_48K 0xe8 454c2353a08SClemens Ladisch #define OXYGEN_OFFSBASE_48K 0xe9 455c2353a08SClemens Ladisch #define OXYGEN_OFFSBASE_MASK 0x0fff 456c2353a08SClemens Ladisch #define OXYGEN_OFFSIN_44K 0xec 457c2353a08SClemens Ladisch #define OXYGEN_OFFSBASE_44K 0xed 458d0ce9946SClemens Ladisch 459d0ce9946SClemens Ladisch #endif 460