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
nexedi
linux
Commits
820783a6
Commit
820783a6
authored
Mar 13, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i2c: add driver model support to i2c adapter drivers
parent
a6934054
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
4 deletions
+33
-4
drivers/i2c/busses/i2c-ali15x3.c
drivers/i2c/busses/i2c-ali15x3.c
+4
-2
drivers/i2c/busses/i2c-amd756.c
drivers/i2c/busses/i2c-amd756.c
+3
-0
drivers/i2c/busses/i2c-amd8111.c
drivers/i2c/busses/i2c-amd8111.c
+4
-1
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-i801.c
+4
-1
drivers/i2c/busses/i2c-piix4.c
drivers/i2c/busses/i2c-piix4.c
+3
-0
drivers/i2c/i2c-core.c
drivers/i2c/i2c-core.c
+13
-0
include/linux/i2c.h
include/linux/i2c.h
+2
-0
No files found.
drivers/i2c/busses/i2c-ali15x3.c
View file @
820783a6
...
@@ -531,10 +531,12 @@ static int __devinit ali15x3_probe(struct pci_dev *dev, const struct pci_device_
...
@@ -531,10 +531,12 @@ static int __devinit ali15x3_probe(struct pci_dev *dev, const struct pci_device_
return
-
ENODEV
;
return
-
ENODEV
;
}
}
/* set up the driverfs linkage to our parent device */
ali15x3_adapter
.
dev
.
parent
=
&
dev
->
dev
;
sprintf
(
ali15x3_adapter
.
name
,
"SMBus ALI15X3 adapter at %04x"
,
sprintf
(
ali15x3_adapter
.
name
,
"SMBus ALI15X3 adapter at %04x"
,
ali15x3_smba
);
ali15x3_smba
);
i2c_add_adapter
(
&
ali15x3_adapter
);
return
i2c_add_adapter
(
&
ali15x3_adapter
);
return
0
;
}
}
static
void
__devexit
ali15x3_remove
(
struct
pci_dev
*
dev
)
static
void
__devexit
ali15x3_remove
(
struct
pci_dev
*
dev
)
...
...
drivers/i2c/busses/i2c-amd756.c
View file @
820783a6
...
@@ -375,6 +375,9 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
...
@@ -375,6 +375,9 @@ static int __devinit amd756_probe(struct pci_dev *pdev,
printk
(
KERN_DEBUG
DRV_NAME
": AMD756_smba = 0x%X
\n
"
,
amd756_ioport
);
printk
(
KERN_DEBUG
DRV_NAME
": AMD756_smba = 0x%X
\n
"
,
amd756_ioport
);
#endif
#endif
/* set up the driverfs linkage to our parent device */
amd756_adapter
.
dev
.
parent
=
&
pdev
->
dev
;
sprintf
(
amd756_adapter
.
name
,
sprintf
(
amd756_adapter
.
name
,
"SMBus AMD75x adapter at %04x"
,
amd756_ioport
);
"SMBus AMD75x adapter at %04x"
,
amd756_ioport
);
...
...
drivers/i2c/busses/i2c-amd8111.c
View file @
820783a6
...
@@ -363,6 +363,9 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_
...
@@ -363,6 +363,9 @@ static int __devinit amd8111_probe(struct pci_dev *dev, const struct pci_device_
smbus
->
adapter
.
algo
=
&
smbus_algorithm
;
smbus
->
adapter
.
algo
=
&
smbus_algorithm
;
smbus
->
adapter
.
algo_data
=
smbus
;
smbus
->
adapter
.
algo_data
=
smbus
;
/* set up the driverfs linkage to our parent device */
smbus
->
adapter
.
dev
.
parent
=
&
dev
->
dev
;
error
=
i2c_add_adapter
(
&
smbus
->
adapter
);
error
=
i2c_add_adapter
(
&
smbus
->
adapter
);
if
(
error
)
if
(
error
)
goto
out_release_region
;
goto
out_release_region
;
...
@@ -389,7 +392,7 @@ static void __devexit amd8111_remove(struct pci_dev *dev)
...
@@ -389,7 +392,7 @@ static void __devexit amd8111_remove(struct pci_dev *dev)
}
}
static
struct
pci_driver
amd8111_driver
=
{
static
struct
pci_driver
amd8111_driver
=
{
.
name
=
"amd8111 smbus
2.0
"
,
.
name
=
"amd8111 smbus"
,
.
id_table
=
amd8111_ids
,
.
id_table
=
amd8111_ids
,
.
probe
=
amd8111_probe
,
.
probe
=
amd8111_probe
,
.
remove
=
__devexit_p
(
amd8111_remove
),
.
remove
=
__devexit_p
(
amd8111_remove
),
...
...
drivers/i2c/busses/i2c-i801.c
View file @
820783a6
...
@@ -672,9 +672,12 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id
...
@@ -672,9 +672,12 @@ static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id
return
-
ENODEV
;
return
-
ENODEV
;
}
}
/* set up the driverfs linkage to our parent device */
i801_adapter
.
dev
.
parent
=
&
dev
->
dev
;
sprintf
(
i801_adapter
.
name
,
"SMBus I801 adapter at %04x"
,
sprintf
(
i801_adapter
.
name
,
"SMBus I801 adapter at %04x"
,
i801_smba
);
i801_smba
);
i2c_add_adapter
(
&
i801_adapter
);
return
i2c_add_adapter
(
&
i801_adapter
);
}
}
static
void
__devexit
i801_remove
(
struct
pci_dev
*
dev
)
static
void
__devexit
i801_remove
(
struct
pci_dev
*
dev
)
...
...
drivers/i2c/busses/i2c-piix4.c
View file @
820783a6
...
@@ -473,6 +473,9 @@ static int __devinit piix4_probe(struct pci_dev *dev, const struct pci_device_id
...
@@ -473,6 +473,9 @@ static int __devinit piix4_probe(struct pci_dev *dev, const struct pci_device_id
if
(
retval
)
if
(
retval
)
return
retval
;
return
retval
;
/* set up the driverfs linkage to our parent device */
piix4_adapter
.
dev
.
parent
=
&
dev
->
dev
;
sprintf
(
piix4_adapter
.
name
,
"SMBus PIIX4 adapter at %04x"
,
sprintf
(
piix4_adapter
.
name
,
"SMBus PIIX4 adapter at %04x"
,
piix4_smba
);
piix4_smba
);
...
...
drivers/i2c/i2c-core.c
View file @
820783a6
...
@@ -87,6 +87,16 @@ int i2c_add_adapter(struct i2c_adapter *adap)
...
@@ -87,6 +87,16 @@ int i2c_add_adapter(struct i2c_adapter *adap)
init_MUTEX
(
&
adap
->
bus
);
init_MUTEX
(
&
adap
->
bus
);
init_MUTEX
(
&
adap
->
list
);
init_MUTEX
(
&
adap
->
list
);
/* Add the adapter to the driver core.
* If the parent pointer is not set up,
* we add this adapter to the legacy bus.
*/
if
(
adap
->
dev
.
parent
==
NULL
)
adap
->
dev
.
parent
=
&
legacy_bus
;
sprintf
(
adap
->
dev
.
bus_id
,
"i2c-%d"
,
i
);
strcpy
(
adap
->
dev
.
name
,
"i2c controller"
);
device_register
(
&
adap
->
dev
);
/* inform drivers of new adapters */
/* inform drivers of new adapters */
for
(
j
=
0
;
j
<
I2C_DRIVER_MAX
;
j
++
)
for
(
j
=
0
;
j
<
I2C_DRIVER_MAX
;
j
++
)
if
(
drivers
[
j
]
!=
NULL
&&
if
(
drivers
[
j
]
!=
NULL
&&
...
@@ -154,6 +164,9 @@ int i2c_del_adapter(struct i2c_adapter *adap)
...
@@ -154,6 +164,9 @@ int i2c_del_adapter(struct i2c_adapter *adap)
i2cproc_remove
(
i
);
i2cproc_remove
(
i
);
/* clean up the sysfs representation */
device_unregister
(
&
adap
->
dev
);
adapters
[
i
]
=
NULL
;
adapters
[
i
]
=
NULL
;
DEB
(
printk
(
KERN_DEBUG
"i2c-core.o: adapter unregistered: %s
\n
"
,
adap
->
name
));
DEB
(
printk
(
KERN_DEBUG
"i2c-core.o: adapter unregistered: %s
\n
"
,
adap
->
name
));
...
...
include/linux/i2c.h
View file @
820783a6
...
@@ -231,12 +231,14 @@ struct i2c_adapter {
...
@@ -231,12 +231,14 @@ struct i2c_adapter {
int
timeout
;
int
timeout
;
int
retries
;
int
retries
;
struct
device
dev
;
/* the adapter device */
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
/* No need to set this when you initialize the adapter */
/* No need to set this when you initialize the adapter */
int
inode
;
int
inode
;
#endif
/* def CONFIG_PROC_FS */
#endif
/* def CONFIG_PROC_FS */
};
};
#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
/*flags for the driver struct: */
/*flags for the driver struct: */
#define I2C_DF_NOTIFY 0x01
/* notify on bus (de/a)ttaches */
#define I2C_DF_NOTIFY 0x01
/* notify on bus (de/a)ttaches */
...
...
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