]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mfd: intel-lpss: Use writeq() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 14 Sep 2015 08:32:48 +0000 (11:32 +0300)
committerLee Jones <lee.jones@linaro.org>
Mon, 26 Oct 2015 14:49:03 +0000 (14:49 +0000)
There are already helper functions to do 64-bit I/O on 32-bit machines, thus we
don't need to reinvent the wheel. In our case we can't use readq() / writeq()
even on 64-bit kernel since there is a hardware limitation (OCP bus is a 32-bit
bus).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/intel-lpss.c

index fdf4d5c1add24c74ce9fccbbd49fdf7910c3aa64..001a7d7708cee1ad84a53839c8c687582331e649 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/seq_file.h>
 
+#include <asm-generic/io-64-nonatomic-lo-hi.h>
+
 #include "intel-lpss.h"
 
 #define LPSS_DEV_OFFSET                0x000
@@ -52,8 +54,7 @@
 #define LPSS_PRIV_SSP_REG              0x20
 #define LPSS_PRIV_SSP_REG_DIS_DMA_FIN  BIT(0)
 
-#define LPSS_PRIV_REMAP_ADDR_LO                0x40
-#define LPSS_PRIV_REMAP_ADDR_HI                0x44
+#define LPSS_PRIV_REMAP_ADDR           0x40
 
 #define LPSS_PRIV_CAPS                 0xfc
 #define LPSS_PRIV_CAPS_NO_IDMA         BIT(8)
@@ -250,12 +251,7 @@ static void intel_lpss_set_remap_addr(const struct intel_lpss *lpss)
 {
        resource_size_t addr = lpss->info->mem->start;
 
-       writel(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR_LO);
-#if BITS_PER_LONG > 32
-       writel(addr >> 32, lpss->priv + LPSS_PRIV_REMAP_ADDR_HI);
-#else
-       writel(0, lpss->priv + LPSS_PRIV_REMAP_ADDR_HI);
-#endif
+       lo_hi_writeq(addr, lpss->priv + LPSS_PRIV_REMAP_ADDR);
 }
 
 static void intel_lpss_deassert_reset(const struct intel_lpss *lpss)