📄 snd_ps3_reg.h
字号:
/* * Audio support for PS3 * Copyright (C) 2007 Sony Computer Entertainment Inc. * Copyright 2006, 2007 Sony Corporation * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *//* * interrupt / configure registers */#define PS3_AUDIO_INTR_0 (0x00000100)#define PS3_AUDIO_INTR_EN_0 (0x00000140)#define PS3_AUDIO_CONFIG (0x00000200)/* * DMAC registers * n:0..9 */#define PS3_AUDIO_DMAC_REGBASE(x) (0x0000210 + 0x20 * (x))#define PS3_AUDIO_KICK(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x00)#define PS3_AUDIO_SOURCE(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x04)#define PS3_AUDIO_DEST(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x08)#define PS3_AUDIO_DMASIZE(n) (PS3_AUDIO_DMAC_REGBASE(n) + 0x0C)/* * mute control */#define PS3_AUDIO_AX_MCTRL (0x00004000)#define PS3_AUDIO_AX_ISBP (0x00004004)#define PS3_AUDIO_AX_AOBP (0x00004008)#define PS3_AUDIO_AX_IC (0x00004010)#define PS3_AUDIO_AX_IE (0x00004014)#define PS3_AUDIO_AX_IS (0x00004018)/* * three wire serial * n:0..3 */#define PS3_AUDIO_AO_MCTRL (0x00006000)#define PS3_AUDIO_AO_3WMCTRL (0x00006004)#define PS3_AUDIO_AO_3WCTRL(n) (0x00006200 + 0x200 * (n))/* * S/PDIF * n:0..1 * x:0..11 * y:0..5 */#define PS3_AUDIO_AO_SPD_REGBASE(n) (0x00007200 + 0x200 * (n))#define PS3_AUDIO_AO_SPDCTRL(n) \ (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x00)#define PS3_AUDIO_AO_SPDUB(n, x) \ (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x04 + 0x04 * (x))#define PS3_AUDIO_AO_SPDCS(n, y) \ (PS3_AUDIO_AO_SPD_REGBASE(n) + 0x34 + 0x04 * (y))/* PS3_AUDIO_INTR_0 register tells an interrupt handler which audio DMA channel triggered the interrupt. The interrupt status for a channel can be cleared by writing a '1' to the corresponding bit. A new interrupt cannot be generated until the previous interrupt has been cleared. Note that the status reported by PS3_AUDIO_INTR_0 is independent of the value of PS3_AUDIO_INTR_EN_0. 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |0 0 0 0 0 0 0 0 0 0 0 0 0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C| INTR_0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+*/#define PS3_AUDIO_INTR_0_CHAN(n) (1 << ((n) * 2))#define PS3_AUDIO_INTR_0_CHAN9 PS3_AUDIO_INTR_0_CHAN(9)#define PS3_AUDIO_INTR_0_CHAN8 PS3_AUDIO_INTR_0_CHAN(8)#define PS3_AUDIO_INTR_0_CHAN7 PS3_AUDIO_INTR_0_CHAN(7)#define PS3_AUDIO_INTR_0_CHAN6 PS3_AUDIO_INTR_0_CHAN(6)#define PS3_AUDIO_INTR_0_CHAN5 PS3_AUDIO_INTR_0_CHAN(5)#define PS3_AUDIO_INTR_0_CHAN4 PS3_AUDIO_INTR_0_CHAN(4)#define PS3_AUDIO_INTR_0_CHAN3 PS3_AUDIO_INTR_0_CHAN(3)#define PS3_AUDIO_INTR_0_CHAN2 PS3_AUDIO_INTR_0_CHAN(2)#define PS3_AUDIO_INTR_0_CHAN1 PS3_AUDIO_INTR_0_CHAN(1)#define PS3_AUDIO_INTR_0_CHAN0 PS3_AUDIO_INTR_0_CHAN(0)/* The PS3_AUDIO_INTR_EN_0 register specifies which DMA channels can generate an interrupt to the PU. Each bit of PS3_AUDIO_INTR_EN_0 is ANDed with the corresponding bit in PS3_AUDIO_INTR_0. The resulting bits are OR'd together to generate the Audio interrupt. 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |0 0 0 0 0 0 0 0 0 0 0 0 0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C|0|C| INTR_EN_0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ Bit assignments are same as PS3_AUDIO_INTR_0*//* PS3_AUDIO_CONFIG 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |0 0 0 0 0 0 0 0|0 0 0 0 0 0 0 0|0 0 0 0 0 0 0 C|0 0 0 0 0 0 0 0| CONFIG +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+*//* The CLEAR field cancels all pending transfers, and stops any running DMA transfers. Any interrupts associated with the canceled transfers will occur as if the transfer had finished. Since this bit is designed to recover from DMA related issues which are caused by unpredictable situations, it is prefered to wait for normal DMA transfer end without using this bit.*/#define PS3_AUDIO_CONFIG_CLEAR (1 << 8) /* RWIVF *//* PS3_AUDIO_AX_MCTRL: Audio Port Mute Control Register 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|A|A|A|0 0 0 0 0 0 0|S|S|A|A|A|A| AX_MCTRL +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+*//* 3 Wire Audio Serial Output Channel Mutes (0..3) */#define PS3_AUDIO_AX_MCTRL_ASOMT(n) (1 << (3 - (n))) /* RWIVF */#define PS3_AUDIO_AX_MCTRL_ASO3MT (1 << 0) /* RWIVF */#define PS3_AUDIO_AX_MCTRL_ASO2MT (1 << 1) /* RWIVF */#define PS3_AUDIO_AX_MCTRL_ASO1MT (1 << 2) /* RWIVF */#define PS3_AUDIO_AX_MCTRL_ASO0MT (1 << 3) /* RWIVF *//* S/PDIF mutes (0,1)*/#define PS3_AUDIO_AX_MCTRL_SPOMT(n) (1 << (5 - (n))) /* RWIVF */#define PS3_AUDIO_AX_MCTRL_SPO1MT (1 << 4) /* RWIVF */#define PS3_AUDIO_AX_MCTRL_SPO0MT (1 << 5) /* RWIVF *//* All 3 Wire Serial Outputs Mute */#define PS3_AUDIO_AX_MCTRL_AASOMT (1 << 13) /* RWIVF *//* All S/PDIF Mute */#define PS3_AUDIO_AX_MCTRL_ASPOMT (1 << 14) /* RWIVF *//* All Audio Outputs Mute */#define PS3_AUDIO_AX_MCTRL_AAOMT (1 << 15) /* RWIVF *//* S/PDIF Outputs Buffer Read/Write Pointer Register 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |0 0 0 0 0 0 0 0|0|SPO0B|0|SPO1B|0 0 0 0 0 0 0 0|0|SPO0B|0|SPO1B| AX_ISBP +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+*//* S/PDIF Output Channel Read Buffer Numbers Buffer number is value of field. Indicates current read access buffer ID from Audio Data Transfer controller of S/PDIF Output*/#define PS3_AUDIO_AX_ISBP_SPOBRN_MASK(n) (0x7 << 4 * (1 - (n))) /* R-IUF */#define PS3_AUDIO_AX_ISBP_SPO1BRN_MASK (0x7 << 0) /* R-IUF */#define PS3_AUDIO_AX_ISBP_SPO0BRN_MASK (0x7 << 4) /* R-IUF *//*S/PDIF Output Channel Buffer Write NumbersIndicates current write access buffer ID from bus master.*/#define PS3_AUDIO_AX_ISBP_SPOBWN_MASK(n) (0x7 << 4 * (5 - (n))) /* R-IUF */#define PS3_AUDIO_AX_ISBP_SPO1BWN_MASK (0x7 << 16) /* R-IUF */#define PS3_AUDIO_AX_ISBP_SPO0BWN_MASK (0x7 << 20) /* R-IUF *//* 3 Wire Audio Serial Outputs Buffer Read/Write Pointer Register Buffer number is value of field 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |0|ASO0B|0|ASO1B|0|ASO2B|0|ASO3B|0|ASO0B|0|ASO1B|0|ASO2B|0|ASO3B| AX_AOBP +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+*//*3 Wire Audio Serial Output Channel Buffer Read NumbersIndicates current read access buffer Id from Audio Data TransferController of 3 Wire Audio Serial Output Channels*/#define PS3_AUDIO_AX_AOBP_ASOBRN_MASK(n) (0x7 << 4 * (3 - (n))) /* R-IUF */#define PS3_AUDIO_AX_AOBP_ASO3BRN_MASK (0x7 << 0) /* R-IUF */#define PS3_AUDIO_AX_AOBP_ASO2BRN_MASK (0x7 << 4) /* R-IUF */#define PS3_AUDIO_AX_AOBP_ASO1BRN_MASK (0x7 << 8) /* R-IUF */#define PS3_AUDIO_AX_AOBP_ASO0BRN_MASK (0x7 << 12) /* R-IUF *//*3 Wire Audio Serial Output Channel Buffer Write NumbersIndicates current write access buffer ID from bus master.*/#define PS3_AUDIO_AX_AOBP_ASOBWN_MASK(n) (0x7 << 4 * (7 - (n))) /* R-IUF */#define PS3_AUDIO_AX_AOBP_ASO3BWN_MASK (0x7 << 16) /* R-IUF */#define PS3_AUDIO_AX_AOBP_ASO2BWN_MASK (0x7 << 20) /* R-IUF */#define PS3_AUDIO_AX_AOBP_ASO1BWN_MASK (0x7 << 24) /* R-IUF */#define PS3_AUDIO_AX_AOBP_ASO0BWN_MASK (0x7 << 28) /* R-IUF *//*Audio Port Interrupt Condition RegisterFor the fields in this register, the following values apply:0 = Interrupt is generated every interrupt event.1 = Interrupt is generated every 2 interrupt events.2 = Interrupt is generated every 4 interrupt events.3 = Reserved 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |0 0 0 0 0 0 0 0|0 0|SPO|0 0|SPO|0 0|AAS|0 0 0 0 0 0 0 0 0 0 0 0| AX_IC +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+*//*All 3-Wire Audio Serial Outputs Interrupt ModeConfigures the Interrupt and Signal Notificationcondition of all 3-wire Audio Serial Outputs.*/#define PS3_AUDIO_AX_IC_AASOIMD_MASK (0x3 << 12) /* RWIVF */#define PS3_AUDIO_AX_IC_AASOIMD_EVERY1 (0x0 << 12) /* RWI-V */#define PS3_AUDIO_AX_IC_AASOIMD_EVERY2 (0x1 << 12) /* RW--V */#define PS3_AUDIO_AX_IC_AASOIMD_EVERY4 (0x2 << 12) /* RW--V *//*S/PDIF Output Channel Interrupt ModesConfigures the Interrupt and signal Notificationconditions of S/PDIF output channels.*/#define PS3_AUDIO_AX_IC_SPO1IMD_MASK (0x3 << 16) /* RWIVF */#define PS3_AUDIO_AX_IC_SPO1IMD_EVERY1 (0x0 << 16) /* RWI-V */#define PS3_AUDIO_AX_IC_SPO1IMD_EVERY2 (0x1 << 16) /* RW--V */#define PS3_AUDIO_AX_IC_SPO1IMD_EVERY4 (0x2 << 16) /* RW--V */#define PS3_AUDIO_AX_IC_SPO0IMD_MASK (0x3 << 20) /* RWIVF */#define PS3_AUDIO_AX_IC_SPO0IMD_EVERY1 (0x0 << 20) /* RWI-V */#define PS3_AUDIO_AX_IC_SPO0IMD_EVERY2 (0x1 << 20) /* RW--V */#define PS3_AUDIO_AX_IC_SPO0IMD_EVERY4 (0x2 << 20) /* RW--V *//*Audio Port interrupt Enable RegisterConfigures whether to enable or disable each Interrupt Generation. 31 24 23 16 15 8 7 0 +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+ |0 0 0 0 0 0 0 0|S|S|0 0|A|A|A|A|0 0 0 0|S|S|0 0|S|S|0 0|A|A|A|A| AX_IE +-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-|-+-+-+-+-+-+-+-+*//*3 Wire Audio Serial Output Channel Buffer UnderflowInterrupt EnablesSelect enable/disable of Buffer Underflow Interrupts for3-Wire Audio Serial Output ChannelsDISABLED=Interrupt generation disabled.*/#define PS3_AUDIO_AX_IE_ASOBUIE(n) (1 << (3 - (n))) /* RWIVF */#define PS3_AUDIO_AX_IE_ASO3BUIE (1 << 0) /* RWIVF */#define PS3_AUDIO_AX_IE_ASO2BUIE (1 << 1) /* RWIVF */#define PS3_AUDIO_AX_IE_ASO1BUIE (1 << 2) /* RWIVF */#define PS3_AUDIO_AX_IE_ASO0BUIE (1 << 3) /* RWIVF *//* S/PDIF Output Channel Buffer Underflow Interrupt Enables */#define PS3_AUDIO_AX_IE_SPOBUIE(n) (1 << (7 - (n))) /* RWIVF */#define PS3_AUDIO_AX_IE_SPO1BUIE (1 << 6) /* RWIVF */#define PS3_AUDIO_AX_IE_SPO0BUIE (1 << 7) /* RWIVF *//* S/PDIF Output Channel One Block Transfer Completion Interrupt Enables */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -