Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
radio-si470x.h File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/videodev2.h>
#include <linux/mutex.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>
#include <media/v4l2-device.h>
#include <asm/unaligned.h>

Go to the source code of this file.

Data Structures

struct  si470x_device
 

Macros

#define DRIVER_NAME   "radio-si470x"
 
#define RADIO_REGISTER_SIZE   2 /* 16 register bit width */
 
#define RADIO_REGISTER_NUM   16 /* DEVICEID ... RDSD */
 
#define RDS_REGISTER_NUM   6 /* STATUSRSSI ... RDSD */
 
#define DEVICEID   0 /* Device ID */
 
#define DEVICEID_PN   0xf000 /* bits 15..12: Part Number */
 
#define DEVICEID_MFGID   0x0fff /* bits 11..00: Manufacturer ID */
 
#define CHIPID   1 /* Chip ID */
 
#define CHIPID_REV   0xfc00 /* bits 15..10: Chip Version */
 
#define CHIPID_DEV   0x0200 /* bits 09..09: Device */
 
#define CHIPID_FIRMWARE   0x01ff /* bits 08..00: Firmware Version */
 
#define POWERCFG   2 /* Power Configuration */
 
#define POWERCFG_DSMUTE   0x8000 /* bits 15..15: Softmute Disable */
 
#define POWERCFG_DMUTE   0x4000 /* bits 14..14: Mute Disable */
 
#define POWERCFG_MONO   0x2000 /* bits 13..13: Mono Select */
 
#define POWERCFG_RDSM   0x0800 /* bits 11..11: RDS Mode (Si4701 only) */
 
#define POWERCFG_SKMODE   0x0400 /* bits 10..10: Seek Mode */
 
#define POWERCFG_SEEKUP   0x0200 /* bits 09..09: Seek Direction */
 
#define POWERCFG_SEEK   0x0100 /* bits 08..08: Seek */
 
#define POWERCFG_DISABLE   0x0040 /* bits 06..06: Powerup Disable */
 
#define POWERCFG_ENABLE   0x0001 /* bits 00..00: Powerup Enable */
 
#define CHANNEL   3 /* Channel */
 
#define CHANNEL_TUNE   0x8000 /* bits 15..15: Tune */
 
#define CHANNEL_CHAN   0x03ff /* bits 09..00: Channel Select */
 
#define SYSCONFIG1   4 /* System Configuration 1 */
 
#define SYSCONFIG1_RDSIEN   0x8000 /* bits 15..15: RDS Interrupt Enable (Si4701 only) */
 
#define SYSCONFIG1_STCIEN   0x4000 /* bits 14..14: Seek/Tune Complete Interrupt Enable */
 
#define SYSCONFIG1_RDS   0x1000 /* bits 12..12: RDS Enable (Si4701 only) */
 
#define SYSCONFIG1_DE   0x0800 /* bits 11..11: De-emphasis (0=75us 1=50us) */
 
#define SYSCONFIG1_AGCD   0x0400 /* bits 10..10: AGC Disable */
 
#define SYSCONFIG1_BLNDADJ   0x00c0 /* bits 07..06: Stereo/Mono Blend Level Adjustment */
 
#define SYSCONFIG1_GPIO3   0x0030 /* bits 05..04: General Purpose I/O 3 */
 
#define SYSCONFIG1_GPIO2   0x000c /* bits 03..02: General Purpose I/O 2 */
 
#define SYSCONFIG1_GPIO1   0x0003 /* bits 01..00: General Purpose I/O 1 */
 
#define SYSCONFIG2   5 /* System Configuration 2 */
 
#define SYSCONFIG2_SEEKTH   0xff00 /* bits 15..08: RSSI Seek Threshold */
 
#define SYSCONFIG2_BAND   0x00c0 /* bits 07..06: Band Select */
 
#define SYSCONFIG2_SPACE   0x0030 /* bits 05..04: Channel Spacing */
 
#define SYSCONFIG2_VOLUME   0x000f /* bits 03..00: Volume */
 
#define SYSCONFIG3   6 /* System Configuration 3 */
 
#define SYSCONFIG3_SMUTER   0xc000 /* bits 15..14: Softmute Attack/Recover Rate */
 
#define SYSCONFIG3_SMUTEA   0x3000 /* bits 13..12: Softmute Attenuation */
 
#define SYSCONFIG3_SKSNR   0x00f0 /* bits 07..04: Seek SNR Threshold */
 
#define SYSCONFIG3_SKCNT   0x000f /* bits 03..00: Seek FM Impulse Detection Threshold */
 
#define TEST1   7 /* Test 1 */
 
#define TEST1_AHIZEN   0x4000 /* bits 14..14: Audio High-Z Enable */
 
#define TEST2   8 /* Test 2 */
 
#define BOOTCONFIG   9 /* Boot Configuration */
 
