Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
07983061
Commit
07983061
authored
Mar 12, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i2c: get i2c-i801 driver to actually bind to a PCI device.
parent
fb72dee2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
36 deletions
+38
-36
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-i801.c
+38
-36
No files found.
drivers/i2c/busses/i2c-i801.c
View file @
07983061
...
@@ -128,49 +128,21 @@ static int i801_transaction(void);
...
@@ -128,49 +128,21 @@ static int i801_transaction(void);
static
int
i801_block_transaction
(
union
i2c_smbus_data
*
data
,
static
int
i801_block_transaction
(
union
i2c_smbus_data
*
data
,
char
read_write
,
int
command
);
char
read_write
,
int
command
);
static
unsigned
short
i801_smba
;
static
struct
pci_dev
*
I801_dev
;
static
int
isich4
;
static
int
i801_setup
(
struct
pci_dev
*
dev
)
static
unsigned
short
i801_smba
=
0
;
static
struct
pci_dev
*
I801_dev
=
NULL
;
static
int
isich4
=
0
;
/* Detect whether a I801 can be found, and initialize it, where necessary.
Note the differences between kernels with the old PCI BIOS interface and
newer kernels with the real PCI interface. In compat.h some things are
defined to make the transition easier. */
int
i801_setup
(
void
)
{
{
int
error_return
=
0
;
int
error_return
=
0
;
int
*
num
=
supported
;
int
*
num
=
supported
;
unsigned
char
temp
;
unsigned
char
temp
;
/* First check whether we can access PCI at all */
if
(
pci_present
()
==
0
)
{
printk
(
KERN_WARNING
"i2c-i801.o: Error: No PCI-bus found!
\n
"
);
error_return
=
-
ENODEV
;
goto
END
;
}
/* Look for each chip */
/* Note: we keep on searching until we have found 'function 3' */
/* Note: we keep on searching until we have found 'function 3' */
I801_dev
=
NULL
;
if
(
PCI_FUNC
(
dev
->
devfn
)
!=
3
)
do
{
return
-
ENODEV
;
if
((
I801_dev
=
pci_find_device
(
PCI_VENDOR_ID_INTEL
,
*
num
,
I801_dev
)))
{
if
(
PCI_FUNC
(
I801_dev
->
devfn
)
!=
3
)
continue
;
break
;
}
num
++
;
}
while
(
*
num
!=
0
);
if
(
I801_dev
==
NULL
)
{
I801_dev
=
dev
;
printk
(
KERN_WARNING
"i2c-i801.o: Error: Can't detect I801, function 3!
\n
"
);
error_return
=
-
ENODEV
;
goto
END
;
}
isich4
=
*
num
==
PCI_DEVICE_ID_INTEL_82801DB_SMBUS
;
isich4
=
*
num
==
PCI_DEVICE_ID_INTEL_82801DB_SMBUS
;
/* Determine the address of the SMBus areas */
/* Determine the address of the SMBus areas */
...
@@ -658,13 +630,43 @@ static struct i2c_adapter i801_adapter = {
...
@@ -658,13 +630,43 @@ static struct i2c_adapter i801_adapter = {
static
struct
pci_device_id
i801_ids
[]
__devinitdata
=
{
static
struct
pci_device_id
i801_ids
[]
__devinitdata
=
{
{
.
vendor
=
PCI_VENDOR_ID_INTEL
,
.
device
=
PCI_DEVICE_ID_INTEL_82801AA_3
,
.
subvendor
=
PCI_ANY_ID
,
.
subdevice
=
PCI_ANY_ID
,
},
{
.
vendor
=
PCI_VENDOR_ID_INTEL
,
.
device
=
PCI_DEVICE_ID_INTEL_82801AB_3
,
.
subvendor
=
PCI_ANY_ID
,
.
subdevice
=
PCI_ANY_ID
,
},
{
.
vendor
=
PCI_VENDOR_ID_INTEL
,
.
device
=
PCI_DEVICE_ID_INTEL_82801BA_2
,
.
subvendor
=
PCI_ANY_ID
,
.
subdevice
=
PCI_ANY_ID
,
},
{
.
vendor
=
PCI_VENDOR_ID_INTEL
,
.
device
=
PCI_DEVICE_ID_INTEL_82801CA_SMBUS
,
.
subvendor
=
PCI_ANY_ID
,
.
subdevice
=
PCI_ANY_ID
,
},
{
.
vendor
=
PCI_VENDOR_ID_INTEL
,
.
device
=
PCI_DEVICE_ID_INTEL_82801DB_SMBUS
,
.
subvendor
=
PCI_ANY_ID
,
.
subdevice
=
PCI_ANY_ID
,
},
{
0
,
}
{
0
,
}
};
};
static
int
__devinit
i801_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
static
int
__devinit
i801_probe
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
{
if
(
i801_setup
())
{
if
(
i801_setup
(
dev
))
{
printk
printk
(
KERN_WARNING
"i2c-i801.o: I801 not detected, module not inserted.
\n
"
);
(
KERN_WARNING
"i2c-i801.o: I801 not detected, module not inserted.
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
...
...
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