]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/busses/i2c-omap.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / drivers / i2c / busses / i2c-omap.c
index dec04da0455c1d4988f715b1868fb66a06512677..cb55cf2ba1e91a4279f3406f34216b4a59f4094e 100644 (file)
@@ -8,7 +8,7 @@
  * Tony Lindgren <tony@atomide.com> and Imre Deak <imre.deak@nokia.com>
  * Copyright (C) 2005 Nokia Corporation
  *
- * Cleaned up by Juha Yrjölä <juha.yrjola@nokia.com>
+ * Cleaned up by Juha Yrjölä <juha.yrjola@nokia.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -203,7 +203,7 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
                while (!(omap_i2c_read_reg(dev, OMAP_I2C_SYSS_REG) &
                         OMAP_I2C_SYSS_RDONE)) {
                        if (time_after(jiffies, timeout)) {
-                               dev_warn(dev->dev, "timeout waiting"
+                               dev_warn(dev->dev, "timeout waiting "
                                                "for controller reset\n");
                                return -ETIMEDOUT;
                        }
@@ -231,8 +231,8 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
                 * 13           2               1
                 * 19.2         2               1
                 */
-               if (fclk_rate > 16000000)
-                       psc = (fclk_rate + 8000000) / 12000000;
+               if (fclk_rate > 12000000)
+                       psc = fclk_rate / 12000000;
        }
 
        /* Setup clock prescaler to obtain approx 12MHz I2C module clock: */
@@ -483,7 +483,7 @@ omap_i2c_isr(int this_irq, void *dev_id)
                                        dev->buf_len--;
                                }
                        } else
-                               dev_err(dev->dev, "RRDY IRQ while no data"
+                               dev_err(dev->dev, "RRDY IRQ while no data "
                                                "requested\n");
                        omap_i2c_ack_stat(dev, OMAP_I2C_STAT_RRDY);
                        continue;
@@ -498,7 +498,7 @@ omap_i2c_isr(int this_irq, void *dev_id)
                                        dev->buf_len--;
                                }
                        } else
-                               dev_err(dev->dev, "XRDY IRQ while no"
+                               dev_err(dev->dev, "XRDY IRQ while no "
                                        "data to send\n");
                        omap_i2c_write_reg(dev, OMAP_I2C_DATA_REG, w);
                        omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XRDY);
@@ -605,7 +605,8 @@ omap_i2c_probe(struct platform_device *pdev)
        adap->dev.parent = &pdev->dev;
 
        /* i2c device drivers may be active on return from add_adapter() */
-       r = i2c_add_adapter(adap);
+       adap->nr = pdev->id;
+       r = i2c_add_numbered_adapter(adap);
        if (r) {
                dev_err(dev->dev, "failure adding adapter\n");
                goto err_free_irq;