#define STATUSRSSI   10 /* Status RSSI */
 
#define STATUSRSSI_RDSR   0x8000 /* bits 15..15: RDS Ready (Si4701 only) */
 
#define STATUSRSSI_STC   0x4000 /* bits 14..14: Seek/Tune Complete */
 
#define STATUSRSSI_SF   0x2000 /* bits 13..13: Seek Fail/Band Limit */
 
#define STATUSRSSI_AFCRL   0x1000 /* bits 12..12: AFC Rail */
 
#define STATUSRSSI_RDSS   0x0800 /* bits 11..11: RDS Synchronized (Si4701 only) */
 
#define STATUSRSSI_BLERA   0x0600 /* bits 10..09: RDS Block A Errors (Si4701 only) */
 
#define STATUSRSSI_ST   0x0100 /* bits 08..08: Stereo Indicator */
 
#define STATUSRSSI_RSSI   0x00ff /* bits 07..00: RSSI (Received Signal Strength Indicator) */
 
#define READCHAN   11 /* Read Channel */
 
#define READCHAN_BLERB   0xc000 /* bits 15..14: RDS Block D Errors (Si4701 only) */
 
#define READCHAN_BLERC   0x3000 /* bits 13..12: RDS Block C Errors (Si4701 only) */
 
#define READCHAN_BLERD   0x0c00 /* bits 11..10: RDS Block B Errors (Si4701 only) */
 
#define READCHAN_READCHAN   0x03ff /* bits 09..00: Read Channel */
 
#define RDSA   12 /* RDSA */
 
#define RDSA_RDSA   0xffff /* bits 15..00: RDS Block A Data (Si4701 only) */
 
#define RDSB   13 /* RDSB */
 
#define RDSB_RDSB   0xffff /* bits 15..00: RDS Block B Data (Si4701 only) */
 
#define RDSC   14 /* RDSC */
 
#define RDSC_RDSC   0xffff /* bits 15..00: RDS Block C Data (Si4701 only) */
 
#define RDSD   15 /* RDSD */
 
#define RDSD_RDSD   0xffff /* bits 15..00: RDS Block D Data (Si4701 only) */
 
#define RADIO_FW_VERSION   12
 
#define FREQ_MUL   (1000000 / 62.5)
 

Functions

int si470x_get_register (struct si470x_device *radio, int regnr)
 
int si470x_set_register (struct si470x_device *radio, int regnr)
 
int si470x_disconnect_check (struct si470x_device *radio)
 
int si470x_set_freq (struct si470x_device *radio, unsigned int freq)
 
int si470x_start (struct si470x_device *radio)
 
int si470x_stop (struct si470x_device *radio)
 
int si470x_fops_open (struct file *file)
 
int si470x_fops_release (struct file *file)
 
int si470x_vidioc_querycap (struct file *file, void *priv, struct v4l2_capability *capability)
 

Variables

struct video_device si470x_viddev_template
 
struct v4l2_ctrl_ops si470x_ctrl_ops
 

Macro Definition Documentation

#define BOOTCONFIG   9 /* Boot Configuration */

Definition at line 106 of file radio-si470x.h.

#define CHANNEL   3 /* Channel */

Definition at line 73 of file radio-si470x.h.

#define CHANNEL_CHAN   0x03ff /* bits 09..00: Channel Select */

Definition at line 75 of file radio-si470x.h.

#define CHANNEL_TUNE   0x8000 /* bits 15..15: Tune */

Definition at line 74 of file radio-si470x.h.

#define CHIPID   1 /* Chip ID */

Definition at line 57 of file radio-si470x.h.

#define CHIPID_DEV   0x0200 /* bits 09..09: Device */

Definition at line 59 of file radio-si470x.h.

#define CHIPID_FIRMWARE   0x01ff /* bits 08..00: Firmware Version */

Definition at line 60 of file radio-si470x.h.

#define CHIPID_REV   0xfc00 /* bits 15..10: Chip Version */

Definition at line 58 of file radio-si470x.h.

#define DEVICEID   0 /* Device ID */

Definition at line 53 of file radio-si470x.h.

#define DEVICEID_MFGID   0x0fff /* bits 11..00: Manufacturer ID */

Definition at line 55 of file radio-si470x.h.

#define DEVICEID_PN   0xf000 /* bits 15..12: Part Number */

Definition at line 54 of file radio-si470x.h.

#define DRIVER_NAME   "radio-si470x"

Definition at line 25 of file radio-si470x.h.

#define FREQ_MUL   (1000000 / 62.5)

Definition at line 208 of file radio-si470x.h.

#define POWERCFG   2 /* Power Configuration */

Definition at line 62 of file radio-si470x.h.

#define POWERCFG_DISABLE   0x0040 /* bits 06..06: Powerup Disable */

