]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/staging/media/atomisp/i2c/imx/drv201.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / drivers / staging / media / atomisp / i2c / imx / drv201.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __DRV201_H__
3 #define __DRV201_H__
4
5 #include "../../include/linux/atomisp_platform.h"
6 #include <linux/types.h>
7 #include <linux/time.h>
8
9 #define DRV201_VCM_ADDR 0x0e
10
11 /* drv201 device structure */
12 struct drv201_device {
13 const struct camera_af_platform_data *platform_data;
14 struct timespec timestamp_t_focus_abs;
15 struct timespec focus_time; /* Time when focus was last time set */
16 s32 focus; /* Current focus value */
17 s16 number_of_steps;
18 bool initialized; /* true if drv201 is detected */
19 };
20
21 #define DRV201_INVALID_CONFIG 0xffffffff
22 #define DRV201_MAX_FOCUS_POS 1023
23 #define DELAY_PER_STEP_NS 1000000
24 #define DELAY_MAX_PER_STEP_NS (1000000 * 1023)
25
26 #define DRV201_CONTROL 2
27 #define DRV201_VCM_CURRENT 3
28 #define DRV201_STATUS 5
29 #define DRV201_MODE 6
30 #define DRV201_VCM_FREQ 7
31
32 #define DEFAULT_CONTROL_VAL 2
33 #define DRV201_RESET 1
34 #define WAKEUP_DELAY_US 100
35 #define VCM_CODE_MASK 0x03ff
36
37 #endif
38
39