Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
snd_ps3.h
Go to the documentation of this file.
1 /*
2  * Audio support for PS3
3  * Copyright (C) 2007 Sony Computer Entertainment Inc.
4  * All rights reserved.
5  * Copyright 2006, 2007 Sony Corporation
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; version 2 of the Licence.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 #if !defined(_SND_PS3_H_)
22 #define _SND_PS3_H_
23 
24 #include <linux/irqreturn.h>
25 
26 #define SND_PS3_DRIVER_NAME "snd_ps3"
27 
33 };
34 
40 };
41 
42 enum snd_ps3_ch {
46 };
47 
49  uint32_t avs_audio_ch; /* fixed */
54  unsigned char avs_cs_info[8];
55 };
56 /*
57  * PS3 audio 'card' instance
58  * there should be only ONE hardware.
59  */
62  struct snd_card *card;
63 
64  struct snd_pcm *pcm;
66 
67  /* hvc info */
70 
71  /* registers */
73 
74  /* irq */
76  unsigned int irq_no;
77 
78  /* remember avsetting */
80 
81  /* dma buffer management */
83  /* dma_lock start */
84  void * dma_start_vaddr[2]; /* 0 for L, 1 for R */
89  int silent;
90  /* dma_lock end */
91 
92  int running;
93 
94  /* null buffer */
97 
98  /* start delay */
99  unsigned int start_delay;
100 
101 };
102 
103 
104 /* PS3 audio DMAC block size in bytes */
105 #define PS3_AUDIO_DMAC_BLOCK_SIZE (128)
106 /* one stage (stereo) of audio FIFO in bytes */
107 #define PS3_AUDIO_FIFO_STAGE_SIZE (256)
108 /* how many stages the fifo have */
109 #define PS3_AUDIO_FIFO_STAGE_COUNT (8)
110 /* fifo size 128 bytes * 8 stages * stereo (2ch) */
111 #define PS3_AUDIO_FIFO_SIZE \
112  (PS3_AUDIO_FIFO_STAGE_SIZE * PS3_AUDIO_FIFO_STAGE_COUNT)
113 
114 /* PS3 audio DMAC max block count in one dma shot = 128 (0x80) blocks*/
115 #define PS3_AUDIO_DMAC_MAX_BLOCKS (PS3_AUDIO_DMASIZE_BLOCKS_MASK + 1)
116 
117 #define PS3_AUDIO_NORMAL_DMA_START_CH (0)
118 #define PS3_AUDIO_NORMAL_DMA_COUNT (8)
119 #define PS3_AUDIO_NULL_DMA_START_CH \
120  (PS3_AUDIO_NORMAL_DMA_START_CH + PS3_AUDIO_NORMAL_DMA_COUNT)
121 #define PS3_AUDIO_NULL_DMA_COUNT (2)
122 
123 #define SND_PS3_MAX_VOL (0x0F)
124 #define SND_PS3_MIN_VOL (0x00)
125 #define SND_PS3_MIN_ATT SND_PS3_MIN_VOL
126 #define SND_PS3_MAX_ATT SND_PS3_MAX_VOL
127 
128 #define SND_PS3_PCM_PREALLOC_SIZE \
129  (PS3_AUDIO_DMAC_BLOCK_SIZE * PS3_AUDIO_DMAC_MAX_BLOCKS * 4)
130 
131 #define SND_PS3_DMA_REGION_SIZE \
132  (SND_PS3_PCM_PREALLOC_SIZE + PAGE_SIZE)
133 
134 #define PS3_AUDIO_IOID (1UL)
135 
136 #endif /* _SND_PS3_H_ */