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
fb1a2653
Commit
fb1a2653
authored
May 09, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Plain Diff
Merge kroah.com:/home/greg/linux/BK/bleed-2.5
into kroah.com:/home/greg/linux/BK/i2c-2.5
parents
55f3c6b7
392e687b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
133 additions
and
108 deletions
+133
-108
drivers/i2c/chips/it87.c
drivers/i2c/chips/it87.c
+98
-97
drivers/i2c/i2c-core.c
drivers/i2c/i2c-core.c
+27
-6
include/linux/i2c.h
include/linux/i2c.h
+8
-5
No files found.
drivers/i2c/chips/it87.c
View file @
fb1a2653
This diff is collapsed.
Click to expand it.
drivers/i2c/i2c-core.c
View file @
fb1a2653
...
...
@@ -55,13 +55,17 @@ int i2c_device_remove(struct device *dev)
return
0
;
}
static
struct
device_driver
i2c_
generic
_driver
=
{
.
name
=
"i2c"
,
static
struct
device_driver
i2c_
adapter
_driver
=
{
.
name
=
"i2c
_adapter
"
,
.
bus
=
&
i2c_bus_type
,
.
probe
=
i2c_device_probe
,
.
remove
=
i2c_device_remove
,
};
static
struct
class
i2c_adapter_class
=
{
.
name
=
"i2c-adapter"
};
/* ---------------------------------------------------
* registering functions
...
...
@@ -94,9 +98,16 @@ int i2c_add_adapter(struct i2c_adapter *adap)
if
(
adap
->
dev
.
parent
==
NULL
)
adap
->
dev
.
parent
=
&
legacy_bus
;
sprintf
(
adap
->
dev
.
bus_id
,
"i2c-%d"
,
adap
->
nr
);
adap
->
dev
.
driver
=
&
i2c_
generic
_driver
;
adap
->
dev
.
driver
=
&
i2c_
adapter
_driver
;
device_register
(
&
adap
->
dev
);
/* Add this adapter to the i2c_adapter class */
memset
(
&
adap
->
class_dev
,
0x00
,
sizeof
(
struct
class_device
));
adap
->
class_dev
.
dev
=
&
adap
->
dev
;
adap
->
class_dev
.
class
=
&
i2c_adapter_class
;
strncpy
(
adap
->
class_dev
.
class_id
,
adap
->
dev
.
bus_id
,
BUS_ID_SIZE
);
class_device_register
(
&
adap
->
class_dev
);
/* inform drivers of new adapters */
list_for_each
(
item
,
&
drivers
)
{
driver
=
list_entry
(
item
,
struct
i2c_driver
,
list
);
...
...
@@ -150,6 +161,7 @@ int i2c_del_adapter(struct i2c_adapter *adap)
}
/* clean up the sysfs representation */
class_device_unregister
(
&
adap
->
class_dev
);
device_unregister
(
&
adap
->
dev
);
list_del
(
&
adap
->
list
);
...
...
@@ -443,14 +455,23 @@ struct bus_type i2c_bus_type = {
.
match
=
i2c_device_match
,
};
static
int
__init
i2c_init
(
void
)
{
return
bus_register
(
&
i2c_bus_type
);
int
retval
;
retval
=
bus_register
(
&
i2c_bus_type
);
if
(
retval
)
return
retval
;
retval
=
driver_register
(
&
i2c_adapter_driver
);
if
(
retval
)
return
retval
;
return
class_register
(
&
i2c_adapter_class
);
}
static
void
__exit
i2c_exit
(
void
)
{
class_unregister
(
&
i2c_adapter_class
);
driver_unregister
(
&
i2c_adapter_driver
);
bus_unregister
(
&
i2c_bus_type
);
}
...
...
@@ -475,7 +496,7 @@ int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg msgs[],int num)
return
ret
;
}
else
{
dev_err
(
&
adap
->
dev
,
"I2C level transfers not supported
\n
"
);
DEB2
(
dev_dbg
(
&
adap
->
dev
,
"I2C level transfers not supported
\n
"
)
);
return
-
ENOSYS
;
}
}
...
...
include/linux/i2c.h
View file @
fb1a2653
...
...
@@ -240,7 +240,8 @@ struct i2c_adapter {
int
timeout
;
int
retries
;
struct
device
dev
;
/* the adapter device */
struct
device
dev
;
/* the adapter device */
struct
class_device
class_dev
;
/* the class device */
#ifdef CONFIG_PROC_FS
/* No need to set this when you initialize the adapter */
...
...
@@ -280,10 +281,12 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
/* Must equal I2C_M_TEN below */
/* i2c adapter classes (bitmask) */
#define I2C_ADAP_CLASS_SMBUS (1<<0)
/* lm_sensors, ... */
#define I2C_ADAP_CLASS_TV_ANALOG (1<<1)
/* bttv + friends */
#define I2C_ADAP_CLASS_TV_DIGINAL (1<<2)
/* dbv cards */
#define I2C_ADAP_CLASS_DDC (1<<3)
/* i2c-matroxfb ? */
#define I2C_ADAP_CLASS_SMBUS (1<<0)
/* lm_sensors, ... */
#define I2C_ADAP_CLASS_TV_ANALOG (1<<1)
/* bttv + friends */
#define I2C_ADAP_CLASS_TV_DIGITAL (1<<2)
/* dbv cards */
#define I2C_ADAP_CLASS_DDC (1<<3)
/* i2c-matroxfb ? */
#define I2C_ADAP_CLASS_CAM_ANALOG (1<<4)
/* camera with analog CCD */
#define I2C_ADAP_CLASS_CAM_DIGITAL (1<<5)
/* most webcams */
/* i2c_client_address_data is the struct for holding default client
* addresses for a driver and for the parameters supplied on the
...
...
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