Commit 85a89079 authored by Andrey Filippov's avatar Andrey Filippov

more on lepton driver

parent 128b5975
...@@ -2028,11 +2028,11 @@ static ssize_t show_fpga_sensor_interface(struct device *dev, struct device_attr ...@@ -2028,11 +2028,11 @@ static ssize_t show_fpga_sensor_interface(struct device *dev, struct device_attr
if (!hardware_initialized) if (!hardware_initialized)
return -EBUSY; return -EBUSY;
switch (x393_sensor_interface()){ switch (x393_sensor_interface()){
case 0: case FPGA_PAR12:
return sprintf(buf,"PAR12\n"); return sprintf(buf,"PAR12\n");
case 1: case FPGA_HISPI:
return sprintf(buf,"HISPI\n"); return sprintf(buf,"HISPI\n");
case 2: case FPGA_VOSPI:
return sprintf(buf,"VOSPI\n"); return sprintf(buf,"VOSPI\n");
default: default:
return sprintf(buf,"0x%08x\n", (int) x393_sensor_interface()); return sprintf(buf,"0x%08x\n", (int) x393_sensor_interface());
......
...@@ -1259,7 +1259,8 @@ int register_i2c_sensor(int ports_mask) ///< bitmask of the sensor ports to use ...@@ -1259,7 +1259,8 @@ int register_i2c_sensor(int ports_mask) ///< bitmask of the sensor ports to use
bool mux; bool mux;
bool broadcast_set = false; bool broadcast_set = false;
dev_dbg(g_dev_ptr,"register_i2c_sensor()\n"); // dev_dbg(g_dev_ptr,"register_i2c_sensor()\n");
dev_info(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) {
...@@ -1351,6 +1352,7 @@ int register_i2c_sensor(int ports_mask) ///< bitmask of the sensor ports to use ...@@ -1351,6 +1352,7 @@ int register_i2c_sensor(int ports_mask) ///< bitmask of the sensor ports to use
memcpy(&dev_sensor, class_sensor, sizeof(x393_i2c_device_t)); memcpy(&dev_sensor, class_sensor, sizeof(x393_i2c_device_t));
i2c_page_register(port, LEGACY_READ_PAGE2); i2c_page_register(port, LEGACY_READ_PAGE2);
set_xi2c_rdc(&dev_sensor, port, LEGACY_READ_PAGE2); set_xi2c_rdc(&dev_sensor, port, LEGACY_READ_PAGE2);
dev_info(g_dev_ptr,"register_i2c_sensor(): port=%d, page = 0x%x\n", port, LEGACY_READ_PAGE2);
if (mux){ if (mux){
// 'read' recs for 10359 // 'read' recs for 10359
...@@ -1401,7 +1403,8 @@ int legacy_i2c(int ports) ///< bitmask of the sensor ports to use ...@@ -1401,7 +1403,8 @@ int legacy_i2c(int ports) ///< bitmask of the sensor ports to use
i2c_page_register(sensor_port, LEGACY_READ_PAGE4); i2c_page_register(sensor_port, LEGACY_READ_PAGE4);
dev_sensor.data_bytes=4; // for reading 10359 in 32-bit mode dev_sensor.data_bytes=4; // for reading 10359 in 32-bit mode
set_xi2c_rdc(&dev_sensor, sensor_port, LEGACY_READ_PAGE4); set_xi2c_rdc(&dev_sensor, sensor_port, LEGACY_READ_PAGE4);
dev_dbg(g_dev_ptr, "Initialized sensor i2c for legacy commands, sensor_port= 0x%x\n",sensor_port); // dev_dbg(g_dev_ptr, "Initialized sensor i2c for legacy commands, sensor_port= 0x%x\n",sensor_port);
dev_info(g_dev_ptr, "Initialized sensor i2c for legacy commands, sensor_port= 0x%x\n",sensor_port);
} }
return 0; return 0;
/* /*
......
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
#define SENSOR_MT9F002 0x38 ///< MT9F002 #define SENSOR_MT9F002 0x38 ///< MT9F002
//#define SENSOR_MT9Y001 0x34 ///< Micron/Aptina/Onsemi MT9P001 - 34 //#define SENSOR_MT9Y001 0x34 ///< Micron/Aptina/Onsemi MT9P001 - 34
#define SENSOR_IBIS51300 0x40 ///< FillFactory IBIS51300 #define SENSOR_IBIS51300 0x40 ///< FillFactory IBIS51300
#define SENSOR_LEPTON35 0x41 ///< FLIR Lepton3 sensor #define SENSOR_LEPTON35 0x44 ///< FLIR Lepton3 sensor
#define SENSOR_KAI11000 0x80 ///< Kodak KAI11002 #define SENSOR_KAI11000 0x80 ///< Kodak KAI11002
#define SENSOR_MUX_10359 0xe0 ///< Sensor multiplexer 10359 #define SENSOR_MUX_10359 0xe0 ///< Sensor multiplexer 10359
#define SENSOR_NONE 0xfc ///< No sensor present #define SENSOR_NONE 0xfc ///< No sensor present
...@@ -1734,6 +1734,13 @@ struct __attribute__((__packed__)) sensor_t { ...@@ -1734,6 +1734,13 @@ struct __attribute__((__packed__)) sensor_t {
#define SENSOR_NEED_RESET_CLK 1 #define SENSOR_NEED_RESET_CLK 1
#define SENSOR_NEED_RESET_PHASE 2 #define SENSOR_NEED_RESET_PHASE 2
typedef enum FPGA_INTERFACES {
FPGA_PAR12 = 0,
FPGA_HISPI = 1,
FPGA_VOSPI = 2
} fpga_interfaces_t;
struct sensorproc_t { struct sensorproc_t {
struct sensor_t sensor; struct sensor_t sensor;
// functions return <0 on error (and do nothing) // functions return <0 on error (and do nothing)
......
...@@ -122,10 +122,11 @@ ...@@ -122,10 +122,11 @@
#define DEV393_IMAGE_RAW3 ("image_raw3", "video_mem", 142, 83, "0666", "c") ///< Channel 3. Access to raw (uncompressed) data in video memory, frame-organized #define DEV393_IMAGE_RAW3 ("image_raw3", "video_mem", 142, 83, "0666", "c") ///< Channel 3. Access to raw (uncompressed) data in video memory, frame-organized
#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_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_LEPTON ("", "elphel393-lepton", -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_DEVNAME(n, ...) n #define _DEV393_DEVNAME(n, ...) n
#define _DEV393_PATH(n, ...) "/dev/"n #define _DEV393_PATH(n, ...) "/dev/"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