leds: bcm6328: add little endian support
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Tue, 15 Dec 2015 20:03:49 +0000 (21:03 +0100)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Mon, 4 Jan 2016 08:57:40 +0000 (09:57 +0100)
This adds little endian support while keeping big endian support.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
drivers/leds/leds-bcm6328.c

index cd542641e38d6f31b41d6d08d39e5a2fadf21780..e13daa2f31fb730a2fbaf0fbc7242596dd7bd86f 100644 (file)
@@ -76,12 +76,20 @@ struct bcm6328_led {
 
 static void bcm6328_led_write(void __iomem *reg, unsigned long data)
 {
+#ifdef CONFIG_CPU_BIG_ENDIAN
        iowrite32be(data, reg);
+#else
+       writel(data, reg);
+#endif
 }
 
 static unsigned long bcm6328_led_read(void __iomem *reg)
 {
+#ifdef CONFIG_CPU_BIG_ENDIAN
        return ioread32be(reg);
+#else
+       return readl(reg);
+#endif
 }
 
 /**