BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
c952d56d
Commit
c952d56d
authored
Jan 09, 2019
by
Thong Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws eink: use devm_gpio functions
Use devm_gpio_request to remove the need to explicitly configure and free the GPIOs.
parent
0f371ad4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
fb_waveshare_eink.c
...l/waveshare_eink/linux_kernel_modules/fb_waveshare_eink.c
+20
-14
No files found.
experimental/waveshare_eink/linux_kernel_modules/fb_waveshare_eink.c
View file @
c952d56d
...
...
@@ -274,22 +274,28 @@ static int display_frame(struct ws_eink_fb_par *par)
static
int
ws_eink_init_display
(
struct
ws_eink_fb_par
*
par
)
{
int
ret
;
struct
device
*
dev
=
&
par
->
spi
->
dev
;
ret
=
devm_gpio_request_one
(
&
par
->
spi
->
dev
,
par
->
rst
,
GPIOF_OUT_INIT_LOW
,
"ws_eink_rst"
);
if
(
ret
)
{
dev_err
(
dev
,
"Couldn't request reset GPIO
\n
"
);
return
ret
;
}
gpio_request
(
par
->
rst
,
"ws_eink_rst"
);
gpio_request
(
par
->
dc
,
"ws_eink_dc"
);
gpio_request
(
par
->
busy
,
"ws_eink_busy"
);
gpio_direction_output
(
par
->
dc
,
true
);
gpio_set_value
(
par
->
dc
,
0
);
gpio_export
(
par
->
dc
,
true
);
gpio_direction_output
(
par
->
rst
,
true
);
gpio_set_value
(
par
->
rst
,
0
);
gpio_export
(
par
->
rst
,
true
);
ret
=
devm_gpio_request_one
(
&
par
->
spi
->
dev
,
par
->
dc
,
GPIOF_OUT_INIT_LOW
,
"ws_eink_dc"
);
if
(
ret
)
{
dev_err
(
dev
,
"Couldn't request data/command GPIO
\n
"
);
return
ret
;
}
gpio_direction_input
(
par
->
busy
);
gpio_set_value
(
par
->
busy
,
0
);
gpio_export
(
par
->
busy
,
true
);
ret
=
devm_gpio_request_one
(
&
par
->
spi
->
dev
,
par
->
busy
,
GPIOF_IN
,
"ws_eink_busy"
);
if
(
ret
)
{
dev_err
(
dev
,
"Couldn't request busy GPIO
\n
"
);
return
ret
;
}
ret
=
int_lut
(
par
,
lut_full_update
,
ARRAY_SIZE
(
lut_full_update
));
if
(
ret
)
...
...
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