MODULE_AUTHOR("R. Offermans & others");
MODULE_DESCRIPTION("A driver for the TerraTec ActiveRadio Standalone radio card.");
MODULE_LICENSE("GPL");
MODULE_VERSION("0.1.99");
/* Note: there seems to be only one possible port (0x590), but without hardwarethisishardtoverify.Fornow,thisistheonlyonewewill
support. */ staticint io = 0x590; staticint radio_nr = -1;
staticint terratec_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol)
{ int i;
if (mute)
vol = 0;
vol = vol + (vol * 32); /* change both channels */ for (i = 0; i < 8; i++) { if (vol & (0x80 >> i))
outb(0x80, isa->io + 1); else
outb(0x00, isa->io + 1);
} return0;
}
/* this is the worst part in this driver */ /* many more or less strange things are going on here, but hey, it works :) */
staticint terratec_s_frequency(struct radio_isa_card *isa, u32 freq)
{ int i; int temp; long rest; unsignedchar buffer[25]; /* we have to bit shift 25 registers */
freq = freq / 160; /* convert the freq. to a nice to handle value */
memset(buffer, 0, sizeof(buffer));
rest = freq * 10 + 10700; /* I once had understood what is going on here */ /* maybe some wise guy (friedhelm?) can comment this stuff */
i = 13;
temp = 102400; while (rest != 0) { if (rest % temp == rest)
buffer[i] = 0; else {
buffer[i] = 1;
rest = rest - temp;
}
i--;
temp = temp / 2;
}
for (i = 24; i > -1; i--) { /* bit shift the values to the radiocard */ if (buffer[i] == 1) {
outb(WRT_EN | DATA, isa->io);
outb(WRT_EN | DATA | CLK_ON, isa->io);
outb(WRT_EN | DATA, isa->io);
} else {
outb(WRT_EN | 0x00, isa->io);
outb(WRT_EN | 0x00 | CLK_ON, isa->io);
}
}
outb(0x00, isa->io); return0;
}
static u32 terratec_g_signal(struct radio_isa_card *isa)
{ /* bit set = no signal present */ return (inb(isa->io) & 2) ? 0 : 0xffff;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.