Definition at line 70 of file radio-si470x.h.

#define POWERCFG_DMUTE   0x4000 /* bits 14..14: Mute Disable */

Definition at line 64 of file radio-si470x.h.

#define POWERCFG_DSMUTE   0x8000 /* bits 15..15: Softmute Disable */

Definition at line 63 of file radio-si470x.h.

#define POWERCFG_ENABLE   0x0001 /* bits 00..00: Powerup Enable */

Definition at line 71 of file radio-si470x.h.

#define POWERCFG_MONO   0x2000 /* bits 13..13: Mono Select */

Definition at line 65 of file radio-si470x.h.

#define POWERCFG_RDSM   0x0800 /* bits 11..11: RDS Mode (Si4701 only) */

Definition at line 66 of file radio-si470x.h.

#define POWERCFG_SEEK   0x0100 /* bits 08..08: Seek */

Definition at line 69 of file radio-si470x.h.

#define POWERCFG_SEEKUP   0x0200 /* bits 09..09: Seek Direction */

Definition at line 68 of file radio-si470x.h.

#define POWERCFG_SKMODE   0x0400 /* bits 10..10: Seek Mode */

Definition at line 67 of file radio-si470x.h.

#define RADIO_FW_VERSION   12

Definition at line 193 of file radio-si470x.h.

#define RADIO_REGISTER_NUM   16 /* DEVICEID ... RDSD */

Definition at line 50 of file radio-si470x.h.

#define RADIO_REGISTER_SIZE   2 /* 16 register bit width */

Definition at line 49 of file radio-si470x.h.

#define RDS_REGISTER_NUM   6 /* STATUSRSSI ... RDSD */

Definition at line 51 of file radio-si470x.h.

#define RDSA   12 /* RDSA */

Definition at line 125 of file radio-si470x.h.

#define RDSA_RDSA   0xffff /* bits 15..00: RDS Block A Data (Si4701 only) */

Definition at line 126 of file radio-si470x.h.

#define RDSB   13 /* RDSB */

Definition at line 128 of file radio-si470x.h.

#define RDSB_RDSB   0xffff /* bits 15..00: RDS Block B Data (Si4701 only) */

Definition at line 129 of file radio-si470x.h.

#define RDSC   14 /* RDSC */

Definition at line 131 of file radio-si470x.h.

#define RDSC_RDSC   0xffff /* bits 15..00: RDS Block C Data (Si4701 only) */

Definition at line 132 of file radio-si470x.h.

#define RDSD   15 /* RDSD */

Definition at line 134 of file radio-si470x.h.

#define RDSD_RDSD   0xffff /* bits 15..00: RDS Block D Data (Si4701 only) */

Definition at line 135 of file radio-si470x.h.

#define READCHAN   11 /* Read Channel */

Definition at line 119 of file radio-si470x.h.

#define READCHAN_BLERB   0xc000 /* bits 15..14: RDS Block D Errors (Si4701 only) */

Definition at line 120 of file radio-si470x.h.

#define READCHAN_BLERC   0x3000 /* bits 13..12: RDS Block C Errors (Si4701 only) */

Definition at line 121 of file radio-si470x.h.

#define READCHAN_BLERD   0x0c00 /* bits 11..10: RDS Block B Errors (Si4701 only) */

Definition at line 122 of file radio-si470x.h.

#define READCHAN_READCHAN   0x03ff /* bits 09..00: Read Channel */

Definition at line 123 of file radio-si470x.h.

#define STATUSRSSI   10 /* Status RSSI */

Definition at line 109 of file radio-si470x.h.

#define STATUSRSSI_AFCRL   0x1000 /* bits 12..12: AFC Rail */

Definition at line 113 of file radio-si470x.h.

#define STATUSRSSI_BLERA   0x0600 /* bits 10..09: RDS Block A Errors (Si4701 only) */

Definition at line 115 of file radio-si470x.h.

#define STATUSRSSI_RDSR   0x8000 /* bits 15..15: RDS Ready (Si4701 only) */

Definition at line 110 of file radio-si470x.h.

#define STATUSRSSI_RDSS   0x0800 /* bits 11..11: RDS Synchronized (Si4701 only) */

Definition at line 114 of file radio-si470x.h.

#define STATUSRSSI_RSSI   0x00ff /* bits 07..00: RSSI (Received Signal Strength Indicator) */

Definition at line 117 of file radio-si470x.h.

#define STATUSRSSI_SF   0x2000 /* bits 13..13: Seek Fail/Band Limit */

Definition at line 112 of file radio-si470x.h.

#define STATUSRSSI_ST   0x0100 /* bits 08..08: Stereo Indicator */

Definition at line 116 of file radio-si470x.h.

#define STATUSRSSI_STC   0x4000 /* bits 14..14: Seek/Tune Complete */

Definition at line 111 of file radio-si470x.h.

