2008-10-01 01:51:53 -06:00
|
|
|
/*
|
|
|
|
* Driver for the s5k83a sensor
|
|
|
|
*
|
2008-10-16 13:43:16 -06:00
|
|
|
* Copyright (C) 2008 Erik Andrén
|
2008-10-01 01:51:53 -06:00
|
|
|
* Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project.
|
|
|
|
* Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br>
|
|
|
|
*
|
|
|
|
* Portions of code to USB interface and ALi driver software,
|
|
|
|
* Copyright (c) 2006 Willem Duinker
|
|
|
|
* v4l2 interface modeled after the V4L2 driver
|
|
|
|
* for SN9C10x PC Camera Controllers
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation, version 2.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef M5602_S5K83A_H_
|
|
|
|
#define M5602_S5K83A_H_
|
|
|
|
|
|
|
|
#include "m5602_sensor.h"
|
|
|
|
|
2009-04-02 23:45:56 -06:00
|
|
|
#define S5K83A_FLIP 0x01
|
|
|
|
#define S5K83A_HFLIP_TUNE 0x03
|
|
|
|
#define S5K83A_VFLIP_TUNE 0x05
|
|
|
|
#define S5K83A_BRIGHTNESS 0x0a
|
|
|
|
#define S5K83A_EXPOSURE 0x18
|
|
|
|
#define S5K83A_GAIN 0x1b
|
|
|
|
#define S5K83A_PAGE_MAP 0xec
|
|
|
|
|
|
|
|
#define S5K83A_DEFAULT_GAIN 0x71
|
|
|
|
#define S5K83A_DEFAULT_BRIGHTNESS 0x7e
|
|
|
|
#define S5K83A_DEFAULT_EXPOSURE 0x00
|
|
|
|
#define S5K83A_MAXIMUM_EXPOSURE 0x3c
|
|
|
|
#define S5K83A_FLIP_MASK 0x10
|
2008-12-28 10:09:21 -07:00
|
|
|
#define S5K83A_GPIO_LED_MASK 0x10
|
2009-04-02 23:45:56 -06:00
|
|
|
#define S5K83A_GPIO_ROTATION_MASK 0x40
|
2008-10-01 01:51:53 -06:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
/* Kernel module parameters */
|
|
|
|
extern int force_sensor;
|
|
|
|
extern int dump_sensor;
|
|
|
|
|
|
|
|
int s5k83a_probe(struct sd *sd);
|
|
|
|
int s5k83a_init(struct sd *sd);
|
2008-12-28 10:09:21 -07:00
|
|
|
int s5k83a_start(struct sd *sd);
|
|
|
|
int s5k83a_stop(struct sd *sd);
|
2008-10-01 01:51:53 -06:00
|
|
|
int s5k83a_power_down(struct sd *sd);
|
2009-04-02 23:45:56 -06:00
|
|
|
void s5k83a_disconnect(struct sd *sd);
|
2008-10-01 01:51:53 -06:00
|
|
|
|
|
|
|
int s5k83a_set_gain(struct gspca_dev *gspca_dev, __s32 val);
|
|
|
|
int s5k83a_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
|
2009-04-02 23:45:56 -06:00
|
|
|
int s5k83a_set_brightness(struct gspca_dev *gspca_dev, __s32 val);
|
|
|
|
int s5k83a_get_brightness(struct gspca_dev *gspca_dev, __s32 *val);
|
|
|
|
int s5k83a_set_exposure(struct gspca_dev *gspca_dev, __s32 val);
|
|
|
|
int s5k83a_get_exposure(struct gspca_dev *gspca_dev, __s32 *val);
|
2008-10-07 00:02:59 -06:00
|
|
|
int s5k83a_get_vflip(struct gspca_dev *gspca_dev, __s32 *val);
|
|
|
|
int s5k83a_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
|
|
|
|
int s5k83a_get_hflip(struct gspca_dev *gspca_dev, __s32 *val);
|
|
|
|
int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
|
|
|
|
|
2008-12-30 13:35:34 -07:00
|
|
|
static const struct m5602_sensor s5k83a = {
|
2008-12-30 11:27:17 -07:00
|
|
|
.name = "S5K83A",
|
|
|
|
.probe = s5k83a_probe,
|
|
|
|
.init = s5k83a_init,
|
|
|
|
.start = s5k83a_start,
|
|
|
|
.stop = s5k83a_stop,
|
|
|
|
.power_down = s5k83a_power_down,
|
2009-04-02 23:45:56 -06:00
|
|
|
.disconnect = s5k83a_disconnect,
|
2008-12-30 11:27:17 -07:00
|
|
|
.i2c_slave_id = 0x5a,
|
|
|
|
.i2c_regW = 2,
|
2008-10-01 01:51:53 -06:00
|
|
|
};
|
|
|
|
|
2009-04-02 23:45:56 -06:00
|
|
|
struct s5k83a_priv {
|
|
|
|
/* We use another thread periodically
|
|
|
|
probing the orientation of the camera */
|
|
|
|
struct task_struct *rotation_thread;
|
|
|
|
s32 *settings;
|
|
|
|
};
|
|
|
|
|
2008-10-01 01:51:53 -06:00
|
|
|
static const unsigned char preinit_s5k83a[][4] =
|
|
|
|
{
|
|
|
|
{BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_TYPE, 0x0d, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_CTRL, 0x00, 0x00},
|
|
|
|
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT, 0x08, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_H, 0x3f, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_H, 0x3f, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_L, 0xff, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_L, 0xff, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_L, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0x80, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xf0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT, 0x1c, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_H, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_I2C_CLK_DIV, 0x20, 0x00},
|
|
|
|
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x00, 0x00}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* This could probably be considerably shortened.
|
|
|
|
I don't have the hardware to experiment with it, patches welcome
|
|
|
|
*/
|
|
|
|
static const unsigned char init_s5k83a[][4] =
|
|
|
|
{
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x04, 0x00},
|
|
|
|
{SENSOR, 0xaf, 0x01, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x7b, 0xff, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR, 0x01, 0x50, 0x00},
|
|
|
|
{SENSOR, 0x12, 0x20, 0x00},
|
|
|
|
{SENSOR, 0x17, 0x40, 0x00},
|
2009-04-02 23:45:56 -06:00
|
|
|
{SENSOR, S5K83A_GAIN, 0x0f, 0x00},
|
2008-10-01 01:51:53 -06:00
|
|
|
{SENSOR, 0x1c, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x02, 0x70, 0x00},
|
|
|
|
{SENSOR, 0x03, 0x0b, 0x00},
|
|
|
|
{SENSOR, 0x04, 0xf0, 0x00},
|
|
|
|
{SENSOR, 0x05, 0x0b, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x01, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0xe4, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x87, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR, 0x06, 0x71, 0x00},
|
|
|
|
{SENSOR, 0x07, 0xe8, 0x00},
|
|
|
|
{SENSOR, 0x08, 0x02, 0x00},
|
|
|
|
{SENSOR, 0x09, 0x88, 0x00},
|
|
|
|
{SENSOR, 0x14, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x15, 0x20, 0x00},
|
|
|
|
{SENSOR, 0x19, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x1a, 0x98, 0x00},
|
|
|
|
{SENSOR, 0x0f, 0x02, 0x00},
|
|
|
|
{SENSOR, 0x10, 0xe5, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR_LONG, 0x14, 0x00, 0x20},
|
|
|
|
{SENSOR_LONG, 0x0d, 0x00, 0x7d},
|
|
|
|
{SENSOR_LONG, 0x1b, 0x0d, 0x05},
|
|
|
|
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x01, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0xe4, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x87, 0x00},
|
|
|
|
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT, 0x08, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_H, 0x3f, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_H, 0x3f, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_L, 0xff, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_L, 0xff, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_L, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0x80, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xf0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT, 0x1c, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_H, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_I2C_CLK_DIV, 0x20, 0x00},
|
|
|
|
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x04, 0x00},
|
|
|
|
{SENSOR, 0xaf, 0x01, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
/* ff ( init value )is very dark) || 71 and f0 better */
|
|
|
|
{SENSOR, 0x7b, 0xff, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR, 0x01, 0x50, 0x00},
|
|
|
|
{SENSOR, 0x12, 0x20, 0x00},
|
|
|
|
{SENSOR, 0x17, 0x40, 0x00},
|
2009-04-02 23:45:56 -06:00
|
|
|
{SENSOR, S5K83A_GAIN, 0x0f, 0x00},
|
2008-10-01 01:51:53 -06:00
|
|
|
{SENSOR, 0x1c, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x02, 0x70, 0x00},
|
|
|
|
/* some values like 0x10 give a blue-purple image */
|
|
|
|
{SENSOR, 0x03, 0x0b, 0x00},
|
|
|
|
{SENSOR, 0x04, 0xf0, 0x00},
|
|
|
|
{SENSOR, 0x05, 0x0b, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
|
|
|
|
/* under 80 don't work, highter depend on value */
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
|
|
|
|
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x01, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0xe4, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x7f, 0x00},
|
|
|
|
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR, 0x06, 0x71, 0x00},
|
|
|
|
{SENSOR, 0x07, 0xe8, 0x00},
|
|
|
|
{SENSOR, 0x08, 0x02, 0x00},
|
|
|
|
{SENSOR, 0x09, 0x88, 0x00},
|
|
|
|
{SENSOR, 0x14, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x15, 0x20, 0x00},
|
|
|
|
{SENSOR, 0x19, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x1a, 0x98, 0x00},
|
|
|
|
{SENSOR, 0x0f, 0x02, 0x00},
|
|
|
|
{SENSOR, 0x10, 0xe5, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR_LONG, 0x14, 0x00, 0x20},
|
|
|
|
{SENSOR_LONG, 0x0d, 0x00, 0x7d},
|
|
|
|
{SENSOR_LONG, 0x1b, 0x0d, 0x05},
|
|
|
|
|
|
|
|
/* The following sequence is useless after a clean boot
|
|
|
|
but is necessary after resume from suspend */
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT, 0x08, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_H, 0x3f, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_H, 0x3f, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_L, 0xff, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_L, 0xff, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_L, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0x80, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_MCU_CLK_DIV, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_MCU_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xf0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR, 0x1d, 0x00},
|
2008-12-28 10:09:21 -07:00
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT, 0x08, 0x00},
|
2008-10-01 01:51:53 -06:00
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_H, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DIR_H, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_DAT_H, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_GPIO_EN_L, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_I2C_CLK_DIV, 0x20, 0x00},
|
|
|
|
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x04, 0x00},
|
|
|
|
{SENSOR, 0xaf, 0x01, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x7b, 0xff, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR, 0x01, 0x50, 0x00},
|
|
|
|
{SENSOR, 0x12, 0x20, 0x00},
|
|
|
|
{SENSOR, 0x17, 0x40, 0x00},
|
2009-04-02 23:45:56 -06:00
|
|
|
{SENSOR, S5K83A_GAIN, 0x0f, 0x00},
|
2008-10-01 01:51:53 -06:00
|
|
|
{SENSOR, 0x1c, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x02, 0x70, 0x00},
|
|
|
|
{SENSOR, 0x03, 0x0b, 0x00},
|
|
|
|
{SENSOR, 0x04, 0xf0, 0x00},
|
|
|
|
{SENSOR, 0x05, 0x0b, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x06, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_ADC_CTRL, 0xc0, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SENSOR_TYPE, 0x09, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x81, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x01, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x01, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0xe4, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x02, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_HSYNC_PARA, 0x7f, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SIG_INI, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x00, 0x00},
|
|
|
|
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0, 0x00},
|
|
|
|
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR, 0x06, 0x71, 0x00},
|
|
|
|
{SENSOR, 0x07, 0xe8, 0x00},
|
|
|
|
{SENSOR, 0x08, 0x02, 0x00},
|
|
|
|
{SENSOR, 0x09, 0x88, 0x00},
|
|
|
|
{SENSOR, 0x14, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x15, 0x20, 0x00},
|
|
|
|
{SENSOR, 0x19, 0x00, 0x00},
|
|
|
|
{SENSOR, 0x1a, 0x98, 0x00},
|
|
|
|
{SENSOR, 0x0f, 0x02, 0x00},
|
|
|
|
|
|
|
|
{SENSOR, 0x10, 0xe5, 0x00},
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR_LONG, 0x14, 0x00, 0x20},
|
|
|
|
{SENSOR_LONG, 0x0d, 0x00, 0x7d},
|
|
|
|
{SENSOR_LONG, 0x1b, 0x0d, 0x05},
|
|
|
|
|
|
|
|
/* normal colors
|
|
|
|
(this is value after boot, but after tries can be different) */
|
|
|
|
{SENSOR, 0x00, 0x06, 0x00},
|
|
|
|
|
2009-04-02 23:45:56 -06:00
|
|
|
/* set default gain */
|
2008-10-01 01:51:53 -06:00
|
|
|
{SENSOR_LONG, 0x14, 0x00, 0x20},
|
|
|
|
{SENSOR_LONG, 0x0d, 0x01, 0x00},
|
2009-04-02 23:45:56 -06:00
|
|
|
{SENSOR_LONG, 0x1b, S5K83A_DEFAULT_GAIN >> 3,
|
|
|
|
S5K83A_DEFAULT_GAIN >> 1},
|
2008-10-01 01:51:53 -06:00
|
|
|
|
2009-04-02 23:45:56 -06:00
|
|
|
/* set default brightness */
|
|
|
|
{SENSOR, S5K83A_BRIGHTNESS, S5K83A_DEFAULT_BRIGHTNESS, 0x00},
|
2008-10-01 01:51:53 -06:00
|
|
|
|
2009-04-02 23:45:56 -06:00
|
|
|
/* set default exposure */
|
|
|
|
{SENSOR_LONG, 0x18, 0x00, S5K83A_DEFAULT_EXPOSURE},
|
2008-10-07 00:02:59 -06:00
|
|
|
|
|
|
|
/* set default flip */
|
|
|
|
{SENSOR, S5K83A_PAGE_MAP, 0x05, 0x00},
|
|
|
|
{SENSOR, S5K83A_FLIP, 0x00 | S5K83A_FLIP_MASK, 0x00},
|
|
|
|
{SENSOR, S5K83A_HFLIP_TUNE, 0x0b, 0x00},
|
|
|
|
{SENSOR, S5K83A_VFLIP_TUNE, 0x0a, 0x00}
|
2008-10-01 01:51:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|