Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
pcsp.h File Reference
#include <linux/hrtimer.h>
#include <linux/i8253.h>
#include <linux/timex.h>

Go to the source code of this file.

Data Structures

struct  snd_pcsp
 

Macros

#define PCSP_SOUND_VERSION   0x400 /* read 4.00 */
 
#define PCSP_DEBUG   0
 
#define DIV_18KHZ   64
 
#define MAX_DIV   DIV_18KHZ
 
#define CALC_DIV(d)   (MAX_DIV >> (d))
 
#define CUR_DIV()   CALC_DIV(chip->treble)
 
#define PCSP_MAX_TREBLE   1
 
#define PCSP_DEFAULT_TREBLE   0
 
#define MIN_DIV   (MAX_DIV >> PCSP_MAX_TREBLE)
 
#define PCSP_MIN_LPJ   1000000
 
#define PCSP_DEFAULT_SDIV   (DIV_18KHZ >> 1)
 
#define PCSP_DEFAULT_SRATE   (PIT_TICK_RATE / PCSP_DEFAULT_SDIV)
 
#define PCSP_INDEX_INC()   (1 << (PCSP_MAX_TREBLE - chip->treble))
 
#define PCSP_CALC_RATE(i)   (PIT_TICK_RATE / CALC_DIV(i))
 
#define PCSP_RATE()   PCSP_CALC_RATE(chip->treble)
 
#define PCSP_MIN_RATE__1   MAX_DIV/PIT_TICK_RATE
 
#define PCSP_MAX_RATE__1   MIN_DIV/PIT_TICK_RATE
 
#define PCSP_MAX_PERIOD_NS   (1000000000ULL * PCSP_MIN_RATE__1)
 
#define PCSP_MIN_PERIOD_NS   (1000000000ULL * PCSP_MAX_RATE__1)
 
#define PCSP_CALC_NS(div)
 
#define PCSP_PERIOD_NS()   PCSP_CALC_NS(CUR_DIV())
 
#define PCSP_MAX_PERIOD_SIZE   (64*1024)
 
#define PCSP_MAX_PERIODS   512
 
#define PCSP_BUFFER_SIZE   (128*1024)
 

Functions

enum hrtimer_restart pcsp_do_timer (struct hrtimer *handle)
 
void pcsp_sync_stop (struct snd_pcsp *chip)
 
int snd_pcsp_new_pcm (struct snd_pcsp *chip)
 
int snd_pcsp_new_mixer (struct snd_pcsp *chip, int nopcm)
 

Variables

struct snd_pcsp pcsp_chip
 

Macro Definition Documentation

#define CALC_DIV (   d)    (MAX_DIV >> (d))

Definition at line 22 of file pcsp.h.

#define CUR_DIV ( )    CALC_DIV(chip->treble)

Definition at line 23 of file pcsp.h.

#define DIV_18KHZ   64

Definition at line 20 of file pcsp.h.

#define MAX_DIV   DIV_18KHZ

Definition at line 21 of file pcsp.h.

#define MIN_DIV   (MAX_DIV >> PCSP_MAX_TREBLE)

Definition at line 28 of file pcsp.h.

#define PCSP_BUFFER_SIZE   (128*1024)

Definition at line 50 of file pcsp.h.

#define PCSP_CALC_NS (   div)
Value:
({ \
u64 __val = 1000000000ULL * (div); \
do_div(__val, PIT_TICK_RATE); \
__val; \
})

Definition at line 41 of file pcsp.h.

#define PCSP_CALC_RATE (   i)    (PIT_TICK_RATE / CALC_DIV(i))

Definition at line 35 of file pcsp.h.

#define PCSP_DEBUG   0

Definition at line 17 of file pcsp.h.

#define PCSP_DEFAULT_SDIV   (DIV_18KHZ >> 1)

Definition at line 32 of file pcsp.h.

#define PCSP_DEFAULT_SRATE   (PIT_TICK_RATE / PCSP_DEFAULT_SDIV)

Definition at line 33 of file pcsp.h.

#define PCSP_DEFAULT_TREBLE   0

Definition at line 27 of file pcsp.h.

#define PCSP_INDEX_INC ( )    (1 << (PCSP_MAX_TREBLE - chip->treble))

Definition at line 34 of file pcsp.h.

#define PCSP_MAX_PERIOD_NS   (1000000000ULL * PCSP_MIN_RATE__1)

Definition at line 39 of file pcsp.h.

#define PCSP_MAX_PERIOD_SIZE   (64*1024)

Definition at line 48 of file pcsp.h.

#define PCSP_MAX_PERIODS   512

Definition at line 49 of file pcsp.h.

#define PCSP_MAX_RATE__1   MIN_DIV/PIT_TICK_RATE

Definition at line 38 of file pcsp.h.

#define PCSP_MAX_TREBLE   1

Definition at line 24 of file pcsp.h.

#define PCSP_MIN_LPJ   1000000

Definition at line 31 of file pcsp.h.

#define PCSP_MIN_PERIOD_NS   (1000000000ULL * PCSP_MAX_RATE__1)

Definition at line 40 of file pcsp.h.

#define PCSP_MIN_RATE__1   MAX_DIV/PIT_TICK_RATE

Definition at line 37 of file pcsp.h.

#define PCSP_PERIOD_NS ( )    PCSP_CALC_NS(CUR_DIV())

Definition at line 46 of file pcsp.h.

#define PCSP_RATE ( )    PCSP_CALC_RATE(chip->treble)

Definition at line 36 of file pcsp.h.

#define PCSP_SOUND_VERSION   0x400 /* read 4.00 */

Definition at line 16 of file pcsp.h.

Function Documentation

enum hrtimer_restart pcsp_do_timer ( struct hrtimer handle)

Definition at line 128 of file pcsp_lib.c.

void pcsp_sync_stop ( struct snd_pcsp chip)

Definition at line 192 of file pcsp_lib.c.

int snd_pcsp_new_mixer ( struct snd_pcsp chip,
int  nopcm 
)

Definition at line 144 of file pcsp_mixer.c.

int snd_pcsp_new_pcm ( struct snd_pcsp chip)

Definition at line 337 of file pcsp_lib.c.

Variable Documentation

struct snd_pcsp pcsp_chip

Definition at line 40 of file pcsp.c.