Go to the documentation of this file.
25 #define DRIVER_NAME "radio-si470x"
29 #include <linux/kernel.h>
30 #include <linux/module.h>
32 #include <linux/sched.h>
33 #include <linux/slab.h>
34 #include <linux/input.h>
35 #include <linux/videodev2.h>
42 #include <asm/unaligned.h>
49 #define RADIO_REGISTER_SIZE 2
50 #define RADIO_REGISTER_NUM 16
51 #define RDS_REGISTER_NUM 6
54 #define DEVICEID_PN 0xf000
55 #define DEVICEID_MFGID 0x0fff
58 #define CHIPID_REV 0xfc00
59 #define CHIPID_DEV 0x0200
60 #define CHIPID_FIRMWARE 0x01ff
63 #define POWERCFG_DSMUTE 0x8000
64 #define POWERCFG_DMUTE 0x4000
65 #define POWERCFG_MONO 0x2000
66 #define POWERCFG_RDSM 0x0800
67 #define POWERCFG_SKMODE 0x0400
68 #define POWERCFG_SEEKUP 0x0200
69 #define POWERCFG_SEEK 0x0100
70 #define POWERCFG_DISABLE 0x0040
71 #define POWERCFG_ENABLE 0x0001
74 #define CHANNEL_TUNE 0x8000
75 #define CHANNEL_CHAN 0x03ff
78 #define SYSCONFIG1_RDSIEN 0x8000
79 #define SYSCONFIG1_STCIEN 0x4000
80 #define SYSCONFIG1_RDS 0x1000
81 #define SYSCONFIG1_DE 0x0800
82 #define SYSCONFIG1_AGCD 0x0400
83 #define SYSCONFIG1_BLNDADJ 0x00c0
84 #define SYSCONFIG1_GPIO3 0x0030
85 #define SYSCONFIG1_GPIO2 0x000c
86 #define SYSCONFIG1_GPIO1 0x0003
89 #define SYSCONFIG2_SEEKTH 0xff00
90 #define SYSCONFIG2_BAND 0x00c0
91 #define SYSCONFIG2_SPACE 0x0030
92 #define SYSCONFIG2_VOLUME 0x000f
95 #define SYSCONFIG3_SMUTER 0xc000
96 #define SYSCONFIG3_SMUTEA 0x3000
97 #define SYSCONFIG3_SKSNR 0x00f0
98 #define SYSCONFIG3_SKCNT 0x000f
101 #define TEST1_AHIZEN 0x4000
109 #define STATUSRSSI 10
110 #define STATUSRSSI_RDSR 0x8000
111 #define STATUSRSSI_STC 0x4000
112 #define STATUSRSSI_SF 0x2000
113 #define STATUSRSSI_AFCRL 0x1000
114 #define STATUSRSSI_RDSS 0x0800
115 #define STATUSRSSI_BLERA 0x0600
116 #define STATUSRSSI_ST 0x0100
117 #define STATUSRSSI_RSSI 0x00ff
120 #define READCHAN_BLERB 0xc000
121 #define READCHAN_BLERC 0x3000
122 #define READCHAN_BLERD 0x0c00
123 #define READCHAN_READCHAN 0x03ff
126 #define RDSA_RDSA 0xffff
129 #define RDSB_RDSB 0xffff
132 #define RDSC_RDSC 0xffff
135 #define RDSD_RDSD 0xffff
166 #if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)
168 struct usb_device *usbdev;
174 struct urb *int_in_urb;
178 unsigned char software_version;
182 #if defined(CONFIG_I2C_SI470X) || defined(CONFIG_I2C_SI470X_MODULE)
193 #define RADIO_FW_VERSION 12
208 #define FREQ_MUL (1000000 / 62.5)