Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple PCIe FMC carrier SPEC - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
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 - Software
Commits
2fa2d8b4
Commit
2fa2d8b4
authored
Sep 21, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel/wr-nic-dio.c: use the already-defined gpio macros
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
63418c1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
wr-nic-dio.c
kernel/wr-nic-dio.c
+7
-6
No files found.
kernel/wr-nic-dio.c
View file @
2fa2d8b4
...
...
@@ -213,6 +213,7 @@ static int wrn_dio_cmd_inout(struct wrn_drvdata *drvdata,
struct
wr_dio_cmd
*
cmd
)
{
struct
DIO_WB
__iomem
*
dio
=
drvdata
->
wrdio_base
;
struct
wrn_gpio_block
__iomem
*
gpio
=
drvdata
->
gpio_base
;
int
mask
,
ch
,
last
,
bits
;
uint32_t
reg
;
...
...
@@ -236,9 +237,9 @@ static int wrn_dio_cmd_inout(struct wrn_drvdata *drvdata,
/* termination is bit 2 (0x4); register 0 clears, reg 4 sets */
if
(
bits
&
WR_DIO_INOUT_TERM
)
writel
(
0x4
<<
(
4
*
ch
),
drvdata
->
gpio_base
+
4
);
writel
(
WRN_GPIO_TERM
(
ch
),
&
gpio
->
set
);
else
writel
(
0x4
<<
(
4
*
ch
),
drvdata
->
gpio_base
+
0
);
writel
(
WRN_GPIO_TERM
(
ch
),
&
gpio
->
clear
);
reg
=
readl
(
&
dio
->
OUT
)
&
~
(
1
<<
ch
);
if
(
bits
&
WR_DIO_INOUT_DIO
)
{
...
...
@@ -249,18 +250,18 @@ static int wrn_dio_cmd_inout(struct wrn_drvdata *drvdata,
if
(
!
(
bits
&
WR_DIO_INOUT_OUTPUT
))
{
/* output-enable is low-active, so set bit 1 (0x2) */
writel
(
0x2
<<
(
4
*
ch
),
drvdata
->
gpio_base
+
4
);
writel
(
WRN_GPIO_OE_N
(
ch
),
&
gpio
->
set
);
writel
(
reg
,
&
dio
->
OUT
);
/* not DIO */
continue
;
/* input, no value to be set */
}
/* Output value is bit 0 (0x1) */
if
(
bits
&
WR_DIO_INOUT_VALUE
)
writel
(
0x1
<<
(
4
*
ch
),
drvdata
->
gpio_base
+
4
);
writel
(
WRN_GPIO_VALUE
(
ch
),
&
gpio
->
set
);
else
writel
(
0x1
<<
(
4
*
ch
),
drvdata
->
gpio_base
+
0
);
writel
(
WRN_GPIO_VALUE
(
ch
),
&
gpio
->
clear
);
/* Then clear the low-active output enable, bit 1 (0x2) */
writel
(
0x2
<<
(
4
*
ch
),
drvdata
->
gpio_base
+
0
);
writel
(
WRN_GPIO_OE_N
(
ch
),
&
gpio
->
clear
);
writel
(
reg
,
&
dio
->
OUT
);
/* not DIO */
}
...
...
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