Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
as3645a.c File Reference
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <media/as3645a.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>

Go to the source code of this file.

Data Structures

struct  as3645a
 

Macros

#define AS_TIMER_MS_TO_CODE(t)   (((t) - 100) / 50)
 
#define AS_TIMER_CODE_TO_MS(c)   (50 * (c) + 100)
 
#define AS_DESIGN_INFO_REG   0x00
 
#define AS_DESIGN_INFO_FACTORY(x)   (((x) >> 4))
 
#define AS_DESIGN_INFO_MODEL(x)   ((x) & 0x0f)
 
#define AS_VERSION_CONTROL_REG   0x01
 
#define AS_VERSION_CONTROL_RFU(x)   (((x) >> 4))
 
#define AS_VERSION_CONTROL_VERSION(x)   ((x) & 0x0f)
 
#define AS_INDICATOR_AND_TIMER_REG   0x02
 
#define AS_INDICATOR_AND_TIMER_TIMEOUT_SHIFT   0
 
#define AS_INDICATOR_AND_TIMER_VREF_SHIFT   4
 
#define AS_INDICATOR_AND_TIMER_INDICATOR_SHIFT   6
 
#define AS_CURRENT_SET_REG   0x03
 
#define AS_CURRENT_ASSIST_LIGHT_SHIFT   0
 
#define AS_CURRENT_LED_DET_ON   (1 << 3)
 
#define AS_CURRENT_FLASH_CURRENT_SHIFT   4
 
#define AS_CONTROL_REG   0x04
 
#define AS_CONTROL_MODE_SETTING_SHIFT   0
 
#define AS_CONTROL_STROBE_ON   (1 << 2)
 
#define AS_CONTROL_OUT_ON   (1 << 3)
 
#define AS_CONTROL_EXT_TORCH_ON   (1 << 4)
 
#define AS_CONTROL_STROBE_TYPE_EDGE   (0 << 5)
 
#define AS_CONTROL_STROBE_TYPE_LEVEL   (1 << 5)
 
#define AS_CONTROL_COIL_PEAK_SHIFT   6
 
#define AS_FAULT_INFO_REG   0x05
 
#define AS_FAULT_INFO_INDUCTOR_PEAK_LIMIT   (1 << 1)
 
#define AS_FAULT_INFO_INDICATOR_LED   (1 << 2)
 
#define AS_FAULT_INFO_LED_AMOUNT   (1 << 3)
 
#define AS_FAULT_INFO_TIMEOUT   (1 << 4)
 
#define AS_FAULT_INFO_OVER_TEMPERATURE   (1 << 5)
 
#define AS_FAULT_INFO_SHORT_CIRCUIT   (1 << 6)
 
#define AS_FAULT_INFO_OVER_VOLTAGE   (1 << 7)
 
#define AS_BOOST_REG   0x0d
 
#define AS_BOOST_CURRENT_DISABLE   (0 << 0)
 
#define AS_BOOST_CURRENT_ENABLE   (1 << 0)
 
#define AS_PASSWORD_REG   0x0f
 
#define AS_PASSWORD_UNLOCK_VALUE   0x55
 
#define to_as3645a(sd)   container_of(sd, struct as3645a, subdev)
 
#define as3645a_suspend   NULL
 
#define as3645a_resume   NULL
 

Enumerations

enum  as_mode { AS_MODE_EXT_TORCH = 0 << AS_CONTROL_MODE_SETTING_SHIFT, AS_MODE_INDICATOR = 1 << AS_CONTROL_MODE_SETTING_SHIFT, AS_MODE_ASSIST = 2 << AS_CONTROL_MODE_SETTING_SHIFT, AS_MODE_FLASH = 3 << AS_CONTROL_MODE_SETTING_SHIFT }
 

Functions

 MODULE_DEVICE_TABLE (i2c, as3645a_id_table)
 
 module_i2c_driver (as3645a_i2c_driver)
 
 MODULE_AUTHOR ("Laurent Pinchart <[email protected]>")
 
 MODULE_DESCRIPTION ("LED flash driver for AS3645A, LM3555 and their clones")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define as3645a_resume   NULL

Definition at line 705 of file as3645a.c.

#define as3645a_suspend   NULL

Definition at line 704 of file as3645a.c.

#define AS_BOOST_CURRENT_DISABLE   (0 << 0)

Definition at line 89 of file as3645a.c.

#define AS_BOOST_CURRENT_ENABLE   (1 << 0)

Definition at line 90 of file as3645a.c.

#define AS_BOOST_REG   0x0d

Definition at line 88 of file as3645a.c.

#define AS_CONTROL_COIL_PEAK_SHIFT   6

Definition at line 75 of file as3645a.c.

#define AS_CONTROL_EXT_TORCH_ON   (1 << 4)

