Lines Matching full:hz
18 DIGBEEP_HZ_STEP = 46875, /* 46.875 Hz */
19 DIGBEEP_HZ_MIN = 93750, /* 93.750 Hz */
56 * defined from the 8bit tone parameter, in Hz,
58 * that is from 12kHz to 93.75Hz in steps of 46.875 Hz
60 static int beep_linear_tone(struct hda_beep *beep, int hz) in beep_linear_tone() argument
62 if (hz <= 0) in beep_linear_tone()
64 hz *= 1000; /* fixed point */ in beep_linear_tone()
65 hz = hz - DIGBEEP_HZ_MIN in beep_linear_tone()
67 if (hz < 0) in beep_linear_tone()
68 hz = 0; /* turn off PC beep*/ in beep_linear_tone()
69 else if (hz >= (DIGBEEP_HZ_MAX - DIGBEEP_HZ_MIN)) in beep_linear_tone()
70 hz = 1; /* max frequency */ in beep_linear_tone()
72 hz /= DIGBEEP_HZ_STEP; in beep_linear_tone()
73 hz = 255 - hz; in beep_linear_tone()
75 return hz; in beep_linear_tone()
80 * The tone frequency in Hz is calculated as
82 * from 47Hz to 12kHz
84 static int beep_standard_tone(struct hda_beep *beep, int hz) in beep_standard_tone() argument
86 if (hz <= 0) in beep_standard_tone()
88 hz = 12000 / hz; in beep_standard_tone()
89 if (hz > 0xff) in beep_standard_tone()
91 if (hz <= 0) in beep_standard_tone()
93 return hz; in beep_standard_tone()
97 unsigned int code, int hz) in snd_hda_beep_event() argument
103 if (hz) in snd_hda_beep_event()
104 hz = 1000; in snd_hda_beep_event()
108 beep->tone = beep_linear_tone(beep, hz); in snd_hda_beep_event()
110 beep->tone = beep_standard_tone(beep, hz); in snd_hda_beep_event()