Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 97307
b: refs/heads/master
c: 97e08f5
h: refs/heads/master
i:
  97305: 6118f25
  97303: 80b5fe0
v: v3
  • Loading branch information
Stas Sergeev authored and Takashi Iwai committed May 25, 2008
1 parent ba01dcd commit e5525c1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97ec710cab76f90a6bece76a04e76aa50096a470
refs/heads/master: 97e08f5d732bbfd5180f73aa7875d328421bee8a
6 changes: 4 additions & 2 deletions trunk/sound/drivers/pcsp/pcsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 :( */
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion trunk/sound/drivers/pcsp/pcsp_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e5525c1

Please sign in to comment.