lkml.org 
[lkml]   [2011]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] gpio: gpio-mxs: remove the duplicated micro define
Date
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
---
drivers/gpio/gpio-mxs.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index 385c58e..b9f7567 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -31,9 +31,6 @@
#include <linux/module.h>
#include <mach/mxs.h>

-#define MXS_SET 0x4
-#define MXS_CLR 0x8
-
#define PINCTRL_DOUT(n) ((cpu_is_mx23() ? 0x0500 : 0x0700) + (n) * 0x10)
#define PINCTRL_DIN(n) ((cpu_is_mx23() ? 0x0600 : 0x0900) + (n) * 0x10)
#define PINCTRL_DOE(n) ((cpu_is_mx23() ? 0x0700 : 0x0b00) + (n) * 0x10)
@@ -91,19 +88,19 @@ static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type)
/* set level or edge */
pin_addr = port->base + PINCTRL_IRQLEV(port->id);
if (edge & GPIO_INT_LEV_MASK)
- writel(pin_mask, pin_addr + MXS_SET);
+ writel(pin_mask, pin_addr + MXS_SET_ADDR);
else
- writel(pin_mask, pin_addr + MXS_CLR);
+ writel(pin_mask, pin_addr + MXS_CLR_ADDR);

/* set polarity */
pin_addr = port->base + PINCTRL_IRQPOL(port->id);
if (edge & GPIO_INT_POL_MASK)
- writel(pin_mask, pin_addr + MXS_SET);
+ writel(pin_mask, pin_addr + MXS_SET_ADDR);
else
- writel(pin_mask, pin_addr + MXS_CLR);
+ writel(pin_mask, pin_addr + MXS_CLR_ADDR);

writel(1 << (gpio & 0x1f),
- port->base + PINCTRL_IRQSTAT(port->id) + MXS_CLR);
+ port->base + PINCTRL_IRQSTAT(port->id) + MXS_CLR_ADDR);

return 0;
}
@@ -164,7 +161,7 @@ static void __init mxs_gpio_init_gc(struct mxs_gpio_port *port)
ct->chip.irq_unmask = irq_gc_mask_set_bit;
ct->chip.irq_set_type = mxs_gpio_set_irq_type;
ct->chip.irq_set_wake = mxs_gpio_set_wake_irq;
- ct->regs.ack = PINCTRL_IRQSTAT(port->id) + MXS_CLR;
+ ct->regs.ack = PINCTRL_IRQSTAT(port->id) + MXS_CLR_ADDR;
ct->regs.mask = PINCTRL_IRQEN(port->id);

irq_setup_generic_chip(gc, IRQ_MSK(32), 0, IRQ_NOREQUEST, 0);
@@ -232,7 +229,7 @@ static int __devinit mxs_gpio_probe(struct platform_device *pdev)
writel(0, port->base + PINCTRL_IRQEN(port->id));

/* clear address has to be used to clear IRQSTAT bits */
- writel(~0U, port->base + PINCTRL_IRQSTAT(port->id) + MXS_CLR);
+ writel(~0U, port->base + PINCTRL_IRQSTAT(port->id) + MXS_CLR_ADDR);

/* gpio-mxs can be a generic irq chip */
mxs_gpio_init_gc(port);
--
1.7.0.4



\
 
 \ /
  Last update: 2011-11-15 10:45    [W:7.902 / U:1.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site