Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
Project
Project
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
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
FMC DEL 1ns 4cha - Software
Commits
fcfbbec3
Commit
fcfbbec3
authored
May 12, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel/i2c.c: add delays for bit-banging interface
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
1fe86aa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
i2c.c
kernel/i2c.c
+3
-0
No files found.
kernel/i2c.c
View file @
fcfbbec3
...
...
@@ -14,6 +14,7 @@
#include <linux/io.h>
#include <linux/time.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/random.h>
#include "fine-delay.h"
#include "hw/fd_main_regs.h"
...
...
@@ -26,6 +27,7 @@ static void set_sda(struct fd_dev *fd, int val)
if
(
val
)
reg
|=
FD_I2CR_SDA_OUT
;
fd_writel
(
fd
,
reg
,
FD_REG_I2CR
);
ndelay
(
1250
);
/* 400kHz -> 2.5us/loop */
}
static
void
set_scl
(
struct
fd_dev
*
fd
,
int
val
)
...
...
@@ -36,6 +38,7 @@ static void set_scl(struct fd_dev *fd, int val)
if
(
val
)
reg
|=
FD_I2CR_SCL_OUT
;
fd_writel
(
fd
,
reg
,
FD_REG_I2CR
);
ndelay
(
1250
);
/* 400kHz -> 2.5us/loop */
}
static
int
get_sda
(
struct
fd_dev
*
fd
)
...
...
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