Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
radio-gemtek.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/videodev2.h>
#include <linux/mutex.h>
#include <linux/io.h>
#include <linux/pnp.h>
#include <linux/slab.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include "radio-isa.h"

Go to the source code of this file.

Data Structures

struct  gemtek
 

Macros

#define CONFIG_RADIO_GEMTEK_PORT   -1
 
#define CONFIG_RADIO_GEMTEK_PROBE   1
 
#define GEMTEK_MAX   4
 
#define FSCALE   8
 
#define IF_OFFSET   ((unsigned int)(10.52 * 16000 * (1<<FSCALE)))
 
#define REF_FREQ   ((unsigned int)(6.39 * 16 * (1<<FSCALE)))
 
#define GEMTEK_CK   0x01 /* Clock signal */
 
#define GEMTEK_DA   0x02 /* Serial data */
 
#define GEMTEK_CE   0x04 /* Chip enable */
 
#define GEMTEK_NS   0x08 /* No signal */
 
#define GEMTEK_MT   0x10 /* Line mute */
 
#define GEMTEK_STDF_3_125_KHZ   0x01 /* Standard frequency 3.125 kHz */
 
#define GEMTEK_PLL_OFF   0x07 /* PLL off */
 
#define BU2614_BUS_SIZE   32 /* BU2614 / BU2614FS bus size */
 
#define SHORT_DELAY   5 /* usec */
 
#define LONG_DELAY   75 /* usec */
 
#define BU2614_FREQ_BITS   16 /* D0..D15, Frequency data */
 
#define BU2614_PORT_BITS   3 /* P0..P2, Output port control data */
 
#define BU2614_VOID_BITS   4 /* unused */
 
#define BU2614_FMES_BITS   1 /* CT, Frequency measurement beginning data */
 
#define BU2614_STDF_BITS   3 /* R0..R2, Standard frequency data */
 
#define BU2614_SWIN_BITS   1 /* S, Switch between FMIN / AMIN */
 
#define BU2614_SWAL_BITS   1 /* PS, Swallow counter division (AMIN only)*/
 
#define BU2614_VOID2_BITS   1 /* unused */
 
#define BU2614_FMUN_BITS   1 /* GT, Frequency measurement time & unlock */
 
#define BU2614_TEST_BITS   1 /* TS, Test data is input */
 
#define BU2614_FREQ_SHIFT   0
 
#define BU2614_PORT_SHIFT   (BU2614_FREQ_BITS + BU2614_FREQ_SHIFT)
 
#define BU2614_VOID_SHIFT   (BU2614_PORT_BITS + BU2614_PORT_SHIFT)
 
#define BU2614_FMES_SHIFT   (BU2614_VOID_BITS + BU2614_VOID_SHIFT)
 
#define BU2614_STDF_SHIFT   (BU2614_FMES_BITS + BU2614_FMES_SHIFT)
 
#define BU2614_SWIN_SHIFT   (BU2614_STDF_BITS + BU2614_STDF_SHIFT)
 
#define BU2614_SWAL_SHIFT   (BU2614_SWIN_BITS + BU2614_SWIN_SHIFT)
 
#define BU2614_VOID2_SHIFT   (BU2614_SWAL_BITS + BU2614_SWAL_SHIFT)
 
#define BU2614_FMUN_SHIFT   (BU2614_VOID2_BITS + BU2614_VOID2_SHIFT)
 
#define BU2614_TEST_SHIFT   (BU2614_FMUN_BITS + BU2614_FMUN_SHIFT)
 
#define MKMASK(field)
 
#define BU2614_PORT_MASK   MKMASK(PORT)
 
#define BU2614_FREQ_MASK   MKMASK(FREQ)
 
#define BU2614_VOID_MASK   MKMASK(VOID)
 
#define BU2614_FMES_MASK   MKMASK(FMES)
 
#define BU2614_STDF_MASK   MKMASK(STDF)
 
#define BU2614_SWIN_MASK   MKMASK(SWIN)
 
#define BU2614_SWAL_MASK   MKMASK(SWAL)
 
#define BU2614_VOID2_MASK   MKMASK(VOID2)
 
#define BU2614_FMUN_MASK   MKMASK(FMUN)
 
#define BU2614_TEST_MASK   MKMASK(TEST)
 
#define gemtek_bu2614_set(dev, field, data)
 

