Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
cafe-driver.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <linux/device.h>
#include <linux/wait.h>
#include <linux/delay.h>
#include <linux/io.h>
#include "mcam-core.h"

Go to the source code of this file.

Data Structures

struct  cafe_camera
 

Macros

#define CAFE_VERSION   0x000002
 
#define REG_GPR   0xb4
 
#define GPR_C1EN   0x00000020 /* Pad 1 (power down) enable */
 
#define GPR_C0EN   0x00000010 /* Pad 0 (reset) enable */
 
#define GPR_C1   0x00000002 /* Control 1 value */
 
#define GPR_C0   0x00000001 /* Control 0 value */
 
#define REG_TWSIC0   0xb8 /* TWSI (smbus) control 0 */
 
#define TWSIC0_EN   0x00000001 /* TWSI enable */
 
#define TWSIC0_MODE   0x00000002 /* 1 = 16-bit, 0 = 8-bit */
 
#define TWSIC0_SID   0x000003fc /* Slave ID */
 
#define TWSIC0_SID_SHIFT   3
 
#define TWSIC0_CLKDIV   0x0007fc00 /* Clock divider */
 
#define TWSIC0_MASKACK   0x00400000 /* Mask ack from sensor */
 
#define TWSIC0_OVMAGIC   0x00800000 /* Make it work on OV sensors */
 
#define REG_TWSIC1   0xbc /* TWSI control 1 */
 
#define TWSIC1_DATA   0x0000ffff /* Data to/from camchip */
 
#define TWSIC1_ADDR   0x00ff0000 /* Address (register) */
 
#define TWSIC1_ADDR_SHIFT   16
 
#define TWSIC1_READ   0x01000000 /* Set for read op */
 
#define TWSIC1_WSTAT   0x02000000 /* Write status */
 
#define TWSIC1_RVALID   0x04000000 /* Read data valid */
 
#define TWSIC1_ERROR   0x08000000 /* Something screwed up */
 
#define REG_GL_CSR   0x3004 /* Control/status register */
 
#define GCSR_SRS   0x00000001 /* SW Reset set */
 
#define GCSR_SRC   0x00000002 /* SW Reset clear */
 
#define GCSR_MRS   0x00000004 /* Master reset set */
 
#define GCSR_MRC   0x00000008 /* HW Reset clear */
 
#define GCSR_CCIC_EN   0x00004000 /* CCIC Clock enable */
 
#define REG_GL_IMASK   0x300c /* Interrupt mask register */
 
#define GIMSK_CCIC_EN   0x00000004 /* CCIC Interrupt enable */
 
#define REG_GL_FCR   0x3038 /* GPIO functional control register */
 
#define GFCR_GPIO_ON   0x08 /* Camera GPIO enabled */
 
#define REG_GL_GPIOR   0x315c /* GPIO register */
 
#define GGPIO_OUT   0x80000 /* GPIO output */
 
#define GGPIO_VAL   0x00008 /* Output pin value */
 
#define REG_LEN   (REG_GL_IMASK + 4)
 
#define cam_err(cam, fmt, arg...)   dev_err(&(cam)->pdev->dev, fmt, ##arg);
 
#define cam_warn(cam, fmt, arg...)   dev_warn(&(cam)->pdev->dev, fmt, ##arg);
 
#define CAFE_SMBUS_TIMEOUT   (HZ) /* generous */
 

