diff options
-rw-r--r-- | drivers/gpio/gpio-vr41xx.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c index 9902732a382d..66cbcc108e62 100644 --- a/drivers/gpio/gpio-vr41xx.c +++ b/drivers/gpio/gpio-vr41xx.c | |||
@@ -81,6 +81,7 @@ static DEFINE_SPINLOCK(giu_lock); | |||
81 | static unsigned long giu_flags; | 81 | static unsigned long giu_flags; |
82 | 82 | ||
83 | static void __iomem *giu_base; | 83 | static void __iomem *giu_base; |
84 | static struct gpio_chip vr41xx_gpio_chip; | ||
84 | 85 | ||
85 | #define giu_read(offset) readw(giu_base + (offset)) | 86 | #define giu_read(offset) readw(giu_base + (offset)) |
86 | #define giu_write(offset, value) writew((value), giu_base + (offset)) | 87 | #define giu_write(offset, value) writew((value), giu_base + (offset)) |
@@ -135,12 +136,31 @@ static void unmask_giuint_low(struct irq_data *d) | |||
135 | giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(d->irq)); | 136 | giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(d->irq)); |
136 | } | 137 | } |
137 | 138 | ||
139 | static unsigned int startup_giuint(struct irq_data *data) | ||
140 | { | ||
141 | if (gpio_lock_as_irq(&vr41xx_gpio_chip, data->hwirq)) | ||
142 | dev_err(vr41xx_gpio_chip.dev, | ||
143 | "unable to lock HW IRQ %lu for IRQ\n", | ||
144 | data->hwirq); | ||
145 | /* Satisfy the .enable semantics by unmasking the line */ | ||
146 | unmask_giuint_low(data); | ||
147 | return 0; | ||
148 | } | ||
149 | |||
150 | static void shutdown_giuint(struct irq_data *data) | ||
151 | { | ||
152 | mask_giuint_low(data); | ||
153 | gpio_unlock_as_irq(&vr41xx_gpio_chip, data->hwirq); | ||
154 | } | ||
155 | |||
138 | static struct irq_chip giuint_low_irq_chip = { | 156 | static struct irq_chip giuint_low_irq_chip = { |
139 | .name = "GIUINTL", | 157 | .name = "GIUINTL", |
140 | .irq_ack = ack_giuint_low, | 158 | .irq_ack = ack_giuint_low, |
141 | .irq_mask = mask_giuint_low, | 159 | .irq_mask = mask_giuint_low, |
142 | .irq_mask_ack = mask_ack_giuint_low, | 160 | .irq_mask_ack = mask_ack_giuint_low, |
143 | .irq_unmask = unmask_giuint_low, | 161 | .irq_unmask = unmask_giuint_low, |
162 | .irq_startup = startup_giuint, | ||
163 | .irq_shutdown = shutdown_giuint, | ||
144 | }; | 164 | }; |
145 | 165 | ||
146 | static void ack_giuint_high(struct irq_data *d) | 166 | static void ack_giuint_high(struct irq_data *d) |