You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
staging/atomisp: Add support for the Intel IPU v2
This patch adds support for the Intel IPU v2 as found on Android and IoT Baytrail-T and Baytrail-CR platforms (those with the IPU PCI mapped). You will also need the firmware files from your device (Android usually puts them into /etc) - or you can find them in the downloadable restore/upgrade kits if you blew them away for some reason. It may be possible to extend the driver to handle the BYT/T windows platforms such as the ASUS T100TA. These platforms don't expose the IPU via the PCI interface but via ACPI buried in the GPU description and with the camera information somewhere unknown so would need a platform driver interface adding to the codebase *IFF* the firmware works on such devices. To get good results you also need a suitable support library such as libxcam. The camera is intended to be driven from Android so it has a lot of features that many desktop apps don't fully spport. In theory all the pieces are there to build it with -DISP2401 and some differing files to get CherryTrail/T support, but unifying the drivers properlly is a work in progress. The IPU driver represents the work of a lot of people within Intel over many years. It's historical goal was portability rather than Linux upstream. Any queries about the upstream aimed driver should be sent to me not to the original authors. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
372499b589
commit
a49d25364d
@@ -34,4 +34,5 @@ source "drivers/staging/media/lirc/Kconfig"
|
||||
|
||||
source "drivers/staging/media/st-cec/Kconfig"
|
||||
|
||||
source "drivers/staging/media/atomisp/Kconfig"
|
||||
endif
|
||||
|
||||
@@ -5,3 +5,4 @@ obj-$(CONFIG_LIRC_STAGING) += lirc/
|
||||
obj-$(CONFIG_VIDEO_DM365_VPFE) += davinci_vpfe/
|
||||
obj-$(CONFIG_VIDEO_OMAP4) += omap4iss/
|
||||
obj-$(CONFIG_VIDEO_STI_HDMI_CEC) += st-cec/
|
||||
obj-$(CONFIG_INTEL_ATOMISP) += atomisp/
|
||||
|
||||
11
drivers/staging/media/atomisp/Kconfig
Normal file
11
drivers/staging/media/atomisp/Kconfig
Normal file
@@ -0,0 +1,11 @@
|
||||
menuconfig INTEL_ATOMISP
|
||||
bool "Enable support to Intel MIPI camera drivers"
|
||||
depends on X86
|
||||
help
|
||||
Enable support for the Intel ISP2 camera interfaces and MIPI
|
||||
sensor drivers.
|
||||
|
||||
if INTEL_ATOMISP
|
||||
source "drivers/staging/media/atomisp/pci/Kconfig"
|
||||
source "drivers/staging/media/atomisp/i2c/Kconfig"
|
||||
endif
|
||||
8
drivers/staging/media/atomisp/Makefile
Normal file
8
drivers/staging/media/atomisp/Makefile
Normal file
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# Makefile for camera drivers.
|
||||
#
|
||||
|
||||
obj-$(CONFIG_INTEL_ATOMISP) += pci/
|
||||
obj-$(CONFIG_INTEL_ATOMISP) += i2c/
|
||||
obj-$(CONFIG_INTEL_ATOMISP) += platform/
|
||||
LINUXINCLUDE += -I drivers/staging/media/atomisp/include/
|
||||
64
drivers/staging/media/atomisp/TODO
Normal file
64
drivers/staging/media/atomisp/TODO
Normal file
@@ -0,0 +1,64 @@
|
||||
1. A single AtomISP driver needs to be implemented to support both BYT and
|
||||
CHT platforms. The current driver is a mechanical and hand combined merge
|
||||
of the two using an ifdef ISP2401 to select the CHT version, which at the
|
||||
moment is not enabled. Eventually this should become a runtime if check,
|
||||
but there are some quite tricky things that need sorting out before that
|
||||
will be possible.
|
||||
|
||||
2. The file structure needs to get tidied up to resemble a normal Linux
|
||||
driver.
|
||||
|
||||
3. Lots of the midlayer glue. unused code and abstraction needs removing.
|
||||
|
||||
3. The sensor drivers read MIPI settings from EFI variables or default to the
|
||||
settings hard-coded in the platform data file for different platforms.
|
||||
This isn't ideal but may be hard to improve as this is how existing
|
||||
platforms work.
|
||||
|
||||
4. The sensor drivers use the regulator framework API. In the ideal world it
|
||||
would be using ACPI but that's not how the existing devices work.
|
||||
|
||||
5. The AtomISP driver includes some special IOCTLS (ATOMISP_IOC_XXXX_XXXX)
|
||||
that may need some cleaning up.
|
||||
|
||||
6. Correct Coding Style. Please don't send coding style patches for this
|
||||
driver until the other work is done.
|
||||
|
||||
7. The ISP code depends on the exact FW version. The version defined in
|
||||
BYT:
|
||||
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_firmware.c
|
||||
static const char *release_version = STR(irci_stable_candrpv_0415_20150521_0458);
|
||||
CHT:
|
||||
drivers/staging/media/atomisp/pci/atomisp2/css/sh_css_firmware.c
|
||||
static const char *release_version = STR(irci_ecr-master_20150911_0724);
|
||||
|
||||
At some point we may need to round up a few driver versions and see if
|
||||
there are any specific things that can be done to fold in support for
|
||||
multiple firmware versions.
|
||||
|
||||
|
||||
Limitations:
|
||||
|
||||
1. Currently the patch only support some camera sensors
|
||||
gc2235/gc0310/0v2680/ov2722/ov5693/mt9m114...
|
||||
|
||||
2. To test the patches, you also need the ISP firmware
|
||||
|
||||
for BYT:/lib/firmware/shisp_2400b0_v21.bin
|
||||
for CHT:/lib/firmware/shisp_2401a0_v21.bin
|
||||
|
||||
The firmware files will usually be found in /etc/firmware on an Android
|
||||
device but can also be extracted from the upgrade kit if you've managed
|
||||
to lose them somehow.
|
||||
|
||||
3. Without a 3A libary the capture behaviour is not very good. To take a good
|
||||
picture, you need tune ISP parameters by IOCTL functions or use a 3A libary
|
||||
such as libxcam.
|
||||
|
||||
4. The driver is intended to drive the PCI exposed versions of the device.
|
||||
It will not detect those devices enumerated via ACPI as a field of the
|
||||
i915 GPU driver.
|
||||
|
||||
5. The driver supports only v2 of the IPU/Camera. It will not work with the
|
||||
versions of the hardware in other SoCs.
|
||||
|
||||
105
drivers/staging/media/atomisp/i2c/Kconfig
Normal file
105
drivers/staging/media/atomisp/i2c/Kconfig
Normal file
@@ -0,0 +1,105 @@
|
||||
#
|
||||
# Kconfig for sensor drivers
|
||||
#
|
||||
|
||||
source "drivers/staging/media/atomisp/i2c/ov5693/Kconfig"
|
||||
source "drivers/staging/media/atomisp/i2c/imx/Kconfig"
|
||||
|
||||
config VIDEO_OV2722
|
||||
tristate "OVT ov2722 sensor support"
|
||||
depends on I2C && VIDEO_V4L2
|
||||
---help---
|
||||
This is a Video4Linux2 sensor-level driver for the OVT
|
||||
OV2722 raw camera.
|
||||
|
||||
OVT is a 2M raw sensor.
|
||||
|
||||
It currently only works with the atomisp driver.
|
||||
|
||||
config VIDEO_GC2235
|
||||
tristate "Galaxy gc2235 sensor support"
|
||||
depends on I2C && VIDEO_V4L2
|
||||
---help---
|
||||
This is a Video4Linux2 sensor-level driver for the OVT
|
||||
GC2235 raw camera.
|
||||
|
||||
GC2235 is a 2M raw sensor.
|
||||
|
||||
It currently only works with the atomisp driver.
|
||||
|
||||
config VIDEO_OV8858
|
||||
tristate "Omnivision ov8858 sensor support"
|
||||
depends on I2C && VIDEO_V4L2 && VIDEO_ATOMISP
|
||||
---help---
|
||||
This is a Video4Linux2 sensor-level driver for the Omnivision
|
||||
ov8858 RAW sensor.
|
||||
|
||||
OV8858 is a 8M raw sensor.
|
||||
|
||||
It currently only works with the atomisp driver.
|
||||
|
||||
config VIDEO_MSRLIST_HELPER
|
||||
tristate "Helper library to load, parse and apply large register lists."
|
||||
depends on I2C
|
||||
---help---
|
||||
This is a helper library to be used from a sensor driver to load, parse
|
||||
and apply large register lists.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called libmsrlisthelper.
|
||||
|
||||
config VIDEO_MT9M114
|
||||
tristate "Aptina mt9m114 sensor support"
|
||||
depends on I2C && VIDEO_V4L2
|
||||
---help---
|
||||
This is a Video4Linux2 sensor-level driver for the Micron
|
||||
mt9m114 1.3 Mpixel camera.
|
||||
|
||||
mt9m114 is video camera sensor.
|
||||
|
||||
It currently only works with the atomisp driver.
|
||||
|
||||
config VIDEO_AP1302
|
||||
tristate "AP1302 external ISP support"
|
||||
depends on I2C && VIDEO_V4L2
|
||||
---help---
|
||||
This is a Video4Linux2 sensor-level driver for the external
|
||||
ISP AP1302.
|
||||
|
||||
AP1302 is an exteral ISP.
|
||||
|
||||
It currently only works with the atomisp driver.
|
||||
|
||||
config VIDEO_GC0310
|
||||
tristate "GC0310 sensor support"
|
||||
depends on I2C && VIDEO_V4L2
|
||||
---help---
|
||||
This is a Video4Linux2 sensor-level driver for the Galaxycore
|
||||
GC0310 0.3MP sensor.
|
||||
|
||||
config VIDEO_OV2680
|
||||
tristate "Omnivision OV2680 sensor support"
|
||||
depends on I2C && VIDEO_V4L2
|
||||
---help---
|
||||
This is a Video4Linux2 sensor-level driver for the Omnivision
|
||||
OV2680 raw camera.
|
||||
|
||||
ov2680 is a 2M raw sensor.
|
||||
|
||||
It currently only works with the atomisp driver.
|
||||
|
||||
#
|
||||
# Kconfig for flash drivers
|
||||
#
|
||||
|
||||
config VIDEO_LM3554
|
||||
tristate "LM3554 flash light driver"
|
||||
depends on VIDEO_V4L2 && I2C
|
||||
---help---
|
||||
This is a Video4Linux2 sub-dev driver for the LM3554
|
||||
flash light driver.
|
||||
|
||||
To compile this driver as a module, choose M here: the
|
||||
module will be called lm3554
|
||||
|
||||
|
||||
23
drivers/staging/media/atomisp/i2c/Makefile
Normal file
23
drivers/staging/media/atomisp/i2c/Makefile
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# Makefile for sensor drivers
|
||||
#
|
||||
|
||||
obj-$(CONFIG_VIDEO_IMX) += imx/
|
||||
obj-$(CONFIG_VIDEO_OV5693) += ov5693/
|
||||
obj-$(CONFIG_VIDEO_MT9M114) += mt9m114.o
|
||||
obj-$(CONFIG_VIDEO_GC2235) += gc2235.o
|
||||
obj-$(CONFIG_VIDEO_OV2722) += ov2722.o
|
||||
obj-$(CONFIG_VIDEO_OV2680) += ov2680.o
|
||||
obj-$(CONFIG_VIDEO_GC0310) += gc0310.o
|
||||
|
||||
obj-$(CONFIG_VIDEO_MSRLIST_HELPER) += libmsrlisthelper.o
|
||||
|
||||
obj-$(CONFIG_VIDEO_AP1302) += ap1302.o
|
||||
|
||||
# Makefile for flash drivers
|
||||
#
|
||||
|
||||
obj-$(CONFIG_VIDEO_LM3554) += lm3554.o
|
||||
|
||||
ccflags-y += -Werror
|
||||
|
||||
1262
drivers/staging/media/atomisp/i2c/ap1302.c
Normal file
1262
drivers/staging/media/atomisp/i2c/ap1302.c
Normal file
File diff suppressed because it is too large
Load Diff
198
drivers/staging/media/atomisp/i2c/ap1302.h
Normal file
198
drivers/staging/media/atomisp/i2c/ap1302.h
Normal file
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2013 Intel Corporation. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version
|
||||
* 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __AP1302_H__
|
||||
#define __AP1302_H__
|
||||
|
||||
#include <linux/atomisp_platform.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/types.h>
|
||||
#include <media/v4l2-ctrls.h>
|
||||
#include <media/v4l2-subdev.h>
|
||||
|
||||
#define AP1302_NAME "ap1302"
|
||||
#define AP1302_CHIP_ID 0x265
|
||||
#define AP1302_I2C_MAX_LEN 65534
|
||||
#define AP1302_FW_WINDOW_OFFSET 0x8000
|
||||
#define AP1302_FW_WINDOW_SIZE 0x2000
|
||||
|
||||
#define AP1302_REG16 2
|
||||
#define AP1302_REG32 4
|
||||
|
||||
#define REG_CHIP_VERSION 0x0000
|
||||
#define REG_CHIP_REV 0x0050
|
||||
#define REG_MF_ID 0x0004
|
||||
#define REG_ERROR 0x0006
|
||||
#define REG_CTRL 0x1000
|
||||
#define REG_DZ_TGT_FCT 0x1010
|
||||
#define REG_SFX_MODE 0x1016
|
||||
#define REG_SS_HEAD_PT0 0x1174
|
||||
#define REG_AE_BV_OFF 0x5014
|
||||
#define REG_AE_BV_BIAS 0x5016
|
||||
#define REG_AWB_CTRL 0x5100
|
||||
#define REG_FLICK_CTRL 0x5440
|
||||
#define REG_SCENE_CTRL 0x5454
|
||||
#define REG_BOOTDATA_STAGE 0x6002
|
||||
#define REG_SENSOR_SELECT 0x600C
|
||||
#define REG_SYS_START 0x601A
|
||||
#define REG_SIP_CRC 0xF052
|
||||
|
||||
#define REG_PREVIEW_BASE 0x2000
|
||||
#define REG_SNAPSHOT_BASE 0x3000
|
||||
#define REG_VIDEO_BASE 0x4000
|
||||
#define CNTX_WIDTH 0x00
|
||||
#define CNTX_HEIGHT 0x02
|
||||
#define CNTX_ROI_X0 0x04
|
||||
#define CNTX_ROI_Y0 0x06
|
||||
#define CNTX_ROI_X1 0x08
|
||||
#define CNTX_ROI_Y1 0x0A
|
||||
#define CNTX_ASPECT 0x0C
|
||||
#define CNTX_LOCK 0x0E
|
||||
#define CNTX_ENABLE 0x10
|
||||
#define CNTX_OUT_FMT 0x12
|
||||
#define CNTX_SENSOR_MODE 0x14
|
||||
#define CNTX_MIPI_CTRL 0x16
|
||||
#define CNTX_MIPI_II_CTRL 0x18
|
||||
#define CNTX_LINE_TIME 0x1C
|
||||
#define CNTX_MAX_FPS 0x20
|
||||
#define CNTX_AE_USG 0x22
|
||||
#define CNTX_AE_UPPER_ET 0x24
|
||||
#define CNTX_AE_MAX_ET 0x28
|
||||
#define CNTX_SS 0x2C
|
||||
#define CNTX_S1_SENSOR_MODE 0x2E
|
||||
#define CNTX_HINF_CTRL 0x30
|
||||
|
||||
#define CTRL_CNTX_MASK 0x03
|
||||
#define CTRL_CNTX_OFFSET 0x00
|
||||
#define HINF_CTRL_LANE_MASK 0x07
|
||||
#define HINF_CTRL_LANE_OFFSET 0x00
|
||||
#define MIPI_CTRL_IMGVC_MASK 0xC0
|
||||
#define MIPI_CTRL_IMGVC_OFFSET 0x06
|
||||
#define MIPI_CTRL_IMGTYPE_AUTO 0x3F
|
||||
#define MIPI_CTRL_SSVC_MASK 0xC000
|
||||
#define MIPI_CTRL_SSVC_OFFSET 0x0E
|
||||
#define MIPI_CTRL_SSTYPE_MASK 0x3F00
|
||||
#define MIPI_CTRL_SSTYPE_OFFSET 0x08
|
||||
#define OUT_FMT_IIS_MASK 0x30
|
||||
#define OUT_FMT_IIS_OFFSET 0x08
|
||||
#define OUT_FMT_SS_MASK 0x1000
|
||||
#define OUT_FMT_SS_OFFSET 0x12
|
||||
#define OUT_FMT_TYPE_MASK 0xFF
|
||||
#define SENSOR_SELECT_MASK 0x03
|
||||
#define SENSOR_SELECT_OFFSET 0x00
|
||||
#define AWB_CTRL_MODE_MASK 0x0F
|
||||
#define AWB_CTRL_MODE_OFFSET 0x00
|
||||
#define AWB_CTRL_FLASH_MASK 0x100
|
||||
|
||||
#define AP1302_FMT_UYVY422 0x50
|
||||
|
||||
#define AP1302_SYS_ACTIVATE 0x8010
|
||||
#define AP1302_SYS_SWITCH 0x8140
|
||||
#define AP1302_SENSOR_PRI 0x01
|
||||
#define AP1302_SENSOR_SEC 0x02
|
||||
#define AP1302_SS_CTRL 0x31
|
||||
|
||||
#define AP1302_MAX_RATIO_MISMATCH 10 /* Unit in percentage */
|
||||
#define AP1302_MAX_EV 2
|
||||
#define AP1302_MIN_EV -2
|
||||
|
||||
enum ap1302_contexts {
|
||||
CONTEXT_PREVIEW = 0,
|
||||
CONTEXT_SNAPSHOT,
|
||||
CONTEXT_VIDEO,
|
||||
CONTEXT_NUM
|
||||
};
|
||||
|
||||
/* The context registers are defined according to preview/video registers.
|
||||
Preview and video context have the same register definition.
|
||||
But snapshot context does not have register S1_SENSOR_MODE.
|
||||
When setting snapshot registers, if the offset exceeds
|
||||
S1_SENSOR_MODE, the actual offset needs to minus 2. */
|
||||
struct ap1302_context_config {
|
||||
u16 width;
|
||||
u16 height;
|
||||
u16 roi_x0;
|
||||
u16 roi_y0;
|
||||
u16 roi_x1;
|
||||
u16 roi_y1;
|
||||
u16 aspect_factor;
|
||||
u16 lock;
|
||||
u16 enable;
|
||||
u16 out_fmt;
|
||||
u16 sensor_mode;
|
||||
u16 mipi_ctrl;
|
||||
u16 mipi_ii_ctrl;
|
||||
u16 padding;
|
||||
u32 line_time;
|
||||
u16 max_fps;
|
||||
u16 ae_usg;
|
||||
u32 ae_upper_et;
|
||||
u32 ae_max_et;
|
||||
u16 ss;
|
||||
u16 s1_sensor_mode;
|
||||
u16 hinf_ctrl;
|
||||
u32 reserved;
|
||||
};
|
||||
|
||||
struct ap1302_res_struct {
|
||||
u16 width;
|
||||
u16 height;
|
||||
u16 fps;
|
||||
};
|
||||
|
||||
struct ap1302_context_res {
|
||||
s32 res_num;
|
||||
s32 cur_res;
|
||||
struct ap1302_res_struct *res_table;
|
||||
};
|
||||
|
||||
struct ap1302_device {
|
||||
struct v4l2_subdev sd;
|
||||
struct media_pad pad;
|
||||
struct camera_sensor_platform_data *platform_data;
|
||||
const struct firmware *fw;
|
||||
struct mutex input_lock; /* serialize sensor's ioctl */
|
||||
struct v4l2_mbus_framefmt format;
|
||||
struct v4l2_ctrl_handler ctrl_handler;
|
||||
struct v4l2_ctrl *run_mode;
|
||||
struct ap1302_context_config cntx_config[CONTEXT_NUM];
|
||||
struct ap1302_context_res cntx_res[CONTEXT_NUM];
|
||||
enum ap1302_contexts cur_context;
|
||||
unsigned int num_lanes;
|
||||
struct regmap *regmap16;
|
||||
struct regmap *regmap32;
|
||||
bool sys_activated;
|
||||
bool power_on;
|
||||
};
|
||||
|
||||
struct ap1302_firmware {
|
||||
u32 crc;
|
||||
u32 pll_init_size;
|
||||
u32 total_size;
|
||||
u32 reserved;
|
||||
};
|
||||
|
||||
struct ap1302_context_info {
|
||||
u16 offset;
|
||||
u16 len;
|
||||
char *name;
|
||||
};
|
||||
|
||||
#endif
|
||||
1495
drivers/staging/media/atomisp/i2c/gc0310.c
Normal file
1495
drivers/staging/media/atomisp/i2c/gc0310.c
Normal file
File diff suppressed because it is too large
Load Diff
459
drivers/staging/media/atomisp/i2c/gc0310.h
Normal file
459
drivers/staging/media/atomisp/i2c/gc0310.h
Normal file
@@ -0,0 +1,459 @@
|
||||
/*
|
||||
* Support for GalaxyCore GC0310 VGA camera sensor.
|
||||
*
|
||||
* Copyright (c) 2013 Intel Corporation. All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version
|
||||
* 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __GC0310_H__
|
||||
#define __GC0310_H__
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/videodev2.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <media/v4l2-subdev.h>
|
||||
#include <media/v4l2-device.h>
|
||||
#include <media/v4l2-ctrls.h>
|
||||
#include <linux/v4l2-mediabus.h>
|
||||
#include <media/media-entity.h>
|
||||
|
||||
#include <linux/atomisp_platform.h>
|
||||
|
||||
#define GC0310_NAME "gc0310"
|
||||
|
||||
/* Defines for register writes and register array processing */
|
||||
#define I2C_MSG_LENGTH 1
|
||||
#define I2C_RETRY_COUNT 5
|
||||
|
||||
#define GC0310_FOCAL_LENGTH_NUM 278 /*2.78mm*/
|
||||
#define GC0310_FOCAL_LENGTH_DEM 100
|
||||
#define GC0310_F_NUMBER_DEFAULT_NUM 26
|
||||
#define GC0310_F_NUMBER_DEM 10
|
||||
|
||||
#define MAX_FMTS 1
|
||||
|
||||
/*
|
||||
* focal length bits definition:
|
||||
* bits 31-16: numerator, bits 15-0: denominator
|
||||
*/
|
||||
#define GC0310_FOCAL_LENGTH_DEFAULT 0x1160064
|
||||
|
||||
/*
|
||||
* current f-number bits definition:
|
||||
* bits 31-16: numerator, bits 15-0: denominator
|
||||
*/
|
||||
#define GC0310_F_NUMBER_DEFAULT 0x1a000a
|
||||
|
||||
/*
|
||||
* f-number range bits definition:
|
||||
* bits 31-24: max f-number numerator
|
||||
* bits 23-16: max f-number denominator
|
||||
* bits 15-8: min f-number numerator
|
||||
* bits 7-0: min f-number denominator
|
||||
*/
|
||||
#define GC0310_F_NUMBER_RANGE 0x1a0a1a0a
|
||||
#define GC0310_ID 0xa310
|
||||
|
||||
#define GC0310_RESET_RELATED 0xFE
|
||||
#define GC0310_REGISTER_PAGE_0 0x0
|
||||
#define GC0310_REGISTER_PAGE_3 0x3
|
||||
|
||||
#define GC0310_FINE_INTG_TIME_MIN 0
|
||||
#define GC0310_FINE_INTG_TIME_MAX_MARGIN 0
|
||||
#define GC0310_COARSE_INTG_TIME_MIN 1
|
||||
#define GC0310_COARSE_INTG_TIME_MAX_MARGIN 6
|
||||
|
||||
/*
|
||||
* GC0310 System control registers
|
||||
*/
|
||||
#define GC0310_SW_STREAM 0x10
|
||||
|
||||
#define GC0310_SC_CMMN_CHIP_ID_H 0xf0
|
||||
#define GC0310_SC_CMMN_CHIP_ID_L 0xf1
|
||||
|
||||
#define GC0310_AEC_PK_EXPO_H 0x03
|
||||
#define GC0310_AEC_PK_EXPO_L 0x04
|
||||
#define GC0310_AGC_ADJ 0x48
|
||||
#define GC0310_DGC_ADJ 0x71
|
||||
#if 0
|
||||
#define GC0310_GROUP_ACCESS 0x3208
|
||||
#endif
|
||||
|
||||
#define GC0310_H_CROP_START_H 0x09
|
||||
#define GC0310_H_CROP_START_L 0x0A
|
||||
#define GC0310_V_CROP_START_H 0x0B
|
||||
#define GC0310_V_CROP_START_L 0x0C
|
||||
#define GC0310_H_OUTSIZE_H 0x0F
|
||||
#define GC0310_H_OUTSIZE_L 0x10
|
||||
#define GC0310_V_OUTSIZE_H 0x0D
|
||||
#define GC0310_V_OUTSIZE_L 0x0E
|
||||
#define GC0310_H_BLANKING_H 0x05
|
||||
#define GC0310_H_BLANKING_L 0x06
|
||||
#define GC0310_V_BLANKING_H 0x07
|
||||
#define GC0310_V_BLANKING_L 0x08
|
||||
#define GC0310_SH_DELAY 0x11
|
||||
|
||||
#define GC0310_START_STREAMING 0x94 /* 8-bit enable */
|
||||
#define GC0310_STOP_STREAMING 0x0 /* 8-bit disable */
|
||||
|
||||
#define GC0310_BIN_FACTOR_MAX 3
|
||||
|
||||
struct regval_list {
|
||||
u16 reg_num;
|
||||
u8 value;
|
||||
};
|
||||
|
||||
struct gc0310_resolution {
|
||||
u8 *desc;
|
||||
const struct gc0310_reg *regs;
|
||||
int res;
|
||||
int width;
|
||||
int height;
|
||||
int fps;
|
||||
int pix_clk_freq;
|
||||
u32 skip_frames;
|
||||
u16 pixels_per_line;
|
||||
u16 lines_per_frame;
|
||||
u8 bin_factor_x;
|
||||
u8 bin_factor_y;
|
||||
u8 bin_mode;
|
||||
bool used;
|
||||
};
|
||||
|
||||
struct gc0310_format {
|
||||
u8 *desc;
|
||||
u32 pixelformat;
|
||||
struct gc0310_reg *regs;
|
||||
};
|
||||
|
||||
/*
|
||||
* gc0310 device structure.
|
||||
*/
|
||||
struct gc0310_device {
|
||||
struct v4l2_subdev sd;
|
||||
struct media_pad pad;
|
||||
struct v4l2_mbus_framefmt format;
|
||||
struct mutex input_lock;
|
||||
struct v4l2_ctrl_handler ctrl_handler;
|
||||
|
||||
struct camera_sensor_platform_data *platform_data;
|
||||
int vt_pix_clk_freq_mhz;
|
||||
int fmt_idx;
|
||||
int run_mode;
|
||||
u8 res;
|
||||
u8 type;
|
||||
};
|
||||
|
||||
enum gc0310_tok_type {
|
||||
GC0310_8BIT = 0x0001,
|
||||
GC0310_TOK_TERM = 0xf000, /* terminating token for reg list */
|
||||
GC0310_TOK_DELAY = 0xfe00, /* delay token for reg list */
|
||||
GC0310_TOK_MASK = 0xfff0
|
||||
};
|
||||
|
||||
/**
|
||||
* struct gc0310_reg - MI sensor register format
|
||||
* @type: type of the register
|
||||
* @reg: 16-bit offset to register
|
||||
* @val: 8/16/32-bit register value
|
||||
*
|
||||
* Define a structure for sensor register initialization values
|
||||
*/
|
||||
struct gc0310_reg {
|
||||
enum gc0310_tok_type type;
|
||||
u8 reg;
|
||||
u8 val; /* @set value for read/mod/write, @mask */
|
||||
};
|
||||
|
||||
#define to_gc0310_sensor(x) container_of(x, struct gc0310_device, sd)
|
||||
|
||||
#define GC0310_MAX_WRITE_BUF_SIZE 30
|
||||
|
||||
struct gc0310_write_buffer {
|
||||
u8 addr;
|
||||
u8 data[GC0310_MAX_WRITE_BUF_SIZE];
|
||||
};
|
||||
|
||||
struct gc0310_write_ctrl {
|
||||
int index;
|
||||
struct gc0310_write_buffer buffer;
|
||||
};
|
||||
|
||||
static const struct i2c_device_id gc0310_id[] = {
|
||||
{GC0310_NAME, 0},
|
||||
{}
|
||||
};
|
||||
|
||||
/*
|
||||
* Register settings for various resolution
|
||||
*/
|
||||
static const struct gc0310_reg gc0310_reset_register[] = {
|
||||
/////////////////////////////////////////////////
|
||||
///////////////// system reg /////////////////
|
||||
/////////////////////////////////////////////////
|
||||
{GC0310_8BIT, 0xfe, 0xf0},
|
||||
{GC0310_8BIT, 0xfe, 0xf0},
|
||||
{GC0310_8BIT, 0xfe, 0x00},
|
||||
|
||||
{GC0310_8BIT, 0xfc, 0x0e}, //4e
|
||||
{GC0310_8BIT, 0xfc, 0x0e}, //16//4e // [0]apwd [6]regf_clk_gate
|
||||
{GC0310_8BIT, 0xf2, 0x80}, //sync output
|
||||
{GC0310_8BIT, 0xf3, 0x00}, //1f//01 data output
|
||||
{GC0310_8BIT, 0xf7, 0x33}, //f9
|
||||
{GC0310_8BIT, 0xf8, 0x05}, //00
|
||||
{GC0310_8BIT, 0xf9, 0x0e}, // 0x8e //0f
|
||||
{GC0310_8BIT, 0xfa, 0x11},
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
/////////////////// MIPI ////////////////////
|
||||
/////////////////////////////////////////////////
|
||||
{GC0310_8BIT, 0xfe, 0x03},
|
||||
{GC0310_8BIT, 0x01, 0x03}, ///mipi 1lane
|
||||
{GC0310_8BIT, 0x02, 0x22}, // 0x33
|
||||
{GC0310_8BIT, 0x03, 0x94},
|
||||
{GC0310_8BIT, 0x04, 0x01}, // fifo_prog
|
||||
{GC0310_8BIT, 0x05, 0x00}, //fifo_prog
|
||||
{GC0310_8BIT, 0x06, 0x80}, //b0 //YUV ISP data
|
||||
{GC0310_8BIT, 0x11, 0x2a},//1e //LDI set YUV422
|
||||
{GC0310_8BIT, 0x12, 0x90},//00 //04 //00 //04//00 //LWC[7:0] //
|
||||
{GC0310_8BIT, 0x13, 0x02},//05 //05 //LWC[15:8]
|
||||
{GC0310_8BIT, 0x15, 0x12}, // 0x10 //DPHYY_MODE read_ready
|
||||
{GC0310_8BIT, 0x17, 0x01},
|
||||
{GC0310_8BIT, 0x40, 0x08},
|
||||
{GC0310_8BIT, 0x41, 0x00},
|
||||
{GC0310_8BIT, 0x42, 0x00},
|
||||
{GC0310_8BIT, 0x43, 0x00},
|
||||
{GC0310_8BIT, 0x21, 0x02}, // 0x01
|
||||
{GC0310_8BIT, 0x22, 0x02}, // 0x01
|
||||
{GC0310_8BIT, 0x23, 0x01}, // 0x05 //Nor:0x05 DOU:0x06
|
||||
{GC0310_8BIT, 0x29, 0x00},
|
||||
{GC0310_8BIT, 0x2A, 0x25}, // 0x05 //data zero 0x7a de
|
||||
{GC0310_8BIT, 0x2B, 0x02},
|
||||
|
||||
{GC0310_8BIT, 0xfe, 0x00},
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
///////////////// CISCTL reg /////////////////
|
||||
/////////////////////////////////////////////////
|
||||
{GC0310_8BIT, 0x00, 0x2f}, //2f//0f//02//01
|
||||
{GC0310_8BIT, 0x01, 0x0f}, //06
|
||||
{GC0310_8BIT, 0x02, 0x04},
|
||||
{GC0310_8BIT, 0x4f, 0x00}, //AEC 0FF
|
||||
{GC0310_8BIT, 0x03, 0x01}, // 0x03 //04
|
||||
{GC0310_8BIT, 0x04, 0xc0}, // 0xe8 //58
|
||||
{GC0310_8BIT, 0x05, 0x00},
|
||||
{GC0310_8BIT, 0x06, 0xb2}, // 0x0a //HB
|
||||
{GC0310_8BIT, 0x07, 0x00},
|
||||
{GC0310_8BIT, 0x08, 0x0c}, // 0x89 //VB
|
||||
{GC0310_8BIT, 0x09, 0x00}, //row start
|
||||
{GC0310_8BIT, 0x0a, 0x00}, //
|
||||
{GC0310_8BIT, 0x0b, 0x00}, //col start
|
||||
{GC0310_8BIT, 0x0c, 0x00},
|
||||
{GC0310_8BIT, 0x0d, 0x01}, //height
|
||||
{GC0310_8BIT, 0x0e, 0xf2}, // 0xf7 //height
|
||||
{GC0310_8BIT, 0x0f, 0x02}, //width
|
||||
{GC0310_8BIT, 0x10, 0x94}, // 0xa0 //height
|
||||
{GC0310_8BIT, 0x17, 0x14},
|
||||
{GC0310_8BIT, 0x18, 0x1a}, //0a//[4]double reset
|
||||
{GC0310_8BIT, 0x19, 0x14}, //AD pipeline
|
||||
{GC0310_8BIT, 0x1b, 0x48},
|
||||
{GC0310_8BIT, 0x1e, 0x6b}, //3b//col bias
|
||||
{GC0310_8BIT, 0x1f, 0x28}, //20//00//08//txlow
|
||||
{GC0310_8BIT, 0x20, 0x89}, //88//0c//[3:2]DA15
|
||||
{GC0310_8BIT, 0x21, 0x49}, //48//[3] txhigh
|
||||
{GC0310_8BIT, 0x22, 0xb0},
|
||||
{GC0310_8BIT, 0x23, 0x04}, //[1:0]vcm_r
|
||||
{GC0310_8BIT, 0x24, 0x16}, //15
|
||||
{GC0310_8BIT, 0x34, 0x20}, //[6:4] rsg high//range
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
//////////////////// BLK ////////////////////
|
||||
/////////////////////////////////////////////////
|
||||
{GC0310_8BIT, 0x26, 0x23}, //[1]dark_current_en [0]offset_en
|
||||
{GC0310_8BIT, 0x28, 0xff}, //BLK_limie_value
|
||||
{GC0310_8BIT, 0x29, 0x00}, //global offset
|
||||
{GC0310_8BIT, 0x33, 0x18}, //offset_ratio
|
||||
{GC0310_8BIT, 0x37, 0x20}, //dark_current_ratio
|
||||
{GC0310_8BIT, 0x2a, 0x00},
|
||||
{GC0310_8BIT, 0x2b, 0x00},
|
||||
{GC0310_8BIT, 0x2c, 0x00},
|
||||
{GC0310_8BIT, 0x2d, 0x00},
|
||||
{GC0310_8BIT, 0x2e, 0x00},
|
||||
{GC0310_8BIT, 0x2f, 0x00},
|
||||
{GC0310_8BIT, 0x30, 0x00},
|
||||
{GC0310_8BIT, 0x31, 0x00},
|
||||
{GC0310_8BIT, 0x47, 0x80}, //a7
|
||||
{GC0310_8BIT, 0x4e, 0x66}, //select_row
|
||||
{GC0310_8BIT, 0xa8, 0x02}, //win_width_dark, same with crop_win_width
|
||||
{GC0310_8BIT, 0xa9, 0x80},
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
////////////////// ISP reg ///////////////////
|
||||
/////////////////////////////////////////////////
|
||||
{GC0310_8BIT, 0x40, 0x06}, // 0xff //ff //48
|
||||
{GC0310_8BIT, 0x41, 0x00}, // 0x21 //00//[0]curve_en
|
||||
{GC0310_8BIT, 0x42, 0x04}, // 0xcf //0a//[1]awn_en
|
||||
{GC0310_8BIT, 0x44, 0x18}, // 0x18 //02
|
||||
{GC0310_8BIT, 0x46, 0x02}, // 0x03 //sync
|
||||
{GC0310_8BIT, 0x49, 0x03},
|
||||
{GC0310_8BIT, 0x4c, 0x20}, //00[5]pretect exp
|
||||
{GC0310_8BIT, 0x50, 0x01}, //crop enable
|
||||
{GC0310_8BIT, 0x51, 0x00},
|
||||
{GC0310_8BIT, 0x52, 0x00},
|
||||
{GC0310_8BIT, 0x53, 0x00},
|
||||
{GC0310_8BIT, 0x54, 0x01},
|
||||
{GC0310_8BIT, 0x55, 0x01}, //crop window height
|
||||
{GC0310_8BIT, 0x56, 0xf0},
|
||||
{GC0310_8BIT, 0x57, 0x02}, //crop window width
|
||||
{GC0310_8BIT, 0x58, 0x90},
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
/////////////////// GAIN ////////////////////
|
||||
/////////////////////////////////////////////////
|
||||
{GC0310_8BIT, 0x70, 0x70}, //70 //80//global gain
|
||||
{GC0310_8BIT, 0x71, 0x20}, // pregain gain
|
||||
{GC0310_8BIT, 0x72, 0x40}, // post gain
|
||||
{GC0310_8BIT, 0x5a, 0x84}, //84//analog gain 0
|
||||
{GC0310_8BIT, 0x5b, 0xc9}, //c9
|
||||
{GC0310_8BIT, 0x5c, 0xed}, //ed//not use pga gain highest level
|
||||
{GC0310_8BIT, 0x77, 0x40}, // R gain 0x74 //awb gain
|
||||
{GC0310_8BIT, 0x78, 0x40}, // G gain
|
||||
{GC0310_8BIT, 0x79, 0x40}, // B gain 0x5f
|
||||
|
||||
{GC0310_8BIT, 0x48, 0x00},
|
||||
{GC0310_8BIT, 0xfe, 0x01},
|
||||
{GC0310_8BIT, 0x0a, 0x45}, //[7]col gain mode
|
||||
|
||||
{GC0310_8BIT, 0x3e, 0x40},
|
||||
{GC0310_8BIT, 0x3f, 0x5c},
|
||||
{GC0310_8BIT, 0x40, 0x7b},
|
||||
{GC0310_8BIT, 0x41, 0xbd},
|
||||
{GC0310_8BIT, 0x42, 0xf6},
|
||||
{GC0310_8BIT, 0x43, 0x63},
|
||||
{GC0310_8BIT, 0x03, 0x60},
|
||||
{GC0310_8BIT, 0x44, 0x03},
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
///////////////// dark sun //////////////////
|
||||
/////////////////////////////////////////////////
|
||||
{GC0310_8BIT, 0xfe, 0x01},
|
||||
{GC0310_8BIT, 0x45, 0xa4}, // 0xf7
|
||||
{GC0310_8BIT, 0x46, 0xf0}, // 0xff //f0//sun vaule th
|
||||
{GC0310_8BIT, 0x48, 0x03}, //sun mode
|
||||
{GC0310_8BIT, 0x4f, 0x60}, //sun_clamp
|
||||
{GC0310_8BIT, 0xfe, 0x00},
|
||||
|
||||
{GC0310_TOK_TERM, 0, 0},
|
||||
};
|
||||
|
||||
static struct gc0310_reg const gc0310_VGA_30fps[] = {
|
||||
{GC0310_8BIT, 0xfe, 0x00},
|
||||
{GC0310_8BIT, 0x0d, 0x01}, //height
|
||||
{GC0310_8BIT, 0x0e, 0xf2}, // 0xf7 //height
|
||||
{GC0310_8BIT, 0x0f, 0x02}, //width
|
||||
{GC0310_8BIT, 0x10, 0x94}, // 0xa0 //height
|
||||
|
||||
{GC0310_8BIT, 0x50, 0x01}, //crop enable
|
||||
{GC0310_8BIT, 0x51, 0x00},
|
||||
{GC0310_8BIT, 0x52, 0x00},
|
||||
{GC0310_8BIT, 0x53, 0x00},
|
||||
{GC0310_8BIT, 0x54, 0x01},
|
||||
{GC0310_8BIT, 0x55, 0x01}, //crop window height
|
||||
{GC0310_8BIT, 0x56, 0xf0},
|
||||
{GC0310_8BIT, 0x57, 0x02}, //crop window width
|
||||
{GC0310_8BIT, 0x58, 0x90},
|
||||
|
||||
{GC0310_8BIT, 0xfe, 0x03},
|
||||
{GC0310_8BIT, 0x12, 0x90},//00 //04 //00 //04//00 //LWC[7:0] //
|
||||
{GC0310_8BIT, 0x13, 0x02},//05 //05 //LWC[15:8]
|
||||
|
||||
{GC0310_8BIT, 0xfe, 0x00},
|
||||
|
||||
{GC0310_TOK_TERM, 0, 0},
|
||||
};
|
||||
|
||||
|
||||
struct gc0310_resolution gc0310_res_preview[] = {
|
||||
{
|
||||
.desc = "gc0310_VGA_30fps",
|
||||
.width = 656, // 648,
|
||||
.height = 496, // 488,
|
||||
.fps = 30,
|
||||
//.pix_clk_freq = 73,
|
||||
.used = 0,
|
||||
#if 0
|
||||
.pixels_per_line = 0x0314,
|
||||
.lines_per_frame = 0x0213,
|
||||
#endif
|
||||
.bin_factor_x = 1,
|
||||
.bin_factor_y = 1,
|
||||
.bin_mode = 0,
|
||||
.skip_frames = 2,
|
||||
.regs = gc0310_VGA_30fps,
|
||||
},
|
||||
};
|
||||
#define N_RES_PREVIEW (ARRAY_SIZE(gc0310_res_preview))
|
||||
|
||||
struct gc0310_resolution gc0310_res_still[] = {
|
||||
{
|
||||
.desc = "gc0310_VGA_30fps",
|
||||
.width = 656, // 648,
|
||||
.height = 496, // 488,
|
||||
.fps = 30,
|
||||
//.pix_clk_freq = 73,
|
||||
.used = 0,
|
||||
#if 0
|
||||
.pixels_per_line = 0x0314,
|
||||
.lines_per_frame = 0x0213,
|
||||
#endif
|
||||
.bin_factor_x = 1,
|
||||
.bin_factor_y = 1,
|
||||
.bin_mode = 0,
|
||||
.skip_frames = 2,
|
||||
.regs = gc0310_VGA_30fps,
|
||||
},
|
||||
};
|
||||
#define N_RES_STILL (ARRAY_SIZE(gc0310_res_still))
|
||||
|
||||
struct gc0310_resolution gc0310_res_video[] = {
|
||||
{
|
||||
.desc = "gc0310_VGA_30fps",
|
||||
.width = 656, // 648,
|
||||
.height = 496, // 488,
|
||||
.fps = 30,
|
||||
//.pix_clk_freq = 73,
|
||||
.used = 0,
|
||||
#if 0
|
||||
.pixels_per_line = 0x0314,
|
||||
.lines_per_frame = 0x0213,
|
||||
#endif
|
||||
.bin_factor_x = 1,
|
||||
.bin_factor_y = 1,
|
||||
.bin_mode = 0,
|
||||
.skip_frames = 2,
|
||||
.regs = gc0310_VGA_30fps,
|
||||
},
|
||||
};
|
||||
#define N_RES_VIDEO (ARRAY_SIZE(gc0310_res_video))
|
||||
|
||||
static struct gc0310_resolution *gc0310_res = gc0310_res_preview;
|
||||
static int N_RES = N_RES_PREVIEW;
|
||||
#endif
|
||||
|
||||
1233
drivers/staging/media/atomisp/i2c/gc2235.c
Normal file
1233
drivers/staging/media/atomisp/i2c/gc2235.c
Normal file
File diff suppressed because it is too large
Load Diff
672
drivers/staging/media/atomisp/i2c/gc2235.h
Normal file
672
drivers/staging/media/atomisp/i2c/gc2235.h
Normal file
File diff suppressed because it is too large
Load Diff
9
drivers/staging/media/atomisp/i2c/imx/Kconfig
Normal file
9
drivers/staging/media/atomisp/i2c/imx/Kconfig
Normal file
@@ -0,0 +1,9 @@
|
||||
config VIDEO_IMX
|
||||
tristate "sony imx sensor support"
|
||||
depends on I2C && VIDEO_V4L2 && VIDEO_MSRLIST_HELPER && m
|
||||
---help---
|
||||
This is a Video4Linux2 sensor-level driver for the Sony
|
||||
IMX RAW sensor.
|
||||
|
||||
It currently depends on internal V4L2 extensions defined in
|
||||
atomisp driver.
|
||||
8
drivers/staging/media/atomisp/i2c/imx/Makefile
Normal file
8
drivers/staging/media/atomisp/i2c/imx/Makefile
Normal file
@@ -0,0 +1,8 @@
|
||||
obj-$(CONFIG_VIDEO_IMX) += imx1x5.o
|
||||
|
||||
imx1x5-objs := imx.o drv201.o ad5816g.o dw9714.o dw9719.o dw9718.o vcm.o otp.o otp_imx.o otp_brcc064_e2prom.o otp_e2prom.o
|
||||
|
||||
ov8858_driver-objs := ../ov8858.o dw9718.o vcm.o
|
||||
obj-$(CONFIG_VIDEO_OV8858) += ov8858_driver.o
|
||||
|
||||
ccflags-y += -Werror
|
||||
225
drivers/staging/media/atomisp/i2c/imx/ad5816g.c
Normal file
225
drivers/staging/media/atomisp/i2c/imx/ad5816g.c
Normal file
@@ -0,0 +1,225 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/kmod.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <media/v4l2-device.h>
|
||||
|
||||
#include "ad5816g.h"
|
||||
|
||||
struct ad5816g_device ad5816g_dev;
|
||||
|
||||
static int ad5816g_i2c_rd8(struct i2c_client *client, u8 reg, u8 *val)
|
||||
{
|
||||
struct i2c_msg msg[2];
|
||||
u8 buf[2];
|
||||
buf[0] = reg;
|
||||
buf[1] = 0;
|
||||
|
||||
msg[0].addr = AD5816G_VCM_ADDR;
|
||||
msg[0].flags = 0;
|
||||
msg[0].len = 1;
|
||||
msg[0].buf = &buf[0];
|
||||
|
||||
msg[1].addr = AD5816G_VCM_ADDR;
|
||||
msg[1].flags = I2C_M_RD;
|
||||
msg[1].len = 1;
|
||||
msg[1].buf = &buf[1];
|
||||
*val = 0;
|
||||
if (i2c_transfer(client->adapter, msg, 2) != 2)
|
||||
return -EIO;
|
||||
*val = buf[1];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ad5816g_i2c_wr8(struct i2c_client *client, u8 reg, u8 val)
|
||||
{
|
||||
struct i2c_msg msg;
|
||||
u8 buf[2];
|
||||
buf[0] = reg;
|
||||
buf[1] = val;
|
||||
msg.addr = AD5816G_VCM_ADDR;
|
||||
msg.flags = 0;
|
||||
msg.len = 2;
|
||||
msg.buf = &buf[0];
|
||||
if (i2c_transfer(client->adapter, &msg, 1) != 1)
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ad5816g_i2c_wr16(struct i2c_client *client, u8 reg, u16 val)
|
||||
{
|
||||
struct i2c_msg msg;
|
||||
u8 buf[3];
|
||||
buf[0] = reg;
|
||||
buf[1] = (u8)(val >> 8);
|
||||
buf[2] = (u8)(val & 0xff);
|
||||
msg.addr = AD5816G_VCM_ADDR;
|
||||
msg.flags = 0;
|
||||
msg.len = 3;
|
||||
msg.buf = &buf[0];
|
||||
if (i2c_transfer(client->adapter, &msg, 1) != 1)
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ad5816g_set_arc_mode(struct i2c_client *client)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ad5816g_i2c_wr8(client, AD5816G_CONTROL, AD5816G_ARC_EN);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ad5816g_i2c_wr8(client, AD5816G_MODE,
|
||||
AD5816G_MODE_2_5M_SWITCH_CLOCK);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = ad5816g_i2c_wr8(client, AD5816G_VCM_FREQ, AD5816G_DEF_FREQ);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ad5816g_vcm_power_up(struct v4l2_subdev *sd)
|
||||
{
|
||||
struct i2c_client *client = v4l2_get_subdevdata(sd);
|
||||
int ret;
|
||||
u8 ad5816g_id;
|
||||
|
||||
/* Enable power */
|
||||
ret = ad5816g_dev.platform_data->power_ctrl(sd, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
/* waiting time AD5816G(vcm) - t1 + t2
|
||||
* t1(1ms) -Time from VDD high to first i2c cmd
|
||||
* t2(100us) - exit power-down mode time
|
||||
*/
|
||||
usleep_range(1100, 2200);
|
||||
/* Detect device */
|
||||
ret = ad5816g_i2c_rd8(client, AD5816G_IC_INFO, &ad5816g_id);
|
||||
if (ret < 0)
|
||||
goto fail_powerdown;
|
||||
if (ad5816g_id != AD5816G_ID) {
|
||||
ret = -ENXIO;
|
||||
goto fail_powerdown;
|
||||
}
|
||||
ret = ad5816g_set_arc_mode(client);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* set the VCM_THRESHOLD */
|
||||
ret = ad5816g_i2c_wr8(client, AD5816G_VCM_THRESHOLD,
|
||||
AD5816G_DEF_THRESHOLD);
|
||||
|
||||
return ret;
|
||||
|
||||
fail_powerdown:
|
||||
ad5816g_dev.platform_data->power_ctrl(sd, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ad5816g_vcm_power_down(struct v4l2_subdev *sd)
|
||||
{
|
||||
return ad5816g_dev.platform_data->power_ctrl(sd, 0);
|
||||
}
|
||||
|
||||
|
||||
int ad5816g_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
|
||||
{
|
||||
struct i2c_client *client = v4l2_get_subdevdata(sd);
|
||||
u16 data = val & VCM_CODE_MASK;
|
||||
|
||||
return ad5816g_i2c_wr16(client, AD5816G_VCM_CODE_MSB, data);
|
||||
}
|
||||
|
||||
int ad5816g_t_focus_abs(struct v4l2_subdev *sd, s32 value)
|
||||
{
|
||||
int ret;
|
||||
|
||||
value = clamp(value, 0, AD5816G_MAX_FOCUS_POS);
|
||||
ret = ad5816g_t_focus_vcm(sd, value);
|
||||
if (ret == 0) {
|
||||
ad5816g_dev.number_of_steps = value - ad5816g_dev.focus;
|
||||
ad5816g_dev.focus = value;
|
||||
getnstimeofday(&(ad5816g_dev.timestamp_t_focus_abs));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ad5816g_t_focus_rel(struct v4l2_subdev *sd, s32 value)
|
||||
{
|
||||
|
||||
return ad5816g_t_focus_abs(sd, ad5816g_dev.focus + value);
|
||||
}
|
||||
|
||||
int ad5816g_q_focus_status(struct v4l2_subdev *sd, s32 *value)
|
||||
{
|
||||
u32 status = 0;
|
||||
struct timespec temptime;
|
||||
const struct timespec timedelay = {
|
||||
0,
|
||||
min_t(u32, abs(ad5816g_dev.number_of_steps) * DELAY_PER_STEP_NS,
|
||||
DELAY_MAX_PER_STEP_NS),
|
||||
};
|
||||
|
||||
ktime_get_ts(&temptime);
|
||||
|
||||
temptime = timespec_sub(temptime, (ad5816g_dev.timestamp_t_focus_abs));
|
||||
|
||||
if (timespec_compare(&temptime, &timedelay) <= 0) {
|
||||
status |= ATOMISP_FOCUS_STATUS_MOVING;
|
||||
status |= ATOMISP_FOCUS_HP_IN_PROGRESS;
|
||||
} else {
|
||||
status |= ATOMISP_FOCUS_STATUS_ACCEPTS_NEW_MOVE;
|
||||
status |= ATOMISP_FOCUS_HP_COMPLETE;
|
||||
}
|
||||
*value = status;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ad5816g_q_focus_abs(struct v4l2_subdev *sd, s32 *value)
|
||||
{
|
||||
s32 val;
|
||||
|
||||
ad5816g_q_focus_status(sd, &val);
|
||||
|
||||
if (val & ATOMISP_FOCUS_STATUS_MOVING)
|
||||
*value = ad5816g_dev.focus - ad5816g_dev.number_of_steps;
|
||||
else
|
||||
*value = ad5816g_dev.focus;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ad5816g_t_vcm_slew(struct v4l2_subdev *sd, s32 value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ad5816g_t_vcm_timing(struct v4l2_subdev *sd, s32 value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ad5816g_vcm_init(struct v4l2_subdev *sd)
|
||||
{
|
||||
ad5816g_dev.platform_data = camera_get_af_platform_data();
|
||||
return (NULL == ad5816g_dev.platform_data) ? -ENODEV : 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
49
drivers/staging/media/atomisp/i2c/imx/ad5816g.h
Normal file
49
drivers/staging/media/atomisp/i2c/imx/ad5816g.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#ifndef __AD5816G_H__
|
||||
#define __AD5816G_H__
|
||||
|
||||
#include <linux/atomisp_platform.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/time.h>
|
||||
|
||||
#define AD5816G_VCM_ADDR 0x0e
|
||||
|
||||
/* ad5816g device structure */
|
||||
struct ad5816g_device {
|
||||
const struct camera_af_platform_data *platform_data;
|
||||
struct timespec timestamp_t_focus_abs;
|
||||
struct timespec focus_time; /* Time when focus was last time set */
|
||||
s32 focus; /* Current focus value */
|
||||
s16 number_of_steps;
|
||||
};
|
||||
|
||||
#define AD5816G_INVALID_CONFIG 0xffffffff
|
||||
#define AD5816G_MAX_FOCUS_POS 1023
|
||||
#define DELAY_PER_STEP_NS 1000000
|
||||
#define DELAY_MAX_PER_STEP_NS (1000000 * 1023)
|
||||
|
||||
/* Register Definitions */
|
||||
#define AD5816G_IC_INFO 0x00
|
||||
#define AD5816G_IC_VERSION 0x01
|
||||
#define AD5816G_CONTROL 0x02
|
||||
#define AD5816G_VCM_CODE_MSB 0x03
|
||||
#define AD5816G_VCM_CODE_LSB 0x04
|
||||
#define AD5816G_STATUS 0x05
|
||||
#define AD5816G_MODE 0x06
|
||||
#define AD5816G_VCM_FREQ 0x07
|
||||
#define AD5816G_VCM_THRESHOLD 0x08
|
||||
|
||||
/* ARC MODE ENABLE */
|
||||
#define AD5816G_ARC_EN 0x02
|
||||
/* ARC RES2 MODE */
|
||||
#define AD5816G_ARC_RES2 0x01
|
||||
/* ARC VCM FREQ - 78.1Hz */
|
||||
#define AD5816G_DEF_FREQ 0x7a
|
||||
/* ARC VCM THRESHOLD - 0x08 << 1 */
|
||||
#define AD5816G_DEF_THRESHOLD 0x64
|
||||
#define AD5816G_ID 0x24
|
||||
#define VCM_CODE_MASK 0x03ff
|
||||
|
||||
#define AD5816G_MODE_2_5M_SWITCH_CLOCK 0x14
|
||||
|
||||
#endif
|
||||
|
||||
65
drivers/staging/media/atomisp/i2c/imx/common.h
Normal file
65
drivers/staging/media/atomisp/i2c/imx/common.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifndef __COMMON_H__
|
||||
#define __COMMON_H__
|
||||
|
||||
#define MAX_FPS_OPTIONS_SUPPORTED 3
|
||||
#define I2C_MSG_LENGTH 0x2
|
||||
#define E2PROM_2ADDR 0x80000000
|
||||
#define E2PROM_ADDR_MASK 0x7fffffff
|
||||
|
||||
/* Defines for register writes and register array processing */
|
||||
#define IMX_BYTE_MAX 32
|
||||
#define IMX_SHORT_MAX 16
|
||||
#define I2C_RETRY_COUNT 5
|
||||
#define IMX_TOK_MASK 0xfff0
|
||||
|
||||
enum imx_tok_type {
|
||||
IMX_8BIT = 0x0001,
|
||||
IMX_16BIT = 0x0002,
|
||||
IMX_TOK_TERM = 0xf000, /* terminating token for reg list */
|
||||
IMX_TOK_DELAY = 0xfe00 /* delay token for reg list */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct imx_reg - MI sensor register format
|
||||
* @type: type of the register
|
||||
* @reg: 16-bit offset to register
|
||||
* @val: 8/16/32-bit register value
|
||||
*
|
||||
* Define a structure for sensor register initialization values
|
||||
*/
|
||||
struct imx_reg {
|
||||
enum imx_tok_type type;
|
||||
u16 sreg;
|
||||
u32 val; /* @set value for read/mod/write, @mask */
|
||||
};
|
||||
|
||||
struct imx_fps_setting {
|
||||
int fps;
|
||||
unsigned short pixels_per_line;
|
||||
unsigned short lines_per_frame;
|
||||
int mipi_freq; /* MIPI lane frequency in kHz */
|
||||
const struct imx_reg *regs; /* regs that the fps setting needs */
|
||||
};
|
||||
|
||||
struct imx_resolution {
|
||||
const struct imx_fps_setting fps_options[MAX_FPS_OPTIONS_SUPPORTED];
|
||||
u8 *desc;
|
||||
const struct imx_reg *regs;
|
||||
int res;
|
||||
int width;
|
||||
int height;
|
||||
int fps;
|
||||
unsigned short pixels_per_line;
|
||||
unsigned short lines_per_frame;
|
||||
int mipi_freq; /* MIPI lane frequency in kHz */
|
||||
unsigned short skip_frames;
|
||||
u8 bin_factor_x;
|
||||
u8 bin_factor_y;
|
||||
bool used;
|
||||
};
|
||||
|
||||
#define GROUPED_PARAMETER_HOLD_ENABLE {IMX_8BIT, 0x0104, 0x1}
|
||||
#define GROUPED_PARAMETER_HOLD_DISABLE {IMX_8BIT, 0x0104, 0x0}
|
||||
|
||||
int imx_write_reg(struct i2c_client *client, u16 data_length, u16 reg, u16 val);
|
||||
#endif
|
||||
218
drivers/staging/media/atomisp/i2c/imx/drv201.c
Normal file
218
drivers/staging/media/atomisp/i2c/imx/drv201.c
Normal file
@@ -0,0 +1,218 @@
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/kmod.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <media/v4l2-device.h>
|
||||
#include <asm/intel-mid.h>
|
||||
|
||||
#include "drv201.h"
|
||||
|
||||
static struct drv201_device drv201_dev;
|
||||
|
||||
static int drv201_i2c_rd8(struct i2c_client *client, u8 reg, u8 *val)
|
||||
{
|
||||
struct i2c_msg msg[2];
|
||||
u8 buf[2];
|
||||
buf[0] = reg;
|
||||
buf[1] = 0;
|
||||
|
||||
msg[0].addr = DRV201_VCM_ADDR;
|
||||
msg[0].flags = 0;
|
||||
msg[0].len = 1;
|
||||
msg[0].buf = &buf[0];
|
||||
|
||||
msg[1].addr = DRV201_VCM_ADDR;
|
||||
msg[1].flags = I2C_M_RD;
|
||||
msg[1].len = 1;
|
||||
msg[1].buf = &buf[1];
|
||||
*val = 0;
|
||||
if (i2c_transfer(client->adapter, msg, 2) != 2)
|
||||
return -EIO;
|
||||
*val = buf[1];
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int drv201_i2c_wr8(struct i2c_client *client, u8 reg, u8 val)
|
||||
{
|
||||
struct i2c_msg msg;
|
||||
u8 buf[2];
|
||||
buf[0] = reg;
|
||||
buf[1] = val;
|
||||
msg.addr = DRV201_VCM_ADDR;
|
||||
msg.flags = 0;
|
||||
msg.len = 2;
|
||||
msg.buf = &buf[0];
|
||||
if (i2c_transfer(client->adapter, &msg, 1) != 1)
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int drv201_i2c_wr16(struct i2c_client *client, u8 reg, u16 val)
|
||||
{
|
||||
struct i2c_msg msg;
|
||||
u8 buf[3];
|
||||
buf[0] = reg;
|
||||
buf[1] = (u8)(val >> 8);
|
||||
buf[2] = (u8)(val & 0xff);
|
||||
msg.addr = DRV201_VCM_ADDR;
|
||||
msg.flags = 0;
|
||||
msg.len = 3;
|
||||
msg.buf = &buf[0];
|
||||
if (i2c_transfer(client->adapter, &msg, 1) != 1)
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int drv201_vcm_power_up(struct v4l2_subdev *sd)
|
||||
{
|
||||
struct i2c_client *client = v4l2_get_subdevdata(sd);
|
||||
int ret;
|
||||
u8 value;
|
||||
|
||||
/* Enable power */
|
||||
ret = drv201_dev.platform_data->power_ctrl(sd, 1);
|
||||
if (ret)
|
||||
return ret;
|
||||
/* Wait for VBAT to stabilize */
|
||||
udelay(1);
|
||||
/*
|
||||
* Jiggle SCL pin to wake up device.
|
||||
* Drv201 expect SCL from low to high to wake device up.
|
||||
* So the 1st access to i2c would fail.
|
||||
* Using following function to wake device up.
|
||||
*/
|
||||
drv201_i2c_wr8(client, DRV201_CONTROL, DRV201_RESET);
|
||||
|
||||
/* Need 100us to transit from SHUTDOWN to STANDBY*/
|
||||
usleep_range(WAKEUP_DELAY_US, WAKEUP_DELAY_US * 10);
|
||||
|
||||
/* Reset device */
|
||||
ret = drv201_i2c_wr8(client, DRV201_CONTROL, DRV201_RESET);
|
||||
if (ret < 0)
|
||||
goto fail_powerdown;
|
||||
|
||||
/* Detect device */
|
||||
ret = drv201_i2c_rd8(client, DRV201_CONTROL, &value);
|
||||
if (ret < 0)
|
||||
goto fail_powerdown;
|
||||
if (value != DEFAULT_CONTROL_VAL) {
|
||||
ret = -ENXIO;
|
||||
goto fail_powerdown;
|
||||
}
|
||||
|
||||
drv201_dev.focus = DRV201_MAX_FOCUS_POS;
|
||||
drv201_dev.initialized = true;
|
||||
|
||||
return 0;
|
||||
fail_powerdown:
|
||||
drv201_dev.platform_data->power_ctrl(sd, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int drv201_vcm_power_down(struct v4l2_subdev *sd)
|
||||
{
|
||||
return drv201_dev.platform_data->power_ctrl(sd, 0);
|
||||
}
|
||||
|
||||
|
||||
int drv201_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
|
||||
{
|
||||
struct i2c_client *client = v4l2_get_subdevdata(sd);
|
||||
u16 data = val & VCM_CODE_MASK;
|
||||
|
||||
if (!drv201_dev.initialized)
|
||||
return -ENODEV;
|
||||
return drv201_i2c_wr16(client, DRV201_VCM_CURRENT, data);
|
||||
}
|
||||
|
||||
int drv201_t_focus_abs(struct v4l2_subdev *sd, s32 value)
|
||||
{
|
||||
int ret;
|
||||
|
||||
value = clamp(value, 0, DRV201_MAX_FOCUS_POS);
|
||||
ret = drv201_t_focus_vcm(sd, value);
|
||||
if (ret == 0) {
|
||||
drv201_dev.number_of_steps = value - drv201_dev.focus;
|
||||
drv201_dev.focus = value;
|
||||
getnstimeofday(&(drv201_dev.timestamp_t_focus_abs));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int drv201_t_focus_rel(struct v4l2_subdev *sd, s32 value)
|
||||
{
|
||||
return drv201_t_focus_abs(sd, drv201_dev.focus + value);
|
||||
}
|
||||
|
||||
int drv201_q_focus_status(struct v4l2_subdev *sd, s32 *value)
|
||||
{
|
||||
u32 status = 0;
|
||||
struct timespec temptime;
|
||||
const struct timespec timedelay = {
|
||||
0,
|
||||
min_t(u32, abs(drv201_dev.number_of_steps)*DELAY_PER_STEP_NS,
|
||||
DELAY_MAX_PER_STEP_NS),
|
||||
};
|
||||
|
||||
ktime_get_ts(&temptime);
|
||||
|
||||
temptime = timespec_sub(temptime, (drv201_dev.timestamp_t_focus_abs));
|
||||
|
||||
if (timespec_compare(&temptime, &timedelay) <= 0) {
|
||||
status |= ATOMISP_FOCUS_STATUS_MOVING;
|
||||
status |= ATOMISP_FOCUS_HP_IN_PROGRESS;
|
||||
} else {
|
||||
status |= ATOMISP_FOCUS_STATUS_ACCEPTS_NEW_MOVE;
|
||||
status |= ATOMISP_FOCUS_HP_COMPLETE;
|
||||
}
|
||||
*value = status;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int drv201_q_focus_abs(struct v4l2_subdev *sd, s32 *value)
|
||||
{
|
||||
s32 val;
|
||||
|
||||
drv201_q_focus_status(sd, &val);
|
||||
|
||||
if (val & ATOMISP_FOCUS_STATUS_MOVING)
|
||||
*value = drv201_dev.focus - drv201_dev.number_of_steps;
|
||||
else
|
||||
*value = drv201_dev.focus;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int drv201_t_vcm_slew(struct v4l2_subdev *sd, s32 value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int drv201_t_vcm_timing(struct v4l2_subdev *sd, s32 value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int drv201_vcm_init(struct v4l2_subdev *sd)
|
||||
{
|
||||
drv201_dev.platform_data = camera_get_af_platform_data();
|
||||
return (NULL == drv201_dev.platform_data) ? -ENODEV : 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
38
drivers/staging/media/atomisp/i2c/imx/drv201.h
Normal file
38
drivers/staging/media/atomisp/i2c/imx/drv201.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef __DRV201_H__
|
||||
#define __DRV201_H__
|
||||
|
||||
#include <linux/atomisp_platform.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/time.h>
|
||||
|
||||
#define DRV201_VCM_ADDR 0x0e
|
||||
|
||||
/* drv201 device structure */
|
||||
struct drv201_device {
|
||||
const struct camera_af_platform_data *platform_data;
|
||||
struct timespec timestamp_t_focus_abs;
|
||||
struct timespec focus_time; /* Time when focus was last time set */
|
||||
s32 focus; /* Current focus value */
|
||||
s16 number_of_steps;
|
||||
bool initialized; /* true if drv201 is detected */
|
||||
};
|
||||
|
||||
#define DRV201_INVALID_CONFIG 0xffffffff
|
||||
#define DRV201_MAX_FOCUS_POS 1023
|
||||
#define DELAY_PER_STEP_NS 1000000
|
||||
#define DELAY_MAX_PER_STEP_NS (1000000 * 1023)
|
||||
|
||||
#define DRV201_CONTROL 2
|
||||
#define DRV201_VCM_CURRENT 3
|
||||
#define DRV201_STATUS 5
|
||||
#define DRV201_MODE 6
|
||||
#define DRV201_VCM_FREQ 7
|
||||
|
||||
#define DEFAULT_CONTROL_VAL 2
|
||||
#define DRV201_RESET 1
|
||||
#define WAKEUP_DELAY_US 100
|
||||
#define VCM_CODE_MASK 0x03ff
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user