Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-shmobile / setup-r8a7740.c
index 14edb5cffa7f23023d8224d055af3e7974a6807d..ec4eb49c16938a28b438282353e5194bc2592688 100644 (file)
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
@@ -60,6 +61,12 @@ static struct map_desc r8a7740_io_desc[] __initdata = {
 void __init r8a7740_map_io(void)
 {
        iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc));
+
+       /*
+        * DMA memory at 0xff200000 - 0xffdfffff. The default 2MB size isn't
+        * enough to allocate the frame buffer memory.
+        */
+       init_consistent_dma_size(12 << 20);
 }
 
 /* SCIFA0 */
@@ -350,19 +357,19 @@ static void r8a7740_i2c_workaround(struct platform_device *pdev)
        i2c_write(reg, ICSTART, i2c_read(reg, ICSTART) | 0x10);
        i2c_read(reg, ICSTART); /* dummy read */
 
-       mdelay(100);
+       udelay(10);
 
        i2c_write(reg, ICCR, 0x01);
-       i2c_read(reg, ICCR);
        i2c_write(reg, ICSTART, 0x00);
-       i2c_read(reg, ICSTART);
+
+       udelay(10);
 
        i2c_write(reg, ICCR, 0x10);
-       mdelay(100);
+       udelay(10);
        i2c_write(reg, ICCR, 0x00);
-       mdelay(100);
+       udelay(10);
        i2c_write(reg, ICCR, 0x10);
-       mdelay(100);
+       udelay(10);
 
        iounmap(reg);
 }