/* Set beeper frequency. Max allowed frequency is 2.5 KHz. This limit is mostly arbitrary, but the beeper isn't really much good beyond this frequency.  */
void set_beeper_frequency(uint frequency)
/* Set beeper frequency. Max allowed frequency is 2.5 KHz. This limit is mostly arbitrary, but the beeper isn't really much good beyond this frequency.  */
void set_beeper_frequency(uint frequency)
{
#define FREQ_LIMIT	2500
	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
	if (frequency > FREQ_LIMIT)
		frequency = FREQ_LIMIT;
	frequency = 1000000 / frequency;
	immap->im_cpmtimer.cpmt_trr1 = (ushort) frequency;
}