Functions

 MODULE_AUTHOR ("Jonas Munsin, Pekka Seppänen <[email protected]>")
 
 MODULE_DESCRIPTION ("A driver for the GemTek Radio card.")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION ("1.0.0")
 
 module_param (probe, bool, 0444)
 
 MODULE_PARM_DESC (probe,"Enable automatic device probing.")
 
 module_param (hardmute, bool, 0644)
 
 MODULE_PARM_DESC (hardmute,"Enable 'hard muting' by shutting down PLL, may ""reduce static noise.")
 
 module_param_array (io, int, NULL, 0444)
 
 MODULE_PARM_DESC (io,"Force I/O ports for the GemTek Radio card if automatic ""probing is disabled or fails. The most common I/O ports are: 0x20c ""0x30c, 0x24c or 0x34c (0x20c, 0x248 and 0x28c have been reported to ""work for the combined sound/radiocard).")
 
 module_param_array (radio_nr, int, NULL, 0444)
 
 MODULE_PARM_DESC (radio_nr,"Radio device numbers")
 
 module_init (gemtek_init)
 
 module_exit (gemtek_exit)
 

Macro Definition Documentation

#define BU2614_BUS_SIZE   32 /* BU2614 / BU2614FS bus size */

Definition at line 98 of file radio-gemtek.c.

#define BU2614_FMES_BITS   1 /* CT, Frequency measurement beginning data */

Definition at line 112 of file radio-gemtek.c.

#define BU2614_FMES_MASK   MKMASK(FMES)

Definition at line 136 of file radio-gemtek.c.

#define BU2614_FMES_SHIFT   (BU2614_VOID_BITS + BU2614_VOID_SHIFT)

Definition at line 123 of file radio-gemtek.c.

#define BU2614_FMUN_BITS   1 /* GT, Frequency measurement time & unlock */

Definition at line 117 of file radio-gemtek.c.

#define BU2614_FMUN_MASK   MKMASK(FMUN)

Definition at line 141 of file radio-gemtek.c.

#define BU2614_FMUN_SHIFT   (BU2614_VOID2_BITS + BU2614_VOID2_SHIFT)

Definition at line 128 of file radio-gemtek.c.

#define BU2614_FREQ_BITS   16 /* D0..D15, Frequency data */

Definition at line 109 of file radio-gemtek.c.

#define BU2614_FREQ_MASK   MKMASK(FREQ)

Definition at line 134 of file radio-gemtek.c.

#define BU2614_FREQ_SHIFT   0

Definition at line 120 of file radio-gemtek.c.

#define BU2614_PORT_BITS   3 /* P0..P2, Output port control data */

Definition at line 110 of file radio-gemtek.c.

#define BU2614_PORT_MASK   MKMASK(PORT)

Definition at line 133 of file radio-gemtek.c.

#define BU2614_PORT_SHIFT   (BU2614_FREQ_BITS + BU2614_FREQ_SHIFT)

Definition at line 121 of file radio-gemtek.c.

#define BU2614_STDF_BITS   3 /* R0..R2, Standard frequency data */

Definition at line 113 of file radio-gemtek.c.

#define BU2614_STDF_MASK   MKMASK(STDF)

Definition at line 137 of file radio-gemtek.c.

#define BU2614_STDF_SHIFT   (BU2614_FMES_BITS + BU2614_FMES_SHIFT)

Definition at line 124 of file radio-gemtek.c.

#define BU2614_SWAL_BITS   1 /* PS, Swallow counter division (AMIN only)*/

Definition at line 115 of file radio-gemtek.c.

#define BU2614_SWAL_MASK   MKMASK(SWAL)

Definition at line 139 of file radio-gemtek.c.

#define BU2614_SWAL_SHIFT   (BU2614_SWIN_BITS + BU2614_SWIN_SHIFT)

Definition at line 126 of file radio-gemtek.c.

#define BU2614_SWIN_BITS   1 /* S, Switch between FMIN / AMIN */

Definition at line 114 of file radio-gemtek.c.

#define BU2614_SWIN_MASK   MKMASK(SWIN)

Definition at line 138 of file radio-gemtek.c.

#define BU2614_SWIN_SHIFT   (BU2614_STDF_BITS + BU2614_STDF_SHIFT)

Definition at line 125 of file radio-gemtek.c.

#define BU2614_TEST_BITS   1 /* TS, Test data is input */

Definition at line 118 of file radio-gemtek.c.

#define BU2614_TEST_MASK   MKMASK(TEST)

Definition at line 142 of file radio-gemtek.c.

