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
1ff6c63f
Commit
1ff6c63f
authored
Sep 21, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] I2C: clean up the i2c-elv.c driver a bit
parent
32c6a7ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
drivers/i2c/busses/i2c-elv.c
drivers/i2c/busses/i2c-elv.c
+9
-12
No files found.
drivers/i2c/busses/i2c-elv.c
View file @
1ff6c63f
...
...
@@ -21,8 +21,6 @@
/* With some changes from Kysti Mlkki <kmalkki@cc.hut.fi> and even
Frodo Looijaard <frodol@dds.nl> */
/* $Id: i2c-elv.c,v 1.27 2003/01/21 08:08:16 kmalkki Exp $ */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
...
...
@@ -36,7 +34,7 @@
#define DEFAULT_BASE 0x378
static
int
base
=
0
;
static
unsigned
char
PortD
ata
=
0
;
static
unsigned
char
port_d
ata
=
0
;
/* ----- global defines ----------------------------------------------- */
#define DEB(x)
/* should be reasonable open, close &c. */
...
...
@@ -57,21 +55,21 @@ static unsigned char PortData = 0;
static
void
bit_elv_setscl
(
void
*
data
,
int
state
)
{
if
(
state
)
{
PortD
ata
&=
0xfe
;
port_d
ata
&=
0xfe
;
}
else
{
PortD
ata
|=
1
;
port_d
ata
|=
1
;
}
outb
(
PortD
ata
,
DATA
);
outb
(
port_d
ata
,
DATA
);
}
static
void
bit_elv_setsda
(
void
*
data
,
int
state
)
{
if
(
state
)
{
PortD
ata
&=
0xfd
;
port_d
ata
&=
0xfd
;
}
else
{
PortD
ata
|=
2
;
port_d
ata
|=
2
;
}
outb
(
PortD
ata
,
DATA
);
outb
(
port_d
ata
,
DATA
);
}
static
int
bit_elv_getscl
(
void
*
data
)
...
...
@@ -103,7 +101,7 @@ static int bit_elv_init(void)
goto
fail
;
}
PortD
ata
=
0
;
port_d
ata
=
0
;
bit_elv_setsda
((
void
*
)
base
,
1
);
bit_elv_setscl
((
void
*
)
base
,
1
);
return
0
;
...
...
@@ -129,14 +127,13 @@ static struct i2c_algo_bit_data bit_elv_data = {
static
struct
i2c_adapter
bit_elv_ops
=
{
.
owner
=
THIS_MODULE
,
.
id
=
I2C_HW_B_ELV
,
.
algo_data
=
&
bit_elv_data
,
.
name
=
"ELV Parallel port adaptor"
,
};
static
int
__init
i2c_bitelv_init
(
void
)
{
printk
(
KERN_INFO
"i2c
-elv.o: i2c ELV parallel port adapter module version %s (%s)
\n
"
,
I2C_VERSION
,
I2C_DATE
);
printk
(
KERN_INFO
"i2c
ELV parallel port adapter driver
\n
"
);
if
(
base
==
0
)
{
/* probe some values */
base
=
DEFAULT_BASE
;
...
...
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