From b5ee9002583fc14e6d45a04c18f208987a8fbced Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 5 Sep 2008 21:53:30 -0400 Subject: [ARM] remove a common set of __virt_to_bus definitions Let's provide an overridable default instead of having every machine class define __virt_to_bus and __bus_to_virt to the same thing. What most platforms are using is bus_addr == phys_addr so such is the default. One exception is ebsa110 which has no DMA what so ever, so the actual definition is not important except only for proper compilation. Also added a comment about the special footbridge bus translation. Let's also remove comments alluding to set_dma_addr which is not (and should not) be commonly used. Signed-off-by: Nicolas Pitre Signed-off-by: Russell King --- arch/arm/mach-ks8695/include/mach/memory.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch/arm/mach-ks8695/include') diff --git a/arch/arm/mach-ks8695/include/mach/memory.h b/arch/arm/mach-ks8695/include/mach/memory.h index 8fbc4c76c38b..6d5887cf5742 100644 --- a/arch/arm/mach-ks8695/include/mach/memory.h +++ b/arch/arm/mach-ks8695/include/mach/memory.h @@ -37,11 +37,6 @@ extern struct bus_type platform_bus_type; (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); }) #define __arch_page_to_dma(dev, x) __arch_virt_to_dma(dev, page_address(x)) -#else - -#define __virt_to_bus(x) __virt_to_phys(x) -#define __bus_to_virt(x) __phys_to_virt(x) - #endif #endif -- cgit v1.2.1 From dcea83adc666061864b82c96e059dffe7268b512 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 29 Nov 2008 11:40:28 +0000 Subject: [ARM] Hide ISA DMA API when ISA_DMA_API is unset When ISA_DMA_API is unset, we're not implementing the ISA DMA API, so there's no point in publishing the prototypes via asm/dma.h, nor including the machine dependent parts of that API. This allows us to remove a lot of mach/dma.h files which don't contain any useful code. Unfortunately though, some platforms put their own private non-ISA definitions into mach/dma.h, so we leave these behind and fix the appropriate #include statments. Signed-off-by: Russell King --- arch/arm/mach-ks8695/include/mach/dma.h | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 arch/arm/mach-ks8695/include/mach/dma.h (limited to 'arch/arm/mach-ks8695/include') diff --git a/arch/arm/mach-ks8695/include/mach/dma.h b/arch/arm/mach-ks8695/include/mach/dma.h deleted file mode 100644 index 561206280089..000000000000 --- a/arch/arm/mach-ks8695/include/mach/dma.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * arch/arm/mach-ks8695/include/mach/dma.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -- cgit v1.2.1 From 0560cf5aa51216b06874333a2fa26ca034d97bdb Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 30 Nov 2008 11:45:54 +0000 Subject: [ARM] Add a common typesafe __io implementation As Al did for Versatile in 2ad4f86b60b649fd7428265c08d73a3bd360c81b, add a typesafe __io implementation for platforms to use. Convert platforms to use this new simple typesafe implementation. Signed-off-by: Russell King --- arch/arm/mach-ks8695/include/mach/io.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-ks8695/include') diff --git a/arch/arm/mach-ks8695/include/mach/io.h b/arch/arm/mach-ks8695/include/mach/io.h index f364f24ffe1e..a7a63ac3ba4e 100644 --- a/arch/arm/mach-ks8695/include/mach/io.h +++ b/arch/arm/mach-ks8695/include/mach/io.h @@ -13,7 +13,7 @@ #define IO_SPACE_LIMIT 0xffffffff -#define __io(a) ((void __iomem *)(a)) -#define __mem_pci(a) (a) +#define __io(a) __typesafe_io(a) +#define __mem_pci(a) (a) #endif -- cgit v1.2.1 From 72880ad866c21badace4d8026c1e58f2fde087fb Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 13 Dec 2008 20:44:12 +0000 Subject: [ARM] KS8695: Fixup the KS8695 GPIO to be GPIOLIB This patch is as small a change as possible to the KS8695 GPIO layer to use GPIOLIB to allow the generic GPIO expanders and the like to be compiled. As a side-effect, we also remove __init_or_module from several functions which could be called by drivers such as i2c-gpio which could plausibly be compiled into a non-modular kernel. Signed-off-by: Daniel Silverstone Signed-off-by: Vincent Sanders Signed-off-by: Ben Dooks --- arch/arm/mach-ks8695/include/mach/gpio.h | 45 +++++++++----------------------- 1 file changed, 12 insertions(+), 33 deletions(-) (limited to 'arch/arm/mach-ks8695/include') diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index d4af5c335f16..6379f2fe843d 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h @@ -30,53 +30,32 @@ #define KS8695_GPIO_14 14 #define KS8695_GPIO_15 15 - /* * Configure GPIO pin as external interrupt source. */ -int __init_or_module ks8695_gpio_interrupt(unsigned int pin, unsigned int type); - -/* - * Configure the GPIO line as an input. - */ -int __init_or_module gpio_direction_input(unsigned int pin); - -/* - * Configure the GPIO line as an output, with default state. - */ -int __init_or_module gpio_direction_output(unsigned int pin, unsigned int state); - -/* - * Set the state of an output GPIO line. - */ -void gpio_set_value(unsigned int pin, unsigned int state); - -/* - * Read the state of a GPIO line. - */ -int gpio_get_value(unsigned int pin); +extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); /* * Map GPIO line to IRQ number. */ -int gpio_to_irq(unsigned int pin); +extern int gpio_to_irq(unsigned int pin); /* * Map IRQ number to GPIO line. */ -int irq_to_gpio(unsigned int irq); - +extern int irq_to_gpio(unsigned int irq); #include -static inline int gpio_request(unsigned int pin, const char *label) -{ - return 0; -} +/* If it turns out that we need to optimise GPIO access for the + * Micrel's GPIOs, then these can be changed to check their argument + * directly as static inlines. However for now it's probably not + * worthwhile. + */ +#define gpio_get_value __gpio_get_value +#define gpio_set_value __gpio_set_value -static inline void gpio_free(unsigned int pin) -{ - might_sleep(); -} +/* Register the GPIOs */ +extern void ks8695_register_gpios(void); #endif -- cgit v1.2.1 From 7ef71320eba8933275be10bfa44e083bec95b3f1 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Sat, 13 Dec 2008 20:44:13 +0000 Subject: [ARM] KS8695: Add GPIO to IRQ mapping function Use the GPIOlib .to_irq call to map KS8695 GPIOs to the relevant IRQ line. Signed-off-by: Ben Dooks --- arch/arm/mach-ks8695/include/mach/gpio.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'arch/arm/mach-ks8695/include') diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h index 6379f2fe843d..86312d476bc6 100644 --- a/arch/arm/mach-ks8695/include/mach/gpio.h +++ b/arch/arm/mach-ks8695/include/mach/gpio.h @@ -35,11 +35,6 @@ */ extern int ks8695_gpio_interrupt(unsigned int pin, unsigned int type); -/* - * Map GPIO line to IRQ number. - */ -extern int gpio_to_irq(unsigned int pin); - /* * Map IRQ number to GPIO line. */ @@ -54,6 +49,7 @@ extern int irq_to_gpio(unsigned int irq); */ #define gpio_get_value __gpio_get_value #define gpio_set_value __gpio_set_value +#define gpio_to_irq __gpio_to_irq /* Register the GPIOs */ extern void ks8695_register_gpios(void); -- cgit v1.2.1