Commit 3c916975 authored by Mark Brown's avatar Mark Brown Committed by Kukjin Kim

ARM: S3C64XX: Use chip_data to store the shift for EINTs

This makes all the functions that use the shift slightly smaller, one
instruction in most cases but more for ack() and maskack().
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent c35cd6ec
...@@ -30,14 +30,14 @@ ...@@ -30,14 +30,14 @@
#include <plat/pm.h> #include <plat/pm.h>
#define eint_offset(irq) ((irq) - IRQ_EINT(0)) #define eint_offset(irq) ((irq) - IRQ_EINT(0))
#define eint_irq_to_bit(irq) (1 << eint_offset(irq)) #define eint_irq_to_bit(irq) ((u32)(1 << eint_offset(irq)))
static inline void s3c_irq_eint_mask(struct irq_data *data) static inline void s3c_irq_eint_mask(struct irq_data *data)
{ {
u32 mask; u32 mask;
mask = __raw_readl(S3C64XX_EINT0MASK); mask = __raw_readl(S3C64XX_EINT0MASK);
mask |= eint_irq_to_bit(data->irq); mask |= (u32)data->chip_data;
__raw_writel(mask, S3C64XX_EINT0MASK); __raw_writel(mask, S3C64XX_EINT0MASK);
} }
...@@ -46,13 +46,13 @@ static void s3c_irq_eint_unmask(struct irq_data *data) ...@@ -46,13 +46,13 @@ static void s3c_irq_eint_unmask(struct irq_data *data)
u32 mask; u32 mask;
mask = __raw_readl(S3C64XX_EINT0MASK); mask = __raw_readl(S3C64XX_EINT0MASK);
mask &= ~eint_irq_to_bit(data->irq); mask &= ~((u32)data->chip_data);
__raw_writel(mask, S3C64XX_EINT0MASK); __raw_writel(mask, S3C64XX_EINT0MASK);
} }
static inline void s3c_irq_eint_ack(struct irq_data *data) static inline void s3c_irq_eint_ack(struct irq_data *data)
{ {
__raw_writel(eint_irq_to_bit(data->irq), S3C64XX_EINT0PEND); __raw_writel((u32)data->chip_data, S3C64XX_EINT0PEND);
} }
static void s3c_irq_eint_maskack(struct irq_data *data) static void s3c_irq_eint_maskack(struct irq_data *data)
...@@ -198,6 +198,7 @@ static int __init s3c64xx_init_irq_eint(void) ...@@ -198,6 +198,7 @@ static int __init s3c64xx_init_irq_eint(void)
for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
set_irq_chip(irq, &s3c_irq_eint); set_irq_chip(irq, &s3c_irq_eint);
set_irq_chip_data(irq, (void *)eint_irq_to_bit(irq));
set_irq_handler(irq, handle_level_irq); set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID); set_irq_flags(irq, IRQF_VALID);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment