31 #include <linux/module.h>
34 #include <linux/videodev2.h>
36 #include <linux/slab.h>
41 #define DRIVER_VERSION "0.1.2"
48 #ifndef CONFIG_RADIO_TYPHOON_PORT
49 #define CONFIG_RADIO_TYPHOON_PORT -1
52 #ifndef CONFIG_RADIO_TYPHOON_MUTEFREQ
53 #define CONFIG_RADIO_TYPHOON_MUTEFREQ 87000
99 outval = (x * x + 2500) / 5000;
100 outval = (outval * x + 5000) / 10000;
101 outval -= (10 * x * x + 10433) / 20866;
102 outval += 4 * x - 11505;
104 outb_p((outval >> 8) & 0x01, isa->
io + 4);
121 if (vol == 0 && !ty->
muted) {
123 return typhoon_s_frequency(isa, mutefreq << 4);
125 if (vol && ty->
muted) {
127 return typhoon_s_frequency(isa, isa->
freq);
133 .alloc = typhoon_alloc,
134 .s_mute_volume = typhoon_s_mute_volume,
135 .s_frequency = typhoon_s_frequency,
138 static const int typhoon_ioports[] = { 0x316, 0x336 };
146 .name =
"radio-typhoon",
150 .radio_nr_params = radio_nr,
151 .io_ports = typhoon_ioports,
152 .num_of_io_ports =
ARRAY_SIZE(typhoon_ioports),
154 .card =
"Typhoon Radio",
160 static int __init typhoon_init(
void)
162 if (mutefreq < 87000 || mutefreq > 108000) {
163 printk(
KERN_ERR "%s: You must set a frequency (in kHz) used when muting the card,\n",
164 typhoon_driver.
driver.driver.name);
165 printk(
KERN_ERR "%s: e.g. with \"mutefreq=87500\" (87000 <= mutefreq <= 108000)\n",
166 typhoon_driver.
driver.driver.name);
172 static void __exit typhoon_exit(
void)