/* * Generic GPIO driver for logic cells found in the Nomadik SoC * * Copyright (C) 2008,2009 STMicroelectronics * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> * Rewritten based on work by Prafulla WADASKAR <prafulla.wadaskar@st.com> * Copyright (C) 2011 Linus Walleij <linus.walleij@linaro.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */#include<linux/kernel.h>#include<linux/module.h>#include<linux/init.h>#include<linux/device.h>#include<linux/platform_device.h>#include<linux/io.h>#include<linux/clk.h>#include<linux/err.h>#include<linux/gpio.h>#include<linux/spinlock.h>#include<linux/interrupt.h>#include<linux/irq.h>#include<linux/irqdomain.h>#include<linux/slab.h>#include<linux/pinctrl/pinctrl.h>#include<asm/mach/irq.h>#include<plat/pincfg.h>#include<plat/gpio-nomadik.h>#include"pinctrl-nomadik.h"/* * The GPIO module in the Nomadik family of Systems-on-Chip is an * AMBA device, managing 32 pins and alternate functions. The logic block * is currently used in the Nomadik and ux500. * * Symbols in this file are called "nmk_gpio" for "nomadik gpio" */#define NMK_GPIO_PER_CHIP 32structnmk_gpio_chip{structgpio_chipchip;structirq_domain*domain;void__iomem*addr;structclk*clk;unsignedintbank;unsignedintparent_irq;intsecondary_parent_irq;u32(*get_secondary_status)(unsignedintbank);void(*set_ioforce)(boolenable);spinlock_tlock;boolsleepmode;/* Keep track of configured edges */u32edge_rising;u32edge_falling;u32real_wake;u32rwimsc;u32fwimsc;u32rimsc;u32fimsc;u32pull_up;u32lowemi;};structnmk_pinctrl{structdevice*dev;structpinctrl_dev*