Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Simple PCIe FMC carrier SPEC
Commits
7b3d1da4
Commit
7b3d1da4
authored
Jun 06, 2019
by
Federico Vaga
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv:gn412x_gpio: fix direction get/set
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
bcfc4f6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
gn412x-gpio.c
kernel/gn412x-gpio.c
+3
-1
No files found.
kernel/gn412x-gpio.c
View file @
7b3d1da4
...
@@ -72,12 +72,13 @@ static void gn412x_gpio_free(struct gpio_chip *chip, unsigned offset)
...
@@ -72,12 +72,13 @@ static void gn412x_gpio_free(struct gpio_chip *chip, unsigned offset)
static
int
gn412x_gpio_get_direction
(
struct
gpio_chip
*
chip
,
static
int
gn412x_gpio_get_direction
(
struct
gpio_chip
*
chip
,
unsigned
offset
)
unsigned
offset
)
{
{
return
!
gn412x_gpio_reg_read
(
chip
,
GNGPIO_
OUTPUT_ENABL
E
,
offset
);
return
!
gn412x_gpio_reg_read
(
chip
,
GNGPIO_
DIRECTION_MOD
E
,
offset
);
}
}
static
int
gn412x_gpio_direction_input
(
struct
gpio_chip
*
chip
,
static
int
gn412x_gpio_direction_input
(
struct
gpio_chip
*
chip
,
unsigned
offset
)
unsigned
offset
)
{
{
gn412x_gpio_reg_write
(
chip
,
GNGPIO_DIRECTION_MODE
,
offset
,
1
);
gn412x_gpio_reg_write
(
chip
,
GNGPIO_OUTPUT_ENABLE
,
offset
,
0
);
gn412x_gpio_reg_write
(
chip
,
GNGPIO_OUTPUT_ENABLE
,
offset
,
0
);
return
0
;
return
0
;
...
@@ -86,6 +87,7 @@ static int gn412x_gpio_direction_input(struct gpio_chip *chip,
...
@@ -86,6 +87,7 @@ static int gn412x_gpio_direction_input(struct gpio_chip *chip,
static
int
gn412x_gpio_direction_output
(
struct
gpio_chip
*
chip
,
static
int
gn412x_gpio_direction_output
(
struct
gpio_chip
*
chip
,
unsigned
offset
,
int
value
)
unsigned
offset
,
int
value
)
{
{
gn412x_gpio_reg_write
(
chip
,
GNGPIO_DIRECTION_MODE
,
offset
,
0
);
gn412x_gpio_reg_write
(
chip
,
GNGPIO_OUTPUT_ENABLE
,
offset
,
1
);
gn412x_gpio_reg_write
(
chip
,
GNGPIO_OUTPUT_ENABLE
,
offset
,
1
);
gn412x_gpio_reg_write
(
chip
,
GNGPIO_OUTPUT_VALUE
,
offset
,
value
);
gn412x_gpio_reg_write
(
chip
,
GNGPIO_OUTPUT_VALUE
,
offset
,
value
);
...
...
Federico Vaga
@FedericoVaga
mentioned in commit
d977e88a
·
Oct 17, 2019
mentioned in commit
d977e88a
mentioned in commit d977e88af0989ee5fc444f74e8166b226adf9885
Toggle commit list
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