summaryrefslogtreecommitdiff
path: root/drivers/staging/media/atomisp/i2c/imx/ad5816g.h
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2017-02-17 19:55:17 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-06 11:39:54 +0300
commita49d25364dfb9f8a64037488a39ab1f56c5fa419 (patch)
treebd97382cf06a958cef045e75334fc622500ba209 /drivers/staging/media/atomisp/i2c/imx/ad5816g.h
parent372499b589ae5ec38d3dec88b72f2bde3b3790d4 (diff)
downloadlinux-a49d25364dfb9f8a64037488a39ab1f56c5fa419.tar.xz
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>
Diffstat (limited to 'drivers/staging/media/atomisp/i2c/imx/ad5816g.h')
-rw-r--r--drivers/staging/media/atomisp/i2c/imx/ad5816g.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/staging/media/atomisp/i2c/imx/ad5816g.h b/drivers/staging/media/atomisp/i2c/imx/ad5816g.h
new file mode 100644
index 000000000000..7410628c28c3
--- /dev/null
+++ b/drivers/staging/media/atomisp/i2c/imx/ad5816g.h
@@ -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
+