From a06cd4b76277bd319d65646481cb61aa3fd89b3b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 15 Dec 2015 21:03:49 +0100 Subject: [PATCH] leds: bcm6328: add little endian support MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This adds little endian support while keeping big endian support. Signed-off-by: Álvaro Fernández Rojas Signed-off-by: Jacek Anaszewski --- drivers/leds/leds-bcm6328.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/leds/leds-bcm6328.c b/drivers/leds/leds-bcm6328.c index cd542641e38d..e13daa2f31fb 100644 --- a/drivers/leds/leds-bcm6328.c +++ b/drivers/leds/leds-bcm6328.c @@ -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 } /** -- 2.20.1