Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
sn9c102_sensor.h File Reference
#include <linux/usb.h>
#include <linux/videodev2.h>
#include <linux/device.h>
#include <linux/stddef.h>
#include <linux/errno.h>
#include <asm/types.h>

Go to the source code of this file.

Data Structures

struct  sn9c102_sensor
 

Macros

#define sn9c102_write_const_regs(sn9c102_device, data...)
 
#define SN9C102_MAX_CTRLS   (V4L2_CID_LASTP1-V4L2_CID_BASE+10)
 
#define SN9C102_V4L2_CID_DAC_MAGNITUDE   (V4L2_CID_PRIVATE_BASE + 0)
 
#define SN9C102_V4L2_CID_GREEN_BALANCE   (V4L2_CID_PRIVATE_BASE + 1)
 
#define SN9C102_V4L2_CID_RESET_LEVEL   (V4L2_CID_PRIVATE_BASE + 2)
 
#define SN9C102_V4L2_CID_PIXEL_BIAS_VOLTAGE   (V4L2_CID_PRIVATE_BASE + 3)
 
#define SN9C102_V4L2_CID_GAMMA   (V4L2_CID_PRIVATE_BASE + 4)
 
#define SN9C102_V4L2_CID_BAND_FILTER   (V4L2_CID_PRIVATE_BASE + 5)
 
#define SN9C102_V4L2_CID_BRIGHT_LEVEL   (V4L2_CID_PRIVATE_BASE + 6)
 

Enumerations

enum  sn9c102_bridge {
  BRIDGE_SN9C101 = 0x01, BRIDGE_SN9C102 = 0x02, BRIDGE_SN9C103 = 0x04, BRIDGE_SN9C105 = 0x08,
  BRIDGE_SN9C120 = 0x10
}
 
enum  sn9c102_i2c_sysfs_ops { SN9C102_I2C_READ = 0x01, SN9C102_I2C_WRITE = 0x02 }
 
enum  sn9c102_i2c_frequency { SN9C102_I2C_100KHZ = 0x01, SN9C102_I2C_400KHZ = 0x02 }
 
enum  sn9c102_i2c_interface { SN9C102_I2C_2WIRES, SN9C102_I2C_3WIRES }
 

Functions

enum sn9c102_bridge sn9c102_get_bridge (struct sn9c102_device *cam)
 
struct sn9c102_sensorsn9c102_get_sensor (struct sn9c102_device *cam)
 
struct sn9c102_devicesn9c102_match_id (struct sn9c102_device *cam, const struct usb_device_id *id)
 
void sn9c102_attach_sensor (struct sn9c102_device *cam, const struct sn9c102_sensor *sensor)
 
int sn9c102_i2c_try_read (struct sn9c102_device *, const struct sn9c102_sensor *, u8 address)
 
int sn9c102_i2c_try_raw_write (struct sn9c102_device *cam, const struct sn9c102_sensor *sensor, u8 n, u8 data0, u8 data1, u8 data2, u8 data3, u8 data4, u8 data5)
 
int sn9c102_i2c_try_raw_read (struct sn9c102_device *cam, const struct sn9c102_sensor *sensor, u8 data0, u8 data1, u8 n, u8 buffer[])
 
int sn9c102_i2c_write (struct sn9c102_device *, u8 address, u8 value)
 
int sn9c102_i2c_read (struct sn9c102_device *, u8 address)
 
int sn9c102_read_reg (struct sn9c102_device *, u16 index)
 
int sn9c102_pread_reg (struct sn9c102_device *, u16 index)
 
int sn9c102_write_reg (struct sn9c102_device *, u8 value, u16 index)
 
int sn9c102_write_regs (struct sn9c102_device *, const u8 valreg[][2], int count)
 

Macro Definition Documentation

#define SN9C102_MAX_CTRLS   (V4L2_CID_LASTP1-V4L2_CID_BASE+10)

Definition at line 146 of file sn9c102_sensor.h.

#define SN9C102_V4L2_CID_BAND_FILTER   (V4L2_CID_PRIVATE_BASE + 5)

Definition at line 304 of file sn9c102_sensor.h.

#define SN9C102_V4L2_CID_BRIGHT_LEVEL   (V4L2_CID_PRIVATE_BASE + 6)

Definition at line 305 of file sn9c102_sensor.h.