#define SYSCONFIG1   4 /* System Configuration 1 */

Definition at line 77 of file radio-si470x.h.

#define SYSCONFIG1_AGCD   0x0400 /* bits 10..10: AGC Disable */

Definition at line 82 of file radio-si470x.h.

#define SYSCONFIG1_BLNDADJ   0x00c0 /* bits 07..06: Stereo/Mono Blend Level Adjustment */

Definition at line 83 of file radio-si470x.h.

#define SYSCONFIG1_DE   0x0800 /* bits 11..11: De-emphasis (0=75us 1=50us) */

Definition at line 81 of file radio-si470x.h.

#define SYSCONFIG1_GPIO1   0x0003 /* bits 01..00: General Purpose I/O 1 */

Definition at line 86 of file radio-si470x.h.

#define SYSCONFIG1_GPIO2   0x000c /* bits 03..02: General Purpose I/O 2 */

Definition at line 85 of file radio-si470x.h.

#define SYSCONFIG1_GPIO3   0x0030 /* bits 05..04: General Purpose I/O 3 */

Definition at line 84 of file radio-si470x.h.

#define SYSCONFIG1_RDS   0x1000 /* bits 12..12: RDS Enable (Si4701 only) */

Definition at line 80 of file radio-si470x.h.

#define SYSCONFIG1_RDSIEN   0x8000 /* bits 15..15: RDS Interrupt Enable (Si4701 only) */

Definition at line 78 of file radio-si470x.h.

#define SYSCONFIG1_STCIEN   0x4000 /* bits 14..14: Seek/Tune Complete Interrupt Enable */

Definition at line 79 of file radio-si470x.h.

#define SYSCONFIG2   5 /* System Configuration 2 */

Definition at line 88 of file radio-si470x.h.

#define SYSCONFIG2_BAND   0x00c0 /* bits 07..06: Band Select */

Definition at line 90 of file radio-si470x.h.

#define SYSCONFIG2_SEEKTH   0xff00 /* bits 15..08: RSSI Seek Threshold */

Definition at line 89 of file radio-si470x.h.

#define SYSCONFIG2_SPACE   0x0030 /* bits 05..04: Channel Spacing */

Definition at line 91 of file radio-si470x.h.

#define SYSCONFIG2_VOLUME   0x000f /* bits 03..00: Volume */

Definition at line 92 of file radio-si470x.h.

#define SYSCONFIG3   6 /* System Configuration 3 */

Definition at line 94 of file radio-si470x.h.

#define SYSCONFIG3_SKCNT   0x000f /* bits 03..00: Seek FM Impulse Detection Threshold */

Definition at line 98 of file radio-si470x.h.

#define SYSCONFIG3_SKSNR   0x00f0 /* bits 07..04: Seek SNR Threshold */

Definition at line 97 of file radio-si470x.h.

#define SYSCONFIG3_SMUTEA   0x3000 /* bits 13..12: Softmute Attenuation */

Definition at line 96 of file radio-si470x.h.

#define SYSCONFIG3_SMUTER   0xc000 /* bits 15..14: Softmute Attack/Recover Rate */

Definition at line 95 of file radio-si470x.h.

#define TEST1   7 /* Test 1 */

Definition at line 100 of file radio-si470x.h.

#define TEST1_AHIZEN   0x4000 /* bits 14..14: Audio High-Z Enable */

Definition at line 101 of file radio-si470x.h.

#define TEST2   8 /* Test 2 */

Definition at line 103 of file radio-si470x.h.

Function Documentation

int si470x_disconnect_check ( struct si470x_device radio)
int si470x_fops_open ( struct file file)

Definition at line 182 of file radio-si470x-i2c.c.

int si470x_fops_release ( struct file file)

Definition at line 214 of file radio-si470x-i2c.c.

int si470x_get_register ( struct si470x_device radio,
int  regnr 
)

Definition at line 97 of file radio-si470x-i2c.c.

int si470x_set_freq ( struct si470x_device radio,
unsigned int  freq 
)

Definition at line 282 of file radio-si470x-common.c.

int si470x_set_register ( struct si470x_device radio,
int  regnr 
)

Definition at line 121 of file radio-si470x-i2c.c.

int si470x_start ( struct si470x_device radio)

Definition at line 370 of file radio-si470x-common.c.

int si470x_stop ( struct si470x_device radio)

Definition at line 410 of file radio-si470x-common.c.

int si470x_vidioc_querycap ( struct file file,
void priv,
struct v4l2_capability capability 
)

Definition at line 234 of file radio-si470x-i2c.c.

Variable Documentation

struct v4l2_ctrl_ops si470x_ctrl_ops

Definition at line 731 of file radio-si470x-common.c.

struct video_device si470x_viddev_template

Definition at line 754 of file radio-si470x-common.c.