Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
si4713-i2c.c File Reference
#include <linux/mutex.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/regulator/consumer.h>
#include <linux/module.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-common.h>
#include "si4713-i2c.h"

Go to the source code of this file.

Macros

#define DEFAULT_RDS_PI   0x00
 
#define DEFAULT_RDS_PTY   0x00
 
#define DEFAULT_RDS_PS_NAME   ""
 
#define DEFAULT_RDS_RADIO_TEXT   DEFAULT_RDS_PS_NAME
 
#define DEFAULT_RDS_DEVIATION   0x00C8
 
#define DEFAULT_RDS_PS_REPEAT_COUNT   0x0003
 
#define DEFAULT_LIMITER_RTIME   0x1392
 
#define DEFAULT_LIMITER_DEV   0x102CA
 
#define DEFAULT_PILOT_FREQUENCY   0x4A38
 
#define DEFAULT_PILOT_DEVIATION   0x1A5E
 
#define DEFAULT_ACOMP_ATIME   0x0000
 
#define DEFAULT_ACOMP_RTIME   0xF4240L
 
#define DEFAULT_ACOMP_GAIN   0x0F
 
#define DEFAULT_ACOMP_THRESHOLD   (-0x28)
 
#define DEFAULT_MUTE   0x01
 
#define DEFAULT_POWER_LEVEL   88
 
#define DEFAULT_FREQUENCY   8800
 
#define DEFAULT_PREEMPHASIS   FMPE_EU
 
#define DEFAULT_TUNE_RNL   0xFF
 
#define to_si4713_device(sd)   container_of(sd, struct si4713_device, sd)
 
#define FREQDEV_UNIT   100000
 
#define FREQV4L2_MULTI   625
 
#define si4713_to_v4l2(f)   ((f * FREQDEV_UNIT) / FREQV4L2_MULTI)
 
#define v4l2_to_si4713(f)   ((f * FREQV4L2_MULTI) / FREQDEV_UNIT)
 
#define FREQ_RANGE_LOW   7600
 
#define FREQ_RANGE_HIGH   10800
 
#define MAX_ARGS   7
 
#define RDS_BLOCK   8
 
#define RDS_BLOCK_CLEAR   0x03
 
#define RDS_BLOCK_LOAD   0x04
 
#define RDS_RADIOTEXT_2A   0x20
 
#define RDS_RADIOTEXT_BLK_SIZE   4
 
#define RDS_RADIOTEXT_INDEX_MAX   0x0F
 
#define RDS_CARRIAGE_RETURN   0x0D
 
#define rds_ps_nblocks(len)   ((len / RDS_BLOCK) + (len % RDS_BLOCK ? 1 : 0))
 
#define get_status_bit(p, b, m)   (((p) & (m)) >> (b))
 
#define set_bits(p, v, b, m)   (((p) & ~(m)) | ((v) << (b)))
 
#define ATTACK_TIME_UNIT   500
 
#define POWER_OFF   0x00
 
#define POWER_ON   0x01
 
#define msb(x)   ((u8)((u16) x >> 8))
 
#define lsb(x)   ((u8)((u16) x & 0x00FF))
 
#define compose_u16(msb, lsb)   (((u16)msb << 8) | lsb)
 
#define check_command_failed(status)
 
#define set_mute(p)   ((p & 1) | ((p & 1) << 1));
 
#define get_mute(p)   (p & 0x01)
 
#define DBG_BUFFER(device, message, buffer, size)
 

Functions

 module_param (debug, int, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (debug,"Debug level (0 - 2)")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Eduardo Valentin <[email protected]>")
 
 MODULE_DESCRIPTION ("I2C driver for Si4713 FM Radio Transmitter")
 
 MODULE_VERSION ("0.0.1")
 
long si4713_ioctl (struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 
 MODULE_DEVICE_TABLE (i2c, si4713_id)
 
 module_i2c_driver (si4713_i2c_driver)
 

Macro Definition Documentation

#define ATTACK_TIME_UNIT   500

Definition at line 99 of file si4713-i2c.c.

#define check_command_failed (   status)
Value:

Definition at line 107 of file si4713-i2c.c.

#define compose_u16 (   msb,
  lsb 
)    (((u16)msb << 8) | lsb)

Definition at line 106 of file si4713-i2c.c.

#define DBG_BUFFER (   device,
  message,
  buffer,
  size 
)

Definition at line 123 of file si4713-i2c.c.

#define DEFAULT_ACOMP_ATIME   0x0000

Definition at line 64 of file si4713-i2c.c.

#define DEFAULT_ACOMP_GAIN   0x0F

Definition at line 66 of file si4713-i2c.c.

#define DEFAULT_ACOMP_RTIME   0xF4240L

Definition at line 65 of file si4713-i2c.c.

#define DEFAULT_ACOMP_THRESHOLD   (-0x28)

Definition at line 67 of file si4713-i2c.c.

#define DEFAULT_FREQUENCY   8800

Definition at line 70 of file si4713-i2c.c.

#define DEFAULT_LIMITER_DEV   0x102CA

