]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - arch/arm/mach-omap2/gpio.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[~shefty/rdma-dev.git] / arch / arm / mach-omap2 / gpio.c
index 48e5eced6b5177d0a19e43eb391907b8f139f630..2765cdc3152df6c9d5d18dcf707b98599b0bb92b 100644 (file)
@@ -61,13 +61,45 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
        pdata->dbck_flag = dev_attr->dbck_flag;
        pdata->virtual_irq_start = IH_GPIO_BASE + 32 * (id - 1);
 
+       pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL);
+       if (!pdata) {
+               pr_err("gpio%d: Memory allocation failed\n", id);
+               return -ENOMEM;
+       }
+
        switch (oh->class->rev) {
        case 0:
        case 1:
                pdata->bank_type = METHOD_GPIO_24XX;
+               pdata->regs->revision = OMAP24XX_GPIO_REVISION;
+               pdata->regs->direction = OMAP24XX_GPIO_OE;
+               pdata->regs->datain = OMAP24XX_GPIO_DATAIN;
+               pdata->regs->dataout = OMAP24XX_GPIO_DATAOUT;
+               pdata->regs->set_dataout = OMAP24XX_GPIO_SETDATAOUT;
+               pdata->regs->clr_dataout = OMAP24XX_GPIO_CLEARDATAOUT;
+               pdata->regs->irqstatus = OMAP24XX_GPIO_IRQSTATUS1;
+               pdata->regs->irqstatus2 = OMAP24XX_GPIO_IRQSTATUS2;
+               pdata->regs->irqenable = OMAP24XX_GPIO_IRQENABLE1;
+               pdata->regs->set_irqenable = OMAP24XX_GPIO_SETIRQENABLE1;
+               pdata->regs->clr_irqenable = OMAP24XX_GPIO_CLEARIRQENABLE1;
+               pdata->regs->debounce = OMAP24XX_GPIO_DEBOUNCE_VAL;
+               pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN;
                break;
        case 2:
                pdata->bank_type = METHOD_GPIO_44XX;
+               pdata->regs->revision = OMAP4_GPIO_REVISION;
+               pdata->regs->direction = OMAP4_GPIO_OE;
+               pdata->regs->datain = OMAP4_GPIO_DATAIN;
+               pdata->regs->dataout = OMAP4_GPIO_DATAOUT;
+               pdata->regs->set_dataout = OMAP4_GPIO_SETDATAOUT;
+               pdata->regs->clr_dataout = OMAP4_GPIO_CLEARDATAOUT;
+               pdata->regs->irqstatus = OMAP4_GPIO_IRQSTATUS0;
+               pdata->regs->irqstatus2 = OMAP4_GPIO_IRQSTATUS1;
+               pdata->regs->irqenable = OMAP4_GPIO_IRQSTATUSSET0;
+               pdata->regs->set_irqenable = OMAP4_GPIO_IRQSTATUSSET0;
+               pdata->regs->clr_irqenable = OMAP4_GPIO_IRQSTATUSCLR0;
+               pdata->regs->debounce = OMAP4_GPIO_DEBOUNCINGTIME;
+               pdata->regs->debounce_en = OMAP4_GPIO_DEBOUNCENABLE;
                break;
        default:
                WARN(1, "Invalid gpio bank_type\n");