From patchwork Thu Aug 27 12:09:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 7083431 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 04F309F22E for ; Thu, 27 Aug 2015 12:11:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 24C9020976 for ; Thu, 27 Aug 2015 12:11:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D52FB208F4 for ; Thu, 27 Aug 2015 12:11:12 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3D7E7260675; Thu, 27 Aug 2015 14:11:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 78DD22605BD; Thu, 27 Aug 2015 14:10:59 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 35D462605C7; Thu, 27 Aug 2015 14:10:57 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 5A8312605B6 for ; Thu, 27 Aug 2015 14:10:49 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 27 Aug 2015 05:09:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,422,1437462000"; d="scan'208";a="776695322" Received: from black.fi.intel.com ([10.237.72.157]) by fmsmga001.fm.intel.com with ESMTP; 27 Aug 2015 05:09:19 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EED9CB2; Thu, 27 Aug 2015 15:09:18 +0300 (EEST) From: Andy Shevchenko To: Jie Yang , Liam Girdwood , alsa-devel@alsa-project.org Date: Thu, 27 Aug 2015 15:09:18 +0300 Message-Id: <1440677358-6681-1-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.5.0 Cc: Andy Shevchenko Subject: [alsa-devel] [PATCH v1 1/1] sst: replace custom implementation of readq / writeq X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The readq() and writeq() helpers are available in the asm-generic/io-64-nonatomic-hi-lo.h and asm-generic/io-64-nonatomic-lo-hi.h headers. Replace custom implementation by the generic helpers. Signed-off-by: Andy Shevchenko Acked-by: Vinod Koul --- sound/soc/intel/atom/sst/sst_pvt.c | 16 ++++++---------- sound/soc/intel/common/sst-dsp.c | 9 ++++----- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/sound/soc/intel/atom/sst/sst_pvt.c b/sound/soc/intel/atom/sst/sst_pvt.c index adb32fe..6cc222d 100644 --- a/sound/soc/intel/atom/sst/sst_pvt.c +++ b/sound/soc/intel/atom/sst/sst_pvt.c @@ -31,7 +31,10 @@ #include #include #include + +#include #include + #include "../sst-mfld-platform.h" #include "sst.h" #include "../../common/sst-dsp.h" @@ -49,25 +52,18 @@ u32 sst_shim_read(void __iomem *addr, int offset) u64 sst_reg_read64(void __iomem *addr, int offset) { - u64 val = 0; - - memcpy_fromio(&val, addr + offset, sizeof(val)); - - return val; + return readq(addr + offset); } int sst_shim_write64(void __iomem *addr, int offset, u64 value) { - memcpy_toio(addr + offset, &value, sizeof(value)); + 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 readq(addr + offset); } void sst_set_fw_state_locked( diff --git a/sound/soc/intel/common/sst-dsp.c b/sound/soc/intel/common/sst-dsp.c index a627236..5274482 100644 --- a/sound/soc/intel/common/sst-dsp.c +++ b/sound/soc/intel/common/sst-dsp.c @@ -22,6 +22,8 @@ #include #include +#include + #include "sst-dsp.h" #include "sst-dsp-priv.h" @@ -43,16 +45,13 @@ EXPORT_SYMBOL_GPL(sst_shim32_read); void sst_shim32_write64(void __iomem *addr, u32 offset, u64 value) { - memcpy_toio(addr + offset, &value, sizeof(value)); + writeq(value, addr + offset); } EXPORT_SYMBOL_GPL(sst_shim32_write64); u64 sst_shim32_read64(void __iomem *addr, u32 offset) { - u64 val; - - memcpy_fromio(&val, addr + offset, sizeof(val)); - return val; + return readq(addr + offset); } EXPORT_SYMBOL_GPL(sst_shim32_read64);