diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-06-16 11:15:58 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-16 11:15:58 +0200 |
commit | e765ee90da62535ac7d7a97f2464f9646539d683 (patch) | |
tree | 7a9cecce5aab958938e9a3bf46c2302d6af1958c /sound/drivers/pcsp | |
parent | a4500b84c51645bbc86be3ca84f2252b7ada060f (diff) | |
parent | 066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff) |
Merge branch 'linus' into tracing/ftracetip-tracing-ftrace-2008-06-16_09.26_Montip-tracing-ftrace-2008-06-16_09.16_Mon
Diffstat (limited to 'sound/drivers/pcsp')
-rw-r--r-- | sound/drivers/pcsp/pcsp.h | 6 | ||||
-rw-r--r-- | sound/drivers/pcsp/pcsp_mixer.c | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sound/drivers/pcsp/pcsp.h b/sound/drivers/pcsp/pcsp.h index f07cc1ee1fe7..1d661f795e8c 100644 --- a/sound/drivers/pcsp/pcsp.h +++ b/sound/drivers/pcsp/pcsp.h @@ -24,7 +24,8 @@ static DEFINE_SPINLOCK(i8253_lock); /* default timer freq for PC-Speaker: 18643 Hz */ #define DIV_18KHZ 64 #define MAX_DIV DIV_18KHZ -#define CUR_DIV() (MAX_DIV >> chip->treble) +#define CALC_DIV(d) (MAX_DIV >> (d)) +#define CUR_DIV() CALC_DIV(chip->treble) #define PCSP_MAX_TREBLE 1 /* unfortunately, with hrtimers 37KHz does not work very well :( */ @@ -36,7 +37,8 @@ static DEFINE_SPINLOCK(i8253_lock); #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_RATE() (PIT_TICK_RATE / CUR_DIV()) +#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) diff --git a/sound/drivers/pcsp/pcsp_mixer.c b/sound/drivers/pcsp/pcsp_mixer.c index 64a695fef74e..caeb0f57fcca 100644 --- a/sound/drivers/pcsp/pcsp_mixer.c +++ b/sound/drivers/pcsp/pcsp_mixer.c @@ -50,7 +50,8 @@ static int pcsp_treble_info(struct snd_kcontrol *kcontrol, uinfo->value.enumerated.items = chip->max_treble + 1; if (uinfo->value.enumerated.item > chip->max_treble) uinfo->value.enumerated.item = chip->max_treble; - sprintf(uinfo->value.enumerated.name, "%d", PCSP_RATE()); + sprintf(uinfo->value.enumerated.name, "%d", + PCSP_CALC_RATE(uinfo->value.enumerated.item)); return 0; } |