Commit 56064cd8 authored by Andrey Filippov's avatar Andrey Filippov

merged with framepars

parents 923da644 809ae1e8
......@@ -299,5 +299,15 @@
klogger-393,buffer_size = <1048576>;
} ;
/* i2c driver for the extension boards, such as imu, gps, etc */
elphel393_ext_i2c:elphel393-ext-i2c@0{
compatible = "elphel,elphel393-ext-i2c-1.00";
time_scl_high = <3>; /* SCL high duration (us) */
time_scl_low = <3>; /* SCL low duration (us) */
time_slave2master = <2>; /* slave -> master delay (us) */
time_master2slave = <2>; /* master -> slave delay (us) */
filter_sda = <7>; /* filter SDA read data by testing multiple times - currently just zero/non zero */
filter_scl = <7>; /* filter SCL read data by testing multiple times - currently just zero/non zero */
};
};
\ No newline at end of file
......@@ -298,6 +298,15 @@
compatible = "elphel,klogger-393-1.00";
klogger-393,buffer_size = <1048576>;
} ;
/* i2c driver for the extension boards, such as imu, gps, etc */
elphel393_ext_i2c:elphel393-ext-i2c@0{
compatible = "elphel,elphel393-ext-i2c-1.00";
time_scl_high = <3>; /* SCL high duration (us) */
time_scl_low = <3>; /* SCL low duration (us) */
time_slave2master = <2>; /* slave -> master delay (us) */
time_master2slave = <2>; /* master -> slave delay (us) */
filter_sda = <7>; /* filter SDA read data by testing multiple times - currently just zero/non zero */
filter_scl = <7>; /* filter SCL read data by testing multiple times - currently just zero/non zero */
};
};
\ No newline at end of file
......@@ -299,5 +299,15 @@
klogger-393,buffer_size = <1048576>;
} ;
/* i2c driver for the extension boards, such as imu, gps, etc */
elphel393_ext_i2c:elphel393-ext-i2c@0{
compatible = "elphel,elphel393-ext-i2c-1.00";
time_scl_high = <3>; /* SCL high duration (us) */
time_scl_low = <3>; /* SCL low duration (us) */
time_slave2master = <2>; /* slave -> master delay (us) */
time_master2slave = <2>; /* master -> slave delay (us) */
filter_sda = <7>; /* filter SDA read data by testing multiple times - currently just zero/non zero */
filter_scl = <7>; /* filter SCL read data by testing multiple times - currently just zero/non zero */
};
};
\ No newline at end of file
......@@ -299,5 +299,15 @@
klogger-393,buffer_size = <1048576>;
} ;
/* i2c driver for the extension boards, such as imu, gps, etc */
elphel393_ext_i2c:elphel393-ext-i2c@0{
compatible = "elphel,elphel393-ext-i2c-1.00";
time_scl_high = <3>; /* SCL high duration (us) */
time_scl_low = <3>; /* SCL low duration (us) */
time_slave2master = <2>; /* slave -> master delay (us) */
time_master2slave = <2>; /* master -> slave delay (us) */
filter_sda = <7>; /* filter SDA read data by testing multiple times - currently just zero/non zero */
filter_scl = <7>; /* filter SCL read data by testing multiple times - currently just zero/non zero */
};
};
\ No newline at end of file
This diff is collapsed.
......@@ -246,7 +246,6 @@ static int get_channel_sub_from_name(struct device_attribute *attr) ///< Linux k
static ssize_t show_port_mux(struct device *dev, struct device_attribute *attr, char *buf)
{
int i;
const char * name = get_name_by_code(get_detected_mux_code(get_channel_from_name(attr)), DETECT_MUX);
if (name) return sprintf(buf,"%s\n", name);
// Should never get here
......@@ -254,7 +253,6 @@ static ssize_t show_port_mux(struct device *dev, struct device_attribute *attr,
}
static ssize_t show_sensor(struct device *dev, struct device_attribute *attr, char *buf)
{
int i;
int psch = get_channel_sub_from_name(attr);
int port = (psch>>4) &3;
int sub_chn = psch &3;
......@@ -265,11 +263,11 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *attr, ch
}
static ssize_t store_port_mux(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
size_t len;
// size_t len;
char name[80];
int port = get_channel_from_name(attr);
int i, code, rslt;
if (sscanf(buf, "%79s", name, &len)){
int rslt;
if (sscanf(buf, "%79s", name)){
if ((rslt = set_detected_mux_code( port, get_code_by_name(name, DETECT_MUX)))<0)
return rslt;
......@@ -278,13 +276,13 @@ static ssize_t store_port_mux(struct device *dev, struct device_attribute *attr,
}
static ssize_t store_sensor(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
size_t len;
// size_t len;
char name[80];
int psch = get_channel_sub_from_name(attr);
int port = (psch>>4) &3;
int sub_chn = psch &3;
int i, rslt;
if (sscanf(buf, "%79s", name, &len)){
int rslt;
if (sscanf(buf, "%79s", name)){
if ((rslt = set_detected_sensor_code(port, sub_chn, get_code_by_name(name, DETECT_SENSOR)))<0)
return rslt;
}
......
......@@ -501,7 +501,7 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
int p=(int)file->private_data;
int thissize=minor_file_size(p);
int maxsize=minor_max_size(p);
// int fp;
int fp;
dev_dbg(g_devfp_ptr,"exif_lseek, minor=%d, offset = 0x%llx, orig=%d\n",p,offset,orig);
// int sensor_port;
switch (orig) {
......@@ -548,7 +548,9 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
case DEV393_MINOR(DEV393_EXIF_META1):
case DEV393_MINOR(DEV393_EXIF_META2):
case DEV393_MINOR(DEV393_EXIF_META3):
file->f_pos=offset*sizeof(struct exif_dir_table_t);
fp= dir_find_tag (offset);
if (fp < 0) return -EOVERFLOW; // tag is not in the directory
file->f_pos=fp;
break;
case DEV393_MINOR(DEV393_EXIF_METADIR):
file->f_pos=offset*sizeof(struct exif_dir_table_t);
......@@ -602,8 +604,11 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
char tmp[MAX_EXIF_SIZE]; //! Or is it possible to disable IRQ while copy_from_user()?
unsigned long flags;
int disabled_err=0;
dev_dbg(g_devfp_ptr,"minor=0x%x\n", p);
if ((*off+count)>maxsize) {
dev_warn(g_devfp_ptr,"%s:%d: Data (0x%x) does not fit into 0x%x bytes\n",__FILE__,__LINE__, (int) (*off+count), maxsize);
// dev_warn(g_devfp_ptr,"%s:%d: Data (0x%x) does not fit into 0x%x bytes\n",__FILE__,__LINE__, (int) (*off+count), maxsize);
dev_dbg(g_devfp_ptr,"Data (0x%x) does not fit into 0x%x bytes, minor = 0x%x\n",(int) (*off+count), maxsize, p);
return -EOVERFLOW;
}
switch (p) {
......
This diff is collapsed.
......@@ -44,7 +44,6 @@
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/of_net.h>
#include <linux/platform_device.h>
#include <linux/sysfs.h>
#include <linux/list.h>
......
......@@ -1652,7 +1652,7 @@ struct p_names_t {
// make this structure common for sensors, add fields as needed
struct sensor_t {
struct __attribute__((__packed__)) sensor_t {
// sensor constants
unsigned long imageWidth; ///< nominal image width for final images
unsigned long imageHeight; ///< nominal image height for final images
......@@ -1789,7 +1789,7 @@ struct i2c_timing_t {
#define GAMMA_SCALE_SHIFT 10 // when scaling - shift right by GAMMA_SCALE_SHIFT (treat scale as 6.10)
#define GAMMA_SCLALE_1 ( 1 << GAMMA_SCALE_SHIFT ) // gamma scale 1.0 - 0x400
struct gamma_stuct_t {
struct __attribute__((__packed__)) gamma_stuct_t {
union {
unsigned long hash32; /// fully identifies current table
struct {
......
......@@ -43,7 +43,7 @@ or Rational or else. The generated Exif header copies that variable fileds on to
The compressed data buffer is stored in "meta pages", one per frame
*/
struct exif_dir_table_t {
struct __attribute__((__packed__)) exif_dir_table_t {
union {
unsigned long ltag;// tag group and tag combined
struct {
......@@ -112,13 +112,13 @@ struct exif_dir_table_t {
// array(0x9003,2,"2001:06:21 12:00:00","len"=> 20), //date/time original time created, always use 20 bytes (19 ."\0")
// array(0x9291,2,"0 ") //original time sub-second length=10 9 ."\0"
///move back to interframe_params_t?
struct frame_exif_t {
struct __attribute__((__packed__)) frame_exif_t {
unsigned short meta_index; //! index of the linked meta page
unsigned short signffff; //! should be 0xffff - it will be a signature that JPEG data was not overwritten
unsigned long frame_length; //! frame length
};
struct meta_GPSInfo_t {
struct __attribute__((__packed__)) meta_GPSInfo_t {
unsigned char GPSLatitudeRef; //"N"/"S"
unsigned long GPSLatitude_deg_nom;
unsigned long GPSLatitude_deg_denom;
......@@ -142,7 +142,7 @@ struct meta_GPSInfo_t {
unsigned char GPSMeasureMode;
};
//hack - use
struct meta_CompassInfo_t {
struct __attribute__((__packed__)) meta_CompassInfo_t {
// unsigned char GPSImgDirectionRef; //"M"/"T" //0x10
unsigned long CompassDirection_nom; //0x11
unsigned long CompassDirection_denom;
......
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