Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25781
b: refs/heads/master
c: e97b81d
h: refs/heads/master
i:
  25779: 1d626bb
v: v3
  • Loading branch information
Mark M. Hoffman authored and Greg Kroah-Hartman committed Apr 14, 2006
1 parent 0666c0c commit 3ad1637
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cb8e1a92ef7588d3acdecf493ddddd0dd71a709
refs/heads/master: e97b81ddbb8b8c72b85330ac4a454a4513dcba8a
16 changes: 10 additions & 6 deletions trunk/Documentation/i2c/busses/i2c-parport
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ meant as a replacement for the older, individual drivers:
teletext adapters)

It currently supports the following devices:
* Philips adapter
* home brew teletext adapter
* Velleman K8000 adapter
* ELV adapter
* Analog Devices evaluation boards (ADM1025, ADM1030, ADM1031, ADM1032)
* Barco LPT->DVI (K5800236) adapter
* (type=0) Philips adapter
* (type=1) home brew teletext adapter
* (type=2) Velleman K8000 adapter
* (type=3) ELV adapter
* (type=4) Analog Devices ADM1032 evaluation board
* (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031
* (type=6) Barco LPT->DVI (K5800236) adapter

These devices use different pinout configurations, so you have to tell
the driver what you have, using the type module parameter. There is no
way to autodetect the devices. Support for different pinout configurations
can be easily added when needed.

Earlier kernels defaulted to type=0 (Philips). But now, if the type
parameter is missing, the driver will simply fail to initialize.


Building your own adapter
-------------------------
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ config I2C_PARPORT
This driver is a replacement for (and was inspired by) an older
driver named i2c-philips-par. The new driver supports more devices,
and makes it easier to add support for new devices.


An adapter type parameter is now mandatory. Please read the file
Documentation/i2c/busses/i2c-parport for details.

Another driver exists, named i2c-parport-light, which doesn't depend
on the parport driver. This is meant for embedded systems. Don't say
Y here if you intend to say Y or M there.
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/i2c/busses/i2c-parport-light.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,14 @@ static struct i2c_adapter parport_adapter = {

static int __init i2c_parport_init(void)
{
if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) {
if (type < 0) {
printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
return -ENODEV;
}

if (type >= ARRAY_SIZE(adapter_parm)) {
printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
type = 0;
return -ENODEV;
}

if (base == 0) {
Expand Down
9 changes: 7 additions & 2 deletions trunk/drivers/i2c/busses/i2c-parport.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,14 @@ static struct parport_driver i2c_parport_driver = {

static int __init i2c_parport_init(void)
{
if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) {
if (type < 0) {
printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
return -ENODEV;
}

if (type >= ARRAY_SIZE(adapter_parm)) {
printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
type = 0;
return -ENODEV;
}

return parport_register_driver(&i2c_parport_driver);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/i2c/busses/i2c-parport.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static struct adapter_parm adapter_parm[] = {
},
};

static int type;
static int type = -1;
module_param(type, int, 0);
MODULE_PARM_DESC(type,
"Type of adapter:\n"
Expand Down

0 comments on commit 3ad1637

Please sign in to comment.