Definition at line 61 of file si4713-i2c.c.

#define DEFAULT_LIMITER_RTIME   0x1392

Definition at line 60 of file si4713-i2c.c.

#define DEFAULT_MUTE   0x01

Definition at line 68 of file si4713-i2c.c.

#define DEFAULT_PILOT_DEVIATION   0x1A5E

Definition at line 63 of file si4713-i2c.c.

#define DEFAULT_PILOT_FREQUENCY   0x4A38

Definition at line 62 of file si4713-i2c.c.

#define DEFAULT_POWER_LEVEL   88

Definition at line 69 of file si4713-i2c.c.

#define DEFAULT_PREEMPHASIS   FMPE_EU

Definition at line 71 of file si4713-i2c.c.

#define DEFAULT_RDS_DEVIATION   0x00C8

Definition at line 58 of file si4713-i2c.c.

#define DEFAULT_RDS_PI   0x00

Definition at line 54 of file si4713-i2c.c.

#define DEFAULT_RDS_PS_NAME   ""

Definition at line 56 of file si4713-i2c.c.

#define DEFAULT_RDS_PS_REPEAT_COUNT   0x0003

Definition at line 59 of file si4713-i2c.c.

#define DEFAULT_RDS_PTY   0x00

Definition at line 55 of file si4713-i2c.c.

#define DEFAULT_RDS_RADIO_TEXT   DEFAULT_RDS_PS_NAME

Definition at line 57 of file si4713-i2c.c.

#define DEFAULT_TUNE_RNL   0xFF

Definition at line 72 of file si4713-i2c.c.

#define FREQ_RANGE_HIGH   10800

Definition at line 82 of file si4713-i2c.c.

#define FREQ_RANGE_LOW   7600

Definition at line 81 of file si4713-i2c.c.

#define FREQDEV_UNIT   100000

Definition at line 77 of file si4713-i2c.c.

#define FREQV4L2_MULTI   625

Definition at line 78 of file si4713-i2c.c.

#define get_mute (   p)    (p & 0x01)

Definition at line 111 of file si4713-i2c.c.

#define get_status_bit (   p,
  b,
  m 
)    (((p) & (m)) >> (b))

Definition at line 96 of file si4713-i2c.c.

#define lsb (   x)    ((u8)((u16) x & 0x00FF))

Definition at line 105 of file si4713-i2c.c.

#define MAX_ARGS   7

Definition at line 84 of file si4713-i2c.c.

#define msb (   x)    ((u8)((u16) x >> 8))

Definition at line 104 of file si4713-i2c.c.

#define POWER_OFF   0x00

Definition at line 101 of file si4713-i2c.c.

#define POWER_ON   0x01

Definition at line 102 of file si4713-i2c.c.

#define RDS_BLOCK   8

Definition at line 86 of file si4713-i2c.c.

#define RDS_BLOCK_CLEAR   0x03

Definition at line 87 of file si4713-i2c.c.

#define RDS_BLOCK_LOAD   0x04

Definition at line 88 of file si4713-i2c.c.

#define RDS_CARRIAGE_RETURN   0x0D

Definition at line 92 of file si4713-i2c.c.

#define rds_ps_nblocks (   len)    ((len / RDS_BLOCK) + (len % RDS_BLOCK ? 1 : 0))

Definition at line 94 of file si4713-i2c.c.

#define RDS_RADIOTEXT_2A   0x20

Definition at line 89 of file si4713-i2c.c.

#define RDS_RADIOTEXT_BLK_SIZE   4

Definition at line 90 of file si4713-i2c.c.

#define RDS_RADIOTEXT_INDEX_MAX   0x0F

Definition at line 91 of file si4713-i2c.c.

#define set_bits (   p,
  v,
  b,
  m 
)    (((p) & ~(m)) | ((v) << (b)))

Definition at line 97 of file si4713-i2c.c.

#define set_mute (   p)    ((p & 1) | ((p & 1) << 1));

Definition at line 110 of file si4713-i2c.c.

#define si4713_to_v4l2 (   f)    ((f * FREQDEV_UNIT) / FREQV4L2_MULTI)

Definition at line 79 of file si4713-i2c.c.

#define to_si4713_device (   sd)    container_of(sd, struct si4713_device, sd)

Definition at line 74 of file si4713-i2c.c.

#define v4l2_to_si4713 (   f)    ((f * FREQV4L2_MULTI) / FREQDEV_UNIT)

Definition at line 80 of file si4713-i2c.c.

Function Documentation

MODULE_AUTHOR ( "Eduardo Valentin <[email protected]>"  )
MODULE_DESCRIPTION ( "I2C driver for Si4713 FM Radio Transmitter"  )
MODULE_DEVICE_TABLE ( i2c  ,
si4713_id   
)
module_i2c_driver ( si4713_i2c_driver  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( debug  ,
"Debug level (0 - 2)"   
)
MODULE_VERSION ( "0.0.1"  )
long si4713_ioctl ( struct v4l2_subdev sd,
unsigned int  cmd,
void arg 
)

Definition at line 1772 of file si4713-i2c.c.