ARM: OMAP4: hwmod: Fix SOFTRESET logic for OMAP4
[pandora-kernel.git] / arch / arm / mach-omap2 / gpmc.c
index 493505c..82979d2 100644 (file)
@@ -480,6 +480,11 @@ int gpmc_read_status(int cmd)
                status = regval & GPMC_STATUS_BUFF_EMPTY;
                break;
 
+       case GPMC_STATUS_WAIT:
+               regval = gpmc_read_reg(GPMC_STATUS);
+               status = regval & 0x100;
+               break;
+
        default:
                printk(KERN_ERR "gpmc_read_status: Not supported\n");
        }
@@ -528,7 +533,13 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
 
        case GPMC_CONFIG_DEV_SIZE:
                regval  = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+               /* clear 2 target bits */
+               regval &= ~GPMC_CONFIG1_DEVICESIZE(3);
+
+               /* set the proper value */
                regval |= GPMC_CONFIG1_DEVICESIZE(wval);
+
                gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
                break;
 
@@ -743,7 +754,7 @@ static int __init gpmc_init(void)
        /* initalize the irq_chained */
        irq = OMAP_GPMC_IRQ_BASE;
        for (cs = 0; cs < GPMC_CS_NUM; cs++) {
-               set_irq_chip_and_handler(irq, &dummy_irq_chip,
+               irq_set_chip_and_handler(irq, &dummy_irq_chip,
                                                handle_simple_irq);
                set_irq_flags(irq, IRQF_VALID);
                irq++;