Orion: DNS323 - add support for hardware accelerated led flashing

The Orion SoC supports generating a square pattern on GPIO pins
with roughly 5Hz

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Cc: Tzachi Perelstein <tzachi@marvell.com>

diff --git a/arch/arm/mach-orion/dns323-setup.c b/arch/arm/mach-orion/dns323-setup.c
index 59de2ac..6ef1cd6 100644
--- a/arch/arm/mach-orion/dns323-setup.c
+++ b/arch/arm/mach-orion/dns323-setup.c
@@ -139,7 +139,7 @@ static struct platform_device dns323_nor_flash = {
 };
 
 /****************************************************************************
- * GPIO LEDs (simple - doesn't use hardware blinking support)
+ * GPIO LEDs
  */
 
 static struct gpio_led dns323_leds[] = {
@@ -158,9 +158,27 @@ static struct gpio_led dns323_leds[] = {
 	},
 };
 
+#define ORION_BLINK_HALF_PERIOD 100 /* ms */
+
+int dns323_gpio_blink_set(unsigned gpio,
+	unsigned long *delay_on, unsigned long *delay_off)
+{
+	if (!*delay_on && !*delay_off)
+		*delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
+
+	if (ORION_BLINK_HALF_PERIOD == *delay_on 
+	    && ORION_BLINK_HALF_PERIOD == *delay_off) {
+		orion_gpio_set_blink(gpio, 1);
+		return 0;
+	}
+
+	return -EINVAL;
+}
+
 static struct gpio_led_platform_data dns323_led_data = {
 	.num_leds	= ARRAY_SIZE(dns323_leds),
 	.leds		= dns323_leds,
+	.gpio_blink_set = dns323_gpio_blink_set,
 };
 
 static struct platform_device dns323_gpio_leds = {

