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
04100bfb
Commit
04100bfb
authored
Aug 02, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i2c: accept a card with no mezzanine
parent
704e7b60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
spec-i2c.c
kernel/spec-i2c.c
+12
-5
No files found.
kernel/spec-i2c.c
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
)
...
...
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