]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/busses/i2c-at91.c
Merge branch 'linux-2.6'
[linux-2.6-omap-h63xx.git] / drivers / i2c / busses / i2c-at91.c
index 67f91bdda08909b32278b45ee6e0d1f4f6fee3d7..c09b036913bd9588f9789f982b884b319cff5890 100644 (file)
@@ -16,8 +16,8 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
+#include <linux/err.h>
 #include <linux/slab.h>
-#include <linux/pci.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/i2c.h>
@@ -135,7 +135,7 @@ static int xfer_write(struct i2c_adapter *adap, unsigned char *buf, int length)
  * Generic i2c master transfer entrypoint.
  *
  * Note: We do not use Atmel's feature of storing the "internal device address".
- * Instead the "internal device address" has to be written using a seperate
+ * Instead the "internal device address" has to be written using a separate
  * i2c message.
  * http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-September/024411.html
  */
@@ -227,13 +227,14 @@ static int __devinit at91_i2c_probe(struct platform_device *pdev)
        adapter->algo = &at91_algorithm;
        adapter->class = I2C_CLASS_HWMON;
        adapter->dev.parent = &pdev->dev;
+       /* adapter->id == 0 ... only one TWI controller for now */
 
        platform_set_drvdata(pdev, adapter);
 
        clk_enable(twi_clk);            /* enable peripheral clock */
        at91_twi_hwinit();              /* initialize TWI controller */
 
-       rc = i2c_add_adapter(adapter);
+       rc = i2c_add_numbered_adapter(adapter);
        if (rc) {
                dev_err(&pdev->dev, "Adapter %s registration failed\n",
                                adapter->name);
@@ -296,6 +297,9 @@ static int at91_i2c_resume(struct platform_device *pdev)
 #define at91_i2c_resume                NULL
 #endif
 
+/* work with "modprobe at91_i2c" from hotplugging or coldplugging */
+MODULE_ALIAS("at91_i2c");
+
 static struct platform_driver at91_i2c_driver = {
        .probe          = at91_i2c_probe,
        .remove         = __devexit_p(at91_i2c_remove),