Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
56064cd8
Commit
56064cd8
authored
Oct 16, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Plain Diff
merged with framepars
parents
923da644
809ae1e8
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
445 additions
and
153 deletions
+445
-153
elphel393_1_mt9p006.dts
src/arch/arm/boot/dts/elphel393_1_mt9p006.dts
+10
-0
elphel393_4_mt9p006.dts
src/arch/arm/boot/dts/elphel393_4_mt9p006.dts
+10
-1
elphel393_eyesis.dts
src/arch/arm/boot/dts/elphel393_eyesis.dts
+10
-0
elphel393_eyesis_bottom2.dts
src/arch/arm/boot/dts/elphel393_eyesis_bottom2.dts
+10
-0
cxi2c.c
src/drivers/elphel/cxi2c.c
+294
-52
detect_sensors.c
src/drivers/elphel/detect_sensors.c
+6
-8
exif393.c
src/drivers/elphel/exif393.c
+9
-4
imu_log393.c
src/drivers/elphel/imu_log393.c
+90
-81
sensor_i2c.c
src/drivers/elphel/sensor_i2c.c
+0
-1
c313a.h
src/include/uapi/elphel/c313a.h
+2
-2
exifa.h
src/include/uapi/elphel/exifa.h
+4
-4
No files found.
src/arch/arm/boot/dts/elphel393_1_mt9p006.dts
View file @
56064cd8
...
@@ -299,5 +299,15 @@
...
@@ -299,5 +299,15 @@
klogger-393,buffer_size = <1048576>;
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
src/arch/arm/boot/dts/elphel393_4_mt9p006.dts
View file @
56064cd8
...
@@ -298,6 +298,15 @@
...
@@ -298,6 +298,15 @@
compatible = "elphel,klogger-393-1.00";
compatible = "elphel,klogger-393-1.00";
klogger-393,buffer_size = <1048576>;
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
src/arch/arm/boot/dts/elphel393_eyesis.dts
View file @
56064cd8
...
@@ -299,5 +299,15 @@
...
@@ -299,5 +299,15 @@
klogger-393,buffer_size = <1048576>;
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
src/arch/arm/boot/dts/elphel393_eyesis_bottom2.dts
View file @
56064cd8
...
@@ -299,5 +299,15 @@
...
@@ -299,5 +299,15 @@
klogger-393,buffer_size = <1048576>;
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
src/drivers/elphel/cxi2c.c
View file @
56064cd8
This diff is collapsed.
Click to expand it.
src/drivers/elphel/detect_sensors.c
View file @
56064cd8
...
@@ -246,7 +246,6 @@ static int get_channel_sub_from_name(struct device_attribute *attr) ///< Linux k
...
@@ -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
)
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
);
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
);
if
(
name
)
return
sprintf
(
buf
,
"%s
\n
"
,
name
);
// Should never get here
// Should never get here
...
@@ -254,7 +253,6 @@ static ssize_t show_port_mux(struct device *dev, struct device_attribute *attr,
...
@@ -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
)
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
psch
=
get_channel_sub_from_name
(
attr
);
int
port
=
(
psch
>>
4
)
&
3
;
int
port
=
(
psch
>>
4
)
&
3
;
int
sub_chn
=
psch
&
3
;
int
sub_chn
=
psch
&
3
;
...
@@ -265,11 +263,11 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *attr, ch
...
@@ -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
)
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
];
char
name
[
80
];
int
port
=
get_channel_from_name
(
attr
);
int
port
=
get_channel_from_name
(
attr
);
int
i
,
code
,
rslt
;
int
rslt
;
if
(
sscanf
(
buf
,
"%79s"
,
name
,
&
len
)){
if
(
sscanf
(
buf
,
"%79s"
,
name
)){
if
((
rslt
=
set_detected_mux_code
(
port
,
get_code_by_name
(
name
,
DETECT_MUX
)))
<
0
)
if
((
rslt
=
set_detected_mux_code
(
port
,
get_code_by_name
(
name
,
DETECT_MUX
)))
<
0
)
return
rslt
;
return
rslt
;
...
@@ -278,13 +276,13 @@ static ssize_t store_port_mux(struct device *dev, struct device_attribute *attr,
...
@@ -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
)
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
];
char
name
[
80
];
int
psch
=
get_channel_sub_from_name
(
attr
);
int
psch
=
get_channel_sub_from_name
(
attr
);
int
port
=
(
psch
>>
4
)
&
3
;
int
port
=
(
psch
>>
4
)
&
3
;
int
sub_chn
=
psch
&
3
;
int
sub_chn
=
psch
&
3
;
int
i
,
rslt
;
int
rslt
;
if
(
sscanf
(
buf
,
"%79s"
,
name
,
&
len
)){
if
(
sscanf
(
buf
,
"%79s"
,
name
)){
if
((
rslt
=
set_detected_sensor_code
(
port
,
sub_chn
,
get_code_by_name
(
name
,
DETECT_SENSOR
)))
<
0
)
if
((
rslt
=
set_detected_sensor_code
(
port
,
sub_chn
,
get_code_by_name
(
name
,
DETECT_SENSOR
)))
<
0
)
return
rslt
;
return
rslt
;
}
}
...
...
src/drivers/elphel/exif393.c
View file @
56064cd8
...
@@ -501,7 +501,7 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
...
@@ -501,7 +501,7 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
int
p
=
(
int
)
file
->
private_data
;
int
p
=
(
int
)
file
->
private_data
;
int
thissize
=
minor_file_size
(
p
);
int
thissize
=
minor_file_size
(
p
);
int
maxsize
=
minor_max_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
);
dev_dbg
(
g_devfp_ptr
,
"exif_lseek, minor=%d, offset = 0x%llx, orig=%d
\n
"
,
p
,
offset
,
orig
);
// int sensor_port;
// int sensor_port;
switch
(
orig
)
{
switch
(
orig
)
{
...
@@ -548,10 +548,12 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
...
@@ -548,10 +548,12 @@ loff_t exif_lseek (struct file * file, loff_t offset, int orig) {
case
DEV393_MINOR
(
DEV393_EXIF_META1
):
case
DEV393_MINOR
(
DEV393_EXIF_META1
):
case
DEV393_MINOR
(
DEV393_EXIF_META2
):
case
DEV393_MINOR
(
DEV393_EXIF_META2
):
case
DEV393_MINOR
(
DEV393_EXIF_META3
):
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
;
break
;
case
DEV393_MINOR
(
DEV393_EXIF_METADIR
):
case
DEV393_MINOR
(
DEV393_EXIF_METADIR
):
file
->
f_pos
=
offset
*
sizeof
(
struct
exif_dir_table_t
);
file
->
f_pos
=
offset
*
sizeof
(
struct
exif_dir_table_t
);
break
;
break
;
case
DEV393_MINOR
(
DEV393_EXIF_TIME
)
:
case
DEV393_MINOR
(
DEV393_EXIF_TIME
)
:
switch
(
offset
)
{
switch
(
offset
)
{
...
@@ -602,8 +604,11 @@ ssize_t exif_write (struct file * file, const char * buf, size_t count, loff
...
@@ -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()?
char
tmp
[
MAX_EXIF_SIZE
];
//! Or is it possible to disable IRQ while copy_from_user()?
unsigned
long
flags
;
unsigned
long
flags
;
int
disabled_err
=
0
;
int
disabled_err
=
0
;
dev_dbg
(
g_devfp_ptr
,
"minor=0x%x
\n
"
,
p
);
if
((
*
off
+
count
)
>
maxsize
)
{
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
;
return
-
EOVERFLOW
;
}
}
switch
(
p
)
{
switch
(
p
)
{
...
...
src/drivers/elphel/imu_log393.c
View file @
56064cd8
This diff is collapsed.
Click to expand it.
src/drivers/elphel/sensor_i2c.c
View file @
56064cd8
...
@@ -44,7 +44,6 @@
...
@@ -44,7 +44,6 @@
#include <linux/of.h>
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <linux/of_fdt.h>
#include <linux/of_net.h>
#include <linux/of_net.h>
#include <linux/platform_device.h>
#include <linux/sysfs.h>
#include <linux/sysfs.h>
#include <linux/list.h>
#include <linux/list.h>
...
...
src/include/uapi/elphel/c313a.h
View file @
56064cd8
...
@@ -1652,7 +1652,7 @@ struct p_names_t {
...
@@ -1652,7 +1652,7 @@ struct p_names_t {
// make this structure common for sensors, add fields as needed
// make this structure common for sensors, add fields as needed
struct
sensor_t
{
struct
__attribute__
((
__packed__
))
sensor_t
{
// sensor constants
// sensor constants
unsigned
long
imageWidth
;
///< nominal image width for final images
unsigned
long
imageWidth
;
///< nominal image width for final images
unsigned
long
imageHeight
;
///< nominal image height for final images
unsigned
long
imageHeight
;
///< nominal image height for final images
...
@@ -1789,7 +1789,7 @@ struct i2c_timing_t {
...
@@ -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_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
#define GAMMA_SCLALE_1 ( 1 << GAMMA_SCALE_SHIFT ) // gamma scale 1.0 - 0x400
struct
gamma_stuct_t
{
struct
__attribute__
((
__packed__
))
gamma_stuct_t
{
union
{
union
{
unsigned
long
hash32
;
/// fully identifies current table
unsigned
long
hash32
;
/// fully identifies current table
struct
{
struct
{
...
...
src/include/uapi/elphel/exifa.h
View file @
56064cd8
...
@@ -43,7 +43,7 @@ or Rational or else. The generated Exif header copies that variable fileds on to
...
@@ -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
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
{
union
{
unsigned
long
ltag
;
// tag group and tag combined
unsigned
long
ltag
;
// tag group and tag combined
struct
{
struct
{
...
@@ -112,13 +112,13 @@ struct exif_dir_table_t {
...
@@ -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(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"
// array(0x9291,2,"0 ") //original time sub-second length=10 9 ."\0"
///move back to interframe_params_t?
///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
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
short
signffff
;
//! should be 0xffff - it will be a signature that JPEG data was not overwritten
unsigned
long
frame_length
;
//! frame length
unsigned
long
frame_length
;
//! frame length
};
};
struct
meta_GPSInfo_t
{
struct
__attribute__
((
__packed__
))
meta_GPSInfo_t
{
unsigned
char
GPSLatitudeRef
;
//"N"/"S"
unsigned
char
GPSLatitudeRef
;
//"N"/"S"
unsigned
long
GPSLatitude_deg_nom
;
unsigned
long
GPSLatitude_deg_nom
;
unsigned
long
GPSLatitude_deg_denom
;
unsigned
long
GPSLatitude_deg_denom
;
...
@@ -142,7 +142,7 @@ struct meta_GPSInfo_t {
...
@@ -142,7 +142,7 @@ struct meta_GPSInfo_t {
unsigned
char
GPSMeasureMode
;
unsigned
char
GPSMeasureMode
;
};
};
//hack - use
//hack - use
struct
meta_CompassInfo_t
{
struct
__attribute__
((
__packed__
))
meta_CompassInfo_t
{
// unsigned char GPSImgDirectionRef; //"M"/"T" //0x10
// unsigned char GPSImgDirectionRef; //"M"/"T" //0x10
unsigned
long
CompassDirection_nom
;
//0x11
unsigned
long
CompassDirection_nom
;
//0x11
unsigned
long
CompassDirection_denom
;
unsigned
long
CompassDirection_denom
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment