Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spec-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
fmc-projects
spec
spec-sw
Commits
6ce1b9d2
Commit
6ce1b9d2
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
kernel/spec-i2c: added static where needed, less verbose
parent
a30d9715
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/spec-i2c.c
+4
-7
4 additions, 7 deletions
kernel/spec-i2c.c
with
4 additions
and
7 deletions
kernel/spec-i2c.c
+
4
−
7
View file @
6ce1b9d2
...
@@ -73,7 +73,7 @@ static void mi2c_stop(struct fmc_device *fmc)
...
@@ -73,7 +73,7 @@ static void mi2c_stop(struct fmc_device *fmc)
set_sda
(
fmc
,
1
);
set_sda
(
fmc
,
1
);
}
}
int
mi2c_put_byte
(
struct
fmc_device
*
fmc
,
int
data
)
static
int
mi2c_put_byte
(
struct
fmc_device
*
fmc
,
int
data
)
{
{
int
i
;
int
i
;
int
ack
;
int
ack
;
...
@@ -95,7 +95,7 @@ int mi2c_put_byte(struct fmc_device *fmc, int data)
...
@@ -95,7 +95,7 @@ int mi2c_put_byte(struct fmc_device *fmc, int data)
return
ack
?
-
EIO
:
0
;
/* ack low == success */
return
ack
?
-
EIO
:
0
;
/* ack low == success */
}
}
int
mi2c_get_byte
(
struct
fmc_device
*
fmc
,
unsigned
char
*
data
,
int
send
ack
)
static
int
mi2c_get_byte
(
struct
fmc_device
*
fmc
,
unsigned
char
*
data
,
int
ack
)
{
{
int
i
;
int
i
;
int
indata
=
0
;
int
indata
=
0
;
...
@@ -111,7 +111,7 @@ int mi2c_get_byte(struct fmc_device *fmc, unsigned char *data, int sendack)
...
@@ -111,7 +111,7 @@ int mi2c_get_byte(struct fmc_device *fmc, unsigned char *data, int sendack)
set_scl
(
fmc
,
0
);
set_scl
(
fmc
,
0
);
}
}
set_sda
(
fmc
,
(
send
ack
?
0
:
1
));
set_sda
(
fmc
,
(
ack
?
0
:
1
));
set_scl
(
fmc
,
1
);
set_scl
(
fmc
,
1
);
set_scl
(
fmc
,
0
);
set_scl
(
fmc
,
0
);
set_sda
(
fmc
,
0
);
set_sda
(
fmc
,
0
);
...
@@ -131,11 +131,8 @@ int mi2c_scan(struct fmc_device *fmc)
...
@@ -131,11 +131,8 @@ int mi2c_scan(struct fmc_device *fmc)
int
i
,
found
=
0
;
int
i
,
found
=
0
;
for
(
i
=
0
;
i
<
256
;
i
+=
2
)
{
for
(
i
=
0
;
i
<
256
;
i
+=
2
)
{
mi2c_start
(
fmc
);
mi2c_start
(
fmc
);
if
(
!
mi2c_put_byte
(
fmc
,
i
))
{
if
(
!
mi2c_put_byte
(
fmc
,
i
))
pr_info
(
"%s: Found i2c device at 0x%x
\n
"
,
KBUILD_MODNAME
,
i
>>
1
);
found
++
;
found
++
;
}
mi2c_stop
(
fmc
);
mi2c_stop
(
fmc
);
}
}
return
found
;
return
found
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment