Go to the documentation of this file.
12 #include <linux/hrtimer.h>
14 #include <linux/timex.h>
16 #define PCSP_SOUND_VERSION 0x400
21 #define MAX_DIV DIV_18KHZ
22 #define CALC_DIV(d) (MAX_DIV >> (d))
23 #define CUR_DIV() CALC_DIV(chip->treble)
24 #define PCSP_MAX_TREBLE 1
27 #define PCSP_DEFAULT_TREBLE 0
28 #define MIN_DIV (MAX_DIV >> PCSP_MAX_TREBLE)
31 #define PCSP_MIN_LPJ 1000000
32 #define PCSP_DEFAULT_SDIV (DIV_18KHZ >> 1)
33 #define PCSP_DEFAULT_SRATE (PIT_TICK_RATE / PCSP_DEFAULT_SDIV)
34 #define PCSP_INDEX_INC() (1 << (PCSP_MAX_TREBLE - chip->treble))
35 #define PCSP_CALC_RATE(i) (PIT_TICK_RATE / CALC_DIV(i))
36 #define PCSP_RATE() PCSP_CALC_RATE(chip->treble)
37 #define PCSP_MIN_RATE__1 MAX_DIV/PIT_TICK_RATE
38 #define PCSP_MAX_RATE__1 MIN_DIV/PIT_TICK_RATE
39 #define PCSP_MAX_PERIOD_NS (1000000000ULL * PCSP_MIN_RATE__1)
40 #define PCSP_MIN_PERIOD_NS (1000000000ULL * PCSP_MAX_RATE__1)
41 #define PCSP_CALC_NS(div) ({ \
42 u64 __val = 1000000000ULL * (div); \
43 do_div(__val, PIT_TICK_RATE); \
46 #define PCSP_PERIOD_NS() PCSP_CALC_NS(CUR_DIV())
48 #define PCSP_MAX_PERIOD_SIZE (64*1024)
49 #define PCSP_MAX_PERIODS 512
50 #define PCSP_BUFFER_SIZE (128*1024)