// SPDX-License-Identifier: GPL-2.0-only /* Typhoon Radio Card driver for radio support * (c) 1999 Dr. Henrik Seidel <[email protected]> * * Notes on the hardware * * This card has two output sockets, one for speakers and one for line. * The speaker output has volume control, but only in four discrete * steps. The line output has neither volume control nor mute. * * The card has auto-stereo according to its manual, although it all * sounds mono to me (even with the Win/DOS drivers). Maybe it's my * antenna - I really don't know for sure. * * Frequency control is done digitally. * * Volume control is done digitally, but there are only four different * possible values. So you should better always turn the volume up and * use line control. I got the best results by connecting line output * to the sound card microphone input. For such a configuration the * volume control has no effect, since volume control only influences * the speaker output. * * There is no explicit mute/unmute. So I set the radio frequency to a * value where I do expect just noise and turn the speaker volume down. * The frequency change is necessary since the card never seems to be * completely silent. * * Converted to V4L2 API by Mauro Carvalho Chehab <[email protected]> */ #include <linux/module.h> /* Modules */ #include <linux/init.h> /* Initdata */ #include <linux/ioport.h> /* request_region */ #include <linux/videodev2.h> /* kernel radio structs */ #include <linux/io.h> /* outb, outb_p */ #include <linux/slab.h> #include <media/v4l2-device.h> #include <media/v4l2-ioctl.h> #include "radio-isa.h" #define DRIVER_VERSION … MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …; MODULE_VERSION(…) …; #ifndef CONFIG_RADIO_TYPHOON_PORT #define CONFIG_RADIO_TYPHOON_PORT … #endif #ifndef CONFIG_RADIO_TYPHOON_MUTEFREQ #define CONFIG_RADIO_TYPHOON_MUTEFREQ … #endif #define TYPHOON_MAX … static int io[TYPHOON_MAX] = …; static int radio_nr[TYPHOON_MAX] = …; static unsigned long mutefreq = …; module_param_array(…); MODULE_PARM_DESC(…) …; module_param_array(…); MODULE_PARM_DESC(…) …; module_param(mutefreq, ulong, 0); MODULE_PARM_DESC(…) …; struct typhoon { … }; static struct radio_isa_card *typhoon_alloc(void) { … } static int typhoon_s_frequency(struct radio_isa_card *isa, u32 freq) { … } static int typhoon_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol) { … } static const struct radio_isa_ops typhoon_ops = …; static const int typhoon_ioports[] = …; static struct radio_isa_driver typhoon_driver = …; static int __init typhoon_init(void) { … } static void __exit typhoon_exit(void) { … } module_init(…) …; module_exit(typhoon_exit);