|
@@ -407,3 +407,90 @@ static struct gpio_led_platform_data balloon3_gpio_led_info = {
|
|
|
};
|
|
|
|
|
|
static struct platform_device balloon3_leds = {
|
|
|
+ .name = "leds-gpio",
|
|
|
+ .id = 0,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &balloon3_gpio_led_info,
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+struct gpio_led balloon3_pcf_gpio_leds[] = {
|
|
|
+ {
|
|
|
+ .name = "balloon3:green:led0",
|
|
|
+ .gpio = BALLOON3_PCF_GPIO_LED0,
|
|
|
+ .active_low = 1,
|
|
|
+ }, {
|
|
|
+ .name = "balloon3:green:led1",
|
|
|
+ .gpio = BALLOON3_PCF_GPIO_LED1,
|
|
|
+ .active_low = 1,
|
|
|
+ }, {
|
|
|
+ .name = "balloon3:orange:led2",
|
|
|
+ .gpio = BALLOON3_PCF_GPIO_LED2,
|
|
|
+ .active_low = 1,
|
|
|
+ }, {
|
|
|
+ .name = "balloon3:orange:led3",
|
|
|
+ .gpio = BALLOON3_PCF_GPIO_LED3,
|
|
|
+ .active_low = 1,
|
|
|
+ }, {
|
|
|
+ .name = "balloon3:orange:led4",
|
|
|
+ .gpio = BALLOON3_PCF_GPIO_LED4,
|
|
|
+ .active_low = 1,
|
|
|
+ }, {
|
|
|
+ .name = "balloon3:orange:led5",
|
|
|
+ .gpio = BALLOON3_PCF_GPIO_LED5,
|
|
|
+ .active_low = 1,
|
|
|
+ }, {
|
|
|
+ .name = "balloon3:red:led6",
|
|
|
+ .gpio = BALLOON3_PCF_GPIO_LED6,
|
|
|
+ .active_low = 1,
|
|
|
+ }, {
|
|
|
+ .name = "balloon3:red:led7",
|
|
|
+ .gpio = BALLOON3_PCF_GPIO_LED7,
|
|
|
+ .active_low = 1,
|
|
|
+ },
|
|
|
+};
|
|
|
+
|
|
|
+static struct gpio_led_platform_data balloon3_pcf_gpio_led_info = {
|
|
|
+ .leds = balloon3_pcf_gpio_leds,
|
|
|
+ .num_leds = ARRAY_SIZE(balloon3_pcf_gpio_leds),
|
|
|
+};
|
|
|
+
|
|
|
+static struct platform_device balloon3_pcf_leds = {
|
|
|
+ .name = "leds-gpio",
|
|
|
+ .id = 1,
|
|
|
+ .dev = {
|
|
|
+ .platform_data = &balloon3_pcf_gpio_led_info,
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+static void __init balloon3_leds_init(void)
|
|
|
+{
|
|
|
+ pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_led_pin_config));
|
|
|
+ platform_device_register(&balloon3_leds);
|
|
|
+ platform_device_register(&balloon3_pcf_leds);
|
|
|
+}
|
|
|
+#else
|
|
|
+static inline void balloon3_leds_init(void) {}
|
|
|
+#endif
|
|
|
+
|
|
|
+/******************************************************************************
|
|
|
+ * FPGA IRQ
|
|
|
+ ******************************************************************************/
|
|
|
+static void balloon3_mask_irq(struct irq_data *d)
|
|
|
+{
|
|
|
+ int balloon3_irq = (d->irq - BALLOON3_IRQ(0));
|
|
|
+ balloon3_irq_enabled &= ~(1 << balloon3_irq);
|
|
|
+ __raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG);
|
|
|
+}
|
|
|
+
|
|
|
+static void balloon3_unmask_irq(struct irq_data *d)
|
|
|
+{
|
|
|
+ int balloon3_irq = (d->irq - BALLOON3_IRQ(0));
|
|
|
+ balloon3_irq_enabled |= (1 << balloon3_irq);
|
|
|
+ __raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG);
|
|
|
+}
|
|
|
+
|
|
|
+static struct irq_chip balloon3_irq_chip = {
|
|
|
+ .name = "FPGA",
|
|
|
+ .irq_ack = balloon3_mask_irq,
|
|
|
+ .irq_mask = balloon3_mask_irq,
|