From patchwork Fri Aug 28 19:21:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 7093521 Return-Path: X-Original-To: patchwork-linux-arm@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 D28719F46B for ; Fri, 28 Aug 2015 19:24:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FD5D209B7 for ; Fri, 28 Aug 2015 19:24:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 37EA1209BB for ; Fri, 28 Aug 2015 19:24:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZVPDz-00027l-1v; Fri, 28 Aug 2015 19:22:07 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZVPDw-000230-Ju for linux-arm-kernel@lists.infradead.org; Fri, 28 Aug 2015 19:22:05 +0000 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 2D4BB1414B7; Fri, 28 Aug 2015 19:21:44 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 158C91414B9; Fri, 28 Aug 2015 19:21:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from sboyd-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sboyd@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 14E391414B7; Fri, 28 Aug 2015 19:21:43 +0000 (UTC) From: Stephen Boyd To: Greg Kroah-Hartman Subject: [PATCH] spmi: pmic-arb: Don't byte swap when reading/writing FIFO Date: Fri, 28 Aug 2015 12:21:42 -0700 Message-Id: <1440789702-1648-1-git-send-email-sboyd@codeaurora.org> X-Mailer: git-send-email 2.3.0.rc1.33.g42e4583 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150828_122204_785092_5280F66A X-CRM114-Status: GOOD ( 13.73 ) X-Spam-Score: -4.0 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andy Gross MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We don't want to swap bytes that we're reading and writing to the FIFOs when we're running on a big-endian CPU. Doing so causes problems like where the qcom-spmi-iadc driver can't detect the type of device because the bytes are all mixed up. Use the raw IO accessors for these API instead, and collapse pmic_arb_base_read() into the byte reading API so that we aren't tempted to read non-FIFO data like commands with that function. Cc: Andy Gross Cc: Bjorn Andersson Signed-off-by: Stephen Boyd Acked-by: Bjorn Andersson --- drivers/spmi/spmi-pmic-arb.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index bdfb3c84c3cb..5e834bd23c09 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c @@ -168,11 +168,6 @@ struct pmic_arb_ver_ops { u32 (*irq_clear)(u8 n); }; -static inline u32 pmic_arb_base_read(struct spmi_pmic_arb_dev *dev, u32 offset) -{ - return readl_relaxed(dev->rd_base + offset); -} - static inline void pmic_arb_base_write(struct spmi_pmic_arb_dev *dev, u32 offset, u32 val) { @@ -193,7 +188,7 @@ static inline void pmic_arb_set_rd_cmd(struct spmi_pmic_arb_dev *dev, */ static void pa_read_data(struct spmi_pmic_arb_dev *dev, u8 *buf, u32 reg, u8 bc) { - u32 data = pmic_arb_base_read(dev, reg); + u32 data = __raw_readl(dev->rd_base + reg); memcpy(buf, &data, (bc & 3) + 1); } @@ -208,7 +203,7 @@ pa_write_data(struct spmi_pmic_arb_dev *dev, const u8 *buf, u32 reg, u8 bc) { u32 data = 0; memcpy(&data, buf, (bc & 3) + 1); - pmic_arb_base_write(dev, reg, data); + __raw_writel(data, dev->wr_base + reg); } static int pmic_arb_wait_for_done(struct spmi_controller *ctrl,