]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/staging/media/atomisp/i2c/imx/ad5816g.h
media: staging: atomisp: Convert timers to use timer_setup()
[mirror_ubuntu-bionic-kernel.git] / drivers / staging / media / atomisp / i2c / imx / ad5816g.h
1 #ifndef __AD5816G_H__
2 #define __AD5816G_H__
3
4 #include "../../include/linux/atomisp_platform.h"
5 #include <linux/types.h>
6 #include <linux/time.h>
7
8 #define AD5816G_VCM_ADDR 0x0e
9
10 /* ad5816g device structure */
11 struct ad5816g_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 };
18
19 #define AD5816G_INVALID_CONFIG 0xffffffff
20 #define AD5816G_MAX_FOCUS_POS 1023
21 #define DELAY_PER_STEP_NS 1000000
22 #define DELAY_MAX_PER_STEP_NS (1000000 * 1023)
23
24 /* Register Definitions */
25 #define AD5816G_IC_INFO 0x00
26 #define AD5816G_IC_VERSION 0x01
27 #define AD5816G_CONTROL 0x02
28 #define AD5816G_VCM_CODE_MSB 0x03
29 #define AD5816G_VCM_CODE_LSB 0x04
30 #define AD5816G_STATUS 0x05
31 #define AD5816G_MODE 0x06
32 #define AD5816G_VCM_FREQ 0x07
33 #define AD5816G_VCM_THRESHOLD 0x08
34
35 /* ARC MODE ENABLE */
36 #define AD5816G_ARC_EN 0x02
37 /* ARC RES2 MODE */
38 #define AD5816G_ARC_RES2 0x01
39 /* ARC VCM FREQ - 78.1Hz */
40 #define AD5816G_DEF_FREQ 0x7a
41 /* ARC VCM THRESHOLD - 0x08 << 1 */
42 #define AD5816G_DEF_THRESHOLD 0x64
43 #define AD5816G_ID 0x24
44 #define VCM_CODE_MASK 0x03ff
45
46 #define AD5816G_MODE_2_5M_SWITCH_CLOCK 0x14
47
48 #endif
49