From patchwork Wed Apr 7 16:03:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 91083 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o37G5qBK005807 for ; Wed, 7 Apr 2010 16:05:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932901Ab0DGQFu (ORCPT ); Wed, 7 Apr 2010 12:05:50 -0400 Received: from smtp.nokia.com ([192.100.122.233]:42743 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932803Ab0DGQFS (ORCPT ); Wed, 7 Apr 2010 12:05:18 -0400 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o37G598u030675 for ; Wed, 7 Apr 2010 19:05:15 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Apr 2010 19:04:42 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 7 Apr 2010 19:04:41 +0300 Received: from localhost.localdomain (esdhcp04088.research.nokia.com [172.21.40.88]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o37G4YMj015130; Wed, 7 Apr 2010 19:04:37 +0300 From: felipe.balbi@nokia.com To: Linux OMAP Mailing List Cc: Felipe Balbi Subject: [RFC PATCH 01/37] cbus: convert u32 base to void __iomem *base Date: Wed, 7 Apr 2010 19:03:52 +0300 Message-Id: <1270656268-7034-2-git-send-email-felipe.balbi@nokia.com> X-Mailer: git-send-email 1.7.0.rc0.33.g7c3932 In-Reply-To: <1270656268-7034-1-git-send-email-felipe.balbi@nokia.com> References: <1270656268-7034-1-git-send-email-felipe.balbi@nokia.com> X-OriginalArrivalTime: 07 Apr 2010 16:04:41.0797 (UTC) FILETIME=[08534F50:01CAD66C] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 07 Apr 2010 16:05:52 +0000 (UTC) diff --git a/drivers/cbus/cbus.c b/drivers/cbus/cbus.c index 00c3c32..c0b4248 100644 --- a/drivers/cbus/cbus.c +++ b/drivers/cbus/cbus.c @@ -45,7 +45,8 @@ EXPORT_SYMBOL(cbus_host); #ifdef CONFIG_ARCH_OMAP1 /* We use our own MPUIO functions to get closer to 1MHz bus speed */ -static inline void cbus_set_gpio_direction(u32 base, int mpuio, int is_input) +static inline void cbus_set_gpio_direction(void __iomem *base, + int mpuio, int is_input) { u16 w; @@ -59,7 +60,8 @@ static inline void cbus_set_gpio_direction(u32 base, int mpuio, int is_input) } -static inline void cbus_set_gpio_dataout(u32 base, int mpuio, int enable) +static inline void cbus_set_gpio_dataout(void __iomem *base, + int mpuio, int enable) { u16 w; @@ -72,14 +74,14 @@ static inline void cbus_set_gpio_dataout(u32 base, int mpuio, int enable) __raw_writew(w, base + OMAP_MPUIO_OUTPUT); } -static inline int cbus_get_gpio_datain(u32 base, int mpuio) +static inline int cbus_get_gpio_datain(void __iomem *base, int mpuio) { mpuio &= 0x0f; return (__raw_readw(base + OMAP_MPUIO_INPUT_LATCH) & (1 << mpuio)) != 0; } -static void cbus_send_bit(struct cbus_host *host, u32 base, int bit, +static void cbus_send_bit(struct cbus_host *host, void __iomem *base, int bit, int set_to_input) { cbus_set_gpio_dataout(base, host->dat_gpio, bit ? 1 : 0); @@ -92,7 +94,7 @@ static void cbus_send_bit(struct cbus_host *host, u32 base, int bit, cbus_set_gpio_dataout(base, host->clk_gpio, 0); } -static u8 cbus_receive_bit(struct cbus_host *host, u32 base) +static u8 cbus_receive_bit(struct cbus_host *host, void __iomem *base) { u8 ret; @@ -144,12 +146,12 @@ static int cbus_transfer(struct cbus_host *host, int dev, int reg, int data) int i; int is_read = 0; unsigned long flags; - u32 base; + void __iomem *base; #ifdef CONFIG_ARCH_OMAP1 base = OMAP1_IO_ADDRESS(OMAP1_MPUIO_BASE); #else - base = 0; + base = NULL; #endif if (data < 0) diff --git a/drivers/cbus/cbus.h b/drivers/cbus/cbus.h index 957224c..90c7617 100644 --- a/drivers/cbus/cbus.h +++ b/drivers/cbus/cbus.h @@ -24,8 +24,14 @@ #define __DRIVERS_CBUS_CBUS_H struct cbus_host { - int clk_gpio, dat_gpio, sel_gpio; - spinlock_t lock; + /* host lock */ + spinlock_t lock; + + void __iomem *base; + + int clk_gpio; + int dat_gpio; + int sel_gpio; }; extern struct cbus_host *cbus_host;