Skip to content

Commit a68af5c

Browse files
Hu KejunZhengShunQian
authored andcommitted
media: i2c: add vm149c driver
Change-Id: Ifcb8027907be60807794e659316ad5211f51ff6d Signed-off-by: Hu Kejun <william.hu@rock-chips.com>
1 parent 2dd3f06 commit a68af5c

4 files changed

Lines changed: 595 additions & 0 deletions

File tree

drivers/media/i2c/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,15 @@ config VIDEO_UPD64083
819819
To compile this driver as a module, choose M here: the
820820
module will be called upd64083.
821821

822+
comment "Camera lens devices"
823+
824+
config VIDEO_VM149C
825+
tristate "VM149C lens voice coil support"
826+
depends on I2C && VIDEO_V4L2 && MEDIA_CONTROLLER
827+
depends on VIDEO_V4L2_SUBDEV_API
828+
---help---
829+
This is a driver for the VM149C camera lens voice coil.
830+
822831
comment "Audio/Video compression chips"
823832

824833
config VIDEO_SAA6752HS

drivers/media/i2c/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,5 @@ obj-$(CONFIG_VIDEO_GC0312) += gc0312.o
9292
obj-$(CONFIG_VIDEO_GC2145) += gc2145.o
9393
obj-$(CONFIG_VIDEO_GC0329) += gc0329.o
9494
obj-$(CONFIG_VIDEO_GC2035) += gc2035.o
95+
96+
obj-$(CONFIG_VIDEO_VM149C) += vm149c.o

drivers/media/i2c/rk_vcm_head.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/* Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd. */
3+
4+
#ifndef RK_VCM_HEAD_H
5+
#define RK_VCM_HEAD_H
6+
7+
/*
8+
* Focus position values:
9+
* 65 logical positions ( 0 - 64 )
10+
* where 64 is the setting for infinity and 0 for macro
11+
*/
12+
#define VCMDRV_MAX_LOG 64U
13+
14+
#define OF_CAMERA_VCMDRV_START_CURRENT "rockchip,vcm-start-current"
15+
#define OF_CAMERA_VCMDRV_RATED_CURRENT "rockchip,vcm-rated-current"
16+
#define OF_CAMERA_VCMDRV_STEP_MODE "rockchip,vcm-step-mode"
17+
18+
#define RK_VIDIOC_VCM_TIMEINFO \
19+
_IOR('V', BASE_VIDIOC_PRIVATE + 0, struct rk_cam_vcm_tim)
20+
21+
#ifdef CONFIG_COMPAT
22+
#define RK_VIDIOC_COMPAT_VCM_TIMEINFO \
23+
_IOR('V', BASE_VIDIOC_PRIVATE + 0, struct rk_cam_compat_vcm_tim)
24+
#endif
25+
26+
struct rk_cam_vcm_tim {
27+
struct timeval vcm_start_t;
28+
struct timeval vcm_end_t;
29+
};
30+
31+
#ifdef CONFIG_COMPAT
32+
struct rk_cam_compat_vcm_tim {
33+
struct compat_timeval vcm_start_t;
34+
struct compat_timeval vcm_end_t;
35+
};
36+
#endif
37+
38+
#endif /* RK_VCM_HEAD_H */
39+

0 commit comments

Comments
 (0)