1#ifndef __DRV201_H__ 2#define __DRV201_H__ 3 4#include "../../include/linux/atomisp_platform.h" 5#include <linux/types.h> 6#include <linux/time.h> 7 8#define DRV201_VCM_ADDR 0x0e 9 10/* drv201 device structure */ 11struct drv201_device { 12 const struct camera_af_platform_data *platform_data; 13 struct timespec timestamp_t_focus_abs; 14 struct timespec focus_time; /* Time when focus was last time set */ 15 s32 focus; /* Current focus value */ 16 s16 number_of_steps; 17 bool initialized; /* true if drv201 is detected */ 18}; 19 20#define DRV201_INVALID_CONFIG 0xffffffff 21#define DRV201_MAX_FOCUS_POS 1023 22#define DELAY_PER_STEP_NS 1000000 23#define DELAY_MAX_PER_STEP_NS (1000000 * 1023) 24 25#define DRV201_CONTROL 2 26#define DRV201_VCM_CURRENT 3 27#define DRV201_STATUS 5 28#define DRV201_MODE 6 29#define DRV201_VCM_FREQ 7 30 31#define DEFAULT_CONTROL_VAL 2 32#define DRV201_RESET 1 33#define WAKEUP_DELAY_US 100 34#define VCM_CODE_MASK 0x03ff 35 36#endif 37 38 39