From patchwork Tue Apr 15 17:37:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 28420 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4C2442036D for ; Tue, 15 Apr 2014 17:38:29 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id up15sf37133271pbc.10 for ; Tue, 15 Apr 2014 10:38:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=73Wfq6d1pjOjuO+2ZzL9C1AEPU2Q26Z8l3PRlcuKQt0=; b=IJCqQxFuhKY8K1R4nn//5s/PttE2nCyo6CDSGaEltRfOTeBV7CACOHxlTaUoVYdTF9 1knVSdla7yHh3QBfNBMKxxe/FcveASWgI7bYO8rgzAwZbZ3BqD4F9wcv+stW8NLxioiu IyslgHvsvC3VUOxygBpG67XycG2bMFzd0R27z/2PyT7qheO9h8j07Q0PV2zVbeBr3WeC Um17AEpXaj1iAu2TV7ttdwd5gIPodqCob/596p5ihUtRQ6UD/l+F6lCnjIUWKVz7ROgq O/52xWLKCiYlZENnkVxcUucwoMXq0g+3xHpa4U5iWfw6Yn8ei+7js0Cu0TSACCpvM1qa ousQ== X-Gm-Message-State: ALoCoQllYjPQ/rXBLf6TDFxyUEL84omAH4kKfyxkN8ESfI72xRxgtI7ORBO2rlyKKbTTEFP78Ie5 X-Received: by 10.66.122.70 with SMTP id lq6mr1305603pab.47.1397583508504; Tue, 15 Apr 2014 10:38:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.75 with SMTP id 69ls243307qgm.94.gmail; Tue, 15 Apr 2014 10:38:28 -0700 (PDT) X-Received: by 10.58.38.166 with SMTP id h6mr2277351vek.22.1397583508264; Tue, 15 Apr 2014 10:38:28 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id vg8si3538237veb.39.2014.04.15.10.38.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 10:38:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hu19so9630071vcb.15 for ; Tue, 15 Apr 2014 10:38:28 -0700 (PDT) X-Received: by 10.58.134.101 with SMTP id pj5mr997693veb.38.1397583508183; Tue, 15 Apr 2014 10:38:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp249661vcb; Tue, 15 Apr 2014 10:38:27 -0700 (PDT) X-Received: by 10.66.147.99 with SMTP id tj3mr3316695pab.47.1397583507397; Tue, 15 Apr 2014 10:38:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zm10si10372574pbc.318.2014.04.15.10.38.26; Tue, 15 Apr 2014 10:38:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754292AbaDORiN (ORCPT + 5 others); Tue, 15 Apr 2014 13:38:13 -0400 Received: from mail-ee0-f43.google.com ([74.125.83.43]:56807 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750990AbaDORiG (ORCPT ); Tue, 15 Apr 2014 13:38:06 -0400 Received: by mail-ee0-f43.google.com with SMTP id e53so7984238eek.2 for ; Tue, 15 Apr 2014 10:38:05 -0700 (PDT) X-Received: by 10.14.246.196 with SMTP id q44mr4204886eer.45.1397583485631; Tue, 15 Apr 2014 10:38:05 -0700 (PDT) Received: from uglx0153363.itg.ti.com ([195.238.92.128]) by mx.google.com with ESMTPSA id n41sm50741279eeg.4.2014.04.15.10.38.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 10:38:05 -0700 (PDT) From: Taras Kondratiuk To: Tony Lindgren Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Victor Kamensky , Taras Kondratiuk Subject: [RESEND PATCH 4/4] ARM: OMAP: debug-leds: raw read and write endian fix Date: Tue, 15 Apr 2014 20:37:49 +0300 Message-Id: <1397583469-14457-5-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397583469-14457-1-git-send-email-taras.kondratiuk@linaro.org> References: <1397583469-14457-1-git-send-email-taras.kondratiuk@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Victor Kamensky All OMAP IP blocks expect LE data, but CPU may operate in BE mode. Need to use endian neutral functions to read/write h/w registers. I.e instead of __raw_read[lw] and __raw_write[lw] functions code need to use read[lw]_relaxed and write[lw]_relaxed functions. If the first simply reads/writes register, the second will byteswap it if host operates in BE mode. Changes are trivial sed like replacement of __raw_xxx functions with xxx_relaxed variant. Signed-off-by: Victor Kamensky Signed-off-by: Taras Kondratiuk --- arch/arm/plat-omap/debug-leds.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c index aa7ebc6..48b69de 100644 --- a/arch/arm/plat-omap/debug-leds.c +++ b/arch/arm/plat-omap/debug-leds.c @@ -85,12 +85,12 @@ static void dbg_led_set(struct led_classdev *cdev, struct dbg_led *led = container_of(cdev, struct dbg_led, cdev); u16 reg; - reg = __raw_readw(&fpga->leds); + reg = readw_relaxed(&fpga->leds); if (b != LED_OFF) reg |= led->mask; else reg &= ~led->mask; - __raw_writew(reg, &fpga->leds); + writew_relaxed(reg, &fpga->leds); } static enum led_brightness dbg_led_get(struct led_classdev *cdev) @@ -98,7 +98,7 @@ static enum led_brightness dbg_led_get(struct led_classdev *cdev) struct dbg_led *led = container_of(cdev, struct dbg_led, cdev); u16 reg; - reg = __raw_readw(&fpga->leds); + reg = readw_relaxed(&fpga->leds); return (reg & led->mask) ? LED_FULL : LED_OFF; } @@ -112,7 +112,7 @@ static int fpga_probe(struct platform_device *pdev) return -ENODEV; fpga = ioremap(iomem->start, resource_size(iomem)); - __raw_writew(0xff, &fpga->leds); + writew_relaxed(0xff, &fpga->leds); for (i = 0; i < ARRAY_SIZE(dbg_leds); i++) { struct dbg_led *led; @@ -138,15 +138,15 @@ static int fpga_probe(struct platform_device *pdev) static int fpga_suspend_noirq(struct device *dev) { - fpga_led_state = __raw_readw(&fpga->leds); - __raw_writew(0xff, &fpga->leds); + fpga_led_state = readw_relaxed(&fpga->leds); + writew_relaxed(0xff, &fpga->leds); return 0; } static int fpga_resume_noirq(struct device *dev) { - __raw_writew(~fpga_led_state, &fpga->leds); + writew_relaxed(~fpga_led_state, &fpga->leds); return 0; }