Functions

 MODULE_AUTHOR ("Jonathan Corbet <[email protected]>")
 
 MODULE_DESCRIPTION ("Marvell 88ALP01 CMOS Camera Controller driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_SUPPORTED_DEVICE ("Video")
 
 MODULE_DEVICE_TABLE (pci, cafe_ids)
 
 module_init (cafe_init)
 
 module_exit (cafe_exit)
 

Macro Definition Documentation

#define CAFE_SMBUS_TIMEOUT   (HZ) /* generous */

Definition at line 143 of file cafe-driver.c.

#define CAFE_VERSION   0x000002

Definition at line 38 of file cafe-driver.c.

#define cam_err (   cam,
  fmt,
  arg... 
)    dev_err(&(cam)->pdev->dev, fmt, ##arg);

Definition at line 132 of file cafe-driver.c.

#define cam_warn (   cam,
  fmt,
  arg... 
)    dev_warn(&(cam)->pdev->dev, fmt, ##arg);

Definition at line 134 of file cafe-driver.c.

#define GCSR_CCIC_EN   0x00004000 /* CCIC Clock enable */

Definition at line 116 of file cafe-driver.c.

#define GCSR_MRC   0x00000008 /* HW Reset clear */

Definition at line 115 of file cafe-driver.c.

#define GCSR_MRS   0x00000004 /* Master reset set */

Definition at line 114 of file cafe-driver.c.

#define GCSR_SRC   0x00000002 /* SW Reset clear */

Definition at line 113 of file cafe-driver.c.

#define GCSR_SRS   0x00000001 /* SW Reset set */

Definition at line 112 of file cafe-driver.c.

#define GFCR_GPIO_ON   0x08 /* Camera GPIO enabled */

Definition at line 121 of file cafe-driver.c.

#define GGPIO_OUT   0x80000 /* GPIO output */

Definition at line 123 of file cafe-driver.c.

#define GGPIO_VAL   0x00008 /* Output pin value */

Definition at line 124 of file cafe-driver.c.

#define GIMSK_CCIC_EN   0x00000004 /* CCIC Interrupt enable */

Definition at line 118 of file cafe-driver.c.

#define GPR_C0   0x00000001 /* Control 0 value */

Definition at line 77 of file cafe-driver.c.

#define GPR_C0EN   0x00000010 /* Pad 0 (reset) enable */

Definition at line 71 of file cafe-driver.c.

#define GPR_C1   0x00000002 /* Control 1 value */

Definition at line 72 of file cafe-driver.c.

#define GPR_C1EN   0x00000020 /* Pad 1 (power down) enable */

Definition at line 70 of file cafe-driver.c.

#define REG_GL_CSR   0x3004 /* Control/status register */

Definition at line 111 of file cafe-driver.c.

#define REG_GL_FCR   0x3038 /* GPIO functional control register */

Definition at line 120 of file cafe-driver.c.

#define REG_GL_GPIOR   0x315c /* GPIO register */

Definition at line 122 of file cafe-driver.c.

#define REG_GL_IMASK   0x300c /* Interrupt mask register */

Definition at line 117 of file cafe-driver.c.

#define REG_GPR   0xb4

Definition at line 69 of file cafe-driver.c.

#define REG_LEN   (REG_GL_IMASK + 4)

Definition at line 126 of file cafe-driver.c.

#define REG_TWSIC0   0xb8 /* TWSI (smbus) control 0 */

Definition at line 83 of file cafe-driver.c.

#define REG_TWSIC1   0xbc /* TWSI control 1 */

Definition at line 99 of file cafe-driver.c.

#define TWSIC0_CLKDIV   0x0007fc00 /* Clock divider */

Definition at line 95 of file cafe-driver.c.

#define TWSIC0_EN   0x00000001 /* TWSI enable */

Definition at line 84 of file cafe-driver.c.

#define TWSIC0_MASKACK   0x00400000 /* Mask ack from sensor */

Definition at line 96 of file cafe-driver.c.

#define TWSIC0_MODE   0x00000002 /* 1 = 16-bit, 0 = 8-bit */

Definition at line 85 of file cafe-driver.c.

#define TWSIC0_OVMAGIC   0x00800000 /* Make it work on OV sensors */

Definition at line 97 of file cafe-driver.c.

#define TWSIC0_SID   0x000003fc /* Slave ID */

Definition at line 86 of file cafe-driver.c.

#define TWSIC0_SID_SHIFT   3

Definition at line 94 of file cafe-driver.c.

#define TWSIC1_ADDR   0x00ff0000 /* Address (register) */

Definition at line 101 of file cafe-driver.c.

#define TWSIC1_ADDR_SHIFT   16

Definition at line 102 of file cafe-driver.c.

#define TWSIC1_DATA   0x0000ffff /* Data to/from camchip */

Definition at line 100 of file cafe-driver.c.

#define TWSIC1_ERROR   0x08000000 /* Something screwed up */

Definition at line 106 of file cafe-driver.c.

#define TWSIC1_READ   0x01000000 /* Set for read op */

Definition at line 103 of file cafe-driver.c.

#define TWSIC1_RVALID   0x04000000 /* Read data valid */

Definition at line 105 of file cafe-driver.c.

#define TWSIC1_WSTAT   0x02000000 /* Write status */

Definition at line 104 of file cafe-driver.c.

Function Documentation

MODULE_AUTHOR ( "Jonathan Corbet <[email protected]>"  )
MODULE_DESCRIPTION ( "Marvell 88ALP01 CMOS Camera Controller driver"  )
MODULE_DEVICE_TABLE ( pci  ,
cafe_ids   
)
module_exit ( cafe_exit  )
module_init ( cafe_init  )
MODULE_LICENSE ( "GPL"  )
MODULE_SUPPORTED_DEVICE ( "Video"  )