Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295645
b: refs/heads/master
c: d0d665a
h: refs/heads/master
i:
  295643: a968836
v: v3
  • Loading branch information
Charulatha V authored and Tarun Kanti DebBarma committed Feb 6, 2012
1 parent 80dfb34 commit 7629167
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 56 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3901eaf1fc289e8175faa8c7c460d542b6eb7dd
refs/heads/master: d0d665a896c5b9a0aa60e8bac15c270cb59aa9e7
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-omap1/gpio15xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static struct omap_gpio_reg_offs omap15xx_mpuio_regs = {

static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
.virtual_irq_start = IH_MPUIO_BASE,
.bank_type = METHOD_MPUIO,
.is_mpuio = true,
.bank_width = 16,
.bank_stride = 1,
.regs = &omap15xx_mpuio_regs,
Expand Down Expand Up @@ -90,7 +90,6 @@ static struct omap_gpio_reg_offs omap15xx_gpio_regs = {

static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
.virtual_irq_start = IH_GPIO_BASE,
.bank_type = METHOD_GPIO_1510,
.bank_width = 16,
.regs = &omap15xx_gpio_regs,
};
Expand Down
6 changes: 1 addition & 5 deletions trunk/arch/arm/mach-omap1/gpio16xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {

static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
.virtual_irq_start = IH_MPUIO_BASE,
.bank_type = METHOD_MPUIO,
.is_mpuio = true,
.bank_width = 16,
.bank_stride = 1,
.regs = &omap16xx_mpuio_regs,
Expand Down Expand Up @@ -100,7 +100,6 @@ static struct omap_gpio_reg_offs omap16xx_gpio_regs = {

static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
.virtual_irq_start = IH_GPIO_BASE,
.bank_type = METHOD_GPIO_1610,
.bank_width = 16,
.regs = &omap16xx_gpio_regs,
};
Expand Down Expand Up @@ -130,7 +129,6 @@ static struct __initdata resource omap16xx_gpio2_resources[] = {

static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = {
.virtual_irq_start = IH_GPIO_BASE + 16,
.bank_type = METHOD_GPIO_1610,
.bank_width = 16,
.regs = &omap16xx_gpio_regs,
};
Expand Down Expand Up @@ -160,7 +158,6 @@ static struct __initdata resource omap16xx_gpio3_resources[] = {

static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = {
.virtual_irq_start = IH_GPIO_BASE + 32,
.bank_type = METHOD_GPIO_1610,
.bank_width = 16,
.regs = &omap16xx_gpio_regs,
};
Expand Down Expand Up @@ -190,7 +187,6 @@ static struct __initdata resource omap16xx_gpio4_resources[] = {

static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = {
.virtual_irq_start = IH_GPIO_BASE + 48,
.bank_type = METHOD_GPIO_1610,
.bank_width = 16,
.regs = &omap16xx_gpio_regs,
};
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/arm/mach-omap1/gpio7xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ static struct omap_gpio_reg_offs omap7xx_mpuio_regs = {

static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
.virtual_irq_start = IH_MPUIO_BASE,
.bank_type = METHOD_MPUIO,
.bank_width = 32,
.is_mpuio = true,
.bank_stride = 2,
.regs = &omap7xx_mpuio_regs,
};
Expand Down Expand Up @@ -94,7 +94,6 @@ static struct omap_gpio_reg_offs omap7xx_gpio_regs = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
.virtual_irq_start = IH_GPIO_BASE,
.bank_type = METHOD_GPIO_7XX,
.bank_width = 32,
.regs = &omap7xx_gpio_regs,
};
Expand Down Expand Up @@ -124,7 +123,6 @@ static struct __initdata resource omap7xx_gpio2_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
.virtual_irq_start = IH_GPIO_BASE + 32,
.bank_type = METHOD_GPIO_7XX,
.bank_width = 32,
.regs = &omap7xx_gpio_regs,
};
Expand Down Expand Up @@ -154,7 +152,6 @@ static struct __initdata resource omap7xx_gpio3_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
.virtual_irq_start = IH_GPIO_BASE + 64,
.bank_type = METHOD_GPIO_7XX,
.bank_width = 32,
.regs = &omap7xx_gpio_regs,
};
Expand Down Expand Up @@ -184,7 +181,6 @@ static struct __initdata resource omap7xx_gpio4_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = {
.virtual_irq_start = IH_GPIO_BASE + 96,
.bank_type = METHOD_GPIO_7XX,
.bank_width = 32,
.regs = &omap7xx_gpio_regs,
};
Expand Down Expand Up @@ -214,7 +210,6 @@ static struct __initdata resource omap7xx_gpio5_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = {
.virtual_irq_start = IH_GPIO_BASE + 128,
.bank_type = METHOD_GPIO_7XX,
.bank_width = 32,
.regs = &omap7xx_gpio_regs,
};
Expand Down Expand Up @@ -244,7 +239,6 @@ static struct __initdata resource omap7xx_gpio6_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = {
.virtual_irq_start = IH_GPIO_BASE + 160,
.bank_type = METHOD_GPIO_7XX,
.bank_width = 32,
.regs = &omap7xx_gpio_regs,
};
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/arm/mach-omap2/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
/* fall through */

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;
Expand All @@ -97,7 +96,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
pdata->regs->fallingdetect = OMAP24XX_GPIO_FALLINGDETECT;
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;
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/arm/plat-omap/include/plat/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,6 @@
IH_MPUIO_BASE + ((nr) & 0x0f) : \
IH_GPIO_BASE + (nr))

#define METHOD_MPUIO 0
#define METHOD_GPIO_1510 1
#define METHOD_GPIO_1610 2
#define METHOD_GPIO_7XX 3
#define METHOD_GPIO_24XX 5
#define METHOD_GPIO_44XX 6

struct omap_gpio_dev_attr {
int bank_width; /* GPIO bank width */
bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
Expand Down Expand Up @@ -210,6 +203,7 @@ struct omap_gpio_platform_data {
int bank_stride; /* Only needed for omap1 MPUIO */
bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
bool loses_context; /* whether the bank would ever lose context */
bool is_mpuio; /* whether the bank is of type MPUIO */
u32 non_wakeup_gpios;

struct omap_gpio_reg_offs *regs;
Expand Down
38 changes: 6 additions & 32 deletions trunk/drivers/gpio/gpio-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ struct gpio_bank {
void __iomem *base;
u16 irq;
u16 virtual_irq_start;
int method;
u32 suspend_wakeup;
u32 saved_wakeup;
u32 non_wakeup_gpios;
Expand All @@ -66,6 +65,7 @@ struct gpio_bank {
u32 mod_usage;
u32 dbck_enable_mask;
struct device *dev;
bool is_mpuio;
bool dbck_flag;
bool loses_context;
int stride;
Expand Down Expand Up @@ -693,14 +693,6 @@ static struct irq_chip gpio_irq_chip = {

/*---------------------------------------------------------------------*/

#ifdef CONFIG_ARCH_OMAP1

#define bank_is_mpuio(bank) ((bank)->method == METHOD_MPUIO)

#ifdef CONFIG_ARCH_OMAP16XX

#include <linux/platform_device.h>

static int omap_mpuio_suspend_noirq(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
Expand Down Expand Up @@ -762,23 +754,8 @@ static inline void mpuio_init(struct gpio_bank *bank)
(void) platform_device_register(&omap_mpuio_device);
}

#else
static inline void mpuio_init(struct gpio_bank *bank) {}
#endif /* 16xx */

#else

#define bank_is_mpuio(bank) 0
static inline void mpuio_init(struct gpio_bank *bank) {}

#endif

/*---------------------------------------------------------------------*/

/* REVISIT these are stupid implementations! replace by ones that
* don't switch on METHOD_* and which mostly avoid spinlocks
*/

static int gpio_input(struct gpio_chip *chip, unsigned offset)
{
struct gpio_bank *bank;
Expand Down Expand Up @@ -899,7 +876,7 @@ static void omap_gpio_mod_init(struct gpio_bank *bank)
if (bank->width == 16)
l = 0xffff;

if (bank_is_mpuio(bank)) {
if (bank->is_mpuio) {
__raw_writel(l, bank->base + bank->regs->irqenable);
return;
}
Expand Down Expand Up @@ -951,7 +928,6 @@ static void __devinit omap_gpio_chip_init(struct gpio_bank *bank)
int j;
static int gpio;

bank->mod_usage = 0;
/*
* REVISIT eventually switch from OMAP-specific gpio structs
* over to the generic ones
Expand All @@ -964,12 +940,10 @@ static void __devinit omap_gpio_chip_init(struct gpio_bank *bank)
bank->chip.set_debounce = gpio_debounce;
bank->chip.set = gpio_set;
bank->chip.to_irq = gpio_2irq;
if (bank_is_mpuio(bank)) {
if (bank->is_mpuio) {
bank->chip.label = "mpuio";
#ifdef CONFIG_ARCH_OMAP16XX
if (bank->regs->wkup_en)
bank->chip.dev = &omap_mpuio_device.dev;
#endif
bank->chip.base = OMAP_MPUIO(0);
} else {
bank->chip.label = "gpio";
Expand All @@ -984,7 +958,7 @@ static void __devinit omap_gpio_chip_init(struct gpio_bank *bank)
j < bank->virtual_irq_start + bank->width; j++) {
irq_set_lockdep_class(j, &gpio_lock_class);
irq_set_chip_data(j, bank);
if (bank_is_mpuio(bank)) {
if (bank->is_mpuio) {
omap_mpuio_alloc_gc(bank, j, bank->width);
} else {
irq_set_chip(j, &gpio_irq_chip);
Expand Down Expand Up @@ -1028,11 +1002,11 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)

pdata = pdev->dev.platform_data;
bank->virtual_irq_start = pdata->virtual_irq_start;
bank->method = pdata->bank_type;
bank->dev = &pdev->dev;
bank->dbck_flag = pdata->dbck_flag;
bank->stride = pdata->bank_stride;
bank->width = pdata->bank_width;
bank->is_mpuio = pdata->is_mpuio;
bank->non_wakeup_gpios = pdata->non_wakeup_gpios;
bank->loses_context = pdata->loses_context;
bank->get_context_loss_count = pdata->get_context_loss_count;
Expand Down Expand Up @@ -1065,7 +1039,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
pm_runtime_enable(bank->dev);
pm_runtime_get_sync(bank->dev);

if (bank_is_mpuio(bank))
if (bank->is_mpuio)
mpuio_init(bank);

omap_gpio_mod_init(bank);
Expand Down

0 comments on commit 7629167

Please sign in to comment.