diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 19:53:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-14 19:53:02 -0400 |
commit | 278429cff8809958d25415ba0ed32b59866ab1a8 (patch) | |
tree | 1085100d82525ff7c0fc93fad475e4320f293548 /drivers/i2c/busses/i2c-pca-isa.c | |
parent | e413b210c541acac1a194085627db28a122f3bdf (diff) | |
parent | a05f2c5a2735ee1d68770137fbbfc334d3b9cda9 (diff) |
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
i2c-viapro: Add support for SMBus Process Call transactions
i2c: Restore i2c_smbus_process_call function
i2c: Do earlier driver model init
i2c: Only build Tyan SMBus mux drivers on x86
i2c: Guard against oopses from bad init sequences
i2c: Document the implementation details of the /dev interface
i2c: Improve dev-interface documentation
i2c-parport-light: Don't register a platform device resource
hwmon: (dme1737) Convert to a new-style i2c driver
hwmon: (dme1737) Be less i2c-centric
i2c/tps65010: Vibrator hookup to gpiolib
i2c-viapro: Add VX800/VX820 support
i2c: Renesas Highlander FPGA SMBus support
i2c-pca-isa: Don't grab arbitrary resources
i2c/isp1301_omap: Convert to a new-style i2c driver, part 2
i2c/isp1301_omap: Convert to a new-style i2c driver, part 1
Diffstat (limited to 'drivers/i2c/busses/i2c-pca-isa.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pca-isa.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-pca-isa.c b/drivers/i2c/busses/i2c-pca-isa.c index a119784bae10..f80df9ae5054 100644 --- a/drivers/i2c/busses/i2c-pca-isa.c +++ b/drivers/i2c/busses/i2c-pca-isa.c | |||
@@ -36,8 +36,8 @@ | |||
36 | #define DRIVER "i2c-pca-isa" | 36 | #define DRIVER "i2c-pca-isa" |
37 | #define IO_SIZE 4 | 37 | #define IO_SIZE 4 |
38 | 38 | ||
39 | static unsigned long base = 0x330; | 39 | static unsigned long base; |
40 | static int irq = 10; | 40 | static int irq = -1; |
41 | 41 | ||
42 | /* Data sheet recommends 59kHz for 100kHz operation due to variation | 42 | /* Data sheet recommends 59kHz for 100kHz operation due to variation |
43 | * in the actual clock rate */ | 43 | * in the actual clock rate */ |
@@ -107,6 +107,19 @@ static struct i2c_adapter pca_isa_ops = { | |||
107 | .timeout = 100, | 107 | .timeout = 100, |
108 | }; | 108 | }; |
109 | 109 | ||
110 | static int __devinit pca_isa_match(struct device *dev, unsigned int id) | ||
111 | { | ||
112 | int match = base != 0; | ||
113 | |||
114 | if (match) { | ||
115 | if (irq <= -1) | ||
116 | dev_warn(dev, "Using polling mode (specify irq)\n"); | ||
117 | } else | ||
118 | dev_err(dev, "Please specify I/O base\n"); | ||
119 | |||
120 | return match; | ||
121 | } | ||
122 | |||
110 | static int __devinit pca_isa_probe(struct device *dev, unsigned int id) | 123 | static int __devinit pca_isa_probe(struct device *dev, unsigned int id) |
111 | { | 124 | { |
112 | init_waitqueue_head(&pca_wait); | 125 | init_waitqueue_head(&pca_wait); |
@@ -153,7 +166,7 @@ static int __devexit pca_isa_remove(struct device *dev, unsigned int id) | |||
153 | { | 166 | { |
154 | i2c_del_adapter(&pca_isa_ops); | 167 | i2c_del_adapter(&pca_isa_ops); |
155 | 168 | ||
156 | if (irq > 0) { | 169 | if (irq > -1) { |
157 | disable_irq(irq); | 170 | disable_irq(irq); |
158 | free_irq(irq, &pca_isa_ops); | 171 | free_irq(irq, &pca_isa_ops); |
159 | } | 172 | } |
@@ -163,6 +176,7 @@ static int __devexit pca_isa_remove(struct device *dev, unsigned int id) | |||
163 | } | 176 | } |
164 | 177 | ||
165 | static struct isa_driver pca_isa_driver = { | 178 | static struct isa_driver pca_isa_driver = { |
179 | .match = pca_isa_match, | ||
166 | .probe = pca_isa_probe, | 180 | .probe = pca_isa_probe, |
167 | .remove = __devexit_p(pca_isa_remove), | 181 | .remove = __devexit_p(pca_isa_remove), |
168 | .driver = { | 182 | .driver = { |