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
500d5250
Commit
500d5250
authored
Mar 12, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i2c: add i2c sysfs bus support.
parent
1464d8c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
drivers/i2c/i2c-core.c
drivers/i2c/i2c-core.c
+30
-3
include/linux/i2c.h
include/linux/i2c.h
+3
-0
No files found.
drivers/i2c/i2c-core.c
View file @
500d5250
...
@@ -598,10 +598,37 @@ static void __exit i2cproc_cleanup(void)
...
@@ -598,10 +598,37 @@ static void __exit i2cproc_cleanup(void)
{
{
remove_proc_entry
(
"i2c"
,
proc_bus
);
remove_proc_entry
(
"i2c"
,
proc_bus
);
}
}
#else
static
int
__init
i2cproc_init
(
void
)
{
return
0
;
}
static
void
__exit
i2cproc_cleanup
(
void
)
{
}
#endif
/* CONFIG_PROC_FS */
/* match always succeeds, as we want the probe() to tell if we really accept this match */
static
int
i2c_device_match
(
struct
device
*
dev
,
struct
device_driver
*
drv
)
{
return
1
;
}
struct
bus_type
i2c_bus_type
=
{
.
name
=
"i2c"
,
.
match
=
i2c_device_match
,
};
static
int
__init
i2c_init
(
void
)
{
bus_register
(
&
i2c_bus_type
);
return
i2cproc_init
();
}
static
void
__exit
i2c_exit
(
void
)
{
i2cproc_cleanup
();
bus_unregister
(
&
i2c_bus_type
);
}
module_init
(
i2cproc_init
);
module_init
(
i2c_init
);
module_exit
(
i2cproc_cleanup
);
module_exit
(
i2c_exit
);
#endif
/* def CONFIG_PROC_FS */
/* ----------------------------------------------------
/* ----------------------------------------------------
* the functional interface to the i2c busses.
* the functional interface to the i2c busses.
...
...
include/linux/i2c.h
View file @
500d5250
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/i2c-id.h>
#include <linux/i2c-id.h>
#include <linux/device.h>
/* for struct device */
#include <asm/semaphore.h>
#include <asm/semaphore.h>
/* --- General options ------------------------------------------------ */
/* --- General options ------------------------------------------------ */
...
@@ -144,6 +145,8 @@ struct i2c_driver {
...
@@ -144,6 +145,8 @@ struct i2c_driver {
int
(
*
command
)(
struct
i2c_client
*
client
,
unsigned
int
cmd
,
void
*
arg
);
int
(
*
command
)(
struct
i2c_client
*
client
,
unsigned
int
cmd
,
void
*
arg
);
};
};
extern
struct
bus_type
i2c_bus_type
;
/*
/*
* i2c_client identifies a single device (i.e. chip) that is connected to an
* i2c_client identifies a single device (i.e. chip) that is connected to an
* i2c bus. The behaviour is defined by the routines of the driver. This
* i2c bus. The behaviour is defined by the routines of the driver. This
...
...
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