Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114478
b: refs/heads/master
c: ce56403
h: refs/heads/master
v: v3
  • Loading branch information
Rene Herman authored and Jean Delvare committed Oct 14, 2008
1 parent a5a146f commit ab9dd1d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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: 9df013b3e46c67dd3745df91eaccdc719118e0cc
refs/heads/master: ce5640330b10c6cecfbda50569b9f53c081d10c6
20 changes: 17 additions & 3 deletions trunk/drivers/i2c/busses/i2c-pca-isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#define DRIVER "i2c-pca-isa"
#define IO_SIZE 4

static unsigned long base = 0x330;
static int irq = 10;
static unsigned long base;
static int irq = -1;

/* Data sheet recommends 59kHz for 100kHz operation due to variation
* in the actual clock rate */
Expand Down Expand Up @@ -107,6 +107,19 @@ static struct i2c_adapter pca_isa_ops = {
.timeout = 100,
};

static int __devinit pca_isa_match(struct device *dev, unsigned int id)
{
int match = base != 0;

if (match) {
if (irq <= -1)
dev_warn(dev, "Using polling mode (specify irq)\n");
} else
dev_err(dev, "Please specify I/O base\n");

return match;
}

static int __devinit pca_isa_probe(struct device *dev, unsigned int id)
{
init_waitqueue_head(&pca_wait);
Expand Down Expand Up @@ -153,7 +166,7 @@ static int __devexit pca_isa_remove(struct device *dev, unsigned int id)
{
i2c_del_adapter(&pca_isa_ops);

if (irq > 0) {
if (irq > -1) {
disable_irq(irq);
free_irq(irq, &pca_isa_ops);
}
Expand All @@ -163,6 +176,7 @@ static int __devexit pca_isa_remove(struct device *dev, unsigned int id)
}

static struct isa_driver pca_isa_driver = {
.match = pca_isa_match,
.probe = pca_isa_probe,
.remove = __devexit_p(pca_isa_remove),
.driver = {
Expand Down

0 comments on commit ab9dd1d

Please sign in to comment.