* (C) 2001 Dimitromanolakis Apostolos <apdim@grecian.net>
*
* Based in the radio Maestro PCI driver. Actually it uses the same chip
* for radio but different pci controller.
*
* I didn't have any specs I reversed engineered the protocol from
* (C) 2001 Dimitromanolakis Apostolos <apdim@grecian.net>
*
* Based in the radio Maestro PCI driver. Actually it uses the same chip
* for radio but different pci controller.
*
* I didn't have any specs I reversed engineered the protocol from
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
.owner = THIS_MODULE,
.open = video_exclusive_open,
.release = video_exclusive_release,
{
__u16 io, /* base of radio io */
muted, /* VIDEO_AUDIO_MUTE */
{
__u16 io, /* base of radio io */
muted, /* VIDEO_AUDIO_MUTE */
struct mutex lock;
} radio_unit = {0, 0, 0, 0, };
struct mutex lock;
} radio_unit = {0, 0, 0, 0, };
outb( power|wren|data|clk ,io); udelay(4);
outb( power|wren|data ,io); udelay(4);
}
outb( power|wren|data|clk ,io); udelay(4);
outb( power|wren|data ,io); udelay(4);
}
{
outb( power|wren ,io); udelay(4);
outb( power|wren|clk ,io); udelay(4);
{
outb( power|wren ,io); udelay(4);
outb( power|wren|clk ,io); udelay(4);
outbit(0,io); // 19 port ?
outbit(0,io); // 18 port ?
outbit(0,io); // 19 port ?
outbit(0,io); // 18 port ?
outbit(0,io); // 17 search level
outbit(0,io); // 16 search level
outbit(0,io); // 17 search level
outbit(0,io); // 16 search level
outb(power,io); udelay(4);
return !(inb(io) & mo_st);
}
static int get_tune(__u16 io)
outb(power,io); udelay(4);
return !(inb(io) & mo_st);
}
static int get_tune(__u16 io)
outb(power+clk,io); udelay(4);
return !(inb(io) & mo_st);
}
outb(power+clk,io); udelay(4);
return !(inb(io) & mo_st);
}
struct video_audio *v = arg;
memset(v,0,sizeof(*v));
strcpy(v->name, "Radio");
v->flags=VIDEO_AUDIO_MUTABLE | card->muted;
v->mode=VIDEO_SOUND_STEREO;
struct video_audio *v = arg;
memset(v,0,sizeof(*v));
strcpy(v->name, "Radio");
v->flags=VIDEO_AUDIO_MUTABLE | card->muted;
v->mode=VIDEO_SOUND_STEREO;
mutex_lock(&card->lock);
ret = video_usercopy(inode, file, cmd, arg, radio_function);
mutex_unlock(&card->lock);
mutex_lock(&card->lock);
ret = video_usercopy(inode, file, cmd, arg, radio_function);
mutex_unlock(&card->lock);
static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
if(!request_region(pci_resource_start(pdev, 0),
static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
if(!request_region(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) {
- printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n");
- goto err_out;
+ pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) {
+ printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n");
+ goto err_out;
radio_unit.io = pci_resource_start(pdev, 0);
mutex_init(&radio_unit.lock);
maxiradio_radio.priv = &radio_unit;
if(video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr)==-1) {
radio_unit.io = pci_resource_start(pdev, 0);
mutex_init(&radio_unit.lock);
maxiradio_radio.priv = &radio_unit;
if(video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr)==-1) {