@@ -318,19 +308,20 @@ int mt9f002_pgm_detectsensor (int sensor_port, ///< sensor port
return0;// no sensor found
}
// Sensor recognized, go on
// Sensor is recognized, go on
// copy sensor definitions
memcpy(sensor,psensor,sizeof(mt9f002));
dev_dbg(g_dev_ptr,"{%d} copied %d bytes of sensor static parameters\n",sensor_port,sizeof(mt9f002));
// add functions to common pgm_functions
add_sensor_proc(sensor_port,onchange_detectsensor,&mt9f002_pgm_detectsensor);// detect sensor type, sets sensor structure (capabilities), function pointers NOTE: will be called directly, not through pointers
add_sensor_proc(sensor_port,onchange_initsensor,&mt9f002_pgm_initsensor);// resets sensor, reads sensor registers, schedules "secret" manufacturer's corrections to the registers (stops/re-enables hardware i2c)
add_sensor_proc(sensor_port,onchange_exposure,&mt9f002_pgm_exposure);// program exposure
add_sensor_proc(sensor_port,onchange_window,&mt9f002_pgm_window);// program sensor WOI and mirroring (flipping)
add_sensor_proc(sensor_port,onchange_window_safe,&mt9f002_pgm_window_safe);// program sensor WOI and mirroring (flipping) - now - only flipping? with lower latency
//add_sensor_proc(sensor_port,onchange_limitfps, &mt9x001_pgm_limitfps); // check compressor will keep up, limit sensor FPS if needed
add_sensor_proc(sensor_port,onchange_limitfps,&mt9f002_pgm_limitfps);// check compressor will keep up, limit sensor FPS if needed
add_sensor_proc(sensor_port,onchange_gains,&mt9f002_pgm_gains);// program analog gains
//add_sensor_proc(sensor_port,onchange_triggermode, &mt9x001_pgm_triggermode); // program sensor trigger mode
//add_sensor_proc(sensor_port,onchange_sensorregs, &mt9x001_pgm_sensorregs); // write sensor registers (only changed from outside the driver as they may have different latencies)?
...
...
@@ -341,9 +332,7 @@ int mt9f002_pgm_detectsensor (int sensor_port, ///< sensor port
// setFramePar(thispars, P_SENSOR | FRAMEPAIR_FORCE_NEWPROC, sensor->sensorType); // force actions
// MDD1(dev_dbg(g_dev_ptr,"\n"));
// CCAM_ARO_ON set. Does it need to be set here? Not earlier (as it is now set for NC393)
dev_dbg(g_dev_ptr,"{%d} set ARO (TRIGGER) line HIGH\n",sensor_port);
// skipped multisensor regs
sensio_ctl.d32=0;
sensio_ctl.aro=1;
...
...
@@ -354,6 +343,7 @@ int mt9f002_pgm_detectsensor (int sensor_port, ///< sensor port
//NOTE 353: hardware i2c is turned off (not needed in 393)
/** Check if compressor can keep up, limit sensor FPS if needed
* FPS is limited by increasing verical blanking, it can not be be made too big, so this method does not work to make time lapse rate. horisontal blanking
* is kept at minimum (to reduce ERS effect) if not specified. If it is specified (>minimal) - it will be used instead.
* calculate line period.
*
* FIXME - uses P_VIRTUAL_WIDTH w/o decreasing it when changing image size? Replace VIRT_WIDTH with HOR_BANK?
* Or require always set them to zero when chnaging WOI?
* FIXME for multisensor - needs per-sensor individual parameters. This uses sensor registers, not the general parameters (i.e. height) */
intmt9f002_pgm_limitfps(intsensor_port,///< sensor port number (0..3)
//pr_info("{%d} RED thispar=0x%08x newRegGain=0x%08x digitalGain=0x%08x\n",sensor_port,thispars->pars[P_SENSOR_REGS+P_MT9F002_GAINR],newRegGain,digitalGain);
if(FRAMEPAR_MODIFIED(P_GAINGB)){
reg=mt9f002_calculate_gain(gaingb);
pr_info("{%d} setting GB gain to 0x%08x\n",sensor_port,reg);