Commit b59b7efd authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

1. testing phase adjustment and i2c operations

2. fixed a couple typos
parent 235bc9fb
This diff is collapsed.
...@@ -544,6 +544,16 @@ ...@@ -544,6 +544,16 @@
#define P_MT9F002_TEST_PATTERN 10 #define P_MT9F002_TEST_PATTERN 10
#define P_MT9F002_HISPI_TIMING 11
#define P_MT9F002_SMIA_PLL_MULTIPLIER 12
#define P_MT9F002_HISPI_CONTROL_STATUS 13
#define P_MT9F002_DATAPATH_SELECT 14
#define P_MT9F002_RESET_REGISTER 15
#define P_MT9F002_ANALOG_GAIN_CODE_GLOBAL 16
#define P_MT9F002_ANALOG_GAIN_CODE_RED 17
#define P_MT9F002_ANALOG_GAIN_CODE_BLUE 18
#define P_MT9F002_COARSE_INTEGRATION_TIME 19
//#define P_REG(x) x //#define P_REG(x) x
//#define P_MT9F002_MODEL_ID 4 //#define P_MT9F002_MODEL_ID 4
......
...@@ -1175,7 +1175,7 @@ int mt9x001_pgm_window_common (int sensor_port, ///< sensor port ...@@ -1175,7 +1175,7 @@ int mt9x001_pgm_window_common (int sensor_port, ///< sensor port
dev_dbg(g_dev_ptr,"{%d} SET_SENSOR_MBPAR(0x%0x, 0x%x, 0x%x, 0x%x, 0x%x)\n",sensor_port, sensor_port, frame16, (int) sensor->i2c_addr, (int) P_MT9X001_ROWSTART,(int) wt); dev_dbg(g_dev_ptr,"{%d} SET_SENSOR_MBPAR(0x%0x, 0x%x, 0x%x, 0x%x, 0x%x)\n",sensor_port, sensor_port, frame16, (int) sensor->i2c_addr, (int) P_MT9X001_ROWSTART,(int) wt);
} }
///TODO:Get rid of get_sensor_i2c_regs16 !!! ///TODO:Get rid of get_sensor_i2c_regs16 !!!
// the fields that should not chnage in non-stop will not change, so it is OK to write them always // the fields that should not change in non-stop will not change, so it is OK to write them always
if((styp == MT9T_TYP) || (styp == MT9P_TYP)) { // 3MPix and 5MPix sensors if((styp == MT9T_TYP) || (styp == MT9P_TYP)) { // 3MPix and 5MPix sensors
v= (thispars->pars[P_SENSOR_REGS+P_MT9X001_RAM] & 0xff88) | ((bv - 1) << 4) | (dv - 1) ; v= (thispars->pars[P_SENSOR_REGS+P_MT9X001_RAM] & 0xff88) | ((bv - 1) << 4) | (dv - 1) ;
if (v != thispars->pars[P_SENSOR_REGS+P_MT9X001_RAM]) { if (v != thispars->pars[P_SENSOR_REGS+P_MT9X001_RAM]) {
......
...@@ -379,8 +379,6 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number ( ...@@ -379,8 +379,6 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
int i2cbytes; int i2cbytes;
int mux,sens; int mux,sens;
pr_info("{%d} pgm_detectsensor\n",sensor_port);
dev_dbg(g_dev_ptr,"{%d} frame16=%d\n",sensor_port,frame16); dev_dbg(g_dev_ptr,"{%d} frame16=%d\n",sensor_port,frame16);
MDP(DBGB_PSFN, sensor_port,"frame16=%d\n",frame16) MDP(DBGB_PSFN, sensor_port,"frame16=%d\n",frame16)
......
...@@ -1223,7 +1223,7 @@ int register_i2c_sensor(int ports_mask) ///< bitmask of the sensor ports to use ...@@ -1223,7 +1223,7 @@ int register_i2c_sensor(int ports_mask) ///< bitmask of the sensor ports to use
bool mux; bool mux;
pr_info("register_i2c_sensor()\n"); dev_dbg(g_dev_ptr,"register_i2c_sensor()\n");
for(port=0;port<SENSOR_PORTS;port++) if ((1<<port)&ports_mask) { for(port=0;port<SENSOR_PORTS;port++) if ((1<<port)&ports_mask) {
......
...@@ -126,7 +126,7 @@ long long get_frame_pos(unsigned int chn, unsigned int pos); ...@@ -126,7 +126,7 @@ long long get_frame_pos(unsigned int chn, unsigned int pos);
#define X3X3_I2C_SEND2_ASAP(port,sa7,reg,data) {\ #define X3X3_I2C_SEND2_ASAP(port,sa7,reg,data) {\
int _ADDR = pSensorPortConfig[(port)].par2addr[0][(reg)];\ int _ADDR = pSensorPortConfig[(port)].par2addr[0][(reg)];\
int _PAGE = pSensorPortConfig[(port)].haddr2rec[0][(_ADDR>>8)&0xff];\ int _PAGE = pSensorPortConfig[(port)].haddr2rec[0][(_ADDR>>8)&0xff];\
write_xi2c_reg16((port),(sa7),(reg),(data));\ write_xi2c_reg16((port),_PAGE,_ADDR&0xff,(data));\
} }
/** Perform I2C read (8 bits address, 16 bits data in "legacy" mode (sensors and 10359), /** Perform I2C read (8 bits address, 16 bits data in "legacy" mode (sensors and 10359),
......
...@@ -328,7 +328,9 @@ int get_bit_delay(int khz) ...@@ -328,7 +328,9 @@ int get_bit_delay(int khz)
// Modified FPGA - added extra division // Modified FPGA - added extra division
// dly = (1000 * mclk_mhz / 4)/khz; // dly = (1000 * mclk_mhz / 4)/khz;
// dly = (1000 * mclk_mhz / 8 )/khz; // // dly = (1000 * mclk_mhz / 8 )/khz; //
dly = (32000 * mclk_mhz / scale_i2c_speed )/khz; //
// WARNING: for 500KHz it is supposed to write 100, but it actually writes 50
dly = (32000 * mclk_mhz / scale_i2c_speed )/khz;
if (dly > 255) if (dly > 255)
dly = 255; dly = 255;
return dly; return dly;
...@@ -1483,7 +1485,7 @@ static ssize_t get_i2c_help(struct device *dev, ///< Linux kernel b ...@@ -1483,7 +1485,7 @@ static ssize_t get_i2c_help(struct device *dev, ///< Linux kernel b
"tbl_rd*: read - decoded table entry for current rd_page, write <page> <2-byte addr> <bytes_to_read> <dly>\n" "tbl_rd*: read - decoded table entry for current rd_page, write <page> <2-byte addr> <bytes_to_read> <dly>\n"
"tbl_rd*: alt: <class-name> <page> <bytes_to_read or 0 (use class)> <dly or 0 (use class)>\n" "tbl_rd*: alt: <class-name> <page> <bytes_to_read or 0 (use class)> <dly or 0 (use class)>\n"
"tbl_rd* and tbl_wr* return same result when read. Delay is 8 bit, 250 - 200KHz SCL\n" "tbl_rd* and tbl_wr* return same result when read. Delay is 8 bit, 250 - 200KHz SCL\n"
"Read/write i2c register (for the pre-configured device classes), sa7_affset is added to class device slave address\n" "Read/write i2c register (for the pre-configured device classes), sa7_offset is added to class device slave address\n"
"[<data>] is used for register write, without - register read. Reading i2c* returns result of last i2c read operation\n" "[<data>] is used for register write, without - register read. Reading i2c* returns result of last i2c read operation\n"
"i2c*: read - last read data, write: <class_name> <sa7_offset> <reg_addr> [<data>]\n" "i2c*: read - last read data, write: <class_name> <sa7_offset> <reg_addr> [<data>]\n"
"i2c_frame*: read - i2c sequencer frame number (4 bit), write: 0 - stop, 1 - run, 2 - reset, 3 - reset+run\n" "i2c_frame*: read - i2c sequencer frame number (4 bit), write: 0 - stop, 1 - run, 2 - reset, 3 - reset+run\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment