Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Simple PCIe FMC carrier SPEC - Software
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
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
Projects
Simple PCIe FMC carrier SPEC - Software
Commits
04100bfb
Commit
04100bfb
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
i2c: accept a card with no mezzanine
parent
704e7b60
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
+12
-5
12 additions, 5 deletions
kernel/spec-i2c.c
with
12 additions
and
5 deletions
kernel/spec-i2c.c
+
12
−
5
View file @
04100bfb
...
...
@@ -126,16 +126,19 @@ void mi2c_init(struct fmc_device *fmc)
set_sda
(
fmc
,
1
);
}
void
mi2c_scan
(
struct
fmc_device
*
fmc
)
int
mi2c_scan
(
struct
fmc_device
*
fmc
)
{
int
i
;
int
i
,
found
=
0
;
for
(
i
=
0
;
i
<
256
;
i
+=
2
)
{
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
++
;
}
mi2c_stop
(
fmc
);
}
return
found
;
}
/* FIXME: this is very inefficient: read several bytes in a row instead */
...
...
@@ -198,9 +201,13 @@ int spec_i2c_init(struct fmc_device *fmc)
{
struct
spec_dev
*
spec
=
fmc
->
carrier_data
;
void
*
buf
;
int
i
;
int
i
,
found
;
mi2c_scan
(
fmc
);
found
=
mi2c_scan
(
fmc
);
if
(
!
found
)
{
dev_err
(
&
spec
->
pdev
->
dev
,
"Empty mezzanine?
\n
"
);
return
0
;
}
buf
=
kmalloc
(
SPEC_I2C_EEPROM_SIZE
,
GFP_KERNEL
);
if
(
!
buf
)
...
...
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