#define SN9C102_V4L2_CID_DAC_MAGNITUDE   (V4L2_CID_PRIVATE_BASE + 0)

Definition at line 299 of file sn9c102_sensor.h.

#define SN9C102_V4L2_CID_GAMMA   (V4L2_CID_PRIVATE_BASE + 4)

Definition at line 303 of file sn9c102_sensor.h.

#define SN9C102_V4L2_CID_GREEN_BALANCE   (V4L2_CID_PRIVATE_BASE + 1)

Definition at line 300 of file sn9c102_sensor.h.

#define SN9C102_V4L2_CID_PIXEL_BIAS_VOLTAGE   (V4L2_CID_PRIVATE_BASE + 3)

Definition at line 302 of file sn9c102_sensor.h.

#define SN9C102_V4L2_CID_RESET_LEVEL   (V4L2_CID_PRIVATE_BASE + 2)

Definition at line 301 of file sn9c102_sensor.h.

#define sn9c102_write_const_regs (   sn9c102_device,
  data... 
)
Value:
({ static const u8 _valreg[][2] = {data}; \
sn9c102_write_regs(sn9c102_device, _valreg, ARRAY_SIZE(_valreg)); })

Definition at line 125 of file sn9c102_sensor.h.

Enumeration Type Documentation

Enumerator:
BRIDGE_SN9C101 
BRIDGE_SN9C102 
BRIDGE_SN9C103 
BRIDGE_SN9C105 
BRIDGE_SN9C120 

Definition at line 56 of file sn9c102_sensor.h.

Enumerator:
SN9C102_I2C_100KHZ 
SN9C102_I2C_400KHZ 

Definition at line 136 of file sn9c102_sensor.h.

Enumerator:
SN9C102_I2C_2WIRES 
SN9C102_I2C_3WIRES 

Definition at line 141 of file sn9c102_sensor.h.

Enumerator:
SN9C102_I2C_READ 
SN9C102_I2C_WRITE 

Definition at line 131 of file sn9c102_sensor.h.

Function Documentation

void sn9c102_attach_sensor ( struct sn9c102_device cam,
const struct sn9c102_sensor sensor 
)

Definition at line 146 of file sn9c102.h.

enum sn9c102_bridge sn9c102_get_bridge ( struct sn9c102_device cam)

Definition at line 154 of file sn9c102.h.

struct sn9c102_sensor* sn9c102_get_sensor ( struct sn9c102_device cam)
read

Definition at line 160 of file sn9c102.h.

int sn9c102_i2c_read ( struct sn9c102_device ,
u8  address 
)

Definition at line 497 of file sn9c102_core.c.

int sn9c102_i2c_try_raw_read ( struct sn9c102_device cam,
const struct sn9c102_sensor sensor,
u8  data0,
u8  data1,
u8  n,
u8  buffer[] 
)

Definition at line 381 of file sn9c102_core.c.

int sn9c102_i2c_try_raw_write ( struct sn9c102_device cam,
const struct sn9c102_sensor sensor,
u8  n,
u8  data0,
u8  data1,
u8  data2,
u8  data3,
u8  data4,
u8  data5 
)

Definition at line 440 of file sn9c102_core.c.

int sn9c102_i2c_try_read ( struct sn9c102_device ,
const struct sn9c102_sensor ,
u8  address 
)

Definition at line 479 of file sn9c102_core.c.

int sn9c102_i2c_write ( struct sn9c102_device ,
u8  address,
u8  value 
)

Definition at line 503 of file sn9c102_core.c.

struct sn9c102_device* sn9c102_match_id ( struct sn9c102_device cam,
const struct usb_device_id id 
)
read

Definition at line 139 of file sn9c102.h.

int sn9c102_pread_reg ( struct sn9c102_device ,
u16  index 
)

Definition at line 318 of file sn9c102_core.c.

int sn9c102_read_reg ( struct sn9c102_device ,
u16  index 
)

Definition at line 302 of file sn9c102_core.c.

int sn9c102_write_reg ( struct sn9c102_device ,
u8  value,
u16  index 
)

Definition at line 276 of file sn9c102_core.c.

int sn9c102_write_regs ( struct sn9c102_device ,
const u8  valreg[][2],
int  count 
)

Definition at line 240 of file sn9c102_core.c.