Commit fac459d0 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

initial pgm_detect and pgm_init for mt9f002

parent 6b7beb2a
...@@ -26,6 +26,7 @@ obj-$(CONFIG_ELPHEL393) += gamma_tables.o ...@@ -26,6 +26,7 @@ obj-$(CONFIG_ELPHEL393) += gamma_tables.o
obj-$(CONFIG_ELPHEL393) += histograms.o obj-$(CONFIG_ELPHEL393) += histograms.o
obj-$(CONFIG_ELPHEL393) += pgm_functions.o obj-$(CONFIG_ELPHEL393) += pgm_functions.o
obj-$(CONFIG_ELPHEL393) += mt9x001.o obj-$(CONFIG_ELPHEL393) += mt9x001.o
obj-$(CONFIG_ELPHEL393) += mt9f002.o
obj-$(CONFIG_ELPHEL393) += multi10359.o obj-$(CONFIG_ELPHEL393) += multi10359.o
obj-$(CONFIG_ELPHEL393) += imu_log393.o obj-$(CONFIG_ELPHEL393) += imu_log393.o
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <uapi/elphel/x393_devices.h> #include <uapi/elphel/x393_devices.h>
#include <uapi/elphel/c313a.h> #include <uapi/elphel/c313a.h>
#include "mt9x001.h" #include "mt9x001.h"
#include "mt9f002.h"
#include "multi10359.h" #include "multi10359.h"
#include "detect_sensors.h" #include "detect_sensors.h"
...@@ -471,6 +472,8 @@ static int par2addr_init(void){ ...@@ -471,6 +472,8 @@ static int par2addr_init(void){
break; break;
case SENSOR_MT9F002: case SENSOR_MT9F002:
// get sensor table // get sensor table
par2addr = mt9f002_par2addr;
pages = mt9f002_pages;
break; break;
} }
if (par2addr){ if (par2addr){
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -527,7 +527,6 @@ ...@@ -527,7 +527,6 @@
#define P_MT9F002_MODEL_ID 0 #define P_MT9F002_MODEL_ID 0
#define P_MT9F002_RESET 1 #define P_MT9F002_RESET 1
//#define P_REG(x) x //#define P_REG(x) x
//#define P_MT9F002_MODEL_ID 4 //#define P_MT9F002_MODEL_ID 4
......
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
#include "sensor_common.h" #include "sensor_common.h"
#include "multi10359.h" #include "multi10359.h"
#include "mt9x001.h" #include "mt9x001.h"
#include "mt9f002.h"
#include "gamma_tables.h" #include "gamma_tables.h"
#include "quantization_tables.h" #include "quantization_tables.h"
#include "latency.h" #include "latency.h"
...@@ -487,8 +488,33 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number ( ...@@ -487,8 +488,33 @@ int pgm_detectsensor (int sensor_port, ///< sensor port number (
} }
if ((thispars->pars[P_SENSOR]==0) &&
((sens & SENSOR_MASK) == SENSOR_MT9F002)){
dev_dbg(g_dev_ptr,"trying MT9F002, port=%d\n",sensor_port);
MDP(DBGB_PADD, sensor_port,"trying MT9F002, port=%d\n",sensor_port)
// TODO: move to sensor driver
// ************************************************************************************************
// ********************************* MT9x00x SENSOR (5MP) *****************************************
// ************************************************************************************************
mt9f002_pgm_detectsensor(sensor_port, sensor, thispars, prevpars, frame16);
// ************************************************************************************************
// ************************************************************************************************
// ************************************************************************************************
}
setFramePar(sensor_port, thispars, P_CLK_FPGA, 200000000); // FIXME: NC393 setFramePar(sensor_port, thispars, P_CLK_FPGA, 200000000); // FIXME: NC393
setFramePar(sensor_port, thispars, P_CLK_SENSOR, 48000000);
// Freqs for sensors
if ((thispars->pars[P_SENSOR]==0) &&
((sens & SENSOR_MASK) == SENSOR_MT9F002)){
setFramePar(sensor_port, thispars, P_CLK_SENSOR, 24444000);
}else{
// this handles MT9x001 & MUX
setFramePar(sensor_port, thispars, P_CLK_SENSOR, 48000000);
}
if (thispars->pars[P_SENSOR] == SENSOR_DETECT) { if (thispars->pars[P_SENSOR] == SENSOR_DETECT) {
sensor->sensorType=SENSOR_NONE; // to prevent from initializing again sensor->sensorType=SENSOR_NONE; // to prevent from initializing again
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
#define DEV393_DETECT_SENSORS ("detect_sensors", "detect_sensors",143, 1, "0666", "c") ///< Probably not needed, only sysfs is used #define DEV393_DETECT_SENSORS ("detect_sensors", "detect_sensors",143, 1, "0666", "c") ///< Probably not needed, only sysfs is used
#define DEV393_I2C_SENSORS ("", "elphel393-sensor-i2c",-1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?) #define DEV393_I2C_SENSORS ("", "elphel393-sensor-i2c",-1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?)
#define DEV393_MT9X001 ("", "elphel393-mt9x001", -1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?) #define DEV393_MT9X001 ("", "elphel393-mt9x001", -1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?)
#define DEV393_MT9F002 ("", "elphel393-mt9f002", -1, -1, "0666", "c") ///< Used only in sysfs, no character device (yet?)
#define DEV393_KLOGGER ("klogger_393", "klogger_393", 144, 1, "0666", "c") ///< kernel event logger to memory (no i/o) #define DEV393_KLOGGER ("klogger_393", "klogger_393", 144, 1, "0666", "c") ///< kernel event logger to memory (no i/o)
#define _DEV393_DEVNAME(n, ...) n #define _DEV393_DEVNAME(n, ...) 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