Commit 63b28248 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

minor edits

parent 2b5bad4a
...@@ -684,18 +684,22 @@ int mt9x001_pgm_sensorregs (int sensor_port, struct sensor_t * sensor, struct ...@@ -684,18 +684,22 @@ int mt9x001_pgm_sensorregs (int sensor_port, struct sensor_t * sensor, struct
#ifdef NC353 #ifdef NC353
#define I2C_READ_DATA16(x) ((i2c_read_data[(x)<<1]<<8)+i2c_read_data[((x)<<1)+1]) #define I2C_READ_DATA16(x) ((i2c_read_data[(x)<<1]<<8)+i2c_read_data[((x)<<1)+1])
#endif #endif
/**Detect and initialize sensor and related data structures
/**
* Detect and initialize sensor and related data structures
* - detect sensor type. * - detect sensor type.
* - if successful, proceed to:, * - if successful, proceed to:,
* - copy sensor static structure * -- copy sensor static structure
* - setup appropriate pgm_* functions * -- setup appropriate pgm_* functions
* - read sensor registers to shadows * -- read sensor registers to shadows
* - initialize appropriate P_* registers (including sensor register shadows) - that initialization will schedule related pgm_* functions * -- initialize appropriate P_* registers (including sensor register shadows) - that initialization will schedule related pgm_* functions
*
* TODO: when is P_CLK_FPGA initialized? Needs to be done before this * TODO: when is P_CLK_FPGA initialized? Needs to be done before this
* hardware i2c is expected to be reset and initialized - no wrong, it will be programmed in * hardware i2c is expected to be reset and initialized - no wrong, it will be programmed in
* onchange_i2c should be the first after init sensor (even before onchange_sensorphase) * onchange_i2c should be the first after init sensor (even before onchange_sensorphase)
* onchange_sensorphase will be triggered after this * onchange_sensorphase will be triggered after this
* hardware i2c after this function will be disabled, will need onchange_sensorphase to initialize/start it. */ * hardware i2c after this function will be disabled, will need onchange_sensorphase to initialize/start it.
*/
int mt9x001_pgm_detectsensor (int sensor_port, ///< sensor port number (0..3) int mt9x001_pgm_detectsensor (int sensor_port, ///< sensor port number (0..3)
struct sensor_t * sensor, ///< sensor static parameters (capabilities) struct sensor_t * sensor, ///< sensor static parameters (capabilities)
struct framepars_t * thispars, ///< sensor current parameters struct framepars_t * thispars, ///< sensor current parameters
...@@ -705,11 +709,11 @@ int mt9x001_pgm_detectsensor (int sensor_port, ///< sensor port ...@@ -705,11 +709,11 @@ int mt9x001_pgm_detectsensor (int sensor_port, ///< sensor port
///< @return 0 - OK, negative - error ///< @return 0 - OK, negative - error
{ {
// unsigned long flags; // this function uses software i2c operations - they need to have interrupts (and hardware i2c off) //unsigned long flags; // this function uses software i2c operations - they need to have interrupts (and hardware i2c off)
// unsigned char i2c_read_data[2]; // each two bytes - one short word, big endian //unsigned char i2c_read_data[2]; // each two bytes - one short word, big endian
u32 i2c_read_dataw; u32 i2c_read_dataw;
// u8 * i2c_read_data = (u8*)& i2c_read_dataw; // each two bytes - one short word, big endian //u8 * i2c_read_data = (u8*)& i2c_read_dataw; // each two bytes - one short word, big endian
// unsigned char chipver_reg=P_MT9X001_CHIPVER; //unsigned char chipver_reg=P_MT9X001_CHIPVER;
int sensor_subtype=0; int sensor_subtype=0;
int i; int i;
int sensor_multi_regs_number; int sensor_multi_regs_number;
......
This diff is collapsed.
...@@ -235,7 +235,7 @@ int i2c_page_alloc(int chn) ...@@ -235,7 +235,7 @@ int i2c_page_alloc(int chn)
EXPORT_SYMBOL_GPL(i2c_page_alloc); EXPORT_SYMBOL_GPL(i2c_page_alloc);
/** Register specific page, can be used with legacy software to register page equal to slave address, /** Register specific page, can be used with legacy software to register page equal to slave address,
* and use 0xff for reading. Works with 1byhte addresses and 16-bit data */ * and use 0xff for reading. Works with 1-byte addresses and 16-bit data */
int i2c_page_register(int chn, ///< Sensor port int i2c_page_register(int chn, ///< Sensor port
int page) ///< page to register (for legacy software, use 7-bit slave address int page) ///< page to register (for legacy software, use 7-bit slave address
///< @return 0 on success, -ENOMEM if page is already registered ///< @return 0 on success, -ENOMEM if page is already registered
......
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