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
cbe1a44b
Commit
cbe1a44b
authored
Oct 15, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding sysfs and DT suppport for the ported program
parent
646d3357
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
340 additions
and
62 deletions
+340
-62
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
sensor_i2c.c
src/drivers/elphel/sensor_i2c.c
+0
-1
No files found.
src/arch/arm/boot/dts/elphel393_1_mt9p006.dts
View file @
cbe1a44b
...
@@ -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 @
cbe1a44b
...
@@ -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 @
cbe1a44b
...
@@ -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 @
cbe1a44b
...
@@ -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 @
cbe1a44b
This diff is collapsed.
Click to expand it.
src/drivers/elphel/detect_sensors.c
View file @
cbe1a44b
...
@@ -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/sensor_i2c.c
View file @
cbe1a44b
...
@@ -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>
...
...
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