alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mark Brown <broonie@kernel.org>,
	alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	Vinod Koul <vinod.koul@intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/4] ASoC: Intel: hifi2: Replace custom implementation of readq / writeq
Date: Tue, 31 Jan 2017 16:14:23 +0200	[thread overview]
Message-ID: <20170131141425.35482-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20170131141425.35482-1-andriy.shevchenko@linux.intel.com>

The readq() and writeq() helpers are available in the
linux/io-64-nonatomic-hi-lo.h and linux/io-64-nonatomic-lo-hi.h headers.

Replace custom implementation by the generic helpers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/intel/atom/sst/sst.h     |  1 -
 sound/soc/intel/atom/sst/sst_pvt.c | 19 +++++--------------
 2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h
index 5c9a51cc77aa..c585b07925f8 100644
--- a/sound/soc/intel/atom/sst/sst.h
+++ b/sound/soc/intel/atom/sst/sst.h
@@ -536,7 +536,6 @@ void sst_add_to_dispatch_list_and_post(struct intel_sst_drv *sst,
 int sst_pm_runtime_put(struct intel_sst_drv *sst_drv);
 int sst_shim_write(void __iomem *addr, int offset, int value);
 u32 sst_shim_read(void __iomem *addr, int offset);
-u64 sst_reg_read64(void __iomem *addr, int offset);
 int sst_shim_write64(void __iomem *addr, int offset, u64 value);
 u64 sst_shim_read64(void __iomem *addr, int offset);
 void sst_set_fw_state_locked(
diff --git a/sound/soc/intel/atom/sst/sst_pvt.c b/sound/soc/intel/atom/sst/sst_pvt.c
index b1e6b8f34a6a..2452cbd77033 100644
--- a/sound/soc/intel/atom/sst/sst_pvt.c
+++ b/sound/soc/intel/atom/sst/sst_pvt.c
@@ -26,12 +26,15 @@
 #include <linux/pm_runtime.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
+#include <linux/io-64-nonatomic-lo-hi.h>
 #include <sound/asound.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/soc.h>
 #include <sound/compress_driver.h>
+
 #include <asm/platform_sst_audio.h>
+
 #include "../sst-mfld-platform.h"
 #include "sst.h"
 #include "../../common/sst-dsp.h"
@@ -47,27 +50,15 @@ u32 sst_shim_read(void __iomem *addr, int offset)
 	return readl(addr + offset);
 }
 
-u64 sst_reg_read64(void __iomem *addr, int offset)
-{
-	u64 val = 0;
-
-	memcpy_fromio(&val, addr + offset, sizeof(val));
-
-	return val;
-}
-
 int sst_shim_write64(void __iomem *addr, int offset, u64 value)
 {
-	memcpy_toio(addr + offset, &value, sizeof(value));
+	lo_hi_writeq(value, addr + offset);
 	return 0;
 }
 
 u64 sst_shim_read64(void __iomem *addr, int offset)
 {
-	u64 val = 0;
-
-	memcpy_fromio(&val, addr + offset, sizeof(val));
-	return val;
+	return lo_hi_readq(addr + offset);
 }
 
 void sst_set_fw_state_locked(
-- 
2.11.0

  reply	other threads:[~2017-01-31 14:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 14:14 [PATCH v1 1/4] ASoC: Intel: common: Replace custom implementation of readq / writeq Andy Shevchenko
2017-01-31 14:14 ` Andy Shevchenko [this message]
2017-01-31 14:14 ` [PATCH v1 3/4] ASoC: Intel: hifi2: Convert write()/write64() to return void Andy Shevchenko
2017-01-31 14:14 ` [PATCH v1 4/4] ASoC: Intel: hifi2: Get rid of snail address in comments Andy Shevchenko
2017-02-03 14:12 ` [PATCH v1 1/4] ASoC: Intel: common: Replace custom implementation of readq / writeq Liam Girdwood
2017-02-06 17:03 ` Vinod Koul
2017-02-08 11:59   ` Andy Shevchenko
2017-02-09  3:56     ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170131141425.35482-2-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).