4 #include "../../include/linux/atomisp_platform.h"
5 #include <linux/types.h>
6 #include <linux/time.h>
8 #define DRV201_VCM_ADDR 0x0e
10 /* drv201 device structure */
11 struct 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 */
17 bool initialized; /* true if drv201 is detected */
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)
25 #define DRV201_CONTROL 2
26 #define DRV201_VCM_CURRENT 3
27 #define DRV201_STATUS 5
29 #define DRV201_VCM_FREQ 7
31 #define DEFAULT_CONTROL_VAL 2
32 #define DRV201_RESET 1
33 #define WAKEUP_DELAY_US 100
34 #define VCM_CODE_MASK 0x03ff