#define BU2614_TEST_SHIFT   (BU2614_FMUN_BITS + BU2614_FMUN_SHIFT)

Definition at line 129 of file radio-gemtek.c.

#define BU2614_VOID2_BITS   1 /* unused */

Definition at line 116 of file radio-gemtek.c.

#define BU2614_VOID2_MASK   MKMASK(VOID2)

Definition at line 140 of file radio-gemtek.c.

#define BU2614_VOID2_SHIFT   (BU2614_SWAL_BITS + BU2614_SWAL_SHIFT)

Definition at line 127 of file radio-gemtek.c.

#define BU2614_VOID_BITS   4 /* unused */

Definition at line 111 of file radio-gemtek.c.

#define BU2614_VOID_MASK   MKMASK(VOID)

Definition at line 135 of file radio-gemtek.c.

#define BU2614_VOID_SHIFT   (BU2614_PORT_BITS + BU2614_PORT_SHIFT)

Definition at line 122 of file radio-gemtek.c.

#define CONFIG_RADIO_GEMTEK_PORT   -1

Definition at line 52 of file radio-gemtek.c.

#define CONFIG_RADIO_GEMTEK_PROBE   1

Definition at line 55 of file radio-gemtek.c.

#define FSCALE   8

Definition at line 86 of file radio-gemtek.c.

#define gemtek_bu2614_set (   dev,
  field,
  data 
)
Value:
((dev)->bu2614data = \
((dev)->bu2614data & ~field##_MASK) | ((data) << field##_SHIFT))

Definition at line 147 of file radio-gemtek.c.

#define GEMTEK_CE   0x04 /* Chip enable */

Definition at line 92 of file radio-gemtek.c.

#define GEMTEK_CK   0x01 /* Clock signal */

Definition at line 90 of file radio-gemtek.c.

#define GEMTEK_DA   0x02 /* Serial data */

Definition at line 91 of file radio-gemtek.c.

#define GEMTEK_MAX   4

Definition at line 58 of file radio-gemtek.c.

#define GEMTEK_MT   0x10 /* Line mute */

Definition at line 94 of file radio-gemtek.c.

#define GEMTEK_NS   0x08 /* No signal */

Definition at line 93 of file radio-gemtek.c.

#define GEMTEK_PLL_OFF   0x07 /* PLL off */

Definition at line 96 of file radio-gemtek.c.

#define GEMTEK_STDF_3_125_KHZ   0x01 /* Standard frequency 3.125 kHz */

Definition at line 95 of file radio-gemtek.c.

#define IF_OFFSET   ((unsigned int)(10.52 * 16000 * (1<<FSCALE)))

Definition at line 87 of file radio-gemtek.c.

#define LONG_DELAY   75 /* usec */

Definition at line 101 of file radio-gemtek.c.

#define MKMASK (   field)
Value:
(((1<<BU2614_##field##_BITS) - 1) << \
BU2614_##field##_SHIFT)

Definition at line 131 of file radio-gemtek.c.

#define REF_FREQ   ((unsigned int)(6.39 * 16 * (1<<FSCALE)))

Definition at line 88 of file radio-gemtek.c.

#define SHORT_DELAY   5 /* usec */

Definition at line 100 of file radio-gemtek.c.

Function Documentation

MODULE_AUTHOR ( "Jonas  Munsin,
Pekka Seppänen< pexu @kapsi.fi >"   
)
MODULE_DESCRIPTION ( "A driver for the GemTek Radio card."  )
module_exit ( gemtek_exit  )
module_init ( gemtek_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( probe  ,
bool  ,
0444   
)
module_param ( hardmute  ,
bool  ,
0644   
)
module_param_array ( io  ,
int  ,
NULL  ,
0444   
)
module_param_array ( radio_nr  ,
int  ,
NULL  ,
0444   
)
MODULE_PARM_DESC ( probe  ,
"Enable automatic device probing."   
)
MODULE_PARM_DESC ( hardmute  ,
"Enable 'hard muting' by shutting down  PLL,
may""reduce static noise."   
)
MODULE_PARM_DESC ( io  ,
"Force I/O ports for the GemTek Radio card if automatic ""probing is disabled or fails. The most common I/O ports are: 0x20c ""  0x30c,
0x24c or 0x34c(0x20c, 0x248 and 0x28c have been reported to""work for the combined sound/radiocard)."   
)
MODULE_PARM_DESC ( radio_nr  ,
"Radio device numbers"   
)
MODULE_VERSION ( "1.0.0"  )