Definition at line 72 of file as3645a.c.

#define AS_CONTROL_MODE_SETTING_SHIFT   0

Definition at line 69 of file as3645a.c.

#define AS_CONTROL_OUT_ON   (1 << 3)

Definition at line 71 of file as3645a.c.

#define AS_CONTROL_REG   0x04

Definition at line 68 of file as3645a.c.

#define AS_CONTROL_STROBE_ON   (1 << 2)

Definition at line 70 of file as3645a.c.

#define AS_CONTROL_STROBE_TYPE_EDGE   (0 << 5)

Definition at line 73 of file as3645a.c.

#define AS_CONTROL_STROBE_TYPE_LEVEL   (1 << 5)

Definition at line 74 of file as3645a.c.

#define AS_CURRENT_ASSIST_LIGHT_SHIFT   0

Definition at line 63 of file as3645a.c.

#define AS_CURRENT_FLASH_CURRENT_SHIFT   4

Definition at line 65 of file as3645a.c.

#define AS_CURRENT_LED_DET_ON   (1 << 3)

Definition at line 64 of file as3645a.c.

#define AS_CURRENT_SET_REG   0x03

Definition at line 62 of file as3645a.c.

#define AS_DESIGN_INFO_FACTORY (   x)    (((x) >> 4))

Definition at line 45 of file as3645a.c.

#define AS_DESIGN_INFO_MODEL (   x)    ((x) & 0x0f)

Definition at line 46 of file as3645a.c.

#define AS_DESIGN_INFO_REG   0x00

Definition at line 44 of file as3645a.c.

#define AS_FAULT_INFO_INDICATOR_LED   (1 << 2)

Definition at line 80 of file as3645a.c.

#define AS_FAULT_INFO_INDUCTOR_PEAK_LIMIT   (1 << 1)

Definition at line 79 of file as3645a.c.

#define AS_FAULT_INFO_LED_AMOUNT   (1 << 3)

Definition at line 81 of file as3645a.c.

#define AS_FAULT_INFO_OVER_TEMPERATURE   (1 << 5)

Definition at line 83 of file as3645a.c.

#define AS_FAULT_INFO_OVER_VOLTAGE   (1 << 7)

Definition at line 85 of file as3645a.c.

#define AS_FAULT_INFO_REG   0x05

Definition at line 78 of file as3645a.c.

#define AS_FAULT_INFO_SHORT_CIRCUIT   (1 << 6)

Definition at line 84 of file as3645a.c.

#define AS_FAULT_INFO_TIMEOUT   (1 << 4)

Definition at line 82 of file as3645a.c.

#define AS_INDICATOR_AND_TIMER_INDICATOR_SHIFT   6

Definition at line 59 of file as3645a.c.

#define AS_INDICATOR_AND_TIMER_REG   0x02

Definition at line 56 of file as3645a.c.

#define AS_INDICATOR_AND_TIMER_TIMEOUT_SHIFT   0

Definition at line 57 of file as3645a.c.

#define AS_INDICATOR_AND_TIMER_VREF_SHIFT   4

Definition at line 58 of file as3645a.c.

#define AS_PASSWORD_REG   0x0f

Definition at line 93 of file as3645a.c.

#define AS_PASSWORD_UNLOCK_VALUE   0x55

Definition at line 94 of file as3645a.c.

#define AS_TIMER_CODE_TO_MS (   c)    (50 * (c) + 100)

Definition at line 39 of file as3645a.c.

#define AS_TIMER_MS_TO_CODE (   t)    (((t) - 100) / 50)

Definition at line 38 of file as3645a.c.

#define AS_VERSION_CONTROL_REG   0x01

Definition at line 51 of file as3645a.c.

#define AS_VERSION_CONTROL_RFU (   x)    (((x) >> 4))

Definition at line 52 of file as3645a.c.

#define AS_VERSION_CONTROL_VERSION (   x)    ((x) & 0x0f)

Definition at line 53 of file as3645a.c.

#define to_as3645a (   sd)    container_of(sd, struct as3645a, subdev)

Definition at line 136 of file as3645a.c.

Enumeration Type Documentation

enum as_mode
Enumerator:
AS_MODE_EXT_TORCH 
AS_MODE_INDICATOR 
AS_MODE_ASSIST 
AS_MODE_FLASH 

Definition at line 96 of file as3645a.c.

Function Documentation

MODULE_AUTHOR ( "Laurent Pinchart <[email protected]>"  )
MODULE_DESCRIPTION ( "LED flash driver for  AS3645A,
LM3555 and their clones"   
)
MODULE_DEVICE_TABLE ( i2c  ,
as3645a_id_table   
)
module_i2c_driver ( as3645a_i2c_driver  )
MODULE_LICENSE ( "GPL"  )