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
085d0e85
Commit
085d0e85
authored
Jun 06, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drv:gn412x_gpio: use custom io funciton
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
e0241fac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
gn412x-gpio.c
kernel/gn412x-gpio.c
+13
-3
No files found.
kernel/gn412x-gpio.c
View file @
085d0e85
...
...
@@ -16,13 +16,23 @@ enum htvic_mem_resources {
GN412X_MEM_BASE
=
0
,
};
static
uint32_t
gn412x_ioread32
(
struct
gn412x_dev
*
gn412x
,
int
reg
)
{
return
ioread32
(
gn412x
->
mem
+
reg
);
}
static
void
gn412x_iowrite32
(
struct
gn412x_dev
*
gn412x
,
uint32_t
val
,
int
reg
)
{
return
iowrite32
(
val
,
gn412x
->
mem
+
reg
);
}
static
int
gn412x_gpio_reg_read
(
struct
gpio_chip
*
chip
,
int
reg
,
unsigned
offset
)
{
struct
gn412x_dev
*
gn412x
=
to_gn412x_dev_gpio
(
chip
);
return
readl
(
gn412x
->
mem
+
reg
)
&
BIT
(
offset
);
return
gn412x_ioread32
(
gn412x
,
reg
)
&
BIT
(
offset
);
}
static
void
gn412x_gpio_reg_write
(
struct
gpio_chip
*
chip
,
...
...
@@ -31,12 +41,12 @@ static void gn412x_gpio_reg_write(struct gpio_chip *chip,
struct
gn412x_dev
*
gn412x
=
to_gn412x_dev_gpio
(
chip
);
uint32_t
regval
;
regval
=
readl
(
gn412x
->
mem
+
reg
);
regval
=
gn412x_ioread32
(
gn412x
,
reg
);
if
(
value
)
regval
|=
BIT
(
offset
);
else
regval
&=
~
BIT
(
offset
);
writel
(
regval
,
gn412x
->
mem
+
reg
);
gn412x_iowrite32
(
gn412x
,
regval
,
reg
);
}
...
...
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