summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/axis-fifo/axis-fifo.c14
-rw-r--r--drivers/staging/gpib/common/iblib.c2
-rw-r--r--drivers/staging/iio/adc/ad7816.c2
-rw-r--r--drivers/staging/media/atomisp/i2c/Kconfig12
-rw-r--r--drivers/staging/media/atomisp/i2c/Makefile1
-rw-r--r--drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c1612
-rw-r--r--drivers/staging/media/atomisp/i2c/mt9m114.h1768
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_cmd.c73
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_compat_css20.c2
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.h244
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_csi2.c2
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c92
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_internal.h10
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_ioctl.c30
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_ioctl.h4
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp_v4l2.c60
-rw-r--r--drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h2
-rw-r--r--drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2_types.h2
-rw-r--r--drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c2
-rw-r--r--drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c3
-rw-r--r--drivers/staging/media/rkvdec/rkvdec-h264.c64
-rw-r--r--drivers/staging/media/rkvdec/rkvdec.c239
-rw-r--r--drivers/staging/media/rkvdec/rkvdec.h18
-rw-r--r--drivers/staging/media/starfive/camss/stf-isp.c2
-rw-r--r--drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c1
25 files changed, 369 insertions, 3892 deletions
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index 7540c20090c7..351f983ef914 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -393,16 +393,14 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
bytes_available = ioread32(fifo->base_addr + XLLF_RLR_OFFSET);
if (!bytes_available) {
- dev_err(fifo->dt_device, "received a packet of length 0 - fifo core will be reset\n");
- reset_ip_core(fifo);
+ dev_err(fifo->dt_device, "received a packet of length 0\n");
ret = -EIO;
goto end_unlock;
}
if (bytes_available > len) {
- dev_err(fifo->dt_device, "user read buffer too small (available bytes=%zu user buffer bytes=%zu) - fifo core will be reset\n",
+ dev_err(fifo->dt_device, "user read buffer too small (available bytes=%zu user buffer bytes=%zu)\n",
bytes_available, len);
- reset_ip_core(fifo);
ret = -EINVAL;
goto end_unlock;
}
@@ -411,8 +409,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
/* this probably can't happen unless IP
* registers were previously mishandled
*/
- dev_err(fifo->dt_device, "received a packet that isn't word-aligned - fifo core will be reset\n");
- reset_ip_core(fifo);
+ dev_err(fifo->dt_device, "received a packet that isn't word-aligned\n");
ret = -EIO;
goto end_unlock;
}
@@ -433,7 +430,6 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
if (copy_to_user(buf + copied * sizeof(u32), tmp_buf,
copy * sizeof(u32))) {
- reset_ip_core(fifo);
ret = -EFAULT;
goto end_unlock;
}
@@ -542,7 +538,6 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
if (copy_from_user(tmp_buf, buf + copied * sizeof(u32),
copy * sizeof(u32))) {
- reset_ip_core(fifo);
ret = -EFAULT;
goto end_unlock;
}
@@ -775,9 +770,6 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
goto end;
}
- /* IP sets TDFV to fifo depth - 4 so we will do the same */
- fifo->tx_fifo_depth -= 4;
-
ret = get_dts_property(fifo, "xlnx,use-rx-data", &fifo->has_rx_fifo);
if (ret) {
dev_err(fifo->dt_device, "missing xlnx,use-rx-data property\n");
diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/common/iblib.c
index b297261818f2..432540e1bc9a 100644
--- a/drivers/staging/gpib/common/iblib.c
+++ b/drivers/staging/gpib/common/iblib.c
@@ -611,7 +611,7 @@ static void start_wait_timer(struct wait_info *winfo)
static void remove_wait_timer(struct wait_info *winfo)
{
timer_delete_sync(&winfo->timer);
- destroy_timer_on_stack(&winfo->timer);
+ timer_destroy_on_stack(&winfo->timer);
}
/*
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 6c14d7bcdd67..081b17f49863 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -136,7 +136,7 @@ static ssize_t ad7816_store_mode(struct device *dev,
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad7816_chip_info *chip = iio_priv(indio_dev);
- if (strcmp(buf, "full")) {
+ if (strcmp(buf, "full") == 0) {
gpiod_set_value(chip->rdwr_pin, 1);
chip->mode = AD7816_FULL;
} else {
diff --git a/drivers/staging/media/atomisp/i2c/Kconfig b/drivers/staging/media/atomisp/i2c/Kconfig
index f5ab23592f29..4f46182da58b 100644
--- a/drivers/staging/media/atomisp/i2c/Kconfig
+++ b/drivers/staging/media/atomisp/i2c/Kconfig
@@ -27,18 +27,6 @@ config VIDEO_ATOMISP_GC2235
It currently only works with the atomisp driver.
-config VIDEO_ATOMISP_MT9M114
- tristate "Aptina mt9m114 sensor support"
- depends on ACPI
- depends on I2C && VIDEO_DEV
- 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_ATOMISP_GC0310
tristate "GC0310 sensor support"
depends on ACPI
diff --git a/drivers/staging/media/atomisp/i2c/Makefile b/drivers/staging/media/atomisp/i2c/Makefile
index 021a7ea0a075..e1637417e5c5 100644
--- a/drivers/staging/media/atomisp/i2c/Makefile
+++ b/drivers/staging/media/atomisp/i2c/Makefile
@@ -3,7 +3,6 @@
# Makefile for sensor drivers
#
-obj-$(CONFIG_VIDEO_ATOMISP_MT9M114) += atomisp-mt9m114.o
obj-$(CONFIG_VIDEO_ATOMISP_GC2235) += atomisp-gc2235.o
obj-$(CONFIG_VIDEO_ATOMISP_OV2722) += atomisp-ov2722.o
obj-$(CONFIG_VIDEO_ATOMISP_GC0310) += atomisp-gc0310.o
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
deleted file mode 100644
index 4658aeeb88fd..000000000000
--- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
+++ /dev/null
@@ -1,1612 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Support for mt9m114 Camera Sensor.
- *
- * Copyright (c) 2010 Intel Corporation. All Rights Reserved.
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/kmod.h>
-#include <linux/device.h>
-#include <linux/fs.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
-#include <linux/i2c.h>
-#include <linux/acpi.h>
-#include <linux/mutex.h>
-#include "../include/linux/atomisp_gmin_platform.h"
-#include <media/v4l2-device.h>
-
-#include "mt9m114.h"
-
-#define to_mt9m114_sensor(s) container_of(s, struct mt9m114_device, sd)
-
-/*
- * TODO: use debug parameter to actually define when debug messages should
- * be printed.
- */
-static int debug;
-static int aaalock;
-module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, "Debug level (0-1)");
-
-static int mt9m114_t_vflip(struct v4l2_subdev *sd, int value);
-static int mt9m114_t_hflip(struct v4l2_subdev *sd, int value);
-static int mt9m114_wait_state(struct i2c_client *client, int timeout);
-
-static int
-mt9m114_read_reg(struct i2c_client *client, u16 data_length, u32 reg, u32 *val)
-{
- int err;
- struct i2c_msg msg[2];
- unsigned char data[4];
-
- if (!client->adapter) {
- v4l2_err(client, "%s error, no client->adapter\n", __func__);
- return -ENODEV;
- }
-
- if (data_length != MISENSOR_8BIT && data_length != MISENSOR_16BIT
- && data_length != MISENSOR_32BIT) {
- v4l2_err(client, "%s error, invalid data length\n", __func__);
- return -EINVAL;
- }
-
- msg[0].addr = client->addr;
- msg[0].flags = 0;
- msg[0].len = MSG_LEN_OFFSET;
- msg[0].buf = data;
-
- /* high byte goes out first */
- data[0] = (u16)(reg >> 8);
- data[1] = (u16)(reg & 0xff);
-
- msg[1].addr = client->addr;
- msg[1].len = data_length;
- msg[1].flags = I2C_M_RD;
- msg[1].buf = data;
-
- err = i2c_transfer(client->adapter, msg, 2);
-
- if (err >= 0) {
- *val = 0;
- /* high byte comes first */
- if (data_length == MISENSOR_8BIT)
- *val = data[0];
- else if (data_length == MISENSOR_16BIT)
- *val = data[1] + (data[0] << 8);
- else
- *val = data[3] + (data[2] << 8) +
- (data[1] << 16) + (data[0] << 24);
-
- return 0;
- }
-
- dev_err(&client->dev, "read from offset 0x%x error %d", reg, err);
- return err;
-}
-
-static int
-mt9m114_write_reg(struct i2c_client *client, u16 data_length, u16 reg, u32 val)
-{
- int num_msg;
- struct i2c_msg msg;
- unsigned char data[6] = {0};
- __be16 *wreg;
- int retry = 0;
-
- if (!client->adapter) {
- v4l2_err(client, "%s error, no client->adapter\n", __func__);
- return -ENODEV;
- }
-
- if (data_length != MISENSOR_8BIT && data_length != MISENSOR_16BIT
- && data_length != MISENSOR_32BIT) {
- v4l2_err(client, "%s error, invalid data_length\n", __func__);
- return -EINVAL;
- }
-
- memset(&msg, 0, sizeof(msg));
-
-again:
- msg.addr = client->addr;
- msg.flags = 0;
- msg.len = 2 + data_length;
- msg.buf = data;
-
- /* high byte goes out first */
- wreg = (void *)data;
- *wreg = cpu_to_be16(reg);
-
- if (data_length == MISENSOR_8BIT) {
- data[2] = (u8)(val);
- } else if (data_length == MISENSOR_16BIT) {
- u16 *wdata = (void *)&data[2];
-
- *wdata = be16_to_cpu(*(__be16 *)&data[2]);
- } else {
- /* MISENSOR_32BIT */
- u32 *wdata = (void *)&data[2];
-
- *wdata = be32_to_cpu(*(__be32 *)&data[2]);
- }
-
- num_msg = i2c_transfer(client->adapter, &msg, 1);
-
- /*
- * HACK: Need some delay here for Rev 2 sensors otherwise some
- * registers do not seem to load correctly.
- */
- mdelay(1);
-
- if (num_msg >= 0)
- return 0;
-
- dev_err(&client->dev, "write error: wrote 0x%x to offset 0x%x error %d",
- val, reg, num_msg);
- if (retry <= I2C_RETRY_COUNT) {
- dev_dbg(&client->dev, "retrying... %d", retry);
- retry++;
- msleep(20);
- goto again;
- }
-
- return num_msg;
-}
-
-/**
- * misensor_rmw_reg - Read/Modify/Write a value to a register in the sensor
- * device
- * @client: i2c driver client structure
- * @data_length: 8/16/32-bits length
- * @reg: register address
- * @mask: masked out bits
- * @set: bits set
- *
- * Read/modify/write a value to a register in the sensor device.
- * Returns zero if successful, or non-zero otherwise.
- */
-static int
-misensor_rmw_reg(struct i2c_client *client, u16 data_length, u16 reg,
- u32 mask, u32 set)
-{
- int err;
- u32 val;
-
- /* Exit when no mask */
- if (mask == 0)
- return 0;
-
- /* @mask must not exceed data length */
- switch (data_length) {
- case MISENSOR_8BIT:
- if (mask & ~0xff)
- return -EINVAL;
- break;
- case MISENSOR_16BIT:
- if (mask & ~0xffff)
- return -EINVAL;
- break;
- case MISENSOR_32BIT:
- break;
- default:
- /* Wrong @data_length */
- return -EINVAL;
- }
-
- err = mt9m114_read_reg(client, data_length, reg, &val);
- if (err) {
- v4l2_err(client, "%s error exit, read failed\n", __func__);
- return -EINVAL;
- }
-
- val &= ~mask;
-
- /*
- * Perform the OR function if the @set exists.
- * Shift @set value to target bit location. @set should set only
- * bits included in @mask.
- *
- * REVISIT: This function expects @set to be non-shifted. Its shift
- * value is then defined to be equal to mask's LSB position.
- * How about to inform values in their right offset position and avoid
- * this unneeded shift operation?
- */
- set <<= ffs(mask) - 1;
- val |= set & mask;
-
- err = mt9m114_write_reg(client, data_length, reg, val);
- if (err) {
- v4l2_err(client, "%s error exit, write failed\n", __func__);
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int __mt9m114_flush_reg_array(struct i2c_client *client,
- struct mt9m114_write_ctrl *ctrl)
-{
- struct i2c_msg msg;
- const int num_msg = 1;
- int ret;
- int retry = 0;
- __be16 *data16 = (void *)&ctrl->buffer.addr;
-
- if (ctrl->index == 0)
- return 0;
-
-again:
- msg.addr = client->addr;
- msg.flags = 0;
- msg.len = 2 + ctrl->index;
- *data16 = cpu_to_be16(ctrl->buffer.addr);
- msg.buf = (u8 *)&ctrl->buffer;
-
- ret = i2c_transfer(client->adapter, &msg, num_msg);
- if (ret != num_msg) {
- if (++retry <= I2C_RETRY_COUNT) {
- dev_dbg(&client->dev, "retrying... %d\n", retry);
- msleep(20);
- goto again;
- }
- dev_err(&client->dev, "%s: i2c transfer error\n", __func__);
- return -EIO;
- }
-
- ctrl->index = 0;
-
- /*
- * REVISIT: Previously we had a delay after writing data to sensor.
- * But it was removed as our tests have shown it is not necessary
- * anymore.
- */
-
- return 0;
-}
-
-static int __mt9m114_buf_reg_array(struct i2c_client *client,
- struct mt9m114_write_ctrl *ctrl,
- const struct misensor_reg *next)
-{
- __be16 *data16;
- __be32 *data32;
- int err;
-
- /* Insufficient buffer? Let's flush and get more free space. */
- if (ctrl->index + next->length >= MT9M114_MAX_WRITE_BUF_SIZE) {
- err = __mt9m114_flush_reg_array(client, ctrl);
- if (err)
- return err;
- }
-
- switch (next->length) {
- case MISENSOR_8BIT:
- ctrl->buffer.data[ctrl->index] = (u8)next->val;
- break;
- case MISENSOR_16BIT:
- data16 = (__be16 *)&ctrl->buffer.data[ctrl->index];
- *data16 = cpu_to_be16((u16)next->val);
- break;
- case MISENSOR_32BIT:
- data32 = (__be32 *)&ctrl->buffer.data[ctrl->index];
- *data32 = cpu_to_be32(next->val);
- break;
- default:
- return -EINVAL;
- }
-
- /* When first item is added, we need to store its starting address */
- if (ctrl->index == 0)
- ctrl->buffer.addr = next->reg;
-
- ctrl->index += next->length;
-
- return 0;
-}
-
-static int
-__mt9m114_write_reg_is_consecutive(struct i2c_client *client,
- struct mt9m114_write_ctrl *ctrl,
- const struct misensor_reg *next)
-{
- if (ctrl->index == 0)
- return 1;
-
- return ctrl->buffer.addr + ctrl->index == next->reg;
-}
-
-/*
- * mt9m114_write_reg_array - Initializes a list of mt9m114 registers
- * @client: i2c driver client structure
- * @reglist: list of registers to be written
- * @poll: completion polling requirement
- * This function initializes a list of registers. When consecutive addresses
- * are found in a row on the list, this function creates a buffer and sends
- * consecutive data in a single i2c_transfer().
- *
- * __mt9m114_flush_reg_array, __mt9m114_buf_reg_array() and
- * __mt9m114_write_reg_is_consecutive() are internal functions to
- * mt9m114_write_reg_array() and should be not used anywhere else.
- *
- */
-static int mt9m114_write_reg_array(struct i2c_client *client,
- const struct misensor_reg *reglist,
- int poll)
-{
- const struct misensor_reg *next = reglist;
- struct mt9m114_write_ctrl ctrl;
- int err;
-
- if (poll == PRE_POLLING) {
- err = mt9m114_wait_state(client, MT9M114_WAIT_STAT_TIMEOUT);
- if (err)
- return err;
- }
-
- ctrl.index = 0;
- for (; next->length != MISENSOR_TOK_TERM; next++) {
- switch (next->length & MISENSOR_TOK_MASK) {
- case MISENSOR_TOK_DELAY:
- err = __mt9m114_flush_reg_array(client, &ctrl);
- if (err)
- return err;
- msleep(next->val);
- break;
- case MISENSOR_TOK_RMW:
- err = __mt9m114_flush_reg_array(client, &ctrl);
- err |= misensor_rmw_reg(client,
- next->length &
- ~MISENSOR_TOK_RMW,
- next->reg, next->val,
- next->val2);
- if (err) {
- dev_err(&client->dev, "%s read err. aborted\n",
- __func__);
- return -EINVAL;
- }
- break;
- default:
- /*
- * If next address is not consecutive, data needs to be
- * flushed before proceed.
- */
- if (!__mt9m114_write_reg_is_consecutive(client, &ctrl,
- next)) {
- err = __mt9m114_flush_reg_array(client, &ctrl);
- if (err)
- return err;
- }
- err = __mt9m114_buf_reg_array(client, &ctrl, next);
- if (err) {
- v4l2_err(client, "%s: write error, aborted\n",
- __func__);
- return err;
- }
- break;
- }
- }
-
- err = __mt9m114_flush_reg_array(client, &ctrl);
- if (err)
- return err;
-
- if (poll == POST_POLLING)
- return mt9m114_wait_state(client, MT9M114_WAIT_STAT_TIMEOUT);
-
- return 0;
-}
-
-static int mt9m114_wait_state(struct i2c_client *client, int timeout)
-{
- int ret;
- unsigned int val;
-
- while (timeout-- > 0) {
- ret = mt9m114_read_reg(client, MISENSOR_16BIT, 0x0080, &val);
- if (ret)
- return ret;
- if ((val & 0x2) == 0)
- return 0;
- msleep(20);
- }
-
- return -EINVAL;
-}
-
-static int mt9m114_set_suspend(struct v4l2_subdev *sd)
-{
- struct i2c_client *client = v4l2_get_subdevdata(sd);
-
- return mt9m114_write_reg_array(client,
- mt9m114_standby_reg, POST_POLLING);
-}
-
-static int mt9m114_init_common(struct v4l2_subdev *sd)
-{
- struct i2c_client *client = v4l2_get_subdevdata(sd);
-
- return mt9m114_write_reg_array(client, mt9m114_common, PRE_POLLING);
-}
-
-static int power_ctrl(struct v4l2_subdev *sd, bool flag)
-{
- int ret;
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
-
- if (!dev || !dev->platform_data)
- return -ENODEV;
-
- if (flag) {
- ret = dev->platform_data->v2p8_ctrl(sd, 1);
- if (ret == 0) {
- ret = dev->platform_data->v1p8_ctrl(sd, 1);
- if (ret)
- ret = dev->platform_data->v2p8_ctrl(sd, 0);
- }
- } else {
- ret = dev->platform_data->v2p8_ctrl(sd, 0);
- ret = dev->platform_data->v1p8_ctrl(sd, 0);
- }
- return ret;
-}
-
-static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
-{
- int ret;
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
-
- if (!dev || !dev->platform_data)
- return -ENODEV;
-
- /*
- * Note: current modules wire only one GPIO signal (RESET#),
- * but the schematic wires up two to the connector. BIOS
- * versions have been unfortunately inconsistent with which
- * ACPI index RESET# is on, so hit both
- */
-
- if (flag) {
- ret = dev->platform_data->gpio0_ctrl(sd, 0);
- ret = dev->platform_data->gpio1_ctrl(sd, 0);
- msleep(60);
- ret |= dev->platform_data->gpio0_ctrl(sd, 1);
- ret |= dev->platform_data->gpio1_ctrl(sd, 1);
- } else {
- ret = dev->platform_data->gpio0_ctrl(sd, 0);
- ret = dev->platform_data->gpio1_ctrl(sd, 0);
- }
- return ret;
-}
-
-static int power_up(struct v4l2_subdev *sd)
-{
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
- struct i2c_client *client = v4l2_get_subdevdata(sd);
- int ret;
-
- if (!dev->platform_data) {
- dev_err(&client->dev, "no camera_sensor_platform_data");
- return -ENODEV;
- }
-
- /* power control */
- ret = power_ctrl(sd, 1);
- if (ret)
- goto fail_power;
-
- /* flis clock control */
- ret = dev->platform_data->flisclk_ctrl(sd, 1);
- if (ret)
- goto fail_clk;
-
- /* gpio ctrl */
- ret = gpio_ctrl(sd, 1);
- if (ret)
- dev_err(&client->dev, "gpio failed 1\n");
- /*
- * according to DS, 44ms is needed between power up and first i2c
- * commend
- */
- msleep(50);
-
- return 0;
-
-fail_clk:
- dev->platform_data->flisclk_ctrl(sd, 0);
-fail_power:
- power_ctrl(sd, 0);
- dev_err(&client->dev, "sensor power-up failed\n");
-
- return ret;
-}
-
-static int power_down(struct v4l2_subdev *sd)
-{
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
- struct i2c_client *client = v4l2_get_subdevdata(sd);
- int ret;
-
- if (!dev->platform_data) {
- dev_err(&client->dev, "no camera_sensor_platform_data");
- return -ENODEV;
- }
-
- ret = dev->platform_data->flisclk_ctrl(sd, 0);
- if (ret)
- dev_err(&client->dev, "flisclk failed\n");
-
- /* gpio ctrl */
- ret = gpio_ctrl(sd, 0);
- if (ret)
- dev_err(&client->dev, "gpio failed 1\n");
-
- /* power control */
- ret = power_ctrl(sd, 0);
- if (ret)
- dev_err(&client->dev, "vprog failed.\n");
-
- /* according to DS, 20ms is needed after power down */
- msleep(20);
-
- return ret;
-}
-
-static int mt9m114_s_power(struct v4l2_subdev *sd, int power)
-{
- if (power == 0)
- return power_down(sd);
-
- if (power_up(sd))
- return -EINVAL;
-
- return mt9m114_init_common(sd);
-}
-
-static int mt9m114_res2size(struct v4l2_subdev *sd, int *h_size, int *v_size)
-{
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
- unsigned short hsize;
- unsigned short vsize;
-
- switch (dev->res) {
- case MT9M114_RES_736P:
- hsize = MT9M114_RES_736P_SIZE_H;
- vsize = MT9M114_RES_736P_SIZE_V;
- break;
- case MT9M114_RES_864P:
- hsize = MT9M114_RES_864P_SIZE_H;
- vsize = MT9M114_RES_864P_SIZE_V;
- break;
- case MT9M114_RES_960P:
- hsize = MT9M114_RES_960P_SIZE_H;
- vsize = MT9M114_RES_960P_SIZE_V;
- break;
- default:
- v4l2_err(sd, "%s: Resolution 0x%08x unknown\n", __func__,
- dev->res);
- return -EINVAL;
- }
-
- if (h_size)
- *h_size = hsize;
- if (v_size)
- *v_size = vsize;
-
- return 0;
-}
-
-static int mt9m114_get_fmt(struct v4l2_subdev *sd,
- struct v4l2_subdev_state *sd_state,
- struct v4l2_subdev_format *format)
-{
- struct v4l2_mbus_framefmt *fmt = &format->format;
- int width, height;
- int ret;
-
- if (format->pad)
- return -EINVAL;
- fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
-
- ret = mt9m114_res2size(sd, &width, &height);
- if (ret)
- return ret;
- fmt->width = width;
- fmt->height = height;
-
- return 0;
-}
-
-static int mt9m114_set_fmt(struct v4l2_subdev *sd,
- struct v4l2_subdev_state *sd_state,
- struct v4l2_subdev_format *format)
-{
- struct v4l2_mbus_framefmt *fmt = &format->format;
- struct i2c_client *c = v4l2_get_subdevdata(sd);
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
- struct mt9m114_res_struct *res;
- u32 width = fmt->width;
- u32 height = fmt->height;
- struct camera_mipi_info *mt9m114_info = NULL;
-
- int ret;
-
- if (format->pad)
- return -EINVAL;
- dev->streamon = 0;
- dev->first_exp = MT9M114_DEFAULT_FIRST_EXP;
-
- mt9m114_info = v4l2_get_subdev_hostdata(sd);
- if (!mt9m114_info)
- return -EINVAL;
-
- res = v4l2_find_nearest_size(mt9m114_res,
- ARRAY_SIZE(mt9m114_res), width,
- height, fmt->width, fmt->height);
- if (!res)
- res = &mt9m114_res[N_RES - 1];
-
- fmt->width = res->width;
- fmt->height = res->height;
- fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
-
- if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
- *v4l2_subdev_state_get_format(sd_state, 0) = *fmt;
- return 0;
- }
-
- switch (res->res) {
- case MT9M114_RES_736P:
- ret = mt9m114_write_reg_array(c, mt9m114_736P_init, NO_POLLING);
- ret += misensor_rmw_reg(c, MISENSOR_16BIT, MISENSOR_READ_MODE,
- MISENSOR_R_MODE_MASK, MISENSOR_NORMAL_SET);
- break;
- case MT9M114_RES_864P:
- ret = mt9m114_write_reg_array(c, mt9m114_864P_init, NO_POLLING);
- ret += misensor_rmw_reg(c, MISENSOR_16BIT, MISENSOR_READ_MODE,
- MISENSOR_R_MODE_MASK, MISENSOR_NORMAL_SET);
- break;
- case MT9M114_RES_960P:
- ret = mt9m114_write_reg_array(c, mt9m114_976P_init, NO_POLLING);
- /* set sensor read_mode to Normal */
- ret += misensor_rmw_reg(c, MISENSOR_16BIT, MISENSOR_READ_MODE,
- MISENSOR_R_MODE_MASK, MISENSOR_NORMAL_SET);
- break;
- default:
- v4l2_err(sd, "set resolution: %d failed!\n", res->res);
- return -EINVAL;
- }
-
- if (ret)
- return -EINVAL;
-
- ret = mt9m114_write_reg_array(c, mt9m114_chgstat_reg, POST_POLLING);
- if (ret < 0)
- return ret;
-
- if (mt9m114_set_suspend(sd))
- return -EINVAL;
-
- if (dev->res != res->res) {
- int index;
-
- /* Switch to different size */
- if (width <= 640) {
- dev->nctx = 0x00; /* Set for context A */
- } else {
- /*
- * Context B is used for resolutions larger than 640x480
- * Using YUV for Context B.
- */
- dev->nctx = 0x01; /* set for context B */
- }
-
- /*
- * Marked current sensor res as being "used"
- *
- * REVISIT: We don't need to use an "used" field on each mode
- * list entry to know which mode is selected. If this
- * information is really necessary, how about to use a single
- * variable on sensor dev struct?
- */
- for (index = 0; index < N_RES; index++) {
- if ((width == mt9m114_res[index].width) &&
- (height == mt9m114_res[index].height)) {
- mt9m114_res[index].used = true;
- continue;
- }
- mt9m114_res[index].used = false;
- }
- }
- /*
- * mt9m114 - we don't poll for context switch
- * because it does not happen with streaming disabled.
- */
- dev->res = res->res;
-
- fmt->width = width;
- fmt->height = height;
- fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
- return 0;
-}
-
-/* Horizontal flip the image. */
-static int mt9m114_g_hflip(struct v4l2_subdev *sd, s32 *val)
-{
- struct i2c_client *c = v4l2_get_subdevdata(sd);
- int ret;
- u32 data;
-
- ret = mt9m114_read_reg(c, MISENSOR_16BIT,
- (u32)MISENSOR_READ_MODE, &data);
- if (ret)
- return ret;
- *val = !!(data & MISENSOR_HFLIP_MASK);
-
- return 0;
-}
-
-static int mt9m114_g_vflip(struct v4l2_subdev *sd, s32 *val)
-{
- struct i2c_client *c = v4l2_get_subdevdata(sd);
- int ret;
- u32 data;
-
- ret = mt9m114_read_reg(c, MISENSOR_16BIT,
- (u32)MISENSOR_READ_MODE, &data);
- if (ret)
- return ret;
- *val = !!(data & MISENSOR_VFLIP_MASK);
-
- return 0;
-}
-
-static long mt9m114_s_exposure(struct v4l2_subdev *sd,
- struct atomisp_exposure *exposure)
-{
- struct i2c_client *client = v4l2_get_subdevdata(sd);
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
- int ret = 0;
- unsigned int coarse_integration = 0;
- unsigned int f_lines = 0;
- unsigned int frame_len_lines = 0; /* ExposureTime.FrameLengthLines; */
- unsigned int analog_gain, digital_gain;
- u32 analog_gain_to_write = 0;
-
- dev_dbg(&client->dev, "%s(0x%X 0x%X 0x%X)\n", __func__,
- exposure->integration_time[0], exposure->gain[0],
- exposure->gain[1]);
-
- coarse_integration = exposure->integration_time[0];
- /*
- * fine_integration = ExposureTime.FineIntegrationTime;
- * frame_len_lines = ExposureTime.FrameLengthLines;
- */
- f_lines = mt9m114_res[dev->res].lines_per_frame;
- analog_gain = exposure->gain[0];
- digital_gain = exposure->gain[1];
- if (!dev->streamon) {
- /*Save the first exposure values while stream is off*/
- dev->first_exp = coarse_integration;
- dev->first_gain = analog_gain;
- dev->first_diggain = digital_gain;
- }
- /* digital_gain = 0x400 * (((u16) digital_gain) >> 8) + */
- /* ((unsigned int)(0x400 * (((u16) digital_gain) & 0xFF)) >>8); */
-
- /* set frame length */
- if (f_lines < coarse_integration + 6)
- f_lines = coarse_integration + 6;
- if (f_lines < frame_len_lines)
- f_lines = frame_len_lines;
- ret = mt9m114_write_reg(client, MISENSOR_16BIT, 0x300A, f_lines);
- if (ret) {
- v4l2_err(client, "%s: fail to set f_lines\n", __func__);
- return -EINVAL;
- }
-
- /* set coarse integration */
- /*
- * 3A provide real exposure time.
- * should not translate to any value here.
- */
- ret = mt9m114_write_reg(client, MISENSOR_16BIT,
- REG_EXPO_COARSE, (u16)(coarse_integration));
- if (ret) {
- v4l2_err(client, "%s: fail to set exposure time\n", __func__);
- return -EINVAL;
- }
-
- /*
- * set analog/digital gain
- switch(analog_gain)
- {
- case 0:
- analog_gain_to_write = 0x0;
- break;
- case 1:
- analog_gain_to_write = 0x20;
- break;
- case 2:
- analog_gain_to_write = 0x60;
- break;
- case 4:
- analog_gain_to_write = 0xA0;
- break;
- case 8:
- analog_gain_to_write = 0xE0;
- break;
- default:
- analog_gain_to_write = 0x20;
- break;
- }
- */
- if (digital_gain >= 16 || digital_gain <= 1)
- digital_gain = 1;
- /*
- * analog_gain_to_write = (u16)((digital_gain << 12)
- * | analog_gain_to_write);
- */
- analog_gain_to_write = (u16)((digital_gain << 12) | (u16)analog_gain);
- ret = mt9m114_write_reg(client, MISENSOR_16BIT,
- REG_GAIN, analog_gain_to_write);
- if (ret) {
- v4l2_err(client, "%s: fail to set analog_gain_to_write\n",
- __func__);
- return -EINVAL;
- }
-
- return ret;
-}
-
-static long mt9m114_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
-{
- switch (cmd) {
- case ATOMISP_IOC_S_EXPOSURE:
- return mt9m114_s_exposure(sd, arg);
- default:
- return -EINVAL;
- }
-
- return 0;
-}
-
-/*
- * This returns the exposure time being used. This should only be used
- * for filling in EXIF data, not for actual image processing.
- */
-static int mt9m114_g_exposure(struct v4l2_subdev *sd, s32 *value)
-{
- struct i2c_client *client = v4l2_get_subdevdata(sd);
- u32 coarse;
- int ret;
-
- /* the fine integration time is currently not calculated */
- ret = mt9m114_read_reg(client, MISENSOR_16BIT,
- REG_EXPO_COARSE, &coarse);
- if (ret)
- return ret;
-
- *value = coarse;
- return 0;
-}
-
-/*
- * This function will return the sensor supported max exposure zone number.
- * the sensor which supports max exposure zone number is 1.
- */
-static int mt9m114_g_exposure_zone_num(struct v4l2_subdev *sd, s32 *val)
-{
- *val = 1;
-
- return 0;
-}
-
-/*
- * set exposure metering, average/center_weighted/spot/matrix.
- */
-static int mt9m114_s_exposure_metering(struct v4l2_subdev *sd, s32 val)
-{
- struct i2c_client *client = v4l2_get_subdevdata(sd);
- int ret;
-
- switch (val) {
- case V4L2_EXPOSURE_METERING_SPOT:
- ret = mt9m114_write_reg_array(client, mt9m114_exp_average,
- NO_POLLING);
- if (ret) {
- dev_err(&client->dev, "write exp_average reg err.\n");
- return ret;
- }
- break;
- case V4L2_EXPOSURE_METERING_CENTER_WEIGHTED:
- default:
- ret = mt9m114_write_reg_array(client, mt9m114_exp_center,
- NO_POLLING);
- if (ret) {
- dev_err(&client->dev, "write exp_default reg err");
- return ret;
- }
- }
-
- return 0;
-}
-
-/*
- * This function is for touch exposure feature.
- */
-static int mt9m114_s_exposure_selection(struct v4l2_subdev *sd,
- struct v4l2_subdev_state *sd_state,
- struct v4l2_subdev_selection *sel)
-{
- struct i2c_client *client = v4l2_get_subdevdata(sd);
- struct misensor_reg exp_reg;
- int width, height;
- int grid_width, grid_height;
- int grid_left, grid_top, grid_right, grid_bottom;
- int win_left, win_top, win_right, win_bottom;
- int i, j;
- int ret;
-
- if (sel->which != V4L2_SUBDEV_FORMAT_TRY &&
- sel->which != V4L2_SUBDEV_FORMAT_ACTIVE)
- return -EINVAL;
-
- grid_left = sel->r.left;
- grid_top = sel->r.top;
- grid_right = sel->r.left + sel->r.width - 1;
- grid_bottom = sel->r.top + sel->r.height - 1;
-
- ret = mt9m114_res2size(sd, &width, &height);
- if (ret)
- return ret;
-
- grid_width = width / 5;
- grid_height = height / 5;
-
- if (grid_width && grid_height) {
- win_left = grid_left / grid_width;
- win_top = grid_top / grid_height;
- win_right = grid_right / grid_width;
- win_bottom = grid_bottom / grid_height;
- } else {
- dev_err(&client->dev, "Incorrect exp grid.\n");
- return -EINVAL;
- }
-
- win_left = clamp_t(int, win_left, 0, 4);
- win_top = clamp_t(int, win_top, 0, 4);
- win_right = clamp_t(int, win_right, 0, 4);
- win_bottom = clamp_t(int, win_bottom, 0, 4);
-
- ret = mt9m114_write_reg_array(client, mt9m114_exp_average, NO_POLLING);
- if (ret) {
- dev_err(&client->dev, "write exp_average reg err.\n");
- return ret;
- }
-
- for (i = win_top; i <= win_bottom; i++) {
- for (j = win_left; j <= win_right; j++) {
- exp_reg = mt9m114_exp_win[i][j];
-
- ret = mt9m114_write_reg(client, exp_reg.length,
- exp_reg.reg, exp_reg.val);
- if (ret) {
- dev_err(&client->dev, "write exp_reg err.\n");
- return ret;
- }
- }
- }
-
- return 0;
-}
-
-static int mt9m114_s_ev(struct v4l2_subdev *sd, s32 val)
-{
- struct i2c_client *c = v4l2_get_subdevdata(sd);
- s32 luma = 0x37;
- int err;
-
- /*
- * EV value only support -2 to 2
- * 0: 0x37, 1:0x47, 2:0x57, -1:0x27, -2:0x17
- */
- if (val < -2 || val > 2)
- return -EINVAL;
- luma += 0x10 * val;
- dev_dbg(&c->dev, "%s val:%d luma:0x%x\n", __func__, val, luma);
- err = mt9m114_write_reg(c, MISENSOR_16BIT, 0x098E, 0xC87A);
- if (err) {
- dev_err(&c->dev, "%s logic addr access error\n", __func__);
- return err;
- }
- err = mt9m114_write_reg(c, MISENSOR_8BIT, 0xC87A, (u32)luma);
- if (err) {
- dev_err(&c->dev, "%s write target_average_luma failed\n",
- __func__);
- return err;
- }
- udelay(10);
-
- return 0;
-}
-
-static int mt9m114_g_ev(struct v4l2_subdev *sd, s32 *val)
-{
- struct i2c_client *c = v4l2_get_subdevdata(sd);
- int err;
- u32 luma;
-
- err = mt9m114_write_reg(c, MISENSOR_16BIT, 0x098E, 0xC87A);
- if (err) {
- dev_err(&c->dev, "%s logic addr access error\n", __func__);
- return err;
- }
- err = mt9m114_read_reg(c, MISENSOR_8BIT, 0xC87A, &luma);
- if (err) {
- dev_err(&c->dev, "%s read target_average_luma failed\n",
- __func__);
- return err;
- }
- luma -= 0x17;
- luma /= 0x10;
- *val = (s32)luma - 2;
- dev_dbg(&c->dev, "%s val:%d\n", __func__, *val);
-
- return 0;
-}
-
-/*
- * Fake interface
- * mt9m114 now can not support 3a_lock
- */
-static int mt9m114_s_3a_lock(struct v4l2_subdev *sd, s32 val)
-{
- aaalock = val;
- return 0;
-}
-
-static int mt9m114_g_3a_lock(struct v4l2_subdev *sd, s32 *val)
-{
- if (aaalock)
- return V4L2_LOCK_EXPOSURE | V4L2_LOCK_WHITE_BALANCE
- | V4L2_LOCK_FOCUS;
- return 0;
-}
-
-static int mt9m114_s_ctrl(struct v4l2_ctrl *ctrl)
-{
- struct mt9m114_device *dev =
- container_of(ctrl->handler, struct mt9m114_device, ctrl_handler);
- struct i2c_client *client = v4l2_get_subdevdata(&dev->sd);
- int ret = 0;
-
- switch (ctrl->id) {
- case V4L2_CID_VFLIP:
- dev_dbg(&client->dev, "%s: CID_VFLIP:%d.\n",
- __func__, ctrl->val);
- ret = mt9m114_t_vflip(&dev->sd, ctrl->val);
- break;
- case V4L2_CID_HFLIP:
- dev_dbg(&client->dev, "%s: CID_HFLIP:%d.\n",
- __func__, ctrl->val);
- ret = mt9m114_t_hflip(&dev->sd, ctrl->val);
- break;
- case V4L2_CID_EXPOSURE_METERING:
- ret = mt9m114_s_exposure_metering(&dev->sd, ctrl->val);
- break;
- case V4L2_CID_EXPOSURE:
- ret = mt9m114_s_ev(&dev->sd, ctrl->val);
- break;
- case V4L2_CID_3A_LOCK:
- ret = mt9m114_s_3a_lock(&dev->sd, ctrl->val);
- break;
- default:
- ret = -EINVAL;
- }
- return ret;
-}
-
-static int mt9m114_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
-{
- struct mt9m114_device *dev =
- container_of(ctrl->handler, struct mt9m114_device, ctrl_handler);
- int ret = 0;
-
- switch (ctrl->id) {
- case V4L2_CID_VFLIP:
- ret = mt9m114_g_vflip(&dev->sd, &ctrl->val);
- break;
- case V4L2_CID_HFLIP:
- ret = mt9m114_g_hflip(&dev->sd, &ctrl->val);
- break;
- case V4L2_CID_EXPOSURE_ABSOLUTE:
- ret = mt9m114_g_exposure(&dev->sd, &ctrl->val);
- break;
- case V4L2_CID_EXPOSURE_ZONE_NUM:
- ret = mt9m114_g_exposure_zone_num(&dev->sd, &ctrl->val);
- break;
- case V4L2_CID_EXPOSURE:
- ret = mt9m114_g_ev(&dev->sd, &ctrl->val);
- break;
- case V4L2_CID_3A_LOCK:
- ret = mt9m114_g_3a_lock(&dev->sd, &ctrl->val);
- break;
- default:
- ret = -EINVAL;
- }
-
- return ret;
-}
-
-static const struct v4l2_ctrl_ops ctrl_ops = {
- .s_ctrl = mt9m114_s_ctrl,
- .g_volatile_ctrl = mt9m114_g_volatile_ctrl
-};
-
-static struct v4l2_ctrl_config mt9m114_controls[] = {
- {
- .ops = &ctrl_ops,
- .id = V4L2_CID_VFLIP,
- .name = "Image v-Flip",
- .type = V4L2_CTRL_TYPE_INTEGER,
- .min = 0,
- .max = 1,
- .step = 1,
- .def = 0,
- },
- {
- .ops = &ctrl_ops,
- .id = V4L2_CID_HFLIP,
- .name = "Image h-Flip",
- .type = V4L2_CTRL_TYPE_INTEGER,
- .min = 0,
- .max = 1,
- .step = 1,
- .def = 0,
- },
- {
- .ops = &ctrl_ops,
- .id = V4L2_CID_EXPOSURE_ABSOLUTE,
- .name = "exposure",
- .type = V4L2_CTRL_TYPE_INTEGER,
- .min = 0,
- .max = 0xffff,
- .step = 1,
- .def = 0,
- .flags = 0,
- },
- {
- .ops = &ctrl_ops,
- .id = V4L2_CID_EXPOSURE_ZONE_NUM,
- .name = "one-time exposure zone number",
- .type = V4L2_CTRL_TYPE_INTEGER,
- .min = 0,
- .max = 0xffff,
- .step = 1,
- .def = 0,
- .flags = 0,
- },
- {
- .ops = &ctrl_ops,
- .id = V4L2_CID_EXPOSURE_METERING,
- .name = "metering",
- .type = V4L2_CTRL_TYPE_MENU,
- .min = 0,
- .max = 3,
- .step = 0,
- .def = 1,
- .flags = 0,
- },
- {
- .ops = &ctrl_ops,
- .id = V4L2_CID_EXPOSURE,
- .name = "exposure biasx",
- .type = V4L2_CTRL_TYPE_INTEGER,
- .min = -2,
- .max = 2,
- .step = 1,
- .def = 0,
- .flags = 0,
- },
-#if 0 /* Causes v4l2_ctrl_new_custom() to fail with -ERANGE, disable for now */
- {
- .ops = &ctrl_ops,
- .id = V4L2_CID_3A_LOCK,
- .name = "3a lock",
- .type = V4L2_CTRL_TYPE_BITMASK,
- .min = 0,
- .max = V4L2_LOCK_EXPOSURE | V4L2_LOCK_WHITE_BALANCE | V4L2_LOCK_FOCUS,
- .step = 1,
- .def = 0,
- .flags = 0,
- },
-#endif
-};
-
-static int mt9m114_detect(struct mt9m114_device *dev, struct i2c_client *client)
-{
- struct i2c_adapter *adapter = client->adapter;
- u32 model;
- int ret;
-
- if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
- dev_err(&client->dev, "%s: i2c error", __func__);
- return -ENODEV;
- }
- ret = mt9m114_read_reg(client, MISENSOR_16BIT, MT9M114_PID, &model);
- if (ret)
- return ret;
- dev->real_model_id = model;
-
- if (model != MT9M114_MOD_ID) {
- dev_err(&client->dev, "%s: failed: client->addr = %x\n",
- __func__, client->addr);
- return -ENODEV;
- }
-
- return 0;
-}
-
-static int
-mt9m114_s_config(struct v4l2_subdev *sd, int irq, void *platform_data)
-{
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
- struct i2c_client *client = v4l2_get_subdevdata(sd);
- int ret;
-
- if (!platform_data)
- return -ENODEV;
-
- dev->platform_data =
- (struct camera_sensor_platform_data *)platform_data;
-
- ret = power_up(sd);
- if (ret) {
- v4l2_err(client, "mt9m114 power-up err");
- return ret;
- }
-
- /* config & detect sensor */
- ret = mt9m114_detect(dev, client);
- if (ret) {
- v4l2_err(client, "mt9m114_detect err s_config.\n");
- goto fail_detect;
- }
-
- ret = dev->platform_data->csi_cfg(sd, 1);
- if (ret)
- goto fail_csi_cfg;
-
- ret = mt9m114_set_suspend(sd);
- if (ret) {
- v4l2_err(client, "mt9m114 suspend err");
- return ret;
- }
-
- ret = power_down(sd);
- if (ret) {
- v4l2_err(client, "mt9m114 power down err");
- return ret;
- }
-
- return ret;
-
-fail_csi_cfg:
- dev->platform_data->csi_cfg(sd, 0);
-fail_detect:
- power_down(sd);
- dev_err(&client->dev, "sensor power-gating failed\n");
- return ret;
-}
-
-/* Horizontal flip the image. */
-static int mt9m114_t_hflip(struct v4l2_subdev *sd, int value)
-{
- struct i2c_client *c = v4l2_get_subdevdata(sd);
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
- int err;
- /* set for direct mode */
- err = mt9m114_write_reg(c, MISENSOR_16BIT, 0x098E, 0xC850);
- if (value) {
- /* enable H flip ctx A */
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC850, 0x01, 0x01);
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC851, 0x01, 0x01);
- /* ctx B */
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC888, 0x01, 0x01);
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC889, 0x01, 0x01);
-
- err += misensor_rmw_reg(c, MISENSOR_16BIT, MISENSOR_READ_MODE,
- MISENSOR_HFLIP_MASK, MISENSOR_FLIP_EN);
-
- dev->bpat = MT9M114_BPAT_GRGRBGBG;
- } else {
- /* disable H flip ctx A */
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC850, 0x01, 0x00);
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC851, 0x01, 0x00);
- /* ctx B */
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC888, 0x01, 0x00);
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC889, 0x01, 0x00);
-
- err += misensor_rmw_reg(c, MISENSOR_16BIT, MISENSOR_READ_MODE,
- MISENSOR_HFLIP_MASK, MISENSOR_FLIP_DIS);
-
- dev->bpat = MT9M114_BPAT_BGBGGRGR;
- }
-
- err += mt9m114_write_reg(c, MISENSOR_8BIT, 0x8404, 0x06);
- udelay(10);
-
- return !!err;
-}
-
-/* Vertically flip the image */
-static int mt9m114_t_vflip(struct v4l2_subdev *sd, int value)
-{
- struct i2c_client *c = v4l2_get_subdevdata(sd);
- int err;
- /* set for direct mode */
- err = mt9m114_write_reg(c, MISENSOR_16BIT, 0x098E, 0xC850);
- if (value >= 1) {
- /* enable H flip - ctx A */
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC850, 0x02, 0x01);
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC851, 0x02, 0x01);
- /* ctx B */
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC888, 0x02, 0x01);
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC889, 0x02, 0x01);
-
- err += misensor_rmw_reg(c, MISENSOR_16BIT, MISENSOR_READ_MODE,
- MISENSOR_VFLIP_MASK, MISENSOR_FLIP_EN);
- } else {
- /* disable H flip - ctx A */
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC850, 0x02, 0x00);
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC851, 0x02, 0x00);
- /* ctx B */
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC888, 0x02, 0x00);
- err += misensor_rmw_reg(c, MISENSOR_8BIT, 0xC889, 0x02, 0x00);
-
- err += misensor_rmw_reg(c, MISENSOR_16BIT, MISENSOR_READ_MODE,
- MISENSOR_VFLIP_MASK, MISENSOR_FLIP_DIS);
- }
-
- err += mt9m114_write_reg(c, MISENSOR_8BIT, 0x8404, 0x06);
- udelay(10);
-
- return !!err;
-}
-
-static int mt9m114_get_frame_interval(struct v4l2_subdev *sd,
- struct v4l2_subdev_state *sd_state,
- struct v4l2_subdev_frame_interval *interval)
-{
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
-
- /*
- * FIXME: Implement support for V4L2_SUBDEV_FORMAT_TRY, using the V4L2
- * subdev active state API.
- */
- if (interval->which != V4L2_SUBDEV_FORMAT_ACTIVE)
- return -EINVAL;
-
- interval->interval.numerator = 1;
- interval->interval.denominator = mt9m114_res[dev->res].fps;
-
- return 0;
-}
-
-static int mt9m114_s_stream(struct v4l2_subdev *sd, int enable)
-{
- int ret;
- struct i2c_client *c = v4l2_get_subdevdata(sd);
- struct mt9m114_device *dev = to_mt9m114_sensor(sd);
- struct atomisp_exposure exposure;
-
- if (enable) {
- ret = mt9m114_write_reg_array(c, mt9m114_chgstat_reg,
- POST_POLLING);
- if (ret < 0)
- return ret;
-
- if (dev->first_exp > MT9M114_MAX_FIRST_EXP) {
- exposure.integration_time[0] = dev->first_exp;
- exposure.gain[0] = dev->first_gain;
- exposure.gain[1] = dev->first_diggain;
- mt9m114_s_exposure(sd, &exposure);
- }
- dev->streamon = 1;
-
- } else {
- dev->streamon = 0;
- ret = mt9m114_set_suspend(sd);
- }
-
- return ret;
-}
-
-static int mt9m114_enum_mbus_code(struct v4l2_subdev *sd,
- struct v4l2_subdev_state *sd_state,
- struct v4l2_subdev_mbus_code_enum *code)
-{
- if (code->index)
- return -EINVAL;
- code->code = MEDIA_BUS_FMT_SGRBG10_1X10;
-
- return 0;
-}
-
-static int mt9m114_enum_frame_size(struct v4l2_subdev *sd,
- struct v4l2_subdev_state *sd_state,
- struct v4l2_subdev_frame_size_enum *fse)
-{
- unsigned int index = fse->index;
-
- if (index >= N_RES)
- return -EINVAL;
-
- fse->min_width = mt9m114_res[index].width;
- fse->min_height = mt9m114_res[index].height;
- fse->max_width = mt9m114_res[index].width;
- fse->max_height = mt9m114_res[index].height;
-
- return 0;
-}
-
-static int mt9m114_g_skip_frames(struct v4l2_subdev *sd, u32 *frames)
-{
- int index;
- struct mt9m114_device *snr = to_mt9m114_sensor(sd);
-
- if (!frames)
- return -EINVAL;
-
- for (index = 0; index < N_RES; index++) {
- if (mt9m114_res[index].res == snr->res)
- break;
- }
-
- if (index >= N_RES)
- return -EINVAL;
-
- *frames = mt9m114_res[index].skip_frames;
-
- return 0;
-}
-
-static const struct v4l2_subdev_video_ops mt9m114_video_ops = {
- .s_stream = mt9m114_s_stream,
-};
-
-static const struct v4l2_subdev_sensor_ops mt9m114_sensor_ops = {
- .g_skip_frames = mt9m114_g_skip_frames,
-};
-
-static const struct v4l2_subdev_core_ops mt9m114_core_ops = {
- .s_power = mt9m114_s_power,
- .ioctl = mt9m114_ioctl,
-};
-
-/* REVISIT: Do we need pad operations? */
-static const struct v4l2_subdev_pad_ops mt9m114_pad_ops = {
- .enum_mbus_code = mt9m114_enum_mbus_code,
- .enum_frame_size = mt9m114_enum_frame_size,
- .get_fmt = mt9m114_get_fmt,
- .set_fmt = mt9m114_set_fmt,
- .set_selection = mt9m114_s_exposure_selection,
- .get_frame_interval = mt9m114_get_frame_interval,
-};
-
-static const struct v4l2_subdev_ops mt9m114_ops = {
- .core = &mt9m114_core_ops,
- .video = &mt9m114_video_ops,
- .pad = &mt9m114_pad_ops,
- .sensor = &mt9m114_sensor_ops,
-};
-
-static void mt9m114_remove(struct i2c_client *client)
-{
- struct mt9m114_device *dev;
- struct v4l2_subdev *sd = i2c_get_clientdata(client);
-
- dev = container_of(sd, struct mt9m114_device, sd);
- dev->platform_data->csi_cfg(sd, 0);
- v4l2_device_unregister_subdev(sd);
- media_entity_cleanup(&dev->sd.entity);
- v4l2_ctrl_handler_free(&dev->ctrl_handler);
-}
-
-static int mt9m114_probe(struct i2c_client *client)
-{
- struct mt9m114_device *dev;
- int ret = 0;
- unsigned int i;
- void *pdata;
-
- /* Setup sensor configuration structure */
- dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL);
- if (!dev)
- return -ENOMEM;
-
- ret = devm_mutex_init(&client->dev, &dev->input_lock);
- if (ret)
- return ret;
-
- v4l2_i2c_subdev_init(&dev->sd, client, &mt9m114_ops);
- pdata = gmin_camera_platform_data(&dev->sd,
- ATOMISP_INPUT_FORMAT_RAW_10,
- atomisp_bayer_order_grbg);
- if (pdata)
- ret = mt9m114_s_config(&dev->sd, client->irq, pdata);
- if (!pdata || ret) {
- v4l2_device_unregister_subdev(&dev->sd);
- return ret;
- }
-
- ret = atomisp_register_i2c_module(&dev->sd, pdata);
- if (ret) {
- v4l2_device_unregister_subdev(&dev->sd);
- /* Coverity CID 298095 - return on error */
- return ret;
- }
-
- /* TODO add format code here */
- dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
- dev->pad.flags = MEDIA_PAD_FL_SOURCE;
- dev->format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
- dev->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
-
- ret =
- v4l2_ctrl_handler_init(&dev->ctrl_handler,
- ARRAY_SIZE(mt9m114_controls));
- if (ret) {
- mt9m114_remove(client);
- return ret;
- }
-
- for (i = 0; i < ARRAY_SIZE(mt9m114_controls); i++)
- v4l2_ctrl_new_custom(&dev->ctrl_handler, &mt9m114_controls[i],
- NULL);
-
- if (dev->ctrl_handler.error) {
- mt9m114_remove(client);
- return dev->ctrl_handler.error;
- }
-
- /* Use same lock for controls as for everything else. */
- dev->ctrl_handler.lock = &dev->input_lock;
- dev->sd.ctrl_handler = &dev->ctrl_handler;
-
- /* REVISIT: Do we need media controller? */
- ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
- if (ret) {
- mt9m114_remove(client);
- return ret;
- }
- return 0;
-}
-
-static const struct acpi_device_id mt9m114_acpi_match[] = {
- { "INT33F0" },
- { "CRMT1040" },
- {},
-};
-MODULE_DEVICE_TABLE(acpi, mt9m114_acpi_match);
-
-static struct i2c_driver mt9m114_driver = {
- .driver = {
- .name = "mt9m114",
- .acpi_match_table = mt9m114_acpi_match,
- },
- .probe = mt9m114_probe,
- .remove = mt9m114_remove,
-};
-module_i2c_driver(mt9m114_driver);
-
-MODULE_AUTHOR("Shuguang Gong <Shuguang.gong@intel.com>");
-MODULE_DESCRIPTION("Aptina mt9m114 sensor support module");
-MODULE_LICENSE("GPL");
diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.h b/drivers/staging/media/atomisp/i2c/mt9m114.h
deleted file mode 100644
index 97820db90827..000000000000
--- a/drivers/staging/media/atomisp/i2c/mt9m114.h
+++ /dev/null
@@ -1,1768 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Support for mt9m114 Camera Sensor.
- *
- * Copyright (c) 2010 Intel Corporation. All Rights Reserved.
- */
-
-#ifndef __A1040_H__
-#define __A1040_H__
-
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/i2c.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 "../include/linux/atomisp_platform.h"
-#include "../include/linux/atomisp.h"
-
-#define V4L2_IDENT_MT9M114 8245
-
-#define MT9P111_REV3
-#define FULLINISUPPORT
-
-/* #defines for register writes and register array processing */
-#define MISENSOR_8BIT 1
-#define MISENSOR_16BIT 2
-#define MISENSOR_32BIT 4
-
-#define MISENSOR_FWBURST0 0x80
-#define MISENSOR_FWBURST1 0x81
-#define MISENSOR_FWBURST4 0x84
-#define MISENSOR_FWBURST 0x88
-
-#define MISENSOR_TOK_TERM 0xf000 /* terminating token for reg list */
-#define MISENSOR_TOK_DELAY 0xfe00 /* delay token for reg list */
-#define MISENSOR_TOK_FWLOAD 0xfd00 /* token indicating load FW */
-#define MISENSOR_TOK_POLL 0xfc00 /* token indicating poll instruction */
-#define MISENSOR_TOK_RMW 0x0010 /* RMW operation */
-#define MISENSOR_TOK_MASK 0xfff0
-#define MISENSOR_AWB_STEADY BIT(0) /* awb steady */
-#define MISENSOR_AE_READY BIT(3) /* ae status ready */
-
-/* mask to set sensor read_mode via misensor_rmw_reg */
-#define MISENSOR_R_MODE_MASK 0x0330
-/* mask to set sensor vert_flip and horz_mirror */
-#define MISENSOR_VFLIP_MASK 0x0002
-#define MISENSOR_HFLIP_MASK 0x0001
-#define MISENSOR_FLIP_EN 1
-#define MISENSOR_FLIP_DIS 0
-
-/* bits set to set sensor read_mode via misensor_rmw_reg */
-#define MISENSOR_SKIPPING_SET 0x0011
-#define MISENSOR_SUMMING_SET 0x0033
-#define MISENSOR_NORMAL_SET 0x0000
-
-/* sensor register that control sensor read-mode and mirror */
-#define MISENSOR_READ_MODE 0xC834
-/* sensor ae-track status register */
-#define MISENSOR_AE_TRACK_STATUS 0xA800
-/* sensor awb status register */
-#define MISENSOR_AWB_STATUS 0xAC00
-/* sensor coarse integration time register */
-#define MISENSOR_COARSE_INTEGRATION_TIME 0xC83C
-
-/* registers */
-#define REG_SW_RESET 0x301A
-#define REG_SW_STREAM 0xDC00
-#define REG_SCCB_CTRL 0x3100
-#define REG_SC_CMMN_CHIP_ID 0x0000
-#define REG_V_START 0xc800 /* 16bits */
-#define REG_H_START 0xc802 /* 16bits */
-#define REG_V_END 0xc804 /* 16bits */
-#define REG_H_END 0xc806 /* 16bits */
-#define REG_PIXEL_CLK 0xc808 /* 32bits */
-#define REG_TIMING_VTS 0xc812 /* 16bits */
-#define REG_TIMING_HTS 0xc814 /* 16bits */
-#define REG_WIDTH 0xC868 /* 16bits */
-#define REG_HEIGHT 0xC86A /* 16bits */
-#define REG_EXPO_COARSE 0x3012 /* 16bits */
-#define REG_EXPO_FINE 0x3014 /* 16bits */
-#define REG_GAIN 0x305E
-#define REG_ANALOGGAIN 0x305F
-#define REG_ADDR_ACESSS 0x098E /* logical_address_access */
-#define REG_COMM_Register 0x0080 /* command_register */
-
-#define SENSOR_DETECTED 1
-#define SENSOR_NOT_DETECTED 0
-
-#define I2C_RETRY_COUNT 5
-#define MSG_LEN_OFFSET 2
-
-#ifndef MIPI_CONTROL
-#define MIPI_CONTROL 0x3400 /* MIPI_Control */
-#endif
-
-/* GPIO pin on Moorestown */
-#define GPIO_SCLK_25 44
-#define GPIO_STB_PIN 47
-
-#define GPIO_STDBY_PIN 49 /* ab:new */
-#define GPIO_RESET_PIN 50
-
-/* System control register for Aptina A-1040SOC*/
-#define MT9M114_PID 0x0
-
-/* MT9P111_DEVICE_ID */
-#define MT9M114_MOD_ID 0x2481
-
-#define MT9M114_FINE_INTG_TIME_MIN 0
-#define MT9M114_FINE_INTG_TIME_MAX_MARGIN 0
-#define MT9M114_COARSE_INTG_TIME_MIN 1
-#define MT9M114_COARSE_INTG_TIME_MAX_MARGIN 6
-
-/* ulBPat; */
-
-#define MT9M114_BPAT_RGRGGBGB BIT(0)
-#define MT9M114_BPAT_GRGRBGBG BIT(1)
-#define MT9M114_BPAT_GBGBRGRG BIT(2)
-#define MT9M114_BPAT_BGBGGRGR BIT(3)
-
-#define MT9M114_FOCAL_LENGTH_NUM 208 /*2.08mm*/
-#define MT9M114_WAIT_STAT_TIMEOUT 100
-#define MT9M114_FLICKER_MODE_50HZ 1
-#define MT9M114_FLICKER_MODE_60HZ 2
-/*
- * focal length bits definition:
- * bits 31-16: numerator, bits 15-0: denominator
- */
-#define MT9M114_FOCAL_LENGTH_DEFAULT 0xD00064
-
-/*
- * current f-number bits definition:
- * bits 31-16: numerator, bits 15-0: denominator
- */
-#define MT9M114_F_NUMBER_DEFAULT 0x18000a
-
-/*
- * 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 MT9M114_F_NUMBER_RANGE 0x180a180a
-
-/* Supported resolutions */
-enum {
- MT9M114_RES_736P,
- MT9M114_RES_864P,
- MT9M114_RES_960P,
-};
-
-#define MT9M114_RES_960P_SIZE_H 1296
-#define MT9M114_RES_960P_SIZE_V 976
-#define MT9M114_RES_720P_SIZE_H 1280
-#define MT9M114_RES_720P_SIZE_V 720
-#define MT9M114_RES_576P_SIZE_H 1024
-#define MT9M114_RES_576P_SIZE_V 576
-#define MT9M114_RES_480P_SIZE_H 768
-#define MT9M114_RES_480P_SIZE_V 480
-#define MT9M114_RES_VGA_SIZE_H 640
-#define MT9M114_RES_VGA_SIZE_V 480
-#define MT9M114_RES_QVGA_SIZE_H 320
-#define MT9M114_RES_QVGA_SIZE_V 240
-#define MT9M114_RES_QCIF_SIZE_H 176
-#define MT9M114_RES_QCIF_SIZE_V 144
-
-#define MT9M114_RES_720_480p_768_SIZE_H 736
-#define MT9M114_RES_720_480p_768_SIZE_V 496
-#define MT9M114_RES_736P_SIZE_H 1296
-#define MT9M114_RES_736P_SIZE_V 736
-#define MT9M114_RES_864P_SIZE_H 1296
-#define MT9M114_RES_864P_SIZE_V 864
-#define MT9M114_RES_976P_SIZE_H 1296
-#define MT9M114_RES_976P_SIZE_V 976
-
-#define MT9M114_BIN_FACTOR_MAX 3
-
-#define MT9M114_DEFAULT_FIRST_EXP 0x10
-#define MT9M114_MAX_FIRST_EXP 0x302
-
-/* completion status polling requirements, usage based on Aptina .INI Rev2 */
-enum poll_reg {
- NO_POLLING,
- PRE_POLLING,
- POST_POLLING,
-};
-
-/*
- * struct misensor_reg - MI sensor register format
- * @length: length 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 misensor_reg {
- u32 length;
- u32 reg;
- u32 val; /* value or for read/mod/write, AND mask */
- u32 val2; /* optional; for rmw, OR mask */
-};
-
-/*
- * struct misensor_fwreg - Firmware burst command
- * @type: FW burst or 8/16 bit register
- * @addr: 16-bit offset to register or other values depending on type
- * @valx: data value for burst (or other commands)
- *
- * Define a structure for sensor register initialization values
- */
-struct misensor_fwreg {
- u32 type; /* type of value, register or FW burst string */
- u32 addr; /* target address */
- u32 val0;
- u32 val1;
- u32 val2;
- u32 val3;
- u32 val4;
- u32 val5;
- u32 val6;
- u32 val7;
-};
-
-struct regval_list {
- u16 reg_num;
- u8 value;
-};
-
-struct mt9m114_device {
- struct v4l2_subdev sd;
- struct media_pad pad;
- struct v4l2_mbus_framefmt format;
-
- struct camera_sensor_platform_data *platform_data;
- struct mutex input_lock; /* serialize sensor's ioctl */
- struct v4l2_ctrl_handler ctrl_handler;
- int real_model_id;
- int nctx;
- int power;
-
- unsigned int bus_width;
- unsigned int mode;
- unsigned int field_inv;
- unsigned int field_sel;
- unsigned int ycseq;
- unsigned int conv422;
- unsigned int bpat;
- unsigned int hpol;
- unsigned int vpol;
- unsigned int edge;
- unsigned int bls;
- unsigned int gamma;
- unsigned int cconv;
- unsigned int res;
- unsigned int dwn_sz;
- unsigned int blc;
- unsigned int agc;
- unsigned int awb;
- unsigned int aec;
- /* extension SENSOR version 2 */
- unsigned int cie_profile;
-
- /* extension SENSOR version 3 */
- unsigned int flicker_freq;
-
- /* extension SENSOR version 4 */
- unsigned int smia_mode;
- unsigned int mipi_mode;
-
- /* Add name here to load shared library */
- unsigned int type;
-
- /*Number of MIPI lanes*/
- unsigned int mipi_lanes;
- /*WA for low light AE*/
- unsigned int first_exp;
- unsigned int first_gain;
- unsigned int first_diggain;
- char name[32];
-
- u8 lightfreq;
- u8 streamon;
-};
-
-struct mt9m114_format_struct {
- u8 *desc;
- u32 pixelformat;
- struct regval_list *regs;
-};
-
-struct mt9m114_res_struct {
- u8 *desc;
- int res;
- int width;
- int height;
- int fps;
- int skip_frames;
- bool used;
- struct regval_list *regs;
- u16 pixels_per_line;
- u16 lines_per_frame;
-};
-
-/* 2 bytes used for address: 256 bytes total */
-#define MT9M114_MAX_WRITE_BUF_SIZE 254
-struct mt9m114_write_buffer {
- u16 addr;
- u8 data[MT9M114_MAX_WRITE_BUF_SIZE];
-};
-
-struct mt9m114_write_ctrl {
- int index;
- struct mt9m114_write_buffer buffer;
-};
-
-/*
- * Modes supported by the mt9m114 driver.
- * Please, keep them in ascending order.
- */
-static struct mt9m114_res_struct mt9m114_res[] = {
- {
- .desc = "720P",
- .res = MT9M114_RES_736P,
- .width = 1296,
- .height = 736,
- .fps = 30,
- .used = false,
- .regs = NULL,
- .skip_frames = 1,
-
- .pixels_per_line = 0x0640,
- .lines_per_frame = 0x0307,
- },
- {
- .desc = "848P",
- .res = MT9M114_RES_864P,
- .width = 1296,
- .height = 864,
- .fps = 30,
- .used = false,
- .regs = NULL,
- .skip_frames = 1,
-
- .pixels_per_line = 0x0640,
- .lines_per_frame = 0x03E8,
- },
- {
- .desc = "960P",
- .res = MT9M114_RES_960P,
- .width = 1296,
- .height = 976,
- .fps = 30,
- .used = false,
- .regs = NULL,
- .skip_frames = 1,
-
- .pixels_per_line = 0x0644, /* consistent with regs arrays */
- .lines_per_frame = 0x03E5, /* consistent with regs arrays */
- },
-};
-
-#define N_RES (ARRAY_SIZE(mt9m114_res))
-
-#if 0 /* Currently unused */
-static struct misensor_reg const mt9m114_exitstandby[] = {
- {MISENSOR_16BIT, 0x098E, 0xDC00},
- /* exit-standby */
- {MISENSOR_8BIT, 0xDC00, 0x54},
- {MISENSOR_16BIT, 0x0080, 0x8002},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-#endif
-
-static struct misensor_reg const mt9m114_exp_win[5][5] = {
- {
- {MISENSOR_8BIT, 0xA407, 0x64},
- {MISENSOR_8BIT, 0xA408, 0x64},
- {MISENSOR_8BIT, 0xA409, 0x64},
- {MISENSOR_8BIT, 0xA40A, 0x64},
- {MISENSOR_8BIT, 0xA40B, 0x64},
- },
- {
- {MISENSOR_8BIT, 0xA40C, 0x64},
- {MISENSOR_8BIT, 0xA40D, 0x64},
- {MISENSOR_8BIT, 0xA40E, 0x64},
- {MISENSOR_8BIT, 0xA40F, 0x64},
- {MISENSOR_8BIT, 0xA410, 0x64},
- },
- {
- {MISENSOR_8BIT, 0xA411, 0x64},
- {MISENSOR_8BIT, 0xA412, 0x64},
- {MISENSOR_8BIT, 0xA413, 0x64},
- {MISENSOR_8BIT, 0xA414, 0x64},
- {MISENSOR_8BIT, 0xA415, 0x64},
- },
- {
- {MISENSOR_8BIT, 0xA416, 0x64},
- {MISENSOR_8BIT, 0xA417, 0x64},
- {MISENSOR_8BIT, 0xA418, 0x64},
- {MISENSOR_8BIT, 0xA419, 0x64},
- {MISENSOR_8BIT, 0xA41A, 0x64},
- },
- {
- {MISENSOR_8BIT, 0xA41B, 0x64},
- {MISENSOR_8BIT, 0xA41C, 0x64},
- {MISENSOR_8BIT, 0xA41D, 0x64},
- {MISENSOR_8BIT, 0xA41E, 0x64},
- {MISENSOR_8BIT, 0xA41F, 0x64},
- },
-};
-
-static struct misensor_reg const mt9m114_exp_average[] = {
- {MISENSOR_8BIT, 0xA407, 0x00},
- {MISENSOR_8BIT, 0xA408, 0x00},
- {MISENSOR_8BIT, 0xA409, 0x00},
- {MISENSOR_8BIT, 0xA40A, 0x00},
- {MISENSOR_8BIT, 0xA40B, 0x00},
- {MISENSOR_8BIT, 0xA40C, 0x00},
- {MISENSOR_8BIT, 0xA40D, 0x00},
- {MISENSOR_8BIT, 0xA40E, 0x00},
- {MISENSOR_8BIT, 0xA40F, 0x00},
- {MISENSOR_8BIT, 0xA410, 0x00},
- {MISENSOR_8BIT, 0xA411, 0x00},
- {MISENSOR_8BIT, 0xA412, 0x00},
- {MISENSOR_8BIT, 0xA413, 0x00},
- {MISENSOR_8BIT, 0xA414, 0x00},
- {MISENSOR_8BIT, 0xA415, 0x00},
- {MISENSOR_8BIT, 0xA416, 0x00},
- {MISENSOR_8BIT, 0xA417, 0x00},
- {MISENSOR_8BIT, 0xA418, 0x00},
- {MISENSOR_8BIT, 0xA419, 0x00},
- {MISENSOR_8BIT, 0xA41A, 0x00},
- {MISENSOR_8BIT, 0xA41B, 0x00},
- {MISENSOR_8BIT, 0xA41C, 0x00},
- {MISENSOR_8BIT, 0xA41D, 0x00},
- {MISENSOR_8BIT, 0xA41E, 0x00},
- {MISENSOR_8BIT, 0xA41F, 0x00},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-static struct misensor_reg const mt9m114_exp_center[] = {
- {MISENSOR_8BIT, 0xA407, 0x19},
- {MISENSOR_8BIT, 0xA408, 0x19},
- {MISENSOR_8BIT, 0xA409, 0x19},
- {MISENSOR_8BIT, 0xA40A, 0x19},
- {MISENSOR_8BIT, 0xA40B, 0x19},
- {MISENSOR_8BIT, 0xA40C, 0x19},
- {MISENSOR_8BIT, 0xA40D, 0x4B},
- {MISENSOR_8BIT, 0xA40E, 0x4B},
- {MISENSOR_8BIT, 0xA40F, 0x4B},
- {MISENSOR_8BIT, 0xA410, 0x19},
- {MISENSOR_8BIT, 0xA411, 0x19},
- {MISENSOR_8BIT, 0xA412, 0x4B},
- {MISENSOR_8BIT, 0xA413, 0x64},
- {MISENSOR_8BIT, 0xA414, 0x4B},
- {MISENSOR_8BIT, 0xA415, 0x19},
- {MISENSOR_8BIT, 0xA416, 0x19},
- {MISENSOR_8BIT, 0xA417, 0x4B},
- {MISENSOR_8BIT, 0xA418, 0x4B},
- {MISENSOR_8BIT, 0xA419, 0x4B},
- {MISENSOR_8BIT, 0xA41A, 0x19},
- {MISENSOR_8BIT, 0xA41B, 0x19},
- {MISENSOR_8BIT, 0xA41C, 0x19},
- {MISENSOR_8BIT, 0xA41D, 0x19},
- {MISENSOR_8BIT, 0xA41E, 0x19},
- {MISENSOR_8BIT, 0xA41F, 0x19},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-#if 0 /* Currently unused */
-static struct misensor_reg const mt9m114_suspend[] = {
- {MISENSOR_16BIT, 0x098E, 0xDC00},
- {MISENSOR_8BIT, 0xDC00, 0x40},
- {MISENSOR_16BIT, 0x0080, 0x8002},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-static struct misensor_reg const mt9m114_streaming[] = {
- {MISENSOR_16BIT, 0x098E, 0xDC00},
- {MISENSOR_8BIT, 0xDC00, 0x34},
- {MISENSOR_16BIT, 0x0080, 0x8002},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-#endif
-
-static struct misensor_reg const mt9m114_standby_reg[] = {
- {MISENSOR_16BIT, 0x098E, 0xDC00},
- {MISENSOR_8BIT, 0xDC00, 0x50},
- {MISENSOR_16BIT, 0x0080, 0x8002},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-#if 0 /* Currently unused */
-static struct misensor_reg const mt9m114_wakeup_reg[] = {
- {MISENSOR_16BIT, 0x098E, 0xDC00},
- {MISENSOR_8BIT, 0xDC00, 0x54},
- {MISENSOR_16BIT, 0x0080, 0x8002},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-#endif
-
-static struct misensor_reg const mt9m114_chgstat_reg[] = {
- {MISENSOR_16BIT, 0x098E, 0xDC00},
- {MISENSOR_8BIT, 0xDC00, 0x28},
- {MISENSOR_16BIT, 0x0080, 0x8002},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-/* [1296x976_30fps] - Intel */
-#if 0
-static struct misensor_reg const mt9m114_960P_init[] = {
- {MISENSOR_16BIT, 0x098E, 0x1000},
- {MISENSOR_8BIT, 0xC97E, 0x01}, /* cam_sysctl_pll_enable = 1 */
- {MISENSOR_16BIT, 0xC980, 0x0128}, /* cam_sysctl_pll_divider_m_n = 276 */
- {MISENSOR_16BIT, 0xC982, 0x0700}, /* cam_sysctl_pll_divider_p = 1792 */
- {MISENSOR_16BIT, 0xC800, 0x0000}, /* cam_sensor_cfg_y_addr_start = 0 */
- {MISENSOR_16BIT, 0xC802, 0x0000}, /* cam_sensor_cfg_x_addr_start = 0 */
- {MISENSOR_16BIT, 0xC804, 0x03CF}, /* cam_sensor_cfg_y_addr_end = 971 */
- {MISENSOR_16BIT, 0xC806, 0x050F}, /* cam_sensor_cfg_x_addr_end = 1291 */
- {MISENSOR_16BIT, 0xC808, 0x02DC}, /* cam_sensor_cfg_pixclk = 48000000 */
- {MISENSOR_16BIT, 0xC80A, 0x6C00},
- {MISENSOR_16BIT, 0xC80C, 0x0001}, /* cam_sensor_cfg_row_speed = 1 */
- /* cam_sensor_cfg_fine_integ_time_min = 219 */
- {MISENSOR_16BIT, 0xC80E, 0x00DB},
- /* cam_sensor_cfg_fine_integ_time_max = 1459 */
- {MISENSOR_16BIT, 0xC810, 0x05B3},
- /* cam_sensor_cfg_frame_length_lines = 1006 */
- {MISENSOR_16BIT, 0xC812, 0x03F6},
- /* cam_sensor_cfg_line_length_pck = 1590 */
- {MISENSOR_16BIT, 0xC814, 0x063E},
- /* cam_sensor_cfg_fine_correction = 96 */
- {MISENSOR_16BIT, 0xC816, 0x0060},
- /* cam_sensor_cfg_cpipe_last_row = 963 */
- {MISENSOR_16BIT, 0xC818, 0x03C3},
- {MISENSOR_16BIT, 0xC826, 0x0020}, /* cam_sensor_cfg_reg_0_data = 32 */
- {MISENSOR_16BIT, 0xC834, 0x0000}, /* cam_sensor_control_read_mode = 0 */
- {MISENSOR_16BIT, 0xC854, 0x0000}, /* cam_crop_window_xoffset = 0 */
- {MISENSOR_16BIT, 0xC856, 0x0000}, /* cam_crop_window_yoffset = 0 */
- {MISENSOR_16BIT, 0xC858, 0x0508}, /* cam_crop_window_width = 1280 */
- {MISENSOR_16BIT, 0xC85A, 0x03C8}, /* cam_crop_window_height = 960 */
- {MISENSOR_8BIT, 0xC85C, 0x03}, /* cam_crop_cropmode = 3 */
- {MISENSOR_16BIT, 0xC868, 0x0508}, /* cam_output_width = 1280 */
- {MISENSOR_16BIT, 0xC86A, 0x03C8}, /* cam_output_height = 960 */
- {MISENSOR_TOK_TERM, 0, 0},
-};
-#endif
-
-/* [1296x976_30fps_768Mbps] */
-static struct misensor_reg const mt9m114_976P_init[] = {
- {MISENSOR_16BIT, 0x98E, 0x1000},
- {MISENSOR_8BIT, 0xC97E, 0x01}, /* cam_sysctl_pll_enable = 1 */
- {MISENSOR_16BIT, 0xC980, 0x0128}, /* cam_sysctl_pll_divider_m_n = 276 */
- {MISENSOR_16BIT, 0xC982, 0x0700}, /* cam_sysctl_pll_divider_p = 1792 */
- {MISENSOR_16BIT, 0xC800, 0x0000}, /* cam_sensor_cfg_y_addr_start = 0 */
- {MISENSOR_16BIT, 0xC802, 0x0000}, /* cam_sensor_cfg_x_addr_start = 0 */
- {MISENSOR_16BIT, 0xC804, 0x03CF}, /* cam_sensor_cfg_y_addr_end = 975 */
- {MISENSOR_16BIT, 0xC806, 0x050F}, /* cam_sensor_cfg_x_addr_end = 1295 */
- {MISENSOR_32BIT, 0xC808, 0x2DC6C00},/* cam_sensor_cfg_pixclk = 480000*/
- {MISENSOR_16BIT, 0xC80C, 0x0001}, /* cam_sensor_cfg_row_speed = 1 */
- /* cam_sensor_cfg_fine_integ_time_min = 219 */
- {MISENSOR_16BIT, 0xC80E, 0x00DB},
- /* 0x062E //cam_sensor_cfg_fine_integ_time_max = 1459 */
- {MISENSOR_16BIT, 0xC810, 0x05B3},
- /* 0x074C //cam_sensor_cfg_frame_length_lines = 1006 */
- {MISENSOR_16BIT, 0xC812, 0x03E5},
- /* 0x06B1 /cam_sensor_cfg_line_length_pck = 1590 */
- {MISENSOR_16BIT, 0xC814, 0x0644},
- /* cam_sensor_cfg_fine_correction = 96 */
- {MISENSOR_16BIT, 0xC816, 0x0060},
- /* cam_sensor_cfg_cpipe_last_row = 963 */
- {MISENSOR_16BIT, 0xC818, 0x03C3},
- {MISENSOR_16BIT, 0xC826, 0x0020}, /* cam_sensor_cfg_reg_0_data = 32 */
- {MISENSOR_16BIT, 0xC834, 0x0000}, /* cam_sensor_control_read_mode = 0 */
- {MISENSOR_16BIT, 0xC854, 0x0000}, /* cam_crop_window_xoffset = 0 */
- {MISENSOR_16BIT, 0xC856, 0x0000}, /* cam_crop_window_yoffset = 0 */
- {MISENSOR_16BIT, 0xC858, 0x0508}, /* cam_crop_window_width = 1288 */
- {MISENSOR_16BIT, 0xC85A, 0x03C8}, /* cam_crop_window_height = 968 */
- {MISENSOR_8BIT, 0xC85C, 0x03}, /* cam_crop_cropmode = 3 */
- {MISENSOR_16BIT, 0xC868, 0x0508}, /* cam_output_width = 1288 */
- {MISENSOR_16BIT, 0xC86A, 0x03C8}, /* cam_output_height = 968 */
- {MISENSOR_8BIT, 0xC878, 0x00}, /* 0x0E //cam_aet_aemode = 0 */
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-/* [1296x864_30fps] */
-static struct misensor_reg const mt9m114_864P_init[] = {
- {MISENSOR_16BIT, 0x98E, 0x1000},
- {MISENSOR_8BIT, 0xC97E, 0x01}, /* cam_sysctl_pll_enable = 1 */
- {MISENSOR_16BIT, 0xC980, 0x0128}, /* cam_sysctl_pll_divider_m_n = 276 */
- {MISENSOR_16BIT, 0xC982, 0x0700}, /* cam_sysctl_pll_divider_p = 1792 */
- {MISENSOR_16BIT, 0xC800, 0x0038}, /* cam_sensor_cfg_y_addr_start = 56 */
- {MISENSOR_16BIT, 0xC802, 0x0000}, /* cam_sensor_cfg_x_addr_start = 0 */
- {MISENSOR_16BIT, 0xC804, 0x0397}, /* cam_sensor_cfg_y_addr_end = 919 */
- {MISENSOR_16BIT, 0xC806, 0x050F}, /* cam_sensor_cfg_x_addr_end = 1295 */
- /* cam_sensor_cfg_pixclk = 48000000 */
- {MISENSOR_32BIT, 0xC808, 0x2DC6C00},
- {MISENSOR_16BIT, 0xC80C, 0x0001}, /* cam_sensor_cfg_row_speed = 1 */
- /* cam_sensor_cfg_fine_integ_time_min = 219 */
- {MISENSOR_16BIT, 0xC80E, 0x00DB},
- /* cam_sensor_cfg_fine_integ_time_max = 1469 */
- {MISENSOR_16BIT, 0xC810, 0x05BD},
- /* cam_sensor_cfg_frame_length_lines = 1000 */
- {MISENSOR_16BIT, 0xC812, 0x03E8},
- /* cam_sensor_cfg_line_length_pck = 1600 */
- {MISENSOR_16BIT, 0xC814, 0x0640},
- /* cam_sensor_cfg_fine_correction = 96 */
- {MISENSOR_16BIT, 0xC816, 0x0060},
- /* cam_sensor_cfg_cpipe_last_row = 859 */
- {MISENSOR_16BIT, 0xC818, 0x035B},
- {MISENSOR_16BIT, 0xC826, 0x0020}, /* cam_sensor_cfg_reg_0_data = 32 */
- {MISENSOR_16BIT, 0xC834, 0x0000}, /* cam_sensor_control_read_mode = 0 */
- {MISENSOR_16BIT, 0xC854, 0x0000}, /* cam_crop_window_xoffset = 0 */
- {MISENSOR_16BIT, 0xC856, 0x0000}, /* cam_crop_window_yoffset = 0 */
- {MISENSOR_16BIT, 0xC858, 0x0508}, /* cam_crop_window_width = 1288 */
- {MISENSOR_16BIT, 0xC85A, 0x0358}, /* cam_crop_window_height = 856 */
- {MISENSOR_8BIT, 0xC85C, 0x03}, /* cam_crop_cropmode = 3 */
- {MISENSOR_16BIT, 0xC868, 0x0508}, /* cam_output_width = 1288 */
- {MISENSOR_16BIT, 0xC86A, 0x0358}, /* cam_output_height = 856 */
- {MISENSOR_8BIT, 0xC878, 0x00}, /* 0x0E //cam_aet_aemode = 0 */
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-/* [1296x736_30fps] */
-static struct misensor_reg const mt9m114_736P_init[] = {
- {MISENSOR_16BIT, 0x98E, 0x1000},
- {MISENSOR_8BIT, 0xC97E, 0x01}, /* cam_sysctl_pll_enable = 1 */
- {MISENSOR_16BIT, 0xC980, 0x011F}, /* cam_sysctl_pll_divider_m_n = 287 */
- {MISENSOR_16BIT, 0xC982, 0x0700}, /* cam_sysctl_pll_divider_p = 1792 */
- {MISENSOR_16BIT, 0xC800, 0x0078}, /* cam_sensor_cfg_y_addr_start = 120*/
- {MISENSOR_16BIT, 0xC802, 0x0000}, /* cam_sensor_cfg_x_addr_start = 0 */
- {MISENSOR_16BIT, 0xC804, 0x0357}, /* cam_sensor_cfg_y_addr_end = 855 */
- {MISENSOR_16BIT, 0xC806, 0x050F}, /* cam_sensor_cfg_x_addr_end = 1295 */
- {MISENSOR_32BIT, 0xC808, 0x237A07F}, /* cam_sensor_cfg_pixclk=37199999*/
- {MISENSOR_16BIT, 0xC80C, 0x0001}, /* cam_sensor_cfg_row_speed = 1 */
- /* cam_sensor_cfg_fine_integ_time_min = 219 */
- {MISENSOR_16BIT, 0xC80E, 0x00DB},
- /* 0x062E //cam_sensor_cfg_fine_integ_time_max = 1469 */
- {MISENSOR_16BIT, 0xC810, 0x05BD},
- /* 0x074C //cam_sensor_cfg_frame_length_lines = 775 */
- {MISENSOR_16BIT, 0xC812, 0x0307},
- /* 0x06B1 /cam_sensor_cfg_line_length_pck = 1600 */
- {MISENSOR_16BIT, 0xC814, 0x0640},
- /* cam_sensor_cfg_fine_correction = 96 */
- {MISENSOR_16BIT, 0xC816, 0x0060},
- /* cam_sensor_cfg_cpipe_last_row = 731 */
- {MISENSOR_16BIT, 0xC818, 0x02DB},
- {MISENSOR_16BIT, 0xC826, 0x0020}, /* cam_sensor_cfg_reg_0_data = 32 */
- {MISENSOR_16BIT, 0xC834, 0x0000}, /* cam_sensor_control_read_mode = 0 */
- {MISENSOR_16BIT, 0xC854, 0x0000}, /* cam_crop_window_xoffset = 0 */
- {MISENSOR_16BIT, 0xC856, 0x0000}, /* cam_crop_window_yoffset = 0 */
- {MISENSOR_16BIT, 0xC858, 0x0508}, /* cam_crop_window_width = 1288 */
- {MISENSOR_16BIT, 0xC85A, 0x02D8}, /* cam_crop_window_height = 728 */
- {MISENSOR_8BIT, 0xC85C, 0x03}, /* cam_crop_cropmode = 3 */
- {MISENSOR_16BIT, 0xC868, 0x0508}, /* cam_output_width = 1288 */
- {MISENSOR_16BIT, 0xC86A, 0x02D8}, /* cam_output_height = 728 */
- {MISENSOR_8BIT, 0xC878, 0x00}, /* 0x0E //cam_aet_aemode = 0 */
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-/* [736x496_30fps_768Mbps] */
-#if 0 /* Currently unused */
-static struct misensor_reg const mt9m114_720_480P_init[] = {
- {MISENSOR_16BIT, 0x98E, 0x1000},
- {MISENSOR_8BIT, 0xC97E, 0x01}, /* cam_sysctl_pll_enable = 1 */
- {MISENSOR_16BIT, 0xC980, 0x0128}, /* cam_sysctl_pll_divider_m_n = 276 */
- {MISENSOR_16BIT, 0xC982, 0x0700}, /* cam_sysctl_pll_divider_p = 1792 */
- {MISENSOR_16BIT, 0xC800, 0x00F0}, /* cam_sensor_cfg_y_addr_start = 240*/
- {MISENSOR_16BIT, 0xC802, 0x0118}, /* cam_sensor_cfg_x_addr_start = 280*/
- {MISENSOR_16BIT, 0xC804, 0x02DF}, /* cam_sensor_cfg_y_addr_end = 735 */
- {MISENSOR_16BIT, 0xC806, 0x03F7}, /* cam_sensor_cfg_x_addr_end = 1015 */
- /* cam_sensor_cfg_pixclk = 48000000 */
- {MISENSOR_32BIT, 0xC808, 0x2DC6C00},
- {MISENSOR_16BIT, 0xC80C, 0x0001}, /* cam_sensor_cfg_row_speed = 1 */
- /* cam_sensor_cfg_fine_integ_time_min = 219 */
- {MISENSOR_16BIT, 0xC80E, 0x00DB},
- /* 0x062E //cam_sensor_cfg_fine_integ_time_max = 1459 */
- {MISENSOR_16BIT, 0xC810, 0x05B3},
- /* 0x074C //cam_sensor_cfg_frame_length_lines = 997 */
- {MISENSOR_16BIT, 0xC812, 0x03E5},
- /* 0x06B1 /cam_sensor_cfg_line_length_pck = 1604 */
- {MISENSOR_16BIT, 0xC814, 0x0644},
- /* cam_sensor_cfg_fine_correction = 96 */
- {MISENSOR_16BIT, 0xC816, 0x0060},
- {MISENSOR_16BIT, 0xC818, 0x03C3}, /* cam_sensor_cfg_cpipe_last_row=963*/
- {MISENSOR_16BIT, 0xC826, 0x0020}, /* cam_sensor_cfg_reg_0_data = 32 */
- {MISENSOR_16BIT, 0xC834, 0x0000}, /* cam_sensor_control_read_mode = 0*/
- {MISENSOR_16BIT, 0xC854, 0x0000}, /* cam_crop_window_xoffset = 0 */
- {MISENSOR_16BIT, 0xC856, 0x0000}, /* cam_crop_window_yoffset = 0 */
- {MISENSOR_16BIT, 0xC858, 0x02D8}, /* cam_crop_window_width = 728 */
- {MISENSOR_16BIT, 0xC85A, 0x01E8}, /* cam_crop_window_height = 488 */
- {MISENSOR_8BIT, 0xC85C, 0x03}, /* cam_crop_cropmode = 3 */
- {MISENSOR_16BIT, 0xC868, 0x02D8}, /* cam_output_width = 728 */
- {MISENSOR_16BIT, 0xC86A, 0x01E8}, /* cam_output_height = 488 */
- {MISENSOR_8BIT, 0xC878, 0x00}, /* 0x0E //cam_aet_aemode = 0 */
- {MISENSOR_TOK_TERM, 0, 0}
-};
-#endif
-
-static struct misensor_reg const mt9m114_common[] = {
- /* reset */
- {MISENSOR_16BIT, 0x301A, 0x0234},
- /* LOAD = Step2-PLL_Timing //PLL and Timing */
- {MISENSOR_16BIT, 0x098E, 0x1000}, /* LOGICAL_ADDRESS_ACCESS */
- {MISENSOR_8BIT, 0xC97E, 0x01}, /* cam_sysctl_pll_enable = 1 */
- {MISENSOR_16BIT, 0xC980, 0x0128}, /* cam_sysctl_pll_divider_m_n = 276 */
- {MISENSOR_16BIT, 0xC982, 0x0700}, /* cam_sysctl_pll_divider_p = 1792 */
- {MISENSOR_16BIT, 0xC800, 0x0000}, /* cam_sensor_cfg_y_addr_start = 216*/
- {MISENSOR_16BIT, 0xC802, 0x0000}, /* cam_sensor_cfg_x_addr_start = 168*/
- {MISENSOR_16BIT, 0xC804, 0x03CD}, /* cam_sensor_cfg_y_addr_end = 761 */
- {MISENSOR_16BIT, 0xC806, 0x050D}, /* cam_sensor_cfg_x_addr_end = 1127 */
- {MISENSOR_16BIT, 0xC808, 0x02DC}, /* cam_sensor_cfg_pixclk = 24000000 */
- {MISENSOR_16BIT, 0xC80A, 0x6C00},
- {MISENSOR_16BIT, 0xC80C, 0x0001}, /* cam_sensor_cfg_row_speed = 1 */
- /* cam_sensor_cfg_fine_integ_time_min = 219 */
- {MISENSOR_16BIT, 0xC80E, 0x01C3},
- /* cam_sensor_cfg_fine_integ_time_max = 1149 */
- {MISENSOR_16BIT, 0xC810, 0x03F7},
- /* cam_sensor_cfg_frame_length_lines = 625 */
- {MISENSOR_16BIT, 0xC812, 0x0500},
- /* cam_sensor_cfg_line_length_pck = 1280 */
- {MISENSOR_16BIT, 0xC814, 0x04E2},
- /* cam_sensor_cfg_fine_correction = 96 */
- {MISENSOR_16BIT, 0xC816, 0x00E0},
- /* cam_sensor_cfg_cpipe_last_row = 541 */
- {MISENSOR_16BIT, 0xC818, 0x01E3},
- {MISENSOR_16BIT, 0xC826, 0x0020}, /* cam_sensor_cfg_reg_0_data = 32 */
- {MISENSOR_16BIT, 0xC834, 0x0330}, /* cam_sensor_control_read_mode = 0 */
- {MISENSOR_16BIT, 0xC854, 0x0000}, /* cam_crop_window_xoffset = 0 */
- {MISENSOR_16BIT, 0xC856, 0x0000}, /* cam_crop_window_yoffset = 0 */
- {MISENSOR_16BIT, 0xC858, 0x0280}, /* cam_crop_window_width = 952 */
- {MISENSOR_16BIT, 0xC85A, 0x01E0}, /* cam_crop_window_height = 538 */
- {MISENSOR_8BIT, 0xC85C, 0x03}, /* cam_crop_cropmode = 3 */
- {MISENSOR_16BIT, 0xC868, 0x0280}, /* cam_output_width = 952 */
- {MISENSOR_16BIT, 0xC86A, 0x01E0}, /* cam_output_height = 538 */
- /*
- * LOAD = Step3-Recommended
- * Patch, Errata and Sensor optimization Setting
- */
- {MISENSOR_16BIT, 0x316A, 0x8270}, /* DAC_TXLO_ROW */
- {MISENSOR_16BIT, 0x316C, 0x8270}, /* DAC_TXLO */
- {MISENSOR_16BIT, 0x3ED0, 0x2305}, /* DAC_LD_4_5 */
- {MISENSOR_16BIT, 0x3ED2, 0x77CF}, /* DAC_LD_6_7 */
- {MISENSOR_16BIT, 0x316E, 0x8202}, /* DAC_ECL */
- {MISENSOR_16BIT, 0x3180, 0x87FF}, /* DELTA_DK_CONTROL */
- {MISENSOR_16BIT, 0x30D4, 0x6080}, /* COLUMN_CORRECTION */
- {MISENSOR_16BIT, 0xA802, 0x0008}, /* AE_TRACK_MODE */
- {MISENSOR_16BIT, 0x3E14, 0xFF39}, /* SAMP_COL_PUP2 */
- {MISENSOR_16BIT, 0x31E0, 0x0003}, /* PIX_DEF_ID */
- /* LOAD = Step8-Features //Ports, special features, etc. */
- {MISENSOR_16BIT, 0x098E, 0x0000}, /* LOGICAL_ADDRESS_ACCESS */
- {MISENSOR_16BIT, 0x001E, 0x0777}, /* PAD_SLEW */
- {MISENSOR_16BIT, 0x098E, 0x0000}, /* LOGICAL_ADDRESS_ACCESS */
- {MISENSOR_16BIT, 0xC984, 0x8001}, /* CAM_PORT_OUTPUT_CONTROL */
- {MISENSOR_16BIT, 0xC988, 0x0F00}, /* CAM_PORT_MIPI_TIMING_T_HS_ZERO */
- /* CAM_PORT_MIPI_TIMING_T_HS_EXIT_HS_TRAIL */
- {MISENSOR_16BIT, 0xC98A, 0x0B07},
- /* CAM_PORT_MIPI_TIMING_T_CLK_POST_CLK_PRE */
- {MISENSOR_16BIT, 0xC98C, 0x0D01},
- /* CAM_PORT_MIPI_TIMING_T_CLK_TRAIL_CLK_ZERO */
- {MISENSOR_16BIT, 0xC98E, 0x071D},
- {MISENSOR_16BIT, 0xC990, 0x0006}, /* CAM_PORT_MIPI_TIMING_T_LPX */
- {MISENSOR_16BIT, 0xC992, 0x0A0C}, /* CAM_PORT_MIPI_TIMING_INIT_TIMING */
- {MISENSOR_16BIT, 0x3C5A, 0x0009}, /* MIPI_DELAY_TRIM */
- {MISENSOR_16BIT, 0xC86C, 0x0210}, /* CAM_OUTPUT_FORMAT */
- {MISENSOR_16BIT, 0xA804, 0x0000}, /* AE_TRACK_ALGO */
- /* default exposure */
- {MISENSOR_16BIT, 0x3012, 0x0110}, /* COMMAND_REGISTER */
- {MISENSOR_TOK_TERM, 0, 0},
-
-};
-
-#if 0 /* Currently unused */
-static struct misensor_reg const mt9m114_antiflicker_50hz[] = {
- {MISENSOR_16BIT, 0x098E, 0xC88B},
- {MISENSOR_8BIT, 0xC88B, 0x32},
- {MISENSOR_8BIT, 0xDC00, 0x28},
- {MISENSOR_16BIT, 0x0080, 0x8002},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-static struct misensor_reg const mt9m114_antiflicker_60hz[] = {
- {MISENSOR_16BIT, 0x098E, 0xC88B},
- {MISENSOR_8BIT, 0xC88B, 0x3C},
- {MISENSOR_8BIT, 0xDC00, 0x28},
- {MISENSOR_16BIT, 0x0080, 0x8002},
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-static struct misensor_reg const mt9m114_iq[] = {
- /* [Step3-Recommended] [Sensor optimization] */
- {MISENSOR_16BIT, 0x316A, 0x8270},
- {MISENSOR_16BIT, 0x316C, 0x8270},
- {MISENSOR_16BIT, 0x3ED0, 0x2305},
- {MISENSOR_16BIT, 0x3ED2, 0x77CF},
- {MISENSOR_16BIT, 0x316E, 0x8202},
- {MISENSOR_16BIT, 0x3180, 0x87FF},
- {MISENSOR_16BIT, 0x30D4, 0x6080},
- {MISENSOR_16BIT, 0xA802, 0x0008},
-
- /* This register is from vender to avoid low light color noise */
- {MISENSOR_16BIT, 0x31E0, 0x0001},
-
- /* LOAD=Errata item 1 */
- {MISENSOR_16BIT, 0x3E14, 0xFF39},
-
- /* LOAD=Errata item 2 */
- {MISENSOR_16BIT, 0x301A, 0x8234},
-
- /*
- * LOAD=Errata item 3
- * LOAD=Patch 0202;
- * Feature Recommended; Black level correction fix
- */
- {MISENSOR_16BIT, 0x0982, 0x0001},
- {MISENSOR_16BIT, 0x098A, 0x5000},
- {MISENSOR_16BIT, 0xD000, 0x70CF},
- {MISENSOR_16BIT, 0xD002, 0xFFFF},
- {MISENSOR_16BIT, 0xD004, 0xC5D4},
- {MISENSOR_16BIT, 0xD006, 0x903A},
- {MISENSOR_16BIT, 0xD008, 0x2144},
- {MISENSOR_16BIT, 0xD00A, 0x0C00},
- {MISENSOR_16BIT, 0xD00C, 0x2186},
- {MISENSOR_16BIT, 0xD00E, 0x0FF3},
- {MISENSOR_16BIT, 0xD010, 0xB844},
- {MISENSOR_16BIT, 0xD012, 0xB948},
- {MISENSOR_16BIT, 0xD014, 0xE082},
- {MISENSOR_16BIT, 0xD016, 0x20CC},
- {MISENSOR_16BIT, 0xD018, 0x80E2},
- {MISENSOR_16BIT, 0xD01A, 0x21CC},
- {MISENSOR_16BIT, 0xD01C, 0x80A2},
- {MISENSOR_16BIT, 0xD01E, 0x21CC},
- {MISENSOR_16BIT, 0xD020, 0x80E2},
- {MISENSOR_16BIT, 0xD022, 0xF404},
- {MISENSOR_16BIT, 0xD024, 0xD801},
- {MISENSOR_16BIT, 0xD026, 0xF003},
- {MISENSOR_16BIT, 0xD028, 0xD800},
- {MISENSOR_16BIT, 0xD02A, 0x7EE0},
- {MISENSOR_16BIT, 0xD02C, 0xC0F1},
- {MISENSOR_16BIT, 0xD02E, 0x08BA},
-
- {MISENSOR_16BIT, 0xD030, 0x0600},
- {MISENSOR_16BIT, 0xD032, 0xC1A1},
- {MISENSOR_16BIT, 0xD034, 0x76CF},
- {MISENSOR_16BIT, 0xD036, 0xFFFF},
- {MISENSOR_16BIT, 0xD038, 0xC130},
- {MISENSOR_16BIT, 0xD03A, 0x6E04},
- {MISENSOR_16BIT, 0xD03C, 0xC040},
- {MISENSOR_16BIT, 0xD03E, 0x71CF},
- {MISENSOR_16BIT, 0xD040, 0xFFFF},
- {MISENSOR_16BIT, 0xD042, 0xC790},
- {MISENSOR_16BIT, 0xD044, 0x8103},
- {MISENSOR_16BIT, 0xD046, 0x77CF},
- {MISENSOR_16BIT, 0xD048, 0xFFFF},
- {MISENSOR_16BIT, 0xD04A, 0xC7C0},
- {MISENSOR_16BIT, 0xD04C, 0xE001},
- {MISENSOR_16BIT, 0xD04E, 0xA103},
- {MISENSOR_16BIT, 0xD050, 0xD800},
- {MISENSOR_16BIT, 0xD052, 0x0C6A},
- {MISENSOR_16BIT, 0xD054, 0x04E0},
- {MISENSOR_16BIT, 0xD056, 0xB89E},
- {MISENSOR_16BIT, 0xD058, 0x7508},
- {MISENSOR_16BIT, 0xD05A, 0x8E1C},
- {MISENSOR_16BIT, 0xD05C, 0x0809},
- {MISENSOR_16BIT, 0xD05E, 0x0191},
-
- {MISENSOR_16BIT, 0xD060, 0xD801},
- {MISENSOR_16BIT, 0xD062, 0xAE1D},
- {MISENSOR_16BIT, 0xD064, 0xE580},
- {MISENSOR_16BIT, 0xD066, 0x20CA},
- {MISENSOR_16BIT, 0xD068, 0x0022},
- {MISENSOR_16BIT, 0xD06A, 0x20CF},
- {MISENSOR_16BIT, 0xD06C, 0x0522},
- {MISENSOR_16BIT, 0xD06E, 0x0C5C},
- {MISENSOR_16BIT, 0xD070, 0x04E2},
- {MISENSOR_16BIT, 0xD072, 0x21CA},
- {MISENSOR_16BIT, 0xD074, 0x0062},
- {MISENSOR_16BIT, 0xD076, 0xE580},
- {MISENSOR_16BIT, 0xD078, 0xD901},
- {MISENSOR_16BIT, 0xD07A, 0x79C0},
- {MISENSOR_16BIT, 0xD07C, 0xD800},
- {MISENSOR_16BIT, 0xD07E, 0x0BE6},
- {MISENSOR_16BIT, 0xD080, 0x04E0},
- {MISENSOR_16BIT, 0xD082, 0xB89E},
- {MISENSOR_16BIT, 0xD084, 0x70CF},
- {MISENSOR_16BIT, 0xD086, 0xFFFF},
- {MISENSOR_16BIT, 0xD088, 0xC8D4},
- {MISENSOR_16BIT, 0xD08A, 0x9002},
- {MISENSOR_16BIT, 0xD08C, 0x0857},
- {MISENSOR_16BIT, 0xD08E, 0x025E},
-
- {MISENSOR_16BIT, 0xD090, 0xFFDC},
- {MISENSOR_16BIT, 0xD092, 0xE080},
- {MISENSOR_16BIT, 0xD094, 0x25CC},
- {MISENSOR_16BIT, 0xD096, 0x9022},
- {MISENSOR_16BIT, 0xD098, 0xF225},
- {MISENSOR_16BIT, 0xD09A, 0x1700},
- {MISENSOR_16BIT, 0xD09C, 0x108A},
- {MISENSOR_16BIT, 0xD09E, 0x73CF},
- {MISENSOR_16BIT, 0xD0A0, 0xFF00},
- {MISENSOR_16BIT, 0xD0A2, 0x3174},
- {MISENSOR_16BIT, 0xD0A4, 0x9307},
- {MISENSOR_16BIT, 0xD0A6, 0x2A04},
- {MISENSOR_16BIT, 0xD0A8, 0x103E},
- {MISENSOR_16BIT, 0xD0AA, 0x9328},
- {MISENSOR_16BIT, 0xD0AC, 0x2942},
- {MISENSOR_16BIT, 0xD0AE, 0x7140},
- {MISENSOR_16BIT, 0xD0B0, 0x2A04},
- {MISENSOR_16BIT, 0xD0B2, 0x107E},
- {MISENSOR_16BIT, 0xD0B4, 0x9349},
- {MISENSOR_16BIT, 0xD0B6, 0x2942},
- {MISENSOR_16BIT, 0xD0B8, 0x7141},
- {MISENSOR_16BIT, 0xD0BA, 0x2A04},
- {MISENSOR_16BIT, 0xD0BC, 0x10BE},
- {MISENSOR_16BIT, 0xD0BE, 0x934A},
-
- {MISENSOR_16BIT, 0xD0C0, 0x2942},
- {MISENSOR_16BIT, 0xD0C2, 0x714B},
- {MISENSOR_16BIT, 0xD0C4, 0x2A04},
- {MISENSOR_16BIT, 0xD0C6, 0x10BE},
- {MISENSOR_16BIT, 0xD0C8, 0x130C},
- {MISENSOR_16BIT, 0xD0CA, 0x010A},
- {MISENSOR_16BIT, 0xD0CC, 0x2942},
- {MISENSOR_16BIT, 0xD0CE, 0x7142},
- {MISENSOR_16BIT, 0xD0D0, 0x2250},
- {MISENSOR_16BIT, 0xD0D2, 0x13CA},
- {MISENSOR_16BIT, 0xD0D4, 0x1B0C},
- {MISENSOR_16BIT, 0xD0D6, 0x0284},
- {MISENSOR_16BIT, 0xD0D8, 0xB307},
- {MISENSOR_16BIT, 0xD0DA, 0xB328},
- {MISENSOR_16BIT, 0xD0DC, 0x1B12},
- {MISENSOR_16BIT, 0xD0DE, 0x02C4},
- {MISENSOR_16BIT, 0xD0E0, 0xB34A},
- {MISENSOR_16BIT, 0xD0E2, 0xED88},
- {MISENSOR_16BIT, 0xD0E4, 0x71CF},
- {MISENSOR_16BIT, 0xD0E6, 0xFF00},
- {MISENSOR_16BIT, 0xD0E8, 0x3174},
- {MISENSOR_16BIT, 0xD0EA, 0x9106},
- {MISENSOR_16BIT, 0xD0EC, 0xB88F},
- {MISENSOR_16BIT, 0xD0EE, 0xB106},
-
- {MISENSOR_16BIT, 0xD0F0, 0x210A},
- {MISENSOR_16BIT, 0xD0F2, 0x8340},
- {MISENSOR_16BIT, 0xD0F4, 0xC000},
- {MISENSOR_16BIT, 0xD0F6, 0x21CA},
- {MISENSOR_16BIT, 0xD0F8, 0x0062},
- {MISENSOR_16BIT, 0xD0FA, 0x20F0},
- {MISENSOR_16BIT, 0xD0FC, 0x0040},
- {MISENSOR_16BIT, 0xD0FE, 0x0B02},
- {MISENSOR_16BIT, 0xD100, 0x0320},
- {MISENSOR_16BIT, 0xD102, 0xD901},
- {MISENSOR_16BIT, 0xD104, 0x07F1},
- {MISENSOR_16BIT, 0xD106, 0x05E0},
- {MISENSOR_16BIT, 0xD108, 0xC0A1},
- {MISENSOR_16BIT, 0xD10A, 0x78E0},
- {MISENSOR_16BIT, 0xD10C, 0xC0F1},
- {MISENSOR_16BIT, 0xD10E, 0x71CF},
- {MISENSOR_16BIT, 0xD110, 0xFFFF},
- {MISENSOR_16BIT, 0xD112, 0xC7C0},
- {MISENSOR_16BIT, 0xD114, 0xD840},
- {MISENSOR_16BIT, 0xD116, 0xA900},
- {MISENSOR_16BIT, 0xD118, 0x71CF},
- {MISENSOR_16BIT, 0xD11A, 0xFFFF},
- {MISENSOR_16BIT, 0xD11C, 0xD02C},
- {MISENSOR_16BIT, 0xD11E, 0xD81E},
-
- {MISENSOR_16BIT, 0xD120, 0x0A5A},
- {MISENSOR_16BIT, 0xD122, 0x04E0},
- {MISENSOR_16BIT, 0xD124, 0xDA00},
- {MISENSOR_16BIT, 0xD126, 0xD800},
- {MISENSOR_16BIT, 0xD128, 0xC0D1},
- {MISENSOR_16BIT, 0xD12A, 0x7EE0},
-
- {MISENSOR_16BIT, 0x098E, 0x0000},
- {MISENSOR_16BIT, 0xE000, 0x010C},
- {MISENSOR_16BIT, 0xE002, 0x0202},
- {MISENSOR_16BIT, 0xE004, 0x4103},
- {MISENSOR_16BIT, 0xE006, 0x0202},
- {MISENSOR_16BIT, 0x0080, 0xFFF0},
- {MISENSOR_16BIT, 0x0080, 0xFFF1},
-
- /* LOAD=Patch 0302; Feature Recommended; Adaptive Sensitivity */
- {MISENSOR_16BIT, 0x0982, 0x0001},
- {MISENSOR_16BIT, 0x098A, 0x512C},
- {MISENSOR_16BIT, 0xD12C, 0x70CF},
- {MISENSOR_16BIT, 0xD12E, 0xFFFF},
- {MISENSOR_16BIT, 0xD130, 0xC5D4},
- {MISENSOR_16BIT, 0xD132, 0x903A},
- {MISENSOR_16BIT, 0xD134, 0x2144},
- {MISENSOR_16BIT, 0xD136, 0x0C00},
- {MISENSOR_16BIT, 0xD138, 0x2186},
- {MISENSOR_16BIT, 0xD13A, 0x0FF3},
- {MISENSOR_16BIT, 0xD13C, 0xB844},
- {MISENSOR_16BIT, 0xD13E, 0x262F},
- {MISENSOR_16BIT, 0xD140, 0xF008},
- {MISENSOR_16BIT, 0xD142, 0xB948},
- {MISENSOR_16BIT, 0xD144, 0x21CC},
- {MISENSOR_16BIT, 0xD146, 0x8021},
- {MISENSOR_16BIT, 0xD148, 0xD801},
- {MISENSOR_16BIT, 0xD14A, 0xF203},
- {MISENSOR_16BIT, 0xD14C, 0xD800},
- {MISENSOR_16BIT, 0xD14E, 0x7EE0},
- {MISENSOR_16BIT, 0xD150, 0xC0F1},
- {MISENSOR_16BIT, 0xD152, 0x71CF},
- {MISENSOR_16BIT, 0xD154, 0xFFFF},
- {MISENSOR_16BIT, 0xD156, 0xC610},
- {MISENSOR_16BIT, 0xD158, 0x910E},
- {MISENSOR_16BIT, 0xD15A, 0x208C},
- {MISENSOR_16BIT, 0xD15C, 0x8014},
- {MISENSOR_16BIT, 0xD15E, 0xF418},
- {MISENSOR_16BIT, 0xD160, 0x910F},
- {MISENSOR_16BIT, 0xD162, 0x208C},
- {MISENSOR_16BIT, 0xD164, 0x800F},
- {MISENSOR_16BIT, 0xD166, 0xF414},
- {MISENSOR_16BIT, 0xD168, 0x9116},
- {MISENSOR_16BIT, 0xD16A, 0x208C},
- {MISENSOR_16BIT, 0xD16C, 0x800A},
- {MISENSOR_16BIT, 0xD16E, 0xF410},
- {MISENSOR_16BIT, 0xD170, 0x9117},
- {MISENSOR_16BIT, 0xD172, 0x208C},
- {MISENSOR_16BIT, 0xD174, 0x8807},
- {MISENSOR_16BIT, 0xD176, 0xF40C},
- {MISENSOR_16BIT, 0xD178, 0x9118},
- {MISENSOR_16BIT, 0xD17A, 0x2086},
- {MISENSOR_16BIT, 0xD17C, 0x0FF3},
- {MISENSOR_16BIT, 0xD17E, 0xB848},
- {MISENSOR_16BIT, 0xD180, 0x080D},
- {MISENSOR_16BIT, 0xD182, 0x0090},
- {MISENSOR_16BIT, 0xD184, 0xFFEA},
- {MISENSOR_16BIT, 0xD186, 0xE081},
- {MISENSOR_16BIT, 0xD188, 0xD801},
- {MISENSOR_16BIT, 0xD18A, 0xF203},
- {MISENSOR_16BIT, 0xD18C, 0xD800},
- {MISENSOR_16BIT, 0xD18E, 0xC0D1},
- {MISENSOR_16BIT, 0xD190, 0x7EE0},
- {MISENSOR_16BIT, 0xD192, 0x78E0},
- {MISENSOR_16BIT, 0xD194, 0xC0F1},
- {MISENSOR_16BIT, 0xD196, 0x71CF},
- {MISENSOR_16BIT, 0xD198, 0xFFFF},
- {MISENSOR_16BIT, 0xD19A, 0xC610},
- {MISENSOR_16BIT, 0xD19C, 0x910E},
- {MISENSOR_16BIT, 0xD19E, 0x208C},
- {MISENSOR_16BIT, 0xD1A0, 0x800A},
- {MISENSOR_16BIT, 0xD1A2, 0xF418},
- {MISENSOR_16BIT, 0xD1A4, 0x910F},
- {MISENSOR_16BIT, 0xD1A6, 0x208C},
- {MISENSOR_16BIT, 0xD1A8, 0x8807},
- {MISENSOR_16BIT, 0xD1AA, 0xF414},
- {MISENSOR_16BIT, 0xD1AC, 0x9116},
- {MISENSOR_16BIT, 0xD1AE, 0x208C},
- {MISENSOR_16BIT, 0xD1B0, 0x800A},
- {MISENSOR_16BIT, 0xD1B2, 0xF410},
- {MISENSOR_16BIT, 0xD1B4, 0x9117},
- {MISENSOR_16BIT, 0xD1B6, 0x208C},
- {MISENSOR_16BIT, 0xD1B8, 0x8807},
- {MISENSOR_16BIT, 0xD1BA, 0xF40C},
- {MISENSOR_16BIT, 0xD1BC, 0x9118},
- {MISENSOR_16BIT, 0xD1BE, 0x2086},
- {MISENSOR_16BIT, 0xD1C0, 0x0FF3},
- {MISENSOR_16BIT, 0xD1C2, 0xB848},
- {MISENSOR_16BIT, 0xD1C4, 0x080D},
- {MISENSOR_16BIT, 0xD1C6, 0x0090},
- {MISENSOR_16BIT, 0xD1C8, 0xFFD9},
- {MISENSOR_16BIT, 0xD1CA, 0xE080},
- {MISENSOR_16BIT, 0xD1CC, 0xD801},
- {MISENSOR_16BIT, 0xD1CE, 0xF203},
- {MISENSOR_16BIT, 0xD1D0, 0xD800},
- {MISENSOR_16BIT, 0xD1D2, 0xF1DF},
- {MISENSOR_16BIT, 0xD1D4, 0x9040},
- {MISENSOR_16BIT, 0xD1D6, 0x71CF},
- {MISENSOR_16BIT, 0xD1D8, 0xFFFF},
- {MISENSOR_16BIT, 0xD1DA, 0xC5D4},
- {MISENSOR_16BIT, 0xD1DC, 0xB15A},
- {MISENSOR_16BIT, 0xD1DE, 0x9041},
- {MISENSOR_16BIT, 0xD1E0, 0x73CF},
- {MISENSOR_16BIT, 0xD1E2, 0xFFFF},
- {MISENSOR_16BIT, 0xD1E4, 0xC7D0},
- {MISENSOR_16BIT, 0xD1E6, 0xB140},
- {MISENSOR_16BIT, 0xD1E8, 0x9042},
- {MISENSOR_16BIT, 0xD1EA, 0xB141},
- {MISENSOR_16BIT, 0xD1EC, 0x9043},
- {MISENSOR_16BIT, 0xD1EE, 0xB142},
- {MISENSOR_16BIT, 0xD1F0, 0x9044},
- {MISENSOR_16BIT, 0xD1F2, 0xB143},
- {MISENSOR_16BIT, 0xD1F4, 0x9045},
- {MISENSOR_16BIT, 0xD1F6, 0xB147},
- {MISENSOR_16BIT, 0xD1F8, 0x9046},
- {MISENSOR_16BIT, 0xD1FA, 0xB148},
- {MISENSOR_16BIT, 0xD1FC, 0x9047},
- {MISENSOR_16BIT, 0xD1FE, 0xB14B},
- {MISENSOR_16BIT, 0xD200, 0x9048},
- {MISENSOR_16BIT, 0xD202, 0xB14C},
- {MISENSOR_16BIT, 0xD204, 0x9049},
- {MISENSOR_16BIT, 0xD206, 0x1958},
- {MISENSOR_16BIT, 0xD208, 0x0084},
- {MISENSOR_16BIT, 0xD20A, 0x904A},
- {MISENSOR_16BIT, 0xD20C, 0x195A},
- {MISENSOR_16BIT, 0xD20E, 0x0084},
- {MISENSOR_16BIT, 0xD210, 0x8856},
- {MISENSOR_16BIT, 0xD212, 0x1B36},
- {MISENSOR_16BIT, 0xD214, 0x8082},
- {MISENSOR_16BIT, 0xD216, 0x8857},
- {MISENSOR_16BIT, 0xD218, 0x1B37},
- {MISENSOR_16BIT, 0xD21A, 0x8082},
- {MISENSOR_16BIT, 0xD21C, 0x904C},
- {MISENSOR_16BIT, 0xD21E, 0x19A7},
- {MISENSOR_16BIT, 0xD220, 0x009C},
- {MISENSOR_16BIT, 0xD222, 0x881A},
- {MISENSOR_16BIT, 0xD224, 0x7FE0},
- {MISENSOR_16BIT, 0xD226, 0x1B54},
- {MISENSOR_16BIT, 0xD228, 0x8002},
- {MISENSOR_16BIT, 0xD22A, 0x78E0},
- {MISENSOR_16BIT, 0xD22C, 0x71CF},
- {MISENSOR_16BIT, 0xD22E, 0xFFFF},
- {MISENSOR_16BIT, 0xD230, 0xC350},
- {MISENSOR_16BIT, 0xD232, 0xD828},
- {MISENSOR_16BIT, 0xD234, 0xA90B},
- {MISENSOR_16BIT, 0xD236, 0x8100},
- {MISENSOR_16BIT, 0xD238, 0x01C5},
- {MISENSOR_16BIT, 0xD23A, 0x0320},
- {MISENSOR_16BIT, 0xD23C, 0xD900},
- {MISENSOR_16BIT, 0xD23E, 0x78E0},
- {MISENSOR_16BIT, 0xD240, 0x220A},
- {MISENSOR_16BIT, 0xD242, 0x1F80},
- {MISENSOR_16BIT, 0xD244, 0xFFFF},
- {MISENSOR_16BIT, 0xD246, 0xD4E0},
- {MISENSOR_16BIT, 0xD248, 0xC0F1},
- {MISENSOR_16BIT, 0xD24A, 0x0811},
- {MISENSOR_16BIT, 0xD24C, 0x0051},
- {MISENSOR_16BIT, 0xD24E, 0x2240},
- {MISENSOR_16BIT, 0xD250, 0x1200},
- {MISENSOR_16BIT, 0xD252, 0xFFE1},
- {MISENSOR_16BIT, 0xD254, 0xD801},
- {MISENSOR_16BIT, 0xD256, 0xF006},
- {MISENSOR_16BIT, 0xD258, 0x2240},
- {MISENSOR_16BIT, 0xD25A, 0x1900},
- {MISENSOR_16BIT, 0xD25C, 0xFFDE},
- {MISENSOR_16BIT, 0xD25E, 0xD802},
- {MISENSOR_16BIT, 0xD260, 0x1A05},
- {MISENSOR_16BIT, 0xD262, 0x1002},
- {MISENSOR_16BIT, 0xD264, 0xFFF2},
- {MISENSOR_16BIT, 0xD266, 0xF195},
- {MISENSOR_16BIT, 0xD268, 0xC0F1},
- {MISENSOR_16BIT, 0xD26A, 0x0E7E},
- {MISENSOR_16BIT, 0xD26C, 0x05C0},
- {MISENSOR_16BIT, 0xD26E, 0x75CF},
- {MISENSOR_16BIT, 0xD270, 0xFFFF},
- {MISENSOR_16BIT, 0xD272, 0xC84C},
- {MISENSOR_16BIT, 0xD274, 0x9502},
- {MISENSOR_16BIT, 0xD276, 0x77CF},
- {MISENSOR_16BIT, 0xD278, 0xFFFF},
- {MISENSOR_16BIT, 0xD27A, 0xC344},
- {MISENSOR_16BIT, 0xD27C, 0x2044},
- {MISENSOR_16BIT, 0xD27E, 0x008E},
- {MISENSOR_16BIT, 0xD280, 0xB8A1},
- {MISENSOR_16BIT, 0xD282, 0x0926},
- {MISENSOR_16BIT, 0xD284, 0x03E0},
- {MISENSOR_16BIT, 0xD286, 0xB502},
- {MISENSOR_16BIT, 0xD288, 0x9502},
- {MISENSOR_16BIT, 0xD28A, 0x952E},
- {MISENSOR_16BIT, 0xD28C, 0x7E05},
- {MISENSOR_16BIT, 0xD28E, 0xB5C2},
- {MISENSOR_16BIT, 0xD290, 0x70CF},
- {MISENSOR_16BIT, 0xD292, 0xFFFF},
- {MISENSOR_16BIT, 0xD294, 0xC610},
- {MISENSOR_16BIT, 0xD296, 0x099A},
- {MISENSOR_16BIT, 0xD298, 0x04A0},
- {MISENSOR_16BIT, 0xD29A, 0xB026},
- {MISENSOR_16BIT, 0xD29C, 0x0E02},
- {MISENSOR_16BIT, 0xD29E, 0x0560},
- {MISENSOR_16BIT, 0xD2A0, 0xDE00},
- {MISENSOR_16BIT, 0xD2A2, 0x0A12},
- {MISENSOR_16BIT, 0xD2A4, 0x0320},
- {MISENSOR_16BIT, 0xD2A6, 0xB7C4},
- {MISENSOR_16BIT, 0xD2A8, 0x0B36},
- {MISENSOR_16BIT, 0xD2AA, 0x03A0},
- {MISENSOR_16BIT, 0xD2AC, 0x70C9},
- {MISENSOR_16BIT, 0xD2AE, 0x9502},
- {MISENSOR_16BIT, 0xD2B0, 0x7608},
- {MISENSOR_16BIT, 0xD2B2, 0xB8A8},
- {MISENSOR_16BIT, 0xD2B4, 0xB502},
- {MISENSOR_16BIT, 0xD2B6, 0x70CF},
- {MISENSOR_16BIT, 0xD2B8, 0x0000},
- {MISENSOR_16BIT, 0xD2BA, 0x5536},
- {MISENSOR_16BIT, 0xD2BC, 0x7860},
- {MISENSOR_16BIT, 0xD2BE, 0x2686},
- {MISENSOR_16BIT, 0xD2C0, 0x1FFB},
- {MISENSOR_16BIT, 0xD2C2, 0x9502},
- {MISENSOR_16BIT, 0xD2C4, 0x78C5},
- {MISENSOR_16BIT, 0xD2C6, 0x0631},
- {MISENSOR_16BIT, 0xD2C8, 0x05E0},
- {MISENSOR_16BIT, 0xD2CA, 0xB502},
- {MISENSOR_16BIT, 0xD2CC, 0x72CF},
- {MISENSOR_16BIT, 0xD2CE, 0xFFFF},
- {MISENSOR_16BIT, 0xD2D0, 0xC5D4},
- {MISENSOR_16BIT, 0xD2D2, 0x923A},
- {MISENSOR_16BIT, 0xD2D4, 0x73CF},
- {MISENSOR_16BIT, 0xD2D6, 0xFFFF},
- {MISENSOR_16BIT, 0xD2D8, 0xC7D0},
- {MISENSOR_16BIT, 0xD2DA, 0xB020},
- {MISENSOR_16BIT, 0xD2DC, 0x9220},
- {MISENSOR_16BIT, 0xD2DE, 0xB021},
- {MISENSOR_16BIT, 0xD2E0, 0x9221},
- {MISENSOR_16BIT, 0xD2E2, 0xB022},
- {MISENSOR_16BIT, 0xD2E4, 0x9222},
- {MISENSOR_16BIT, 0xD2E6, 0xB023},
- {MISENSOR_16BIT, 0xD2E8, 0x9223},
- {MISENSOR_16BIT, 0xD2EA, 0xB024},
- {MISENSOR_16BIT, 0xD2EC, 0x9227},
- {MISENSOR_16BIT, 0xD2EE, 0xB025},
- {MISENSOR_16BIT, 0xD2F0, 0x9228},
- {MISENSOR_16BIT, 0xD2F2, 0xB026},
- {MISENSOR_16BIT, 0xD2F4, 0x922B},
- {MISENSOR_16BIT, 0xD2F6, 0xB027},
- {MISENSOR_16BIT, 0xD2F8, 0x922C},
- {MISENSOR_16BIT, 0xD2FA, 0xB028},
- {MISENSOR_16BIT, 0xD2FC, 0x1258},
- {MISENSOR_16BIT, 0xD2FE, 0x0101},
- {MISENSOR_16BIT, 0xD300, 0xB029},
- {MISENSOR_16BIT, 0xD302, 0x125A},
- {MISENSOR_16BIT, 0xD304, 0x0101},
- {MISENSOR_16BIT, 0xD306, 0xB02A},
- {MISENSOR_16BIT, 0xD308, 0x1336},
- {MISENSOR_16BIT, 0xD30A, 0x8081},
- {MISENSOR_16BIT, 0xD30C, 0xA836},
- {MISENSOR_16BIT, 0xD30E, 0x1337},
- {MISENSOR_16BIT, 0xD310, 0x8081},
- {MISENSOR_16BIT, 0xD312, 0xA837},
- {MISENSOR_16BIT, 0xD314, 0x12A7},
- {MISENSOR_16BIT, 0xD316, 0x0701},
- {MISENSOR_16BIT, 0xD318, 0xB02C},
- {MISENSOR_16BIT, 0xD31A, 0x1354},
- {MISENSOR_16BIT, 0xD31C, 0x8081},
- {MISENSOR_16BIT, 0xD31E, 0x7FE0},
- {MISENSOR_16BIT, 0xD320, 0xA83A},
- {MISENSOR_16BIT, 0xD322, 0x78E0},
- {MISENSOR_16BIT, 0xD324, 0xC0F1},
- {MISENSOR_16BIT, 0xD326, 0x0DC2},
- {MISENSOR_16BIT, 0xD328, 0x05C0},
- {MISENSOR_16BIT, 0xD32A, 0x7608},
- {MISENSOR_16BIT, 0xD32C, 0x09BB},
- {MISENSOR_16BIT, 0xD32E, 0x0010},
- {MISENSOR_16BIT, 0xD330, 0x75CF},
- {MISENSOR_16BIT, 0xD332, 0xFFFF},
- {MISENSOR_16BIT, 0xD334, 0xD4E0},
- {MISENSOR_16BIT, 0xD336, 0x8D21},
- {MISENSOR_16BIT, 0xD338, 0x8D00},
- {MISENSOR_16BIT, 0xD33A, 0x2153},
- {MISENSOR_16BIT, 0xD33C, 0x0003},
- {MISENSOR_16BIT, 0xD33E, 0xB8C0},
- {MISENSOR_16BIT, 0xD340, 0x8D45},
- {MISENSOR_16BIT, 0xD342, 0x0B23},
- {MISENSOR_16BIT, 0xD344, 0x0000},
- {MISENSOR_16BIT, 0xD346, 0xEA8F},
- {MISENSOR_16BIT, 0xD348, 0x0915},
- {MISENSOR_16BIT, 0xD34A, 0x001E},
- {MISENSOR_16BIT, 0xD34C, 0xFF81},
- {MISENSOR_16BIT, 0xD34E, 0xE808},
- {MISENSOR_16BIT, 0xD350, 0x2540},
- {MISENSOR_16BIT, 0xD352, 0x1900},
- {MISENSOR_16BIT, 0xD354, 0xFFDE},
- {MISENSOR_16BIT, 0xD356, 0x8D00},
- {MISENSOR_16BIT, 0xD358, 0xB880},
- {MISENSOR_16BIT, 0xD35A, 0xF004},
- {MISENSOR_16BIT, 0xD35C, 0x8D00},
- {MISENSOR_16BIT, 0xD35E, 0xB8A0},
- {MISENSOR_16BIT, 0xD360, 0xAD00},
- {MISENSOR_16BIT, 0xD362, 0x8D05},
- {MISENSOR_16BIT, 0xD364, 0xE081},
- {MISENSOR_16BIT, 0xD366, 0x20CC},
- {MISENSOR_16BIT, 0xD368, 0x80A2},
- {MISENSOR_16BIT, 0xD36A, 0xDF00},
- {MISENSOR_16BIT, 0xD36C, 0xF40A},
- {MISENSOR_16BIT, 0xD36E, 0x71CF},
- {MISENSOR_16BIT, 0xD370, 0xFFFF},
- {MISENSOR_16BIT, 0xD372, 0xC84C},
- {MISENSOR_16BIT, 0xD374, 0x9102},
- {MISENSOR_16BIT, 0xD376, 0x7708},
- {MISENSOR_16BIT, 0xD378, 0xB8A6},
- {MISENSOR_16BIT, 0xD37A, 0x2786},
- {MISENSOR_16BIT, 0xD37C, 0x1FFE},
- {MISENSOR_16BIT, 0xD37E, 0xB102},
- {MISENSOR_16BIT, 0xD380, 0x0B42},
- {MISENSOR_16BIT, 0xD382, 0x0180},
- {MISENSOR_16BIT, 0xD384, 0x0E3E},
- {MISENSOR_16BIT, 0xD386, 0x0180},
- {MISENSOR_16BIT, 0xD388, 0x0F4A},
- {MISENSOR_16BIT, 0xD38A, 0x0160},
- {MISENSOR_16BIT, 0xD38C, 0x70C9},
- {MISENSOR_16BIT, 0xD38E, 0x8D05},
- {MISENSOR_16BIT, 0xD390, 0xE081},
- {MISENSOR_16BIT, 0xD392, 0x20CC},
- {MISENSOR_16BIT, 0xD394, 0x80A2},
- {MISENSOR_16BIT, 0xD396, 0xF429},
- {MISENSOR_16BIT, 0xD398, 0x76CF},
- {MISENSOR_16BIT, 0xD39A, 0xFFFF},
- {MISENSOR_16BIT, 0xD39C, 0xC84C},
- {MISENSOR_16BIT, 0xD39E, 0x082D},
- {MISENSOR_16BIT, 0xD3A0, 0x0051},
- {MISENSOR_16BIT, 0xD3A2, 0x70CF},
- {MISENSOR_16BIT, 0xD3A4, 0xFFFF},
- {MISENSOR_16BIT, 0xD3A6, 0xC90C},
- {MISENSOR_16BIT, 0xD3A8, 0x8805},
- {MISENSOR_16BIT, 0xD3AA, 0x09B6},
- {MISENSOR_16BIT, 0xD3AC, 0x0360},
- {MISENSOR_16BIT, 0xD3AE, 0xD908},
- {MISENSOR_16BIT, 0xD3B0, 0x2099},
- {MISENSOR_16BIT, 0xD3B2, 0x0802},
- {MISENSOR_16BIT, 0xD3B4, 0x9634},
- {MISENSOR_16BIT, 0xD3B6, 0xB503},
- {MISENSOR_16BIT, 0xD3B8, 0x7902},
- {MISENSOR_16BIT, 0xD3BA, 0x1523},
- {MISENSOR_16BIT, 0xD3BC, 0x1080},
- {MISENSOR_16BIT, 0xD3BE, 0xB634},
- {MISENSOR_16BIT, 0xD3C0, 0xE001},
- {MISENSOR_16BIT, 0xD3C2, 0x1D23},
- {MISENSOR_16BIT, 0xD3C4, 0x1002},
- {MISENSOR_16BIT, 0xD3C6, 0xF00B},
- {MISENSOR_16BIT, 0xD3C8, 0x9634},
- {MISENSOR_16BIT, 0xD3CA, 0x9503},
- {MISENSOR_16BIT, 0xD3CC, 0x6038},
- {MISENSOR_16BIT, 0xD3CE, 0xB614},
- {MISENSOR_16BIT, 0xD3D0, 0x153F},
- {MISENSOR_16BIT, 0xD3D2, 0x1080},
- {MISENSOR_16BIT, 0xD3D4, 0xE001},
- {MISENSOR_16BIT, 0xD3D6, 0x1D3F},
- {MISENSOR_16BIT, 0xD3D8, 0x1002},
- {MISENSOR_16BIT, 0xD3DA, 0xFFA4},
- {MISENSOR_16BIT, 0xD3DC, 0x9602},
- {MISENSOR_16BIT, 0xD3DE, 0x7F05},
- {MISENSOR_16BIT, 0xD3E0, 0xD800},
- {MISENSOR_16BIT, 0xD3E2, 0xB6E2},
- {MISENSOR_16BIT, 0xD3E4, 0xAD05},
- {MISENSOR_16BIT, 0xD3E6, 0x0511},
- {MISENSOR_16BIT, 0xD3E8, 0x05E0},
- {MISENSOR_16BIT, 0xD3EA, 0xD800},
- {MISENSOR_16BIT, 0xD3EC, 0xC0F1},
- {MISENSOR_16BIT, 0xD3EE, 0x0CFE},
- {MISENSOR_16BIT, 0xD3F0, 0x05C0},
- {MISENSOR_16BIT, 0xD3F2, 0x0A96},
- {MISENSOR_16BIT, 0xD3F4, 0x05A0},
- {MISENSOR_16BIT, 0xD3F6, 0x7608},
- {MISENSOR_16BIT, 0xD3F8, 0x0C22},
- {MISENSOR_16BIT, 0xD3FA, 0x0240},
- {MISENSOR_16BIT, 0xD3FC, 0xE080},
- {MISENSOR_16BIT, 0xD3FE, 0x20CA},
- {MISENSOR_16BIT, 0xD400, 0x0F82},
- {MISENSOR_16BIT, 0xD402, 0x0000},
- {MISENSOR_16BIT, 0xD404, 0x190B},
- {MISENSOR_16BIT, 0xD406, 0x0C60},
- {MISENSOR_16BIT, 0xD408, 0x05A2},
- {MISENSOR_16BIT, 0xD40A, 0x21CA},
- {MISENSOR_16BIT, 0xD40C, 0x0022},
- {MISENSOR_16BIT, 0xD40E, 0x0C56},
- {MISENSOR_16BIT, 0xD410, 0x0240},
- {MISENSOR_16BIT, 0xD412, 0xE806},
- {MISENSOR_16BIT, 0xD414, 0x0E0E},
- {MISENSOR_16BIT, 0xD416, 0x0220},
- {MISENSOR_16BIT, 0xD418, 0x70C9},
- {MISENSOR_16BIT, 0xD41A, 0xF048},
- {MISENSOR_16BIT, 0xD41C, 0x0896},
- {MISENSOR_16BIT, 0xD41E, 0x0440},
- {MISENSOR_16BIT, 0xD420, 0x0E96},
- {MISENSOR_16BIT, 0xD422, 0x0400},
- {MISENSOR_16BIT, 0xD424, 0x0966},
- {MISENSOR_16BIT, 0xD426, 0x0380},
- {MISENSOR_16BIT, 0xD428, 0x75CF},
- {MISENSOR_16BIT, 0xD42A, 0xFFFF},
- {MISENSOR_16BIT, 0xD42C, 0xD4E0},
- {MISENSOR_16BIT, 0xD42E, 0x8D00},
- {MISENSOR_16BIT, 0xD430, 0x084D},
- {MISENSOR_16BIT, 0xD432, 0x001E},
- {MISENSOR_16BIT, 0xD434, 0xFF47},
- {MISENSOR_16BIT, 0xD436, 0x080D},
- {MISENSOR_16BIT, 0xD438, 0x0050},
- {MISENSOR_16BIT, 0xD43A, 0xFF57},
- {MISENSOR_16BIT, 0xD43C, 0x0841},
- {MISENSOR_16BIT, 0xD43E, 0x0051},
- {MISENSOR_16BIT, 0xD440, 0x8D04},
- {MISENSOR_16BIT, 0xD442, 0x9521},
- {MISENSOR_16BIT, 0xD444, 0xE064},
- {MISENSOR_16BIT, 0xD446, 0x790C},
- {MISENSOR_16BIT, 0xD448, 0x702F},
- {MISENSOR_16BIT, 0xD44A, 0x0CE2},
- {MISENSOR_16BIT, 0xD44C, 0x05E0},
- {MISENSOR_16BIT, 0xD44E, 0xD964},
- {MISENSOR_16BIT, 0xD450, 0x72CF},
- {MISENSOR_16BIT, 0xD452, 0xFFFF},
- {MISENSOR_16BIT, 0xD454, 0xC700},
- {MISENSOR_16BIT, 0xD456, 0x9235},
- {MISENSOR_16BIT, 0xD458, 0x0811},
- {MISENSOR_16BIT, 0xD45A, 0x0043},
- {MISENSOR_16BIT, 0xD45C, 0xFF3D},
- {MISENSOR_16BIT, 0xD45E, 0x080D},
- {MISENSOR_16BIT, 0xD460, 0x0051},
- {MISENSOR_16BIT, 0xD462, 0xD801},
- {MISENSOR_16BIT, 0xD464, 0xFF77},
- {MISENSOR_16BIT, 0xD466, 0xF025},
- {MISENSOR_16BIT, 0xD468, 0x9501},
- {MISENSOR_16BIT, 0xD46A, 0x9235},
- {MISENSOR_16BIT, 0xD46C, 0x0911},
- {MISENSOR_16BIT, 0xD46E, 0x0003},
- {MISENSOR_16BIT, 0xD470, 0xFF49},
- {MISENSOR_16BIT, 0xD472, 0x080D},
- {MISENSOR_16BIT, 0xD474, 0x0051},
- {MISENSOR_16BIT, 0xD476, 0xD800},
- {MISENSOR_16BIT, 0xD478, 0xFF72},
- {MISENSOR_16BIT, 0xD47A, 0xF01B},
- {MISENSOR_16BIT, 0xD47C, 0x0886},
- {MISENSOR_16BIT, 0xD47E, 0x03E0},
- {MISENSOR_16BIT, 0xD480, 0xD801},
- {MISENSOR_16BIT, 0xD482, 0x0EF6},
- {MISENSOR_16BIT, 0xD484, 0x03C0},
- {MISENSOR_16BIT, 0xD486, 0x0F52},
- {MISENSOR_16BIT, 0xD488, 0x0340},
- {MISENSOR_16BIT, 0xD48A, 0x0DBA},
- {MISENSOR_16BIT, 0xD48C, 0x0200},
- {MISENSOR_16BIT, 0xD48E, 0x0AF6},
- {MISENSOR_16BIT, 0xD490, 0x0440},
- {MISENSOR_16BIT, 0xD492, 0x0C22},
- {MISENSOR_16BIT, 0xD494, 0x0400},
- {MISENSOR_16BIT, 0xD496, 0x0D72},
- {MISENSOR_16BIT, 0xD498, 0x0440},
- {MISENSOR_16BIT, 0xD49A, 0x0DC2},
- {MISENSOR_16BIT, 0xD49C, 0x0200},
- {MISENSOR_16BIT, 0xD49E, 0x0972},
- {MISENSOR_16BIT, 0xD4A0, 0x0440},
- {MISENSOR_16BIT, 0xD4A2, 0x0D3A},
- {MISENSOR_16BIT, 0xD4A4, 0x0220},
- {MISENSOR_16BIT, 0xD4A6, 0xD820},
- {MISENSOR_16BIT, 0xD4A8, 0x0BFA},
- {MISENSOR_16BIT, 0xD4AA, 0x0260},
- {MISENSOR_16BIT, 0xD4AC, 0x70C9},
- {MISENSOR_16BIT, 0xD4AE, 0x0451},
- {MISENSOR_16BIT, 0xD4B0, 0x05C0},
- {MISENSOR_16BIT, 0xD4B2, 0x78E0},
- {MISENSOR_16BIT, 0xD4B4, 0xD900},
- {MISENSOR_16BIT, 0xD4B6, 0xF00A},
- {MISENSOR_16BIT, 0xD4B8, 0x70CF},
- {MISENSOR_16BIT, 0xD4BA, 0xFFFF},
- {MISENSOR_16BIT, 0xD4BC, 0xD520},
- {MISENSOR_16BIT, 0xD4BE, 0x7835},
- {MISENSOR_16BIT, 0xD4C0, 0x8041},
- {MISENSOR_16BIT, 0xD4C2, 0x8000},
- {MISENSOR_16BIT, 0xD4C4, 0xE102},
- {MISENSOR_16BIT, 0xD4C6, 0xA040},
- {MISENSOR_16BIT, 0xD4C8, 0x09F1},
- {MISENSOR_16BIT, 0xD4CA, 0x8114},
- {MISENSOR_16BIT, 0xD4CC, 0x71CF},
- {MISENSOR_16BIT, 0xD4CE, 0xFFFF},
- {MISENSOR_16BIT, 0xD4D0, 0xD4E0},
- {MISENSOR_16BIT, 0xD4D2, 0x70CF},
- {MISENSOR_16BIT, 0xD4D4, 0xFFFF},
- {MISENSOR_16BIT, 0xD4D6, 0xC594},
- {MISENSOR_16BIT, 0xD4D8, 0xB03A},
- {MISENSOR_16BIT, 0xD4DA, 0x7FE0},
- {MISENSOR_16BIT, 0xD4DC, 0xD800},
- {MISENSOR_16BIT, 0xD4DE, 0x0000},
- {MISENSOR_16BIT, 0xD4E0, 0x0000},
- {MISENSOR_16BIT, 0xD4E2, 0x0500},
- {MISENSOR_16BIT, 0xD4E4, 0x0500},
- {MISENSOR_16BIT, 0xD4E6, 0x0200},
- {MISENSOR_16BIT, 0xD4E8, 0x0330},
- {MISENSOR_16BIT, 0xD4EA, 0x0000},
- {MISENSOR_16BIT, 0xD4EC, 0x0000},
- {MISENSOR_16BIT, 0xD4EE, 0x03CD},
- {MISENSOR_16BIT, 0xD4F0, 0x050D},
- {MISENSOR_16BIT, 0xD4F2, 0x01C5},
- {MISENSOR_16BIT, 0xD4F4, 0x03B3},
- {MISENSOR_16BIT, 0xD4F6, 0x00E0},
- {MISENSOR_16BIT, 0xD4F8, 0x01E3},
- {MISENSOR_16BIT, 0xD4FA, 0x0280},
- {MISENSOR_16BIT, 0xD4FC, 0x01E0},
- {MISENSOR_16BIT, 0xD4FE, 0x0109},
- {MISENSOR_16BIT, 0xD500, 0x0080},
- {MISENSOR_16BIT, 0xD502, 0x0500},
- {MISENSOR_16BIT, 0xD504, 0x0000},
- {MISENSOR_16BIT, 0xD506, 0x0000},
- {MISENSOR_16BIT, 0xD508, 0x0000},
- {MISENSOR_16BIT, 0xD50A, 0x0000},
- {MISENSOR_16BIT, 0xD50C, 0x0000},
- {MISENSOR_16BIT, 0xD50E, 0x0000},
- {MISENSOR_16BIT, 0xD510, 0x0000},
- {MISENSOR_16BIT, 0xD512, 0x0000},
- {MISENSOR_16BIT, 0xD514, 0x0000},
- {MISENSOR_16BIT, 0xD516, 0x0000},
- {MISENSOR_16BIT, 0xD518, 0x0000},
- {MISENSOR_16BIT, 0xD51A, 0x0000},
- {MISENSOR_16BIT, 0xD51C, 0x0000},
- {MISENSOR_16BIT, 0xD51E, 0x0000},
- {MISENSOR_16BIT, 0xD520, 0xFFFF},
- {MISENSOR_16BIT, 0xD522, 0xC9B4},
- {MISENSOR_16BIT, 0xD524, 0xFFFF},
- {MISENSOR_16BIT, 0xD526, 0xD324},
- {MISENSOR_16BIT, 0xD528, 0xFFFF},
- {MISENSOR_16BIT, 0xD52A, 0xCA34},
- {MISENSOR_16BIT, 0xD52C, 0xFFFF},
- {MISENSOR_16BIT, 0xD52E, 0xD3EC},
- {MISENSOR_16BIT, 0x098E, 0x0000},
- {MISENSOR_16BIT, 0xE000, 0x04B4},
- {MISENSOR_16BIT, 0xE002, 0x0302},
- {MISENSOR_16BIT, 0xE004, 0x4103},
- {MISENSOR_16BIT, 0xE006, 0x0202},
- {MISENSOR_16BIT, 0x0080, 0xFFF0},
- {MISENSOR_16BIT, 0x0080, 0xFFF1},
-
- /* PGA parameter and APGA
- * [Step4-APGA] [TP101_MT9M114_APGA]
- */
- {MISENSOR_16BIT, 0x098E, 0x495E},
- {MISENSOR_16BIT, 0xC95E, 0x0000},
- {MISENSOR_16BIT, 0x3640, 0x02B0},
- {MISENSOR_16BIT, 0x3642, 0x8063},
- {MISENSOR_16BIT, 0x3644, 0x78D0},
- {MISENSOR_16BIT, 0x3646, 0x50CC},
- {MISENSOR_16BIT, 0x3648, 0x3511},
- {MISENSOR_16BIT, 0x364A, 0x0110},
- {MISENSOR_16BIT, 0x364C, 0xBD8A},
- {MISENSOR_16BIT, 0x364E, 0x0CD1},
- {MISENSOR_16BIT, 0x3650, 0x24ED},
- {MISENSOR_16BIT, 0x3652, 0x7C11},
- {MISENSOR_16BIT, 0x3654, 0x0150},
- {MISENSOR_16BIT, 0x3656, 0x124C},
- {MISENSOR_16BIT, 0x3658, 0x3130},
- {MISENSOR_16BIT, 0x365A, 0x508C},
- {MISENSOR_16BIT, 0x365C, 0x21F1},
- {MISENSOR_16BIT, 0x365E, 0x0090},
- {MISENSOR_16BIT, 0x3660, 0xBFCA},
- {MISENSOR_16BIT, 0x3662, 0x0A11},
- {MISENSOR_16BIT, 0x3664, 0x4F4B},
- {MISENSOR_16BIT, 0x3666, 0x28B1},
- {MISENSOR_16BIT, 0x3680, 0x50A9},
- {MISENSOR_16BIT, 0x3682, 0xA04B},
- {MISENSOR_16BIT, 0x3684, 0x0E2D},
- {MISENSOR_16BIT, 0x3686, 0x73EC},
- {MISENSOR_16BIT, 0x3688, 0x164F},
- {MISENSOR_16BIT, 0x368A, 0xF829},
- {MISENSOR_16BIT, 0x368C, 0xC1A8},
- {MISENSOR_16BIT, 0x368E, 0xB0EC},
- {MISENSOR_16BIT, 0x3690, 0xE76A},
- {MISENSOR_16BIT, 0x3692, 0x69AF},
- {MISENSOR_16BIT, 0x3694, 0x378C},
- {MISENSOR_16BIT, 0x3696, 0xA70D},
- {MISENSOR_16BIT, 0x3698, 0x884F},
- {MISENSOR_16BIT, 0x369A, 0xEE8B},
- {MISENSOR_16BIT, 0x369C, 0x5DEF},
- {MISENSOR_16BIT, 0x369E, 0x27CC},
- {MISENSOR_16BIT, 0x36A0, 0xCAAC},
- {MISENSOR_16BIT, 0x36A2, 0x840E},
- {MISENSOR_16BIT, 0x36A4, 0xDAA9},
- {MISENSOR_16BIT, 0x36A6, 0xF00C},
- {MISENSOR_16BIT, 0x36C0, 0x1371},
- {MISENSOR_16BIT, 0x36C2, 0x272F},
- {MISENSOR_16BIT, 0x36C4, 0x2293},
- {MISENSOR_16BIT, 0x36C6, 0xE6D0},
- {MISENSOR_16BIT, 0x36C8, 0xEC32},
- {MISENSOR_16BIT, 0x36CA, 0x11B1},
- {MISENSOR_16BIT, 0x36CC, 0x7BAF},
- {MISENSOR_16BIT, 0x36CE, 0x5813},
- {MISENSOR_16BIT, 0x36D0, 0xB871},
- {MISENSOR_16BIT, 0x36D2, 0x8913},
- {MISENSOR_16BIT, 0x36D4, 0x4610},
- {MISENSOR_16BIT, 0x36D6, 0x7EEE},
- {MISENSOR_16BIT, 0x36D8, 0x0DF3},
- {MISENSOR_16BIT, 0x36DA, 0xB84F},
- {MISENSOR_16BIT, 0x36DC, 0xB532},
- {MISENSOR_16BIT, 0x36DE, 0x1171},
- {MISENSOR_16BIT, 0x36E0, 0x13CF},
- {MISENSOR_16BIT, 0x36E2, 0x22F3},
- {MISENSOR_16BIT, 0x36E4, 0xE090},
- {MISENSOR_16BIT, 0x36E6, 0x8133},
- {MISENSOR_16BIT, 0x3700, 0x88AE},
- {MISENSOR_16BIT, 0x3702, 0x00EA},
- {MISENSOR_16BIT, 0x3704, 0x344F},
- {MISENSOR_16BIT, 0x3706, 0xEC88},
- {MISENSOR_16BIT, 0x3708, 0x3E91},
- {MISENSOR_16BIT, 0x370A, 0xF12D},
- {MISENSOR_16BIT, 0x370C, 0xB0EF},
- {MISENSOR_16BIT, 0x370E, 0x77CD},
- {MISENSOR_16BIT, 0x3710, 0x7930},
- {MISENSOR_16BIT, 0x3712, 0x5C12},
- {MISENSOR_16BIT, 0x3714, 0x500C},
- {MISENSOR_16BIT, 0x3716, 0x22CE},
- {MISENSOR_16BIT, 0x3718, 0x2370},
- {MISENSOR_16BIT, 0x371A, 0x258F},
- {MISENSOR_16BIT, 0x371C, 0x3D30},
- {MISENSOR_16BIT, 0x371E, 0x370C},
- {MISENSOR_16BIT, 0x3720, 0x03ED},
- {MISENSOR_16BIT, 0x3722, 0x9AD0},
- {MISENSOR_16BIT, 0x3724, 0x7ECF},
- {MISENSOR_16BIT, 0x3726, 0x1093},
- {MISENSOR_16BIT, 0x3740, 0x2391},
- {MISENSOR_16BIT, 0x3742, 0xAAD0},
- {MISENSOR_16BIT, 0x3744, 0x28F2},
- {MISENSOR_16BIT, 0x3746, 0xBA4F},
- {MISENSOR_16BIT, 0x3748, 0xC536},
- {MISENSOR_16BIT, 0x374A, 0x1472},
- {MISENSOR_16BIT, 0x374C, 0xD110},
- {MISENSOR_16BIT, 0x374E, 0x2933},
- {MISENSOR_16BIT, 0x3750, 0xD0D1},
- {MISENSOR_16BIT, 0x3752, 0x9F37},
- {MISENSOR_16BIT, 0x3754, 0x34D1},
- {MISENSOR_16BIT, 0x3756, 0x1C6C},
- {MISENSOR_16BIT, 0x3758, 0x3FD2},
- {MISENSOR_16BIT, 0x375A, 0xCB72},
- {MISENSOR_16BIT, 0x375C, 0xBA96},
- {MISENSOR_16BIT, 0x375E, 0x1551},
- {MISENSOR_16BIT, 0x3760, 0xB74F},
- {MISENSOR_16BIT, 0x3762, 0x1672},
- {MISENSOR_16BIT, 0x3764, 0x84F1},
- {MISENSOR_16BIT, 0x3766, 0xC2D6},
- {MISENSOR_16BIT, 0x3782, 0x01E0},
- {MISENSOR_16BIT, 0x3784, 0x0280},
- {MISENSOR_16BIT, 0x37C0, 0xA6EA},
- {MISENSOR_16BIT, 0x37C2, 0x874B},
- {MISENSOR_16BIT, 0x37C4, 0x85CB},
- {MISENSOR_16BIT, 0x37C6, 0x968A},
- {MISENSOR_16BIT, 0x098E, 0x0000},
- {MISENSOR_16BIT, 0xC960, 0x0AF0},
- {MISENSOR_16BIT, 0xC962, 0x79E2},
- {MISENSOR_16BIT, 0xC964, 0x5EC8},
- {MISENSOR_16BIT, 0xC966, 0x791F},
- {MISENSOR_16BIT, 0xC968, 0x76EE},
- {MISENSOR_16BIT, 0xC96A, 0x0FA0},
- {MISENSOR_16BIT, 0xC96C, 0x7DFA},
- {MISENSOR_16BIT, 0xC96E, 0x7DAF},
- {MISENSOR_16BIT, 0xC970, 0x7E02},
- {MISENSOR_16BIT, 0xC972, 0x7E0A},
- {MISENSOR_16BIT, 0xC974, 0x1964},
- {MISENSOR_16BIT, 0xC976, 0x7CDC},
- {MISENSOR_16BIT, 0xC978, 0x7838},
- {MISENSOR_16BIT, 0xC97A, 0x7C2F},
- {MISENSOR_16BIT, 0xC97C, 0x7792},
- {MISENSOR_16BIT, 0xC95E, 0x0003},
-
- /* [Step4-APGA] */
- {MISENSOR_16BIT, 0x098E, 0x0000},
- {MISENSOR_16BIT, 0xC95E, 0x0003},
-
- /* [Step5-AWB_CCM]1: LOAD=CCM */
- {MISENSOR_16BIT, 0xC892, 0x0267},
- {MISENSOR_16BIT, 0xC894, 0xFF1A},
- {MISENSOR_16BIT, 0xC896, 0xFFB3},
- {MISENSOR_16BIT, 0xC898, 0xFF80},
- {MISENSOR_16BIT, 0xC89A, 0x0166},
- {MISENSOR_16BIT, 0xC89C, 0x0003},
- {MISENSOR_16BIT, 0xC89E, 0xFF9A},
- {MISENSOR_16BIT, 0xC8A0, 0xFEB4},
- {MISENSOR_16BIT, 0xC8A2, 0x024D},
- {MISENSOR_16BIT, 0xC8A4, 0x01BF},
- {MISENSOR_16BIT, 0xC8A6, 0xFF01},
- {MISENSOR_16BIT, 0xC8A8, 0xFFF3},
- {MISENSOR_16BIT, 0xC8AA, 0xFF75},
- {MISENSOR_16BIT, 0xC8AC, 0x0198},
- {MISENSOR_16BIT, 0xC8AE, 0xFFFD},
- {MISENSOR_16BIT, 0xC8B0, 0xFF9A},
- {MISENSOR_16BIT, 0xC8B2, 0xFEE7},
- {MISENSOR_16BIT, 0xC8B4, 0x02A8},
- {MISENSOR_16BIT, 0xC8B6, 0x01D9},
- {MISENSOR_16BIT, 0xC8B8, 0xFF26},
- {MISENSOR_16BIT, 0xC8BA, 0xFFF3},
- {MISENSOR_16BIT, 0xC8BC, 0xFFB3},
- {MISENSOR_16BIT, 0xC8BE, 0x0132},
- {MISENSOR_16BIT, 0xC8C0, 0xFFE8},
- {MISENSOR_16BIT, 0xC8C2, 0xFFDA},
- {MISENSOR_16BIT, 0xC8C4, 0xFECD},
- {MISENSOR_16BIT, 0xC8C6, 0x02C2},
- {MISENSOR_16BIT, 0xC8C8, 0x0075},
- {MISENSOR_16BIT, 0xC8CA, 0x011C},
- {MISENSOR_16BIT, 0xC8CC, 0x009A},
- {MISENSOR_16BIT, 0xC8CE, 0x0105},
- {MISENSOR_16BIT, 0xC8D0, 0x00A4},
- {MISENSOR_16BIT, 0xC8D2, 0x00AC},
- {MISENSOR_16BIT, 0xC8D4, 0x0A8C},
- {MISENSOR_16BIT, 0xC8D6, 0x0F0A},
- {MISENSOR_16BIT, 0xC8D8, 0x1964},
-
- /* LOAD=AWB */
- {MISENSOR_16BIT, 0xC914, 0x0000},
- {MISENSOR_16BIT, 0xC916, 0x0000},
- {MISENSOR_16BIT, 0xC918, 0x04FF},
- {MISENSOR_16BIT, 0xC91A, 0x02CF},
- {MISENSOR_16BIT, 0xC904, 0x0033},
- {MISENSOR_16BIT, 0xC906, 0x0040},
- {MISENSOR_8BIT, 0xC8F2, 0x03},
- {MISENSOR_8BIT, 0xC8F3, 0x02},
- {MISENSOR_16BIT, 0xC906, 0x003C},
- {MISENSOR_16BIT, 0xC8F4, 0x0000},
- {MISENSOR_16BIT, 0xC8F6, 0x0000},
- {MISENSOR_16BIT, 0xC8F8, 0x0000},
- {MISENSOR_16BIT, 0xC8FA, 0xE724},
- {MISENSOR_16BIT, 0xC8FC, 0x1583},
- {MISENSOR_16BIT, 0xC8FE, 0x2045},
- {MISENSOR_16BIT, 0xC900, 0x05DC},
- {MISENSOR_16BIT, 0xC902, 0x007C},
- {MISENSOR_8BIT, 0xC90C, 0x80},
- {MISENSOR_8BIT, 0xC90D, 0x80},
- {MISENSOR_8BIT, 0xC90E, 0x80},
- {MISENSOR_8BIT, 0xC90F, 0x88},
- {MISENSOR_8BIT, 0xC910, 0x80},
- {MISENSOR_8BIT, 0xC911, 0x80},
-
- /* LOAD=Step7-CPIPE_Preference */
- {MISENSOR_16BIT, 0xC926, 0x0020},
- {MISENSOR_16BIT, 0xC928, 0x009A},
- {MISENSOR_16BIT, 0xC946, 0x0070},
- {MISENSOR_16BIT, 0xC948, 0x00F3},
- {MISENSOR_16BIT, 0xC952, 0x0020},
- {MISENSOR_16BIT, 0xC954, 0x009A},
- {MISENSOR_8BIT, 0xC92A, 0x80},
- {MISENSOR_8BIT, 0xC92B, 0x4B},
- {MISENSOR_8BIT, 0xC92C, 0x00},
- {MISENSOR_8BIT, 0xC92D, 0xFF},
- {MISENSOR_8BIT, 0xC92E, 0x3C},
- {MISENSOR_8BIT, 0xC92F, 0x02},
- {MISENSOR_8BIT, 0xC930, 0x06},
- {MISENSOR_8BIT, 0xC931, 0x64},
- {MISENSOR_8BIT, 0xC932, 0x01},
- {MISENSOR_8BIT, 0xC933, 0x0C},
- {MISENSOR_8BIT, 0xC934, 0x3C},
- {MISENSOR_8BIT, 0xC935, 0x3C},
- {MISENSOR_8BIT, 0xC936, 0x3C},
- {MISENSOR_8BIT, 0xC937, 0x0F},
- {MISENSOR_8BIT, 0xC938, 0x64},
- {MISENSOR_8BIT, 0xC939, 0x64},
- {MISENSOR_8BIT, 0xC93A, 0x64},
- {MISENSOR_8BIT, 0xC93B, 0x32},
- {MISENSOR_16BIT, 0xC93C, 0x0020},
- {MISENSOR_16BIT, 0xC93E, 0x009A},
- {MISENSOR_16BIT, 0xC940, 0x00DC},
- {MISENSOR_8BIT, 0xC942, 0x38},
- {MISENSOR_8BIT, 0xC943, 0x30},
- {MISENSOR_8BIT, 0xC944, 0x50},
- {MISENSOR_8BIT, 0xC945, 0x19},
- {MISENSOR_16BIT, 0xC94A, 0x0230},
- {MISENSOR_16BIT, 0xC94C, 0x0010},
- {MISENSOR_16BIT, 0xC94E, 0x01CD},
- {MISENSOR_8BIT, 0xC950, 0x05},
- {MISENSOR_8BIT, 0xC951, 0x40},
- {MISENSOR_8BIT, 0xC87B, 0x1B},
- {MISENSOR_8BIT, 0xC878, 0x0E},
- {MISENSOR_16BIT, 0xC890, 0x0080},
- {MISENSOR_16BIT, 0xC886, 0x0100},
- {MISENSOR_16BIT, 0xC87C, 0x005A},
- {MISENSOR_8BIT, 0xB42A, 0x05},
- {MISENSOR_8BIT, 0xA80A, 0x20},
-
- /* Speed up AE/AWB */
- {MISENSOR_16BIT, 0x098E, 0x2802},
- {MISENSOR_16BIT, 0xA802, 0x0008},
- {MISENSOR_8BIT, 0xC908, 0x01},
- {MISENSOR_8BIT, 0xC879, 0x01},
- {MISENSOR_8BIT, 0xC909, 0x02},
- {MISENSOR_8BIT, 0xA80A, 0x18},
- {MISENSOR_8BIT, 0xA80B, 0x18},
- {MISENSOR_8BIT, 0xAC16, 0x18},
- {MISENSOR_8BIT, 0xC878, 0x0E},
-
- {MISENSOR_TOK_TERM, 0, 0}
-};
-
-#endif
-#endif
diff --git a/drivers/staging/media/atomisp/pci/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
index 02ccf80e6559..3a4eb4f6d3be 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_cmd.c
@@ -87,7 +87,7 @@ static unsigned short atomisp_get_sensor_fps(struct atomisp_sub_device *asd)
unsigned short fps = 0;
int ret;
- ret = v4l2_subdev_call_state_active(isp->inputs[asd->input_curr].camera,
+ ret = v4l2_subdev_call_state_active(isp->inputs[asd->input_curr].sensor,
pad, get_frame_interval, &fi);
if (!ret && fi.interval.numerator)
@@ -881,7 +881,8 @@ void atomisp_assert_recovery_work(struct work_struct *work)
spin_unlock_irqrestore(&isp->lock, flags);
/* stream off sensor */
- ret = v4l2_subdev_call(isp->inputs[isp->asd.input_curr].camera, video, s_stream, 0);
+ ret = v4l2_subdev_call(isp->inputs[isp->asd.input_curr].csi_remote_source,
+ video, s_stream, 0);
if (ret)
dev_warn(isp->dev, "Stopping sensor stream failed: %d\n", ret);
@@ -936,7 +937,8 @@ void atomisp_assert_recovery_work(struct work_struct *work)
/* Requeue unprocessed per-frame parameters. */
atomisp_recover_params_queue(&isp->asd.video_out);
- ret = v4l2_subdev_call(isp->inputs[isp->asd.input_curr].camera, video, s_stream, 1);
+ ret = v4l2_subdev_call(isp->inputs[isp->asd.input_curr].csi_remote_source,
+ video, s_stream, 1);
if (ret)
dev_err(isp->dev, "Starting sensor stream failed: %d\n", ret);
@@ -3124,7 +3126,7 @@ int atomisp_color_effect(struct atomisp_sub_device *asd, int flag,
control.id = V4L2_CID_COLORFX;
control.value = *effect;
ret =
- v4l2_s_ctrl(NULL, isp->inputs[asd->input_curr].camera->ctrl_handler,
+ v4l2_s_ctrl(NULL, isp->inputs[asd->input_curr].sensor->ctrl_handler,
&control);
/*
* if set color effect to sensor successfully, return
@@ -3620,16 +3622,16 @@ int atomisp_s_sensor_power(struct atomisp_device *isp, unsigned int input, bool
{
int ret;
- if (isp->inputs[input].camera_on == on)
+ if (isp->inputs[input].sensor_on == on)
return 0;
- ret = v4l2_subdev_call(isp->inputs[input].camera, core, s_power, on);
+ ret = v4l2_subdev_call(isp->inputs[input].sensor, core, s_power, on);
if (ret && ret != -ENOIOCTLCMD) {
dev_err(isp->dev, "Error setting sensor power %d: %d\n", on, ret);
return ret;
}
- isp->inputs[input].camera_on = on;
+ isp->inputs[input].sensor_on = on;
return 0;
}
@@ -3677,7 +3679,7 @@ void atomisp_setup_input_links(struct atomisp_device *isp)
* will end up calling atomisp_link_setup() which calls this
* function again leading to endless recursion.
*/
- if (isp->sensor_subdevs[i] == isp->inputs[isp->asd.input_curr].camera)
+ if (isp->sensor_subdevs[i] == isp->inputs[isp->asd.input_curr].csi_remote_source)
link->flags |= MEDIA_LNK_FL_ENABLED;
else
link->flags &= ~MEDIA_LNK_FL_ENABLED;
@@ -3704,7 +3706,7 @@ static int atomisp_set_sensor_crop_and_fmt(struct atomisp_device *isp,
struct v4l2_subdev_state *sd_state;
int ret = 0;
- if (!input->camera)
+ if (!input->sensor)
return -EINVAL;
/*
@@ -3719,7 +3721,7 @@ static int atomisp_set_sensor_crop_and_fmt(struct atomisp_device *isp,
}
sd_state = (which == V4L2_SUBDEV_FORMAT_TRY) ? input->try_sd_state :
- input->camera->active_state;
+ input->sensor->active_state;
if (sd_state)
v4l2_subdev_lock_state(sd_state);
@@ -3740,20 +3742,44 @@ static int atomisp_set_sensor_crop_and_fmt(struct atomisp_device *isp,
sel.r.left = ((input->native_rect.width - sel.r.width) / 2) & ~1;
sel.r.top = ((input->native_rect.height - sel.r.height) / 2) & ~1;
- ret = v4l2_subdev_call(input->camera, pad, set_selection, sd_state, &sel);
+ ret = v4l2_subdev_call(input->sensor, pad, set_selection, sd_state, &sel);
if (ret)
- dev_err(isp->dev, "Error setting crop to %ux%u @%ux%u: %d\n",
- sel.r.width, sel.r.height, sel.r.left, sel.r.top, ret);
+ dev_err(isp->dev, "Error setting crop to (%d,%d)/%ux%u: %d\n",
+ sel.r.left, sel.r.top, sel.r.width, sel.r.height, ret);
set_fmt:
- if (ret == 0)
- ret = v4l2_subdev_call(input->camera, pad, set_fmt, sd_state, &format);
+ if (ret == 0) {
+ ret = v4l2_subdev_call(input->sensor, pad, set_fmt, sd_state, &format);
+ dev_dbg(isp->dev, "Set sensor format ret: %d size %dx%d\n",
+ ret, format.format.width, format.format.height);
+ }
if (sd_state)
v4l2_subdev_unlock_state(sd_state);
+ /* Propagate new fmt to sensor ISP */
+ if (ret == 0 && which == V4L2_SUBDEV_FORMAT_ACTIVE && input->sensor_isp) {
+ sd_state = v4l2_subdev_lock_and_get_active_state(input->sensor_isp);
+
+ format.pad = SENSOR_ISP_PAD_SINK;
+ ret = v4l2_subdev_call(input->sensor_isp, pad, set_fmt, sd_state, &format);
+ dev_dbg(isp->dev, "Set sensor ISP sink format ret: %d size %dx%d\n",
+ ret, format.format.width, format.format.height);
+
+ if (ret == 0) {
+ format.pad = SENSOR_ISP_PAD_SOURCE;
+ ret = v4l2_subdev_call(input->sensor_isp, pad, set_fmt, sd_state, &format);
+ dev_dbg(isp->dev, "Set sensor ISP source format ret: %d size %dx%d\n",
+ ret, format.format.width, format.format.height);
+ }
+
+ if (sd_state)
+ v4l2_subdev_unlock_state(sd_state);
+ }
+
/* Propagate new fmt to CSI port */
- if (which == V4L2_SUBDEV_FORMAT_ACTIVE) {
+ if (ret == 0 && which == V4L2_SUBDEV_FORMAT_ACTIVE) {
+ format.pad = CSI2_PAD_SINK;
ret = v4l2_subdev_call(input->csi_port, pad, set_fmt, NULL, &format);
if (ret)
return ret;
@@ -3784,9 +3810,14 @@ int atomisp_try_fmt(struct atomisp_device *isp, struct v4l2_pix_format *f,
return -EINVAL;
}
- /* The preview pipeline does not support width > 1920 */
- if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW)
- f->width = min_t(u32, f->width, 1920);
+ /*
+ * The preview pipeline does not support width > 1920. Also limit height
+ * to avoid sensor drivers still picking a too wide resolution.
+ */
+ if (asd->run_mode->val == ATOMISP_RUN_MODE_PREVIEW) {
+ f->width = min(f->width, 1920U);
+ f->height = min(f->height, 1440U);
+ }
/*
* atomisp_set_fmt() will set the sensor resolution to the requested
@@ -3875,7 +3906,7 @@ static inline int atomisp_set_sensor_mipi_to_isp(
u32 mipi_port, metadata_width = 0, metadata_height = 0;
ctrl.id = V4L2_CID_LINK_FREQ;
- if (v4l2_g_ctrl(input->camera->ctrl_handler, &ctrl) == 0)
+ if (v4l2_g_ctrl(input->sensor->ctrl_handler, &ctrl) == 0)
mipi_freq = ctrl.value;
if (asd->stream_env[stream_id].isys_configs == 1) {
@@ -4038,7 +4069,7 @@ static int atomisp_set_fmt_to_isp(struct video_device *vdev,
if (!format)
return -EINVAL;
- mipi_info = atomisp_to_sensor_mipi_info(input->camera);
+ mipi_info = atomisp_to_sensor_mipi_info(input->sensor);
if (atomisp_set_sensor_mipi_to_isp(asd, ATOMISP_INPUT_STREAM_GENERAL,
mipi_info))
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index 2eb44bccff0e..bc97fa2c374c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -1845,7 +1845,7 @@ static enum ia_css_pipe_mode __pipe_id_to_pipe_mode(
{
struct atomisp_device *isp = asd->isp;
struct camera_mipi_info *mipi_info = atomisp_to_sensor_mipi_info(
- isp->inputs[asd->input_curr].camera);
+ isp->inputs[asd->input_curr].sensor);
switch (pipe_id) {
case IA_CSS_PIPE_ID_COPY:
diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.h b/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.h
deleted file mode 100644
index 23d798f3085c..000000000000
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_ioctl32.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Support for Intel Camera Imaging ISP subsystem.
- *
- * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
- */
-#ifndef __ATOMISP_COMPAT_IOCTL32_H__
-#define __ATOMISP_COMPAT_IOCTL32_H__
-
-#include <linux/compat.h>
-#include <linux/videodev2.h>
-
-#include "atomisp_compat.h"
-
-struct atomisp_histogram32 {
- unsigned int num_elements;
- compat_uptr_t data;
-};
-
-struct atomisp_dvs2_stat_types32 {
- compat_uptr_t odd_real; /** real part of the odd statistics*/
- compat_uptr_t odd_imag; /** imaginary part of the odd statistics*/
- compat_uptr_t even_real;/** real part of the even statistics*/
- compat_uptr_t even_imag;/** imaginary part of the even statistics*/
-};
-
-struct atomisp_dvs2_coef_types32 {
- compat_uptr_t odd_real; /** real part of the odd coefficients*/
- compat_uptr_t odd_imag; /** imaginary part of the odd coefficients*/
- compat_uptr_t even_real;/** real part of the even coefficients*/
- compat_uptr_t even_imag;/** imaginary part of the even coefficients*/
-};
-
-struct atomisp_dvs2_statistics32 {
- struct atomisp_dvs_grid_info grid_info;
- struct atomisp_dvs2_stat_types32 hor_prod;
- struct atomisp_dvs2_stat_types32 ver_prod;
-};
-
-struct atomisp_dis_statistics32 {
- struct atomisp_dvs2_statistics32 dvs2_stat;
- u32 exp_id;
-};
-
-struct atomisp_dis_coefficients32 {
- struct atomisp_dvs_grid_info grid_info;
- struct atomisp_dvs2_coef_types32 hor_coefs;
- struct atomisp_dvs2_coef_types32 ver_coefs;
-};
-
-struct atomisp_3a_statistics32 {
- struct atomisp_grid_info grid_info;
- compat_uptr_t data;
- compat_uptr_t rgby_data;
- u32 exp_id;
- u32 isp_config_id;
-};
-
-struct atomisp_morph_table32 {
- unsigned int enabled;
- unsigned int height;
- unsigned int width; /* number of valid elements per line */
- compat_uptr_t coordinates_x[ATOMISP_MORPH_TABLE_NUM_PLANES];
- compat_uptr_t coordinates_y[ATOMISP_MORPH_TABLE_NUM_PLANES];
-};
-
-struct v4l2_framebuffer32 {
- __u32 capability;
- __u32 flags;
- compat_uptr_t base;
- struct v4l2_pix_format fmt;
-};
-
-struct atomisp_overlay32 {
- /* the frame containing the overlay data The overlay frame width should
- * be the multiples of 2*ISP_VEC_NELEMS. The overlay frame height
- * should be the multiples of 2.
- */
- compat_uptr_t frame;
- /* Y value of overlay background */
- unsigned char bg_y;
- /* U value of overlay background */
- char bg_u;
- /* V value of overlay background */
- char bg_v;
- /* the blending percent of input data for Y subpixels */
- unsigned char blend_input_perc_y;
- /* the blending percent of input data for U subpixels */
- unsigned char blend_input_perc_u;
- /* the blending percent of input data for V subpixels */
- unsigned char blend_input_perc_v;
- /* the blending percent of overlay data for Y subpixels */
- unsigned char blend_overlay_perc_y;
- /* the blending percent of overlay data for U subpixels */
- unsigned char blend_overlay_perc_u;
- /* the blending percent of overlay data for V subpixels */
- unsigned char blend_overlay_perc_v;
- /* the overlay start x pixel position on output frame It should be the
- multiples of 2*ISP_VEC_NELEMS. */
- unsigned int overlay_start_x;
- /* the overlay start y pixel position on output frame It should be the
- multiples of 2. */
- unsigned int overlay_start_y;
-};
-
-struct atomisp_shading_table32 {
- __u32 enable;
- __u32 sensor_width;
- __u32 sensor_height;
- __u32 width;
- __u32 height;
- __u32 fraction_bits;
-
- compat_uptr_t data[ATOMISP_NUM_SC_COLORS];
-};
-
-struct atomisp_parameters32 {
- compat_uptr_t wb_config; /* White Balance config */
- compat_uptr_t cc_config; /* Color Correction config */
- compat_uptr_t tnr_config; /* Temporal Noise Reduction */
- compat_uptr_t ecd_config; /* Eigen Color Demosaicing */
- compat_uptr_t ynr_config; /* Y(Luma) Noise Reduction */
- compat_uptr_t fc_config; /* Fringe Control */
- compat_uptr_t formats_config; /* Formats Control */
- compat_uptr_t cnr_config; /* Chroma Noise Reduction */
- compat_uptr_t macc_config; /* MACC */
- compat_uptr_t ctc_config; /* Chroma Tone Control */
- compat_uptr_t aa_config; /* Anti-Aliasing */
- compat_uptr_t baa_config; /* Anti-Aliasing */
- compat_uptr_t ce_config;
- compat_uptr_t dvs_6axis_config;
- compat_uptr_t ob_config; /* Objective Black config */
- compat_uptr_t dp_config; /* Dead Pixel config */
- compat_uptr_t nr_config; /* Noise Reduction config */
- compat_uptr_t ee_config; /* Edge Enhancement config */
- compat_uptr_t de_config; /* Demosaic config */
- compat_uptr_t gc_config; /* Gamma Correction config */
- compat_uptr_t anr_config; /* Advanced Noise Reduction */
- compat_uptr_t a3a_config; /* 3A Statistics config */
- compat_uptr_t xnr_config; /* eXtra Noise Reduction */
- compat_uptr_t dz_config; /* Digital Zoom */
- compat_uptr_t yuv2rgb_cc_config; /* Color
- Correction config */
- compat_uptr_t rgb2yuv_cc_config; /* Color
- Correction config */
- compat_uptr_t macc_table;
- compat_uptr_t gamma_table;
- compat_uptr_t ctc_table;
- compat_uptr_t xnr_table;
- compat_uptr_t r_gamma_table;
- compat_uptr_t g_gamma_table;
- compat_uptr_t b_gamma_table;
- compat_uptr_t motion_vector; /* For 2-axis DVS */
- compat_uptr_t shading_table;
- compat_uptr_t morph_table;
- compat_uptr_t dvs_coefs; /* DVS 1.0 coefficients */
- compat_uptr_t dvs2_coefs; /* DVS 2.0 coefficients */
- compat_uptr_t capture_config;
- compat_uptr_t anr_thres;
-
- compat_uptr_t lin_2500_config; /* Skylake: Linearization config */
- compat_uptr_t obgrid_2500_config; /* Skylake: OBGRID config */
- compat_uptr_t bnr_2500_config; /* Skylake: bayer denoise config */
- compat_uptr_t shd_2500_config; /* Skylake: shading config */
- compat_uptr_t dm_2500_config; /* Skylake: demosaic config */
- compat_uptr_t rgbpp_2500_config; /* Skylake: RGBPP config */
- compat_uptr_t dvs_stat_2500_config; /* Skylake: DVS STAT config */
- compat_uptr_t lace_stat_2500_config; /* Skylake: LACE STAT config */
- compat_uptr_t yuvp1_2500_config; /* Skylake: yuvp1 config */
- compat_uptr_t yuvp2_2500_config; /* Skylake: yuvp2 config */
- compat_uptr_t tnr_2500_config; /* Skylake: TNR config */
- compat_uptr_t dpc_2500_config; /* Skylake: DPC config */
- compat_uptr_t awb_2500_config; /* Skylake: auto white balance config */
- compat_uptr_t
- awb_fr_2500_config; /* Skylake: auto white balance filter response config */
- compat_uptr_t anr_2500_config; /* Skylake: ANR config */
- compat_uptr_t af_2500_config; /* Skylake: auto focus config */
- compat_uptr_t ae_2500_config; /* Skylake: auto exposure config */
- compat_uptr_t bds_2500_config; /* Skylake: bayer downscaler config */
- compat_uptr_t
- dvs_2500_config; /* Skylake: digital video stabilization config */
- compat_uptr_t res_mgr_2500_config;
-
- /*
- * Output frame pointer the config is to be applied to (optional),
- * set to NULL to make this config is applied as global.
- */
- compat_uptr_t output_frame;
- /*
- * Unique ID to track which config was actually applied to a particular
- * frame, driver will send this id back with output frame together.
- */
- u32 isp_config_id;
- u32 per_frame_setting;
-};
-
-struct atomisp_dvs_6axis_config32 {
- u32 exp_id;
- u32 width_y;
- u32 height_y;
- u32 width_uv;
- u32 height_uv;
- compat_uptr_t xcoords_y;
- compat_uptr_t ycoords_y;
- compat_uptr_t xcoords_uv;
- compat_uptr_t ycoords_uv;
-};
-
-#define ATOMISP_IOC_G_HISTOGRAM32 \
- _IOWR('v', BASE_VIDIOC_PRIVATE + 3, struct atomisp_histogram32)
-#define ATOMISP_IOC_S_HISTOGRAM32 \
- _IOW('v', BASE_VIDIOC_PRIVATE + 3, struct atomisp_histogram32)
-
-#define ATOMISP_IOC_G_DIS_STAT32 \
- _IOWR('v', BASE_VIDIOC_PRIVATE + 6, struct atomisp_dis_statistics32)
-#define ATOMISP_IOC_S_DIS_COEFS32 \
- _IOW('v', BASE_VIDIOC_PRIVATE + 6, struct atomisp_dis_coefficients32)
-
-#define ATOMISP_IOC_S_DIS_VECTOR32 \
- _IOW('v', BASE_VIDIOC_PRIVATE + 6, struct atomisp_dvs_6axis_config32)
-
-#define ATOMISP_IOC_G_3A_STAT32 \
- _IOWR('v', BASE_VIDIOC_PRIVATE + 7, struct atomisp_3a_statistics32)
-
-#define ATOMISP_IOC_G_ISP_GDC_TAB32 \
- _IOR('v', BASE_VIDIOC_PRIVATE + 10, struct atomisp_morph_table32)
-#define ATOMISP_IOC_S_ISP_GDC_TAB32 \
- _IOW('v', BASE_VIDIOC_PRIVATE + 10, struct atomisp_morph_table32)
-
-#define ATOMISP_IOC_S_ISP_FPN_TABLE32 \
- _IOW('v', BASE_VIDIOC_PRIVATE + 17, struct v4l2_framebuffer32)
-
-#define ATOMISP_IOC_G_ISP_OVERLAY32 \
- _IOWR('v', BASE_VIDIOC_PRIVATE + 18, struct atomisp_overlay32)
-#define ATOMISP_IOC_S_ISP_OVERLAY32 \
- _IOW('v', BASE_VIDIOC_PRIVATE + 18, struct atomisp_overlay32)
-
-#define ATOMISP_IOC_S_ISP_SHD_TAB32 \
- _IOWR('v', BASE_VIDIOC_PRIVATE + 27, struct atomisp_shading_table32)
-
-#define ATOMISP_IOC_S_PARAMETERS32 \
- _IOW('v', BASE_VIDIOC_PRIVATE + 32, struct atomisp_parameters32)
-
-#endif /* __ATOMISP_COMPAT_IOCTL32_H__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2.c b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
index 28afc0bfc43b..95b9113d75e9 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_csi2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_csi2.c
@@ -298,7 +298,7 @@ static void atomisp_csi2_configure_isp2401(struct atomisp_sub_device *asd)
ctrl.id = V4L2_CID_LINK_FREQ;
if (v4l2_g_ctrl
- (isp->inputs[asd->input_curr].camera->ctrl_handler, &ctrl) == 0)
+ (isp->inputs[asd->input_curr].sensor->ctrl_handler, &ctrl) == 0)
mipi_freq = ctrl.value;
clk_termen = atomisp_csi2_configure_calc(coeff_clk_termen, mipi_freq,
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index e176483df301..5f59519ac8e2 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -85,9 +85,6 @@ struct gmin_subdev {
bool v2p8_on;
bool v1p2_on;
- int v1p8_gpio;
- int v2p8_gpio;
-
u8 pwm_i2c_addr;
/* For PMIC AXP */
@@ -225,16 +222,6 @@ static struct gmin_cfg_var ffrd8_vars[] = {
{},
};
-/* Cribbed from MCG defaults in the mt9m114 driver, not actually verified
- * vs. T100 hardware
- */
-static struct gmin_cfg_var t100_vars[] = {
- { "INT33F0:00_CsiPort", "0" },
- { "INT33F0:00_CsiLanes", "1" },
- { "INT33F0:00_CamClk", "1" },
- {},
-};
-
static struct gmin_cfg_var mrd7_vars[] = {
{"INT33F8:00_CamType", "1"},
{"INT33F8:00_CsiPort", "1"},
@@ -252,22 +239,6 @@ static struct gmin_cfg_var mrd7_vars[] = {
{},
};
-static struct gmin_cfg_var ecs7_vars[] = {
- {"INT33BE:00_CsiPort", "1"},
- {"INT33BE:00_CsiLanes", "2"},
- {"INT33BE:00_CsiFmt", "13"},
- {"INT33BE:00_CsiBayer", "2"},
- {"INT33BE:00_CamClk", "0"},
-
- {"INT33F0:00_CsiPort", "0"},
- {"INT33F0:00_CsiLanes", "1"},
- {"INT33F0:00_CsiFmt", "13"},
- {"INT33F0:00_CsiBayer", "0"},
- {"INT33F0:00_CamClk", "1"},
- {"gmin_V2P8GPIO", "402"},
- {},
-};
-
static struct gmin_cfg_var i8880_vars[] = {
{"XXOV2680:00_CsiPort", "1"},
{"XXOV2680:00_CsiLanes", "1"},
@@ -310,13 +281,6 @@ static const struct dmi_system_id gmin_vars[] = {
.driver_data = ffrd8_vars,
},
{
- .ident = "T100TA",
- .matches = {
- DMI_MATCH(DMI_BOARD_NAME, "T100TA"),
- },
- .driver_data = t100_vars,
- },
- {
.ident = "MRD7",
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "TABLET"),
@@ -325,13 +289,6 @@ static const struct dmi_system_id gmin_vars[] = {
.driver_data = mrd7_vars,
},
{
- .ident = "ST70408",
- .matches = {
- DMI_MATCH(DMI_BOARD_NAME, "ST70408"),
- },
- .driver_data = ecs7_vars,
- },
- {
.ident = "VTA0803",
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "VTA0803"),
@@ -516,9 +473,9 @@ static int gmin_subdev_add(struct gmin_subdev *gs)
dev_info(dev, "%s: ACPI path is %pfw\n", __func__, dev_fwnode(dev));
- /*WA:CHT requires XTAL clock as PLL is not stable.*/
+ /* WA:CHT requires XTAL clock as PLL is not stable. */
gs->clock_src = gmin_get_var_int(dev, false, "ClkSrc",
- VLV2_CLK_PLL_19P2MHZ);
+ VLV2_CLK_PLL_19P2MHZ);
/*
* Get ACPI _PR0 derived clock here already because it is used
@@ -549,23 +506,6 @@ static int gmin_subdev_add(struct gmin_subdev *gs)
dev_info(dev, "will handle gpio1 via ACPI\n");
/*
- * Those are used only when there is an external regulator apart
- * from the PMIC that would be providing power supply, like on the
- * two cases below:
- *
- * The ECS E7 board drives camera 2.8v from an external regulator
- * instead of the PMIC. There's a gmin_CamV2P8 config variable
- * that specifies the GPIO to handle this particular case,
- * but this needs a broader architecture for handling camera power.
- *
- * The CHT RVP board drives camera 1.8v from an* external regulator
- * instead of the PMIC just like ECS E7 board.
- */
-
- gs->v1p8_gpio = gmin_get_var_int(dev, true, "V1P8GPIO", -1);
- gs->v2p8_gpio = gmin_get_var_int(dev, true, "V2P8GPIO", -1);
-
- /*
* FIXME:
*
* The ACPI handling code checks for the _PR? tables in order to
@@ -837,16 +777,6 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
if (!gs || gs->v1p8_on == on)
return 0;
- if (gs->v1p8_gpio >= 0) {
- pr_info("atomisp_gmin_platform: 1.8v power on GPIO %d\n",
- gs->v1p8_gpio);
- ret = gpio_request(gs->v1p8_gpio, "camera_v1p8_en");
- if (!ret)
- ret = gpio_direction_output(gs->v1p8_gpio, 0);
- if (ret)
- pr_err("V1P8 GPIO initialization failed\n");
- }
-
gs->v1p8_on = on;
ret = 0;
@@ -861,9 +791,6 @@ static int gmin_v1p8_ctrl(struct v4l2_subdev *subdev, int on)
goto out; /* Still needed */
}
- if (gs->v1p8_gpio >= 0)
- gpio_set_value(gs->v1p8_gpio, on);
-
if (gs->v1p8_reg) {
regulator_set_voltage(gs->v1p8_reg, 1800000, 1800000);
if (on)
@@ -918,16 +845,6 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on)
if (WARN_ON(!gs))
return -ENODEV;
- if (gs->v2p8_gpio >= 0) {
- pr_info("atomisp_gmin_platform: 2.8v power on GPIO %d\n",
- gs->v2p8_gpio);
- ret = gpio_request(gs->v2p8_gpio, "camera_v2p8");
- if (!ret)
- ret = gpio_direction_output(gs->v2p8_gpio, 0);
- if (ret)
- pr_err("V2P8 GPIO initialization failed\n");
- }
-
if (gs->v2p8_on == on)
return 0;
gs->v2p8_on = on;
@@ -944,9 +861,6 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on)
goto out; /* Still needed */
}
- if (gs->v2p8_gpio >= 0)
- gpio_set_value(gs->v2p8_gpio, on);
-
if (gs->v2p8_reg) {
regulator_set_voltage(gs->v2p8_reg, 2900000, 2900000);
if (on)
@@ -1292,7 +1206,7 @@ static int gmin_get_config_dsm_var(struct device *dev,
* if it founds something different than string, letting it
* to fall back to the old code.
*/
- if (cur && cur->type != ACPI_TYPE_STRING) {
+ if (cur->type != ACPI_TYPE_STRING) {
dev_info(dev, "found non-string _DSM entry for '%s'\n", var);
ACPI_FREE(obj);
return -EINVAL;
diff --git a/drivers/staging/media/atomisp/pci/atomisp_internal.h b/drivers/staging/media/atomisp/pci/atomisp_internal.h
index 775506757471..5a69580b8251 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_internal.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_internal.h
@@ -109,14 +109,20 @@
#define DIV_NEAREST_STEP(n, d, step) \
round_down((2 * (n) + (d) * (step)) / (2 * (d)), (step))
+#define SENSOR_ISP_PAD_SINK 0
+#define SENSOR_ISP_PAD_SOURCE 1
+#define SENSOR_ISP_PADS_NUM 2
+
struct atomisp_input_subdev {
enum atomisp_camera_port port;
u32 code; /* MEDIA_BUS_FMT_* */
bool binning_support;
bool crop_support;
- bool camera_on;
- struct v4l2_subdev *camera;
+ bool sensor_on;
+ struct v4l2_subdev *sensor;
+ struct v4l2_subdev *sensor_isp;
struct v4l2_subdev *csi_port;
+ struct v4l2_subdev *csi_remote_source;
/* Sensor rects for sensors which support crop */
struct v4l2_rect native_rect;
struct v4l2_rect active_rect;
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 1fb2ba819de3..97d99bed1560 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -386,11 +386,11 @@ static int atomisp_enum_input(struct file *file, void *fh,
if (index >= isp->input_cnt)
return -EINVAL;
- if (!isp->inputs[index].camera)
+ if (!isp->inputs[index].sensor)
return -EINVAL;
memset(input, 0, sizeof(struct v4l2_input));
- strscpy(input->name, isp->inputs[index].camera->name,
+ strscpy(input->name, isp->inputs[index].sensor->name,
sizeof(input->name));
input->type = V4L2_INPUT_TYPE_CAMERA;
@@ -433,7 +433,7 @@ static int atomisp_s_input(struct file *file, void *fh, unsigned int input)
if (input >= isp->input_cnt)
return -EINVAL;
- if (!isp->inputs[input].camera)
+ if (!isp->inputs[input].sensor)
return -EINVAL;
ret = atomisp_pipe_check(pipe, true);
@@ -539,14 +539,14 @@ static int atomisp_enum_framesizes(struct file *file, void *priv,
struct v4l2_subdev_state *act_sd_state;
int ret;
- if (!input->camera)
+ if (!input->sensor)
return -EINVAL;
if (input->crop_support)
return atomisp_enum_framesizes_crop(isp, fsize);
- act_sd_state = v4l2_subdev_lock_and_get_active_state(input->camera);
- ret = v4l2_subdev_call(input->camera, pad, enum_frame_size,
+ act_sd_state = v4l2_subdev_lock_and_get_active_state(input->sensor);
+ ret = v4l2_subdev_call(input->sensor, pad, enum_frame_size,
act_sd_state, &fse);
if (act_sd_state)
v4l2_subdev_unlock_state(act_sd_state);
@@ -577,11 +577,11 @@ static int atomisp_enum_frameintervals(struct file *file, void *priv,
struct v4l2_subdev_state *act_sd_state;
int ret;
- if (!input->camera)
+ if (!input->sensor)
return -EINVAL;
- act_sd_state = v4l2_subdev_lock_and_get_active_state(input->camera);
- ret = v4l2_subdev_call(input->camera, pad, enum_frame_interval,
+ act_sd_state = v4l2_subdev_lock_and_get_active_state(input->sensor);
+ ret = v4l2_subdev_call(input->sensor, pad, enum_frame_interval,
act_sd_state, &fie);
if (act_sd_state)
v4l2_subdev_unlock_state(act_sd_state);
@@ -609,11 +609,11 @@ static int atomisp_enum_fmt_cap(struct file *file, void *fh,
unsigned int i, fi = 0;
int ret;
- if (!input->camera)
+ if (!input->sensor)
return -EINVAL;
- act_sd_state = v4l2_subdev_lock_and_get_active_state(input->camera);
- ret = v4l2_subdev_call(input->camera, pad, enum_mbus_code,
+ act_sd_state = v4l2_subdev_lock_and_get_active_state(input->sensor);
+ ret = v4l2_subdev_call(input->sensor, pad, enum_mbus_code,
act_sd_state, &code);
if (act_sd_state)
v4l2_subdev_unlock_state(act_sd_state);
@@ -945,7 +945,7 @@ int atomisp_start_streaming(struct vb2_queue *vq, unsigned int count)
}
/* stream on the sensor */
- ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
+ ret = v4l2_subdev_call(isp->inputs[asd->input_curr].csi_remote_source,
video, s_stream, 1);
if (ret) {
dev_err(isp->dev, "Starting sensor stream failed: %d\n", ret);
@@ -1002,7 +1002,7 @@ void atomisp_stop_streaming(struct vb2_queue *vq)
atomisp_subdev_cleanup_pending_events(asd);
- ret = v4l2_subdev_call(isp->inputs[asd->input_curr].camera,
+ ret = v4l2_subdev_call(isp->inputs[asd->input_curr].csi_remote_source,
video, s_stream, 0);
if (ret)
dev_warn(isp->dev, "Stopping sensor stream failed: %d\n", ret);
@@ -1332,7 +1332,7 @@ static int atomisp_s_parm(struct file *file, void *fh,
fi.interval = parm->parm.capture.timeperframe;
- rval = v4l2_subdev_call_state_active(isp->inputs[asd->input_curr].camera,
+ rval = v4l2_subdev_call_state_active(isp->inputs[asd->input_curr].csi_remote_source,
pad, set_frame_interval, &fi);
if (!rval)
parm->parm.capture.timeperframe = fi.interval;
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.h b/drivers/staging/media/atomisp/pci/atomisp_ioctl.h
index 4feaa0338cb4..57f608f9db56 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.h
@@ -33,8 +33,4 @@ void atomisp_stop_streaming(struct vb2_queue *vq);
extern const struct v4l2_ioctl_ops atomisp_ioctl_ops;
-/* compat_ioctl for 32bit userland app and 64bit kernel */
-long atomisp_compat_ioctl32(struct file *file,
- unsigned int cmd, unsigned long arg);
-
#endif /* __ATOMISP_IOCTL_H__ */
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index 2841824cd0ca..0bd0bfded4af 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -895,24 +895,25 @@ static void atomisp_init_sensor(struct atomisp_input_subdev *input)
* it emulates a normal v4l2 device there, passing through try_fmt /
* set_fmt to the sensor.
*/
- try_sd_state = __v4l2_subdev_state_alloc(input->camera,
- "atomisp:try_sd_state->lock", &try_sd_state_key);
+ try_sd_state = __v4l2_subdev_state_alloc(input->sensor,
+ "atomisp:try_sd_state->lock",
+ &try_sd_state_key);
if (IS_ERR(try_sd_state))
return;
input->try_sd_state = try_sd_state;
- act_sd_state = v4l2_subdev_lock_and_get_active_state(input->camera);
+ act_sd_state = v4l2_subdev_lock_and_get_active_state(input->sensor);
mbus_code_enum.which = V4L2_SUBDEV_FORMAT_ACTIVE;
- err = v4l2_subdev_call(input->camera, pad, enum_mbus_code,
+ err = v4l2_subdev_call(input->sensor, pad, enum_mbus_code,
act_sd_state, &mbus_code_enum);
if (!err)
input->code = mbus_code_enum.code;
sel.which = V4L2_SUBDEV_FORMAT_ACTIVE;
sel.target = V4L2_SEL_TGT_NATIVE_SIZE;
- err = v4l2_subdev_call(input->camera, pad, get_selection,
+ err = v4l2_subdev_call(input->sensor, pad, get_selection,
act_sd_state, &sel);
if (err)
goto unlock_act_sd_state;
@@ -921,7 +922,7 @@ static void atomisp_init_sensor(struct atomisp_input_subdev *input)
sel.which = V4L2_SUBDEV_FORMAT_ACTIVE;
sel.target = V4L2_SEL_TGT_CROP_DEFAULT;
- err = v4l2_subdev_call(input->camera, pad, get_selection,
+ err = v4l2_subdev_call(input->sensor, pad, get_selection,
act_sd_state, &sel);
if (err)
goto unlock_act_sd_state;
@@ -939,7 +940,7 @@ static void atomisp_init_sensor(struct atomisp_input_subdev *input)
fse.code = input->code;
fse.which = V4L2_SUBDEV_FORMAT_ACTIVE;
- err = v4l2_subdev_call(input->camera, pad, enum_frame_size,
+ err = v4l2_subdev_call(input->sensor, pad, enum_frame_size,
act_sd_state, &fse);
if (err)
break;
@@ -962,22 +963,29 @@ static void atomisp_init_sensor(struct atomisp_input_subdev *input)
sel.which = V4L2_SUBDEV_FORMAT_TRY;
sel.target = V4L2_SEL_TGT_CROP;
sel.r = input->native_rect;
- v4l2_subdev_lock_state(input->try_sd_state);
- err = v4l2_subdev_call(input->camera, pad, set_selection,
+
+ /* Don't lock try_sd_state if the lock is shared with the active state */
+ if (!input->sensor->state_lock)
+ v4l2_subdev_lock_state(input->try_sd_state);
+
+ err = v4l2_subdev_call(input->sensor, pad, set_selection,
input->try_sd_state, &sel);
- v4l2_subdev_unlock_state(input->try_sd_state);
+
+ if (!input->sensor->state_lock)
+ v4l2_subdev_unlock_state(input->try_sd_state);
+
if (err)
goto unlock_act_sd_state;
sel.which = V4L2_SUBDEV_FORMAT_ACTIVE;
sel.target = V4L2_SEL_TGT_CROP;
sel.r = input->native_rect;
- err = v4l2_subdev_call(input->camera, pad, set_selection,
+ err = v4l2_subdev_call(input->sensor, pad, set_selection,
act_sd_state, &sel);
if (err)
goto unlock_act_sd_state;
- dev_info(input->camera->dev, "Supports crop native %dx%d active %dx%d binning %d\n",
+ dev_info(input->sensor->dev, "Supports crop native %dx%d active %dx%d binning %d\n",
input->native_rect.width, input->native_rect.height,
input->active_rect.width, input->active_rect.height,
input->binning_support);
@@ -991,8 +999,9 @@ unlock_act_sd_state:
int atomisp_register_device_nodes(struct atomisp_device *isp)
{
+ struct media_pad *sensor_isp_sink, *sensor_src;
struct atomisp_input_subdev *input;
- int i, err;
+ int i, err, source_pad;
for (i = 0; i < ATOMISP_CAMERA_NR_PORTS; i++) {
err = media_create_pad_link(&isp->csi2_port[i].subdev.entity,
@@ -1007,12 +1016,33 @@ int atomisp_register_device_nodes(struct atomisp_device *isp)
input = &isp->inputs[isp->input_cnt];
input->port = i;
- input->camera = isp->sensor_subdevs[i];
input->csi_port = &isp->csi2_port[i].subdev;
+ input->csi_remote_source = isp->sensor_subdevs[i];
+
+ /*
+ * Special case for sensors with a ISP in the sensor modelled
+ * as a separate v4l2-subdev, like the mt9m114.
+ */
+ if (isp->sensor_subdevs[i]->entity.function == MEDIA_ENT_F_PROC_VIDEO_ISP) {
+ input->sensor_isp = isp->sensor_subdevs[i];
+ source_pad = SENSOR_ISP_PAD_SOURCE;
+
+ sensor_isp_sink = &input->sensor_isp->entity.pads[SENSOR_ISP_PAD_SINK];
+ sensor_src = media_pad_remote_pad_first(sensor_isp_sink);
+ if (!sensor_src) {
+ dev_err(isp->dev, "Error could not find remote pad for sensor ISP sink\n");
+ return -ENOENT;
+ }
+
+ input->sensor = media_entity_to_v4l2_subdev(sensor_src->entity);
+ } else {
+ input->sensor = isp->sensor_subdevs[i];
+ source_pad = 0;
+ }
atomisp_init_sensor(input);
- err = media_create_pad_link(&input->camera->entity, 0,
+ err = media_create_pad_link(&isp->sensor_subdevs[i]->entity, source_pad,
&isp->csi2_port[i].subdev.entity,
CSI2_PAD_SINK,
MEDIA_LNK_FL_ENABLED | MEDIA_LNK_FL_IMMUTABLE);
diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h b/drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h
index 2c47e7820bd7..69e68ecd6bc3 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/irq_global.h
@@ -18,7 +18,7 @@
#endif
/* The IRQ is not mapped uniformly on its related interfaces */
-#define IRQ_SW_CHANNEL_OFFSET hrt_isp_css_irq_sw_pin_0
+#define IRQ_SW_CHANNEL_OFFSET HIVE_GP_DEV_IRQ_SW_PIN_0_BIT_ID
typedef enum {
IRQ_SW_CHANNEL0_ID = hrt_isp_css_irq_sw_pin_0 - IRQ_SW_CHANNEL_OFFSET,
diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2_types.h b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2_types.h
index f37802878528..2bed08435755 100644
--- a/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2_types.h
+++ b/drivers/staging/media/atomisp/pci/isp/kernels/sdis/sdis_2/ia_css_sdis2_types.h
@@ -19,7 +19,7 @@
#endif
/* DVS 2.0 Coefficient types. This structure contains 4 pointers to
- * arrays that contain the coeffients for each type.
+ * arrays that contain the coefficients for each type.
*/
struct ia_css_dvs2_coef_types {
s16 *odd_real; /** real part of the odd coefficients*/
diff --git a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
index ece5e3da34ee..127f12ba2214 100644
--- a/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
+++ b/drivers/staging/media/atomisp/pci/isp/kernels/vf/vf_1.0/ia_css_vf.host.c
@@ -114,7 +114,7 @@ configure_dma(
}
int ia_css_vf_configure(const struct ia_css_binary *binary,
- const struct ia_css_frame_info *out_info,
+ const struct ia_css_frame_info *out_info,
struct ia_css_frame_info *vf_info,
unsigned int *downscale_log2)
{
diff --git a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
index 9818771a35e5..84220359c957 100644
--- a/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
+++ b/drivers/staging/media/atomisp/pci/runtime/debug/src/ia_css_debug.c
@@ -121,7 +121,8 @@ static const char *const pipe_id_to_str[] = {
/* [IA_CSS_PIPE_ID_YUVPP] =*/ "yuvpp",
};
-static char dot_id_input_bin[SH_CSS_MAX_BINARY_NAME + 10];
+/* 27 is combined length of _stage%d(pipe%d)\0. */
+static char dot_id_input_bin[SH_CSS_MAX_BINARY_NAME + 27];
static char ring_buffer[200];
void ia_css_debug_dtrace(unsigned int level, const char *fmt, ...)
diff --git a/drivers/staging/media/rkvdec/rkvdec-h264.c b/drivers/staging/media/rkvdec/rkvdec-h264.c
index 4fc167b42cf0..d14b4d173448 100644
--- a/drivers/staging/media/rkvdec/rkvdec-h264.c
+++ b/drivers/staging/media/rkvdec/rkvdec-h264.c
@@ -655,13 +655,14 @@ static void assemble_hw_pps(struct rkvdec_ctx *ctx,
#define WRITE_PPS(value, field) set_ps_field(hw_ps->info, field, value)
/* write sps */
- WRITE_PPS(0xf, SEQ_PARAMETER_SET_ID);
- WRITE_PPS(0xff, PROFILE_IDC);
- WRITE_PPS(1, CONSTRAINT_SET3_FLAG);
+ WRITE_PPS(sps->seq_parameter_set_id, SEQ_PARAMETER_SET_ID);
+ WRITE_PPS(sps->profile_idc, PROFILE_IDC);
+ WRITE_PPS(!!(sps->constraint_set_flags & (1 << 3)), CONSTRAINT_SET3_FLAG);
WRITE_PPS(sps->chroma_format_idc, CHROMA_FORMAT_IDC);
WRITE_PPS(sps->bit_depth_luma_minus8, BIT_DEPTH_LUMA);
WRITE_PPS(sps->bit_depth_chroma_minus8, BIT_DEPTH_CHROMA);
- WRITE_PPS(0, QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG);
+ WRITE_PPS(!!(sps->flags & V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS),
+ QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG);
WRITE_PPS(sps->log2_max_frame_num_minus4, LOG2_MAX_FRAME_NUM_MINUS4);
WRITE_PPS(sps->max_num_ref_frames, MAX_NUM_REF_FRAMES);
WRITE_PPS(sps->pic_order_cnt_type, PIC_ORDER_CNT_TYPE);
@@ -688,8 +689,8 @@ static void assemble_hw_pps(struct rkvdec_ctx *ctx,
DIRECT_8X8_INFERENCE_FLAG);
/* write pps */
- WRITE_PPS(0xff, PIC_PARAMETER_SET_ID);
- WRITE_PPS(0x1f, PPS_SEQ_PARAMETER_SET_ID);
+ WRITE_PPS(pps->pic_parameter_set_id, PIC_PARAMETER_SET_ID);
+ WRITE_PPS(pps->seq_parameter_set_id, PPS_SEQ_PARAMETER_SET_ID);
WRITE_PPS(!!(pps->flags & V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE),
ENTROPY_CODING_MODE_FLAG);
WRITE_PPS(!!(pps->flags & V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT),
@@ -896,9 +897,9 @@ static void config_registers(struct rkvdec_ctx *ctx,
dma_addr_t rlc_addr;
dma_addr_t refer_addr;
u32 rlc_len;
- u32 hor_virstride = 0;
- u32 ver_virstride = 0;
- u32 y_virstride = 0;
+ u32 hor_virstride;
+ u32 ver_virstride;
+ u32 y_virstride;
u32 yuv_virstride = 0;
u32 offset;
dma_addr_t dst_addr;
@@ -909,16 +910,16 @@ static void config_registers(struct rkvdec_ctx *ctx,
f = &ctx->decoded_fmt;
dst_fmt = &f->fmt.pix_mp;
- hor_virstride = (sps->bit_depth_luma_minus8 + 8) * dst_fmt->width / 8;
- ver_virstride = round_up(dst_fmt->height, 16);
+ hor_virstride = dst_fmt->plane_fmt[0].bytesperline;
+ ver_virstride = dst_fmt->height;
y_virstride = hor_virstride * ver_virstride;
if (sps->chroma_format_idc == 0)
yuv_virstride = y_virstride;
else if (sps->chroma_format_idc == 1)
- yuv_virstride += y_virstride + y_virstride / 2;
+ yuv_virstride = y_virstride + y_virstride / 2;
else if (sps->chroma_format_idc == 2)
- yuv_virstride += 2 * y_virstride;
+ yuv_virstride = 2 * y_virstride;
reg = RKVDEC_Y_HOR_VIRSTRIDE(hor_virstride / 16) |
RKVDEC_UV_HOR_VIRSTRIDE(hor_virstride / 16) |
@@ -1026,24 +1027,42 @@ static int rkvdec_h264_adjust_fmt(struct rkvdec_ctx *ctx,
return 0;
}
+static enum rkvdec_image_fmt rkvdec_h264_get_image_fmt(struct rkvdec_ctx *ctx,
+ struct v4l2_ctrl *ctrl)
+{
+ const struct v4l2_ctrl_h264_sps *sps = ctrl->p_new.p_h264_sps;
+
+ if (ctrl->id != V4L2_CID_STATELESS_H264_SPS)
+ return RKVDEC_IMG_FMT_ANY;
+
+ if (sps->bit_depth_luma_minus8 == 0) {
+ if (sps->chroma_format_idc == 2)
+ return RKVDEC_IMG_FMT_422_8BIT;
+ else
+ return RKVDEC_IMG_FMT_420_8BIT;
+ } else if (sps->bit_depth_luma_minus8 == 2) {
+ if (sps->chroma_format_idc == 2)
+ return RKVDEC_IMG_FMT_422_10BIT;
+ else
+ return RKVDEC_IMG_FMT_420_10BIT;
+ }
+
+ return RKVDEC_IMG_FMT_ANY;
+}
+
static int rkvdec_h264_validate_sps(struct rkvdec_ctx *ctx,
const struct v4l2_ctrl_h264_sps *sps)
{
unsigned int width, height;
- /*
- * TODO: The hardware supports 10-bit and 4:2:2 profiles,
- * but it's currently broken in the driver.
- * Reject them for now, until it's fixed.
- */
- if (sps->chroma_format_idc > 1)
- /* Only 4:0:0 and 4:2:0 are supported */
+ if (sps->chroma_format_idc > 2)
+ /* Only 4:0:0, 4:2:0 and 4:2:2 are supported */
return -EINVAL;
if (sps->bit_depth_luma_minus8 != sps->bit_depth_chroma_minus8)
/* Luma and chroma bit depth mismatch */
return -EINVAL;
- if (sps->bit_depth_luma_minus8 != 0)
- /* Only 8-bit is supported */
+ if (sps->bit_depth_luma_minus8 != 0 && sps->bit_depth_luma_minus8 != 2)
+ /* Only 8-bit and 10-bit is supported */
return -EINVAL;
width = (sps->pic_width_in_mbs_minus1 + 1) * 16;
@@ -1189,4 +1208,5 @@ const struct rkvdec_coded_fmt_ops rkvdec_h264_fmt_ops = {
.stop = rkvdec_h264_stop,
.run = rkvdec_h264_run,
.try_ctrl = rkvdec_h264_try_ctrl,
+ .get_image_fmt = rkvdec_h264_get_image_fmt,
};
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
index f9bef5173bf2..3367902f22de 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -27,6 +27,95 @@
#include "rkvdec.h"
#include "rkvdec-regs.h"
+static bool rkvdec_image_fmt_match(enum rkvdec_image_fmt fmt1,
+ enum rkvdec_image_fmt fmt2)
+{
+ return fmt1 == fmt2 || fmt2 == RKVDEC_IMG_FMT_ANY ||
+ fmt1 == RKVDEC_IMG_FMT_ANY;
+}
+
+static bool rkvdec_image_fmt_changed(struct rkvdec_ctx *ctx,
+ enum rkvdec_image_fmt image_fmt)
+{
+ if (image_fmt == RKVDEC_IMG_FMT_ANY)
+ return false;
+
+ return ctx->image_fmt != image_fmt;
+}
+
+static u32 rkvdec_enum_decoded_fmt(struct rkvdec_ctx *ctx, int index,
+ enum rkvdec_image_fmt image_fmt)
+{
+ const struct rkvdec_coded_fmt_desc *desc = ctx->coded_fmt_desc;
+ int fmt_idx = -1;
+ unsigned int i;
+
+ if (WARN_ON(!desc))
+ return 0;
+
+ for (i = 0; i < desc->num_decoded_fmts; i++) {
+ if (!rkvdec_image_fmt_match(desc->decoded_fmts[i].image_fmt,
+ image_fmt))
+ continue;
+ fmt_idx++;
+ if (index == fmt_idx)
+ return desc->decoded_fmts[i].fourcc;
+ }
+
+ return 0;
+}
+
+static bool rkvdec_is_valid_fmt(struct rkvdec_ctx *ctx, u32 fourcc,
+ enum rkvdec_image_fmt image_fmt)
+{
+ const struct rkvdec_coded_fmt_desc *desc = ctx->coded_fmt_desc;
+ unsigned int i;
+
+ for (i = 0; i < desc->num_decoded_fmts; i++) {
+ if (rkvdec_image_fmt_match(desc->decoded_fmts[i].image_fmt,
+ image_fmt) &&
+ desc->decoded_fmts[i].fourcc == fourcc)
+ return true;
+ }
+
+ return false;
+}
+
+static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx,
+ struct v4l2_pix_format_mplane *pix_mp)
+{
+ v4l2_fill_pixfmt_mp(pix_mp, pix_mp->pixelformat,
+ pix_mp->width, pix_mp->height);
+ pix_mp->plane_fmt[0].sizeimage += 128 *
+ DIV_ROUND_UP(pix_mp->width, 16) *
+ DIV_ROUND_UP(pix_mp->height, 16);
+}
+
+static void rkvdec_reset_fmt(struct rkvdec_ctx *ctx, struct v4l2_format *f,
+ u32 fourcc)
+{
+ memset(f, 0, sizeof(*f));
+ f->fmt.pix_mp.pixelformat = fourcc;
+ f->fmt.pix_mp.field = V4L2_FIELD_NONE;
+ f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_REC709;
+ f->fmt.pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
+ f->fmt.pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT;
+ f->fmt.pix_mp.xfer_func = V4L2_XFER_FUNC_DEFAULT;
+}
+
+static void rkvdec_reset_decoded_fmt(struct rkvdec_ctx *ctx)
+{
+ struct v4l2_format *f = &ctx->decoded_fmt;
+ u32 fourcc;
+
+ fourcc = rkvdec_enum_decoded_fmt(ctx, 0, ctx->image_fmt);
+ rkvdec_reset_fmt(ctx, f, fourcc);
+ f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ f->fmt.pix_mp.width = ctx->coded_fmt.fmt.pix_mp.width;
+ f->fmt.pix_mp.height = ctx->coded_fmt.fmt.pix_mp.height;
+ rkvdec_fill_decoded_pixfmt(ctx, &f->fmt.pix_mp);
+}
+
static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
{
struct rkvdec_ctx *ctx = container_of(ctrl->handler, struct rkvdec_ctx, ctrl_hdl);
@@ -38,8 +127,34 @@ static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl)
return 0;
}
+static int rkvdec_s_ctrl(struct v4l2_ctrl *ctrl)
+{
+ struct rkvdec_ctx *ctx = container_of(ctrl->handler, struct rkvdec_ctx, ctrl_hdl);
+ const struct rkvdec_coded_fmt_desc *desc = ctx->coded_fmt_desc;
+ enum rkvdec_image_fmt image_fmt;
+ struct vb2_queue *vq;
+
+ /* Check if this change requires a capture format reset */
+ if (!desc->ops->get_image_fmt)
+ return 0;
+
+ image_fmt = desc->ops->get_image_fmt(ctx, ctrl);
+ if (rkvdec_image_fmt_changed(ctx, image_fmt)) {
+ vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx,
+ V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
+ if (vb2_is_busy(vq))
+ return -EBUSY;
+
+ ctx->image_fmt = image_fmt;
+ rkvdec_reset_decoded_fmt(ctx);
+ }
+
+ return 0;
+}
+
static const struct v4l2_ctrl_ops rkvdec_ctrl_ops = {
.try_ctrl = rkvdec_try_ctrl,
+ .s_ctrl = rkvdec_s_ctrl,
};
static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = {
@@ -70,10 +185,11 @@ static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = {
},
{
.cfg.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE,
- .cfg.min = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE,
- .cfg.max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH,
+ .cfg.min = V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE,
+ .cfg.max = V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA,
.cfg.menu_skip_mask =
- BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED),
+ BIT(V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED) |
+ BIT(V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE),
.cfg.def = V4L2_MPEG_VIDEO_H264_PROFILE_MAIN,
},
{
@@ -88,8 +204,23 @@ static const struct rkvdec_ctrls rkvdec_h264_ctrls = {
.num_ctrls = ARRAY_SIZE(rkvdec_h264_ctrl_descs),
};
-static const u32 rkvdec_h264_vp9_decoded_fmts[] = {
- V4L2_PIX_FMT_NV12,
+static const struct rkvdec_decoded_fmt_desc rkvdec_h264_decoded_fmts[] = {
+ {
+ .fourcc = V4L2_PIX_FMT_NV12,
+ .image_fmt = RKVDEC_IMG_FMT_420_8BIT,
+ },
+ {
+ .fourcc = V4L2_PIX_FMT_NV15,
+ .image_fmt = RKVDEC_IMG_FMT_420_10BIT,
+ },
+ {
+ .fourcc = V4L2_PIX_FMT_NV16,
+ .image_fmt = RKVDEC_IMG_FMT_422_8BIT,
+ },
+ {
+ .fourcc = V4L2_PIX_FMT_NV20,
+ .image_fmt = RKVDEC_IMG_FMT_422_10BIT,
+ },
};
static const struct rkvdec_ctrl_desc rkvdec_vp9_ctrl_descs[] = {
@@ -112,21 +243,28 @@ static const struct rkvdec_ctrls rkvdec_vp9_ctrls = {
.num_ctrls = ARRAY_SIZE(rkvdec_vp9_ctrl_descs),
};
+static const struct rkvdec_decoded_fmt_desc rkvdec_vp9_decoded_fmts[] = {
+ {
+ .fourcc = V4L2_PIX_FMT_NV12,
+ .image_fmt = RKVDEC_IMG_FMT_420_8BIT,
+ },
+};
+
static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
{
.fourcc = V4L2_PIX_FMT_H264_SLICE,
.frmsize = {
- .min_width = 48,
+ .min_width = 64,
.max_width = 4096,
- .step_width = 16,
+ .step_width = 64,
.min_height = 48,
.max_height = 2560,
.step_height = 16,
},
.ctrls = &rkvdec_h264_ctrls,
.ops = &rkvdec_h264_fmt_ops,
- .num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_vp9_decoded_fmts),
- .decoded_fmts = rkvdec_h264_vp9_decoded_fmts,
+ .num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_decoded_fmts),
+ .decoded_fmts = rkvdec_h264_decoded_fmts,
.subsystem_flags = VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF,
},
{
@@ -141,8 +279,8 @@ static const struct rkvdec_coded_fmt_desc rkvdec_coded_fmts[] = {
},
.ctrls = &rkvdec_vp9_ctrls,
.ops = &rkvdec_vp9_fmt_ops,
- .num_decoded_fmts = ARRAY_SIZE(rkvdec_h264_vp9_decoded_fmts),
- .decoded_fmts = rkvdec_h264_vp9_decoded_fmts,
+ .num_decoded_fmts = ARRAY_SIZE(rkvdec_vp9_decoded_fmts),
+ .decoded_fmts = rkvdec_vp9_decoded_fmts,
}
};
@@ -159,18 +297,6 @@ rkvdec_find_coded_fmt_desc(u32 fourcc)
return NULL;
}
-static void rkvdec_reset_fmt(struct rkvdec_ctx *ctx, struct v4l2_format *f,
- u32 fourcc)
-{
- memset(f, 0, sizeof(*f));
- f->fmt.pix_mp.pixelformat = fourcc;
- f->fmt.pix_mp.field = V4L2_FIELD_NONE;
- f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_REC709;
- f->fmt.pix_mp.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
- f->fmt.pix_mp.quantization = V4L2_QUANTIZATION_DEFAULT;
- f->fmt.pix_mp.xfer_func = V4L2_XFER_FUNC_DEFAULT;
-}
-
static void rkvdec_reset_coded_fmt(struct rkvdec_ctx *ctx)
{
struct v4l2_format *f = &ctx->coded_fmt;
@@ -186,21 +312,6 @@ static void rkvdec_reset_coded_fmt(struct rkvdec_ctx *ctx)
ctx->coded_fmt_desc->ops->adjust_fmt(ctx, f);
}
-static void rkvdec_reset_decoded_fmt(struct rkvdec_ctx *ctx)
-{
- struct v4l2_format *f = &ctx->decoded_fmt;
-
- rkvdec_reset_fmt(ctx, f, ctx->coded_fmt_desc->decoded_fmts[0]);
- f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- v4l2_fill_pixfmt_mp(&f->fmt.pix_mp,
- ctx->coded_fmt_desc->decoded_fmts[0],
- ctx->coded_fmt.fmt.pix_mp.width,
- ctx->coded_fmt.fmt.pix_mp.height);
- f->fmt.pix_mp.plane_fmt[0].sizeimage += 128 *
- DIV_ROUND_UP(f->fmt.pix_mp.width, 16) *
- DIV_ROUND_UP(f->fmt.pix_mp.height, 16);
-}
-
static int rkvdec_enum_framesizes(struct file *file, void *priv,
struct v4l2_frmsizeenum *fsize)
{
@@ -213,8 +324,14 @@ static int rkvdec_enum_framesizes(struct file *file, void *priv,
if (!fmt)
return -EINVAL;
- fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
- fsize->stepwise = fmt->frmsize;
+ fsize->type = V4L2_FRMSIZE_TYPE_CONTINUOUS;
+ fsize->stepwise.min_width = 1;
+ fsize->stepwise.max_width = fmt->frmsize.max_width;
+ fsize->stepwise.step_width = 1;
+ fsize->stepwise.min_height = 1;
+ fsize->stepwise.max_height = fmt->frmsize.max_height;
+ fsize->stepwise.step_height = 1;
+
return 0;
}
@@ -238,7 +355,6 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv,
struct v4l2_pix_format_mplane *pix_mp = &f->fmt.pix_mp;
struct rkvdec_ctx *ctx = fh_to_rkvdec_ctx(priv);
const struct rkvdec_coded_fmt_desc *coded_desc;
- unsigned int i;
/*
* The codec context should point to a coded format desc, if the format
@@ -249,13 +365,9 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv,
if (WARN_ON(!coded_desc))
return -EINVAL;
- for (i = 0; i < coded_desc->num_decoded_fmts; i++) {
- if (coded_desc->decoded_fmts[i] == pix_mp->pixelformat)
- break;
- }
-
- if (i == coded_desc->num_decoded_fmts)
- pix_mp->pixelformat = coded_desc->decoded_fmts[0];
+ if (!rkvdec_is_valid_fmt(ctx, pix_mp->pixelformat, ctx->image_fmt))
+ pix_mp->pixelformat = rkvdec_enum_decoded_fmt(ctx, 0,
+ ctx->image_fmt);
/* Always apply the frmsize constraint of the coded end. */
pix_mp->width = max(pix_mp->width, ctx->coded_fmt.fmt.pix_mp.width);
@@ -264,12 +376,7 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv,
&pix_mp->height,
&coded_desc->frmsize);
- v4l2_fill_pixfmt_mp(pix_mp, pix_mp->pixelformat,
- pix_mp->width, pix_mp->height);
- pix_mp->plane_fmt[0].sizeimage +=
- 128 *
- DIV_ROUND_UP(pix_mp->width, 16) *
- DIV_ROUND_UP(pix_mp->height, 16);
+ rkvdec_fill_decoded_pixfmt(ctx, pix_mp);
pix_mp->field = V4L2_FIELD_NONE;
return 0;
@@ -377,6 +484,7 @@ static int rkvdec_s_output_fmt(struct file *file, void *priv,
*
* Note that this will propagates any size changes to the decoded format.
*/
+ ctx->image_fmt = RKVDEC_IMG_FMT_ANY;
rkvdec_reset_decoded_fmt(ctx);
/* Propagate colorspace information to capture. */
@@ -424,14 +532,13 @@ static int rkvdec_enum_capture_fmt(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{
struct rkvdec_ctx *ctx = fh_to_rkvdec_ctx(priv);
+ u32 fourcc;
- if (WARN_ON(!ctx->coded_fmt_desc))
- return -EINVAL;
-
- if (f->index >= ctx->coded_fmt_desc->num_decoded_fmts)
+ fourcc = rkvdec_enum_decoded_fmt(ctx, f->index, ctx->image_fmt);
+ if (!fourcc)
return -EINVAL;
- f->pixelformat = ctx->coded_fmt_desc->decoded_fmts[f->index];
+ f->pixelformat = fourcc;
return 0;
}
@@ -819,24 +926,24 @@ static int rkvdec_open(struct file *filp)
rkvdec_reset_decoded_fmt(ctx);
v4l2_fh_init(&ctx->fh, video_devdata(filp));
- ret = rkvdec_init_ctrls(ctx);
- if (ret)
- goto err_free_ctx;
-
ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(rkvdec->m2m_dev, ctx,
rkvdec_queue_init);
if (IS_ERR(ctx->fh.m2m_ctx)) {
ret = PTR_ERR(ctx->fh.m2m_ctx);
- goto err_cleanup_ctrls;
+ goto err_free_ctx;
}
+ ret = rkvdec_init_ctrls(ctx);
+ if (ret)
+ goto err_cleanup_m2m_ctx;
+
filp->private_data = &ctx->fh;
v4l2_fh_add(&ctx->fh);
return 0;
-err_cleanup_ctrls:
- v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
+err_cleanup_m2m_ctx:
+ v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
err_free_ctx:
kfree(ctx);
diff --git a/drivers/staging/media/rkvdec/rkvdec.h b/drivers/staging/media/rkvdec/rkvdec.h
index 633335ebb9c4..9a9f4fced7a1 100644
--- a/drivers/staging/media/rkvdec/rkvdec.h
+++ b/drivers/staging/media/rkvdec/rkvdec.h
@@ -73,6 +73,21 @@ struct rkvdec_coded_fmt_ops {
struct vb2_v4l2_buffer *dst_buf,
enum vb2_buffer_state result);
int (*try_ctrl)(struct rkvdec_ctx *ctx, struct v4l2_ctrl *ctrl);
+ enum rkvdec_image_fmt (*get_image_fmt)(struct rkvdec_ctx *ctx,
+ struct v4l2_ctrl *ctrl);
+};
+
+enum rkvdec_image_fmt {
+ RKVDEC_IMG_FMT_ANY = 0,
+ RKVDEC_IMG_FMT_420_8BIT,
+ RKVDEC_IMG_FMT_420_10BIT,
+ RKVDEC_IMG_FMT_422_8BIT,
+ RKVDEC_IMG_FMT_422_10BIT,
+};
+
+struct rkvdec_decoded_fmt_desc {
+ u32 fourcc;
+ enum rkvdec_image_fmt image_fmt;
};
struct rkvdec_coded_fmt_desc {
@@ -81,7 +96,7 @@ struct rkvdec_coded_fmt_desc {
const struct rkvdec_ctrls *ctrls;
const struct rkvdec_coded_fmt_ops *ops;
unsigned int num_decoded_fmts;
- const u32 *decoded_fmts;
+ const struct rkvdec_decoded_fmt_desc *decoded_fmts;
u32 subsystem_flags;
};
@@ -104,6 +119,7 @@ struct rkvdec_ctx {
const struct rkvdec_coded_fmt_desc *coded_fmt_desc;
struct v4l2_ctrl_handler ctrl_hdl;
struct rkvdec_dev *dev;
+ enum rkvdec_image_fmt image_fmt;
void *priv;
};
diff --git a/drivers/staging/media/starfive/camss/stf-isp.c b/drivers/staging/media/starfive/camss/stf-isp.c
index 4e6e26736852..df7a903fbb1b 100644
--- a/drivers/staging/media/starfive/camss/stf-isp.c
+++ b/drivers/staging/media/starfive/camss/stf-isp.c
@@ -278,7 +278,7 @@ static int isp_set_selection(struct v4l2_subdev *sd,
isp_set_format(sd, state, &fmt);
}
- dev_dbg(isp_dev->stfcamss->dev, "pad: %d sel(%d,%d)/%dx%d\n",
+ dev_dbg(isp_dev->stfcamss->dev, "pad: %d sel(%d,%d)/%ux%u\n",
sel->pad, sel->r.left, sel->r.top, sel->r.width, sel->r.height);
return 0;
diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index b839b50ac26a..fa7ea4ca4c36 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -1900,6 +1900,7 @@ static int bcm2835_mmal_probe(struct vchiq_device *device)
__func__, ret);
goto free_dev;
}
+ dev->v4l2_dev.dev = &device->dev;
/* setup v4l controls */
ret = bcm2835_mmal_init_controls(dev, &dev->ctrl_handler);