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
a7e2dd1c
Commit
a7e2dd1c
authored
Dec 23, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
status file if 10389 is present
parent
c6524ce2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
elphel393-pwr.c
src/drivers/elphel/elphel393-pwr.c
+10
-0
No files found.
src/drivers/elphel/elphel393-pwr.c
View file @
a7e2dd1c
...
...
@@ -264,6 +264,7 @@ static ssize_t enable_por_store(struct device *dev, struct device_attribute *att
static
ssize_t
gpio_10389_get
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
);
static
ssize_t
gpio_10389_set
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
,
size_t
count
);
static
ssize_t
gpio_poweroff
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
,
size_t
count
);
static
ssize_t
detected_10389_get
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
);
static
int
gpio_shutdown
(
struct
device
*
dev
);
static
int
por_ctrl
(
struct
device
*
dev
,
int
disable_por
);
...
...
@@ -331,6 +332,7 @@ static DEVICE_ATTR(power_off, SYSFS_PERMISSIONS , NULL,
* P7-P4 - NC, 0xX0X0 - not supported even on this driver level.
*/
static
DEVICE_ATTR
(
gpio_10389
,
SYSFS_PERMISSIONS
,
gpio_10389_get
,
gpio_10389_set
);
static
DEVICE_ATTR
(
detected_10389
,
SYSFS_PERMISSIONS
&
SYSFS_READONLY
,
detected_10389_get
,
NULL
);
static
struct
attribute
*
root_dev_attrs
[]
=
{
&
dev_attr_simulate
.
attr
,
...
...
@@ -343,6 +345,7 @@ static struct attribute *root_dev_attrs[] = {
&
dev_attr_enable_por
.
attr
,
&
dev_attr_power_off
.
attr
,
&
dev_attr_gpio_10389
.
attr
,
&
dev_attr_detected_10389
.
attr
,
NULL
};
static
const
struct
attribute_group
dev_attr_root_group
=
{
...
...
@@ -633,6 +636,12 @@ static ssize_t gpio_10389_get(struct device *dev, struct device_attribute *attr,
return
sprintf
(
buf
,
"%02x
\n
"
,
res
);
}
static
ssize_t
detected_10389_get
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
int
res
=
1
;
return
sprintf
(
buf
,
"%i"
,
res
);
}
static
ssize_t
gpio_poweroff
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
,
size_t
count
)
{
int
rc
=
gpio_shutdown
(
dev
);
...
...
@@ -1275,6 +1284,7 @@ static int elphel393_pwr_probe(struct platform_device *pdev)
if
(
base
[
2
]
==
NULL
){
device_remove_file
(
&
pdev
->
dev
,
&
dev_attr_gpio_10389
);
device_remove_file
(
&
pdev
->
dev
,
&
dev_attr_detected_10389
);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
pwr_gpio
);
i
++
){
...
...
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