19 #include <linux/module.h>
22 #include <linux/videodev2.h>
24 #include <linux/slab.h>
29 MODULE_AUTHOR(
"Eric Lammerts, Russell Kroll, Quay Lu, Donald Song, Jason Lewis, Scott McGrath, William McGrath");
36 #ifndef CONFIG_RADIO_TRUST_PORT
37 #define CONFIG_RADIO_TRUST_PORT -1
64 #define TDA7318_ADDR 0x88
65 #define TSA6060T_ADDR 0xc4
67 #define TR_DELAY do { inb(tr->isa.io); inb(tr->isa.io); inb(tr->isa.io); } while (0)
68 #define TR_SET_SCL outb(tr->ioval |= 2, tr->isa.io)
69 #define TR_CLR_SCL outb(tr->ioval &= 0xfd, tr->isa.io)
70 #define TR_SET_SDA outb(tr->ioval |= 1, tr->isa.io)
71 #define TR_CLR_SDA outb(tr->ioval &= 0xfe, tr->isa.io)
73 static void write_i2c(
struct trust *
tr,
int n, ...)
89 val =
va_arg(args,
unsigned);
90 for (mask = 0x80;
mask; mask >>= 1) {
129 static int trust_s_stereo(
struct radio_isa_card *isa,
bool stereo)
133 tr->
ioval = (tr->
ioval & 0xfb) | (!stereo << 2);
142 for (i = 0, v = 0; i < 100; i++)
144 return (v & 1) ? 0 : 0xffff;
154 freq >> 7, 0x60 | ((freq >> 15) & 1), 0);
158 static int basstreble2chip[15] = {
159 0, 1, 2, 3, 4, 5, 6, 7, 14, 13, 12, 11, 10, 9, 8
180 .s_ctrl = trust_s_ctrl,
198 return isa->
hdl.error;
202 .init = trust_initialize,
203 .alloc = trust_alloc,
204 .s_mute_volume = trust_s_mute_volume,
205 .s_frequency = trust_s_frequency,
206 .s_stereo = trust_s_stereo,
207 .g_signal = trust_g_signal,
210 static const int trust_ioports[] = { 0x350, 0x358 };
218 .name =
"radio-trust",
222 .radio_nr_params = radio_nr,
223 .io_ports = trust_ioports,
226 .card =
"Trust FM Radio",
232 static int __init trust_init(
void)
237 static void __exit trust_exit(
void)