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
6cecbe52
Commit
6cecbe52
authored
May 04, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
missed a func declaration in the top - for power off
parent
c7ba788d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
elphel393-pwr.c
src/drivers/elphel/elphel393-pwr.c
+15
-10
No files found.
src/drivers/elphel/elphel393-pwr.c
View file @
6cecbe52
...
@@ -287,6 +287,7 @@ static int get_enable(struct device *dev, int chn);
...
@@ -287,6 +287,7 @@ static int get_enable(struct device *dev, int chn);
static
int
set_enable
(
struct
device
*
dev
,
int
chn
,
int
enable
);
static
int
set_enable
(
struct
device
*
dev
,
int
chn
,
int
enable
);
static
int
get_pgood
(
struct
device
*
dev
,
int
chn
);
static
int
get_pgood
(
struct
device
*
dev
,
int
chn
);
int
gpio_10389_ctrl
(
struct
device
*
dev
,
int
value
);
/*
/*
Voltages:
Voltages:
...
@@ -640,6 +641,13 @@ static ssize_t gpio_poweroff(struct device *dev, struct device_attribute *attr,
...
@@ -640,6 +641,13 @@ static ssize_t gpio_poweroff(struct device *dev, struct device_attribute *attr,
return
count
;
return
count
;
}
}
int
gpio_shutdown
(
struct
device
*
dev
)
{
int
gpio_shutdown_index
=
get_gpio_index_by_name
(
"NSHUTDOWN"
);
if
(
gpio_shutdown_index
<
0
)
return
gpio_shutdown_index
;
return
gpio_conf_by_index
(
dev
,
gpio_shutdown_index
,
1
,
0
);
}
int
gpio_10389_ctrl
(
struct
device
*
dev
,
int
value
){
int
gpio_10389_ctrl
(
struct
device
*
dev
,
int
value
){
int
i
,
res
;
int
i
,
res
;
int
val
=
0
;
int
val
=
0
;
...
@@ -647,8 +655,8 @@ int gpio_10389_ctrl(struct device *dev, int value){
...
@@ -647,8 +655,8 @@ int gpio_10389_ctrl(struct device *dev, int value){
for
(
i
=
16
;
i
<
20
;
i
++
){
for
(
i
=
16
;
i
<
20
;
i
++
){
if
((
value
>>
(
i
-
8
))
&
0x1
){
if
((
value
>>
(
i
-
8
))
&
0x1
){
val
=
(
value
>>
(
i
-
16
))
&
0x1
;
val
=
(
value
>>
(
i
-
16
))
&
0x1
;
res
=
gpio_conf_by_index
(
dev
,
i
,
1
,
~
val
);
//
res = gpio_conf_by_index(dev, i, 1, ~val);
if
(
res
<
0
)
return
res
;
//
if (res<0) return res;
res
=
gpio_conf_by_index
(
dev
,
i
,
1
,
val
);
res
=
gpio_conf_by_index
(
dev
,
i
,
1
,
val
);
if
(
res
<
0
)
return
res
;
if
(
res
<
0
)
return
res
;
}
}
...
@@ -657,13 +665,6 @@ int gpio_10389_ctrl(struct device *dev, int value){
...
@@ -657,13 +665,6 @@ int gpio_10389_ctrl(struct device *dev, int value){
return
0
;
return
0
;
}
}
int
gpio_shutdown
(
struct
device
*
dev
)
{
int
gpio_shutdown_index
=
get_gpio_index_by_name
(
"NSHUTDOWN"
);
if
(
gpio_shutdown_index
<
0
)
return
gpio_shutdown_index
;
return
gpio_conf_by_index
(
dev
,
gpio_shutdown_index
,
1
,
0
);
}
int
por_ctrl
(
struct
device
*
dev
,
int
disable_por
)
int
por_ctrl
(
struct
device
*
dev
,
int
disable_por
)
{
{
int
gpio_disable_por_index
=
get_gpio_index_by_name
(
"DIS_POR"
);
int
gpio_disable_por_index
=
get_gpio_index_by_name
(
"DIS_POR"
);
...
@@ -1227,7 +1228,11 @@ static int elphel393_pwr_probe(struct platform_device *pdev)
...
@@ -1227,7 +1228,11 @@ static int elphel393_pwr_probe(struct platform_device *pdev)
clientdata
->
pwr_gpio
[
i
].
pin
=
base
[
i
>>
3
]
+
(
i
&
7
);
clientdata
->
pwr_gpio
[
i
].
pin
=
base
[
i
>>
3
]
+
(
i
&
7
);
if
(
i
<
16
)
clientdata
->
pwr_gpio
[
i
].
dir
=
0
;
/* input */
if
(
i
<
16
)
clientdata
->
pwr_gpio
[
i
].
dir
=
0
;
/* input */
else
clientdata
->
pwr_gpio
[
i
].
dir
=
1
;
/* output */
else
clientdata
->
pwr_gpio
[
i
].
dir
=
1
;
/* output */
clientdata
->
pwr_gpio
[
i
].
out_val
=
0
;
//if (i<16) clientdata->pwr_gpio[i].out_val=0;
//else clientdata->pwr_gpio[i].out_val=1;
clientdata
->
pwr_gpio
[
i
].
out_val
=
0
;
rc
=
gpio_request
(
clientdata
->
pwr_gpio
[
i
].
pin
,
clientdata
->
pwr_gpio
[
i
].
label
);
rc
=
gpio_request
(
clientdata
->
pwr_gpio
[
i
].
pin
,
clientdata
->
pwr_gpio
[
i
].
label
);
if
(
rc
<
0
){
if
(
rc
<
0
){
dev_err
(
&
pdev
->
dev
,
" Failed to get GPIO[%d] with label %s
\n
"
,
clientdata
->
pwr_gpio
[
i
].
pin
,
clientdata
->
pwr_gpio
[
i
].
label
);
dev_err
(
&
pdev
->
dev
,
" Failed to get GPIO[%d] with label %s
\n
"
,
clientdata
->
pwr_gpio
[
i
].
pin
,
clientdata
->
pwr_gpio
[
i
].
label
);
...
...
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