Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/wait.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <asm/visws/cobalt.h>
#include "sound_config.h"
Go to the source code of this file.
Data Structures | |
struct | lithium |
struct | dma_chan_desc |
struct | dma_chan |
struct | ustmsc |
struct | ad1843_bitfield |
struct | ad1843_gain |
struct | vwsnd_port |
struct | vwsnd_dev |
Macros | |
#define | ASSERT(e) ((void) 0) |
#define | DBGDO(x) /* don't */ |
#define | DBGX(fmt, args...) ((void) 0) |
#define | DBGP(fmt, args...) ((void) 0) |
#define | DBGE(fmt, args...) ((void) 0) |
#define | DBGC(rtn) ((void) 0) |
#define | DBGR() ((void) 0) |
#define | DBGPV(fmt, args...) ((void) 0) |
#define | DBGXV(fmt, args...) ((void) 0) |
#define | DBGEV(fmt, args...) ((void) 0) |
#define | DBGCV(rtn) ((void) 0) |
#define | DBGRV() ((void) 0) |
#define | LI_HOST_CONTROLLER 0x000 |
#define | LI_HC_RESET 0x00008000 |
#define | LI_HC_LINK_ENABLE 0x00004000 |
#define | LI_HC_LINK_FAILURE 0x00000004 |
#define | LI_HC_LINK_CODEC 0x00000002 |
#define | LI_HC_LINK_READY 0x00000001 |
#define | LI_INTR_STATUS 0x010 |
#define | LI_INTR_MASK 0x014 |
#define | LI_INTR_LINK_ERR 0x00008000 |
#define | LI_INTR_COMM2_TRIG 0x00000008 |
#define | LI_INTR_COMM2_UNDERFLOW 0x00000004 |
#define | LI_INTR_COMM1_TRIG 0x00000002 |
#define | LI_INTR_COMM1_OVERFLOW 0x00000001 |
#define | LI_CODEC_COMMAND 0x018 |
#define | LI_CC_BUSY 0x00008000 |
#define | LI_CC_DIR 0x00000080 |
#define | LI_CC_DIR_RD LI_CC_DIR |
#define | LI_CC_DIR_WR (!LI_CC_DIR) |
#define | LI_CC_ADDR_MASK 0x0000007F |
#define | LI_CODEC_DATA 0x01C |
#define | LI_COMM1_BASE 0x100 |
#define | LI_COMM1_CTL 0x104 |
#define | LI_CCTL_RESET 0x80000000 |
#define | LI_CCTL_SIZE 0x70000000 |
#define | LI_CCTL_DMA_ENABLE 0x08000000 |
#define | LI_CCTL_TMASK 0x07000000 /* trigger mask */ |
#define | LI_CCTL_TPTR 0x00FF0000 /* trigger pointer */ |
#define | LI_CCTL_RPTR 0x0000FF00 |
#define | LI_CCTL_WPTR 0x000000FF |
#define | LI_COMM1_CFG 0x108 |
#define | LI_CCFG_LOCK 0x00008000 |
#define | LI_CCFG_SLOT 0x00000070 |
#define | LI_CCFG_DIRECTION 0x00000008 |
#define | LI_CCFG_DIR_IN (!LI_CCFG_DIRECTION) |
#define | LI_CCFG_DIR_OUT LI_CCFG_DIRECTION |
#define | LI_CCFG_MODE 0x00000004 |
#define | LI_CCFG_MODE_MONO (!LI_CCFG_MODE) |
#define | LI_CCFG_MODE_STEREO LI_CCFG_MODE |
#define | LI_CCFG_FORMAT 0x00000003 |
#define | LI_CCFG_FMT_8BIT 0x00000000 |
#define | LI_CCFG_FMT_16BIT 0x00000001 |
#define | LI_COMM2_BASE 0x10C |
#define | LI_COMM2_CTL 0x110 |
#define | LI_COMM2_CFG 0x114 |
#define | LI_UST_LOW 0x200 /* 64-bit Unadjusted System Time is */ |
#define | LI_UST_HIGH 0x204 /* microseconds since boot */ |
#define | LI_AUDIO1_UST 0x300 /* UST-MSC pairs */ |
#define | LI_AUDIO1_MSC 0x304 /* MSC (Media Stream Counter) */ |
#define | LI_AUDIO2_UST 0x308 /* counts samples actually */ |
#define | LI_AUDIO2_MSC 0x30C /* processed as of time UST */ |
#define | DMACHUNK_SHIFT 5 |
#define | DMACHUNK_SIZE (1 << DMACHUNK_SHIFT) |
#define | BYTES_TO_CHUNKS(bytes) ((bytes) >> DMACHUNK_SHIFT) |
#define | CHUNKS_TO_BYTES(chunks) ((chunks) << DMACHUNK_SHIFT) |
#define | SHIFT_FIELD(val, mask) (((val) * ((mask) & -(mask))) & (mask)) |
#define | UNSHIFT_FIELD(val, mask) (((val) & (mask)) / ((mask) & -(mask))) |
#define | READ_INTR_MASK (LI_INTR_COMM1_TRIG | LI_INTR_COMM1_OVERFLOW) |
#define | WRITE_INTR_MASK (LI_INTR_COMM2_TRIG | LI_INTR_COMM2_UNDERFLOW) |
#define | INC_USE_COUNT (atomic_inc(&vwsnd_use_count)) |
#define | DEC_USE_COUNT (atomic_dec(&vwsnd_use_count)) |
#define | IN_USE (atomic_read(&vwsnd_use_count) != 0) |
#define | HWBUF_SHIFT 13 |
#define | HWBUF_SIZE (1 << HWBUF_SHIFT) |
#define | HBO (HWBUF_SHIFT > PAGE_SHIFT ? HWBUF_SHIFT - PAGE_SHIFT : 0) |
#define | HWBUF_ORDER (HBO + 1) /* next size bigger */ |
#define | MIN_SPEED 4000 |
#define | MAX_SPEED 49000 |
#define | MIN_FRAGSHIFT (DMACHUNK_SHIFT + 1) |
#define | MAX_FRAGSHIFT (PAGE_SHIFT) |
#define | MIN_FRAGSIZE (1 << MIN_FRAGSHIFT) |
#define | MAX_FRAGSIZE (1 << MAX_FRAGSHIFT) |
#define | MIN_FRAGCOUNT(fragsize) 3 |
#define | MAX_FRAGCOUNT(fragsize) (32 * PAGE_SIZE / (fragsize)) |
#define | DEFAULT_FRAGSHIFT 12 |
#define | DEFAULT_FRAGCOUNT 16 |
#define | DEFAULT_SUBDIVSHIFT 0 |
Typedefs | |
typedef struct lithium | lithium_t |
typedef struct dma_chan_desc | dma_chan_desc_t |
typedef struct dma_chan | dma_chan_t |
typedef struct ustmsc | ustmsc_t |
typedef struct ad1843_bitfield | ad1843_bitfield_t |
typedef struct ad1843_gain | ad1843_gain_t |
typedef enum vwsnd_port_swstate | vwsnd_port_swstate_t |
typedef enum vwsnd_port_hwstate | vwsnd_port_hwstate_t |
typedef enum vwsnd_port_flags | vwsnd_port_flags_t |
typedef struct vwsnd_port | vwsnd_port_t |
typedef struct vwsnd_dev | vwsnd_dev_t |
Enumerations | |
enum | { LI_PAGE0_OFFSET = 0x01000 - 0x1000, LI_PAGE1_OFFSET = 0x0F000 - 0x1000, LI_PAGE2_OFFSET = 0x10000 - 0x1000 } |
enum | vwsnd_port_swstate { SW_OFF, SW_INITIAL, SW_RUN, SW_DRAIN } |
enum | vwsnd_port_hwstate { HW_STOPPED, HW_RUNNING } |
enum | vwsnd_port_flags { DISABLED = 1 << 0, ERFLOWN = 1 << 1, HW_BUSY = 1 << 2 } |
Functions | |
MODULE_DESCRIPTION ("SGI Visual Workstation sound module") | |
MODULE_AUTHOR ("Bob Miller <[email protected]>") | |
MODULE_LICENSE ("GPL") | |
module_init (init_vwsnd) | |
module_exit (cleanup_vwsnd) | |
#define BYTES_TO_CHUNKS | ( | bytes | ) | ((bytes) >> DMACHUNK_SHIFT) |
#define CHUNKS_TO_BYTES | ( | chunks | ) | ((chunks) << DMACHUNK_SHIFT) |
#define DEC_USE_COUNT (atomic_dec(&vwsnd_use_count)) |
#define DMACHUNK_SIZE (1 << DMACHUNK_SHIFT) |
#define HBO (HWBUF_SHIFT > PAGE_SHIFT ? HWBUF_SHIFT - PAGE_SHIFT : 0) |
#define HWBUF_SIZE (1 << HWBUF_SHIFT) |
#define IN_USE (atomic_read(&vwsnd_use_count) != 0) |
#define INC_USE_COUNT (atomic_inc(&vwsnd_use_count)) |
#define LI_AUDIO1_MSC 0x304 /* MSC (Media Stream Counter) */ |
#define LI_CCFG_DIR_IN (!LI_CCFG_DIRECTION) |
#define LI_CCFG_DIR_OUT LI_CCFG_DIRECTION |
#define LI_CCFG_MODE_MONO (!LI_CCFG_MODE) |
#define LI_CCFG_MODE_STEREO LI_CCFG_MODE |
#define LI_UST_LOW 0x200 /* 64-bit Unadjusted System Time is */ |
#define MAX_FRAGCOUNT | ( | fragsize | ) | (32 * PAGE_SIZE / (fragsize)) |
#define MAX_FRAGSHIFT (PAGE_SHIFT) |
#define MAX_FRAGSIZE (1 << MAX_FRAGSHIFT) |
#define MIN_FRAGSHIFT (DMACHUNK_SHIFT + 1) |
#define MIN_FRAGSIZE (1 << MIN_FRAGSHIFT) |
#define READ_INTR_MASK (LI_INTR_COMM1_TRIG | LI_INTR_COMM1_OVERFLOW) |
#define WRITE_INTR_MASK (LI_INTR_COMM2_TRIG | LI_INTR_COMM2_UNDERFLOW) |
typedef struct ad1843_bitfield ad1843_bitfield_t |
typedef struct ad1843_gain ad1843_gain_t |
typedef struct dma_chan_desc dma_chan_desc_t |
typedef struct dma_chan dma_chan_t |
typedef struct vwsnd_dev vwsnd_dev_t |
typedef enum vwsnd_port_flags vwsnd_port_flags_t |
typedef enum vwsnd_port_hwstate vwsnd_port_hwstate_t |
typedef enum vwsnd_port_swstate vwsnd_port_swstate_t |
typedef struct vwsnd_port vwsnd_port_t |
anonymous enum |
enum vwsnd_port_flags |
enum vwsnd_port_hwstate |
enum vwsnd_port_swstate |
MODULE_AUTHOR | ( | "Bob Miller <[email protected]>" | ) |
MODULE_DESCRIPTION | ( | "SGI Visual Workstation sound module" | ) |
module_exit | ( | cleanup_vwsnd | ) |
module_init | ( | init_vwsnd | ) |
MODULE_LICENSE | ( | "GPL" | ) |