From 78a56aab11234e53b7e94e5a255cc3d27ab0a62b Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Thu, 18 Jan 2007 00:44:09 -0500 Subject: Input: gpio-keys - keyboard driver for GPIO buttons This is an interrupt-driven keyboard driver for simple buttons connected directly to CPU GPIO lines of embedded ARM systems. It supports pxa architectures and is used by a number of PDAs and PocketPC phones in the handhelds.org kernel. Support for other architectures, such as sa11xx and sc2410, will be added once generic GPIO API is available. Signed-off-by: Paul Sokolovsky Signed-off-by: Philipp Zabel Signed-off-by: Dmitry Torokhov --- include/asm-arm/hardware/gpio_keys.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 include/asm-arm/hardware/gpio_keys.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/hardware/gpio_keys.h b/include/asm-arm/hardware/gpio_keys.h new file mode 100644 index 00000000000..2b217c7b931 --- /dev/null +++ b/include/asm-arm/hardware/gpio_keys.h @@ -0,0 +1,17 @@ +#ifndef _GPIO_KEYS_H +#define _GPIO_KEYS_H + +struct gpio_keys_button { + /* Configuration parameters */ + int keycode; + int gpio; + int active_low; + char *desc; +}; + +struct gpio_keys_platform_data { + struct gpio_keys_button *buttons; + int nbuttons; +}; + +#endif -- cgit v1.2.3 From 75e7153abd220f1c4a731a9613fb705485b56aa8 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Fri, 9 Feb 2007 17:08:58 +0000 Subject: [APM] ARM: Convert to use shared APM emulation. Signed-off-by: Ralf Baechle --- include/asm-arm/apm.h | 64 --------------------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 include/asm-arm/apm.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/apm.h b/include/asm-arm/apm.h deleted file mode 100644 index d09113b37e4..00000000000 --- a/include/asm-arm/apm.h +++ /dev/null @@ -1,64 +0,0 @@ -/* -*- linux-c -*- - * - * (C) 2003 zecke@handhelds.org - * - * GPL version 2 - * - * based on arch/arm/kernel/apm.c - * factor out the information needed by architectures to provide - * apm status - * - * - */ -#ifndef ARM_ASM_SA1100_APM_H -#define ARM_ASM_SA1100_APM_H - -#include - -/* - * This structure gets filled in by the machine specific 'get_power_status' - * implementation. Any fields which are not set default to a safe value. - */ -struct apm_power_info { - unsigned char ac_line_status; -#define APM_AC_OFFLINE 0 -#define APM_AC_ONLINE 1 -#define APM_AC_BACKUP 2 -#define APM_AC_UNKNOWN 0xff - - unsigned char battery_status; -#define APM_BATTERY_STATUS_HIGH 0 -#define APM_BATTERY_STATUS_LOW 1 -#define APM_BATTERY_STATUS_CRITICAL 2 -#define APM_BATTERY_STATUS_CHARGING 3 -#define APM_BATTERY_STATUS_NOT_PRESENT 4 -#define APM_BATTERY_STATUS_UNKNOWN 0xff - - unsigned char battery_flag; -#define APM_BATTERY_FLAG_HIGH (1 << 0) -#define APM_BATTERY_FLAG_LOW (1 << 1) -#define APM_BATTERY_FLAG_CRITICAL (1 << 2) -#define APM_BATTERY_FLAG_CHARGING (1 << 3) -#define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7) -#define APM_BATTERY_FLAG_UNKNOWN 0xff - - int battery_life; - int time; - int units; -#define APM_UNITS_MINS 0 -#define APM_UNITS_SECS 1 -#define APM_UNITS_UNKNOWN -1 - -}; - -/* - * This allows machines to provide their own "apm get power status" function. - */ -extern void (*apm_get_power_status)(struct apm_power_info *); - -/* - * Queue an event (APM_SYS_SUSPEND or APM_CRITICAL_SUSPEND) - */ -void apm_queue_event(apm_event_t event); - -#endif -- cgit v1.2.3 From 4ec031166f6a466a443f462e567f7551096b1741 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 9 Feb 2007 16:38:30 +0000 Subject: [PATCH] kill eth_io_copy_and_sum() On all targets that sucker boils down to memcpy_fromio(sbk->data, from, len). The function name is highly misguiding (it _never_ does any checksums), the last argument is just a noise and simply expanding the call to memcpy_fromio() gives shorter and more readable source. For a lot of reasons it has almost no remaining users, so it's better to just outright kill it. Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- include/asm-arm/arch-ixp4xx/io.h | 3 --- include/asm-arm/io.h | 5 ----- 2 files changed, 8 deletions(-) (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h index 0d517267fb6..b7b5414d932 100644 --- a/include/asm-arm/arch-ixp4xx/io.h +++ b/include/asm-arm/arch-ixp4xx/io.h @@ -238,9 +238,6 @@ __ixp4xx_readsl(const volatile void __iomem *bus_addr, u32 *vaddr, u32 count) #define memcpy_fromio(a,c,l) _memcpy_fromio((a),(c),(l)) #define memcpy_toio(c,a,l) _memcpy_toio((c),(a),(l)) -#define eth_io_copy_and_sum(s,c,l,b) \ - eth_copy_and_sum((s),__mem_pci(c),(l),(b)) - static inline int check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature, int length) diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 288f76b166d..5f60b422090 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -182,9 +182,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t); #define memcpy_fromio(a,c,l) _memcpy_fromio((a),__mem_pci(c),(l)) #define memcpy_toio(c,a,l) _memcpy_toio(__mem_pci(c),(a),(l)) -#define eth_io_copy_and_sum(s,c,l,b) \ - eth_copy_and_sum((s),__mem_pci(c),(l),(b)) - #elif !defined(readb) #define readb(c) (__readwrite_bug("readb"),0) @@ -194,8 +191,6 @@ extern void _memset_io(volatile void __iomem *, int, size_t); #define writew(v,c) __readwrite_bug("writew") #define writel(v,c) __readwrite_bug("writel") -#define eth_io_copy_and_sum(s,c,l,b) __readwrite_bug("eth_io_copy_and_sum") - #define check_signature(io,sig,len) (0) #endif /* __mem_pci */ -- cgit v1.2.3 From 4564f9e5fd00767d11fcf61e0d52787706dfcc87 Mon Sep 17 00:00:00 2001 From: Tilman Schmidt Date: Sat, 10 Feb 2007 01:45:00 -0800 Subject: [PATCH] consolidate line discipline number definitions The line discipline numbers N_* are currently defined for each architecture individually, but (except for a seeming mistake) identically, in asm/termios.h. There is no obvious reason why these numbers should be architecture specific, nor any apparent relationship with the termios structure. The total number of these, NR_LDISCS, is defined in linux/tty.h anyway. So I propose the following patch which moves the definitions of the individual line disciplines to linux/tty.h too. Three of these numbers (N_MASC, N_PROFIBUS_FDL, and N_SMSBLOCK) are unused in the current kernel, but the patch still keeps the complete set in case there are plans to use them yet. Signed-off-by: Tilman Schmidt Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/termios.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'include/asm-arm') diff --git a/include/asm-arm/termios.h b/include/asm-arm/termios.h index 7b8f5e8ae06..329c324c404 100644 --- a/include/asm-arm/termios.h +++ b/include/asm-arm/termios.h @@ -49,24 +49,6 @@ struct termio { /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -/* line disciplines */ -#define N_TTY 0 -#define N_SLIP 1 -#define N_MOUSE 2 -#define N_PPP 3 -#define N_STRIP 4 -#define N_AX25 5 -#define N_X25 6 /* X.25 async */ -#define N_6PACK 7 -#define N_MASC 8 /* Reserved for Mobitex module */ -#define N_R3964 9 /* Reserved for Simatic R3964 module */ -#define N_PROFIBUS_FDL 10 /* Reserved for Profibus */ -#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ -#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ -#define N_HDLC 13 /* synchronous HDLC */ -#define N_SYNC_PPP 14 -#define N_HCI 15 /* Bluetooth HCI UART */ - #ifdef __KERNEL__ /* -- cgit v1.2.3 From 16cf5b39b81b95d1e3d81df3ba8c82cadf54f551 Mon Sep 17 00:00:00 2001 From: Tilman Schmidt Date: Sat, 10 Feb 2007 01:45:41 -0800 Subject: [PATCH] fix sparse warnings from {asm,net}/checksum.h Rename the variable "sum" in the __range_ok macros to avoid name collisions causing lots of "symbol shadows an earlier one" warnings by sparse. Signed-off-by: Tilman Schmidt Cc: Russell King Cc: Andi Kleen Cc: Hirokazu Takata Acked-by: Ian Molton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/asm-arm') diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index 5f420a0149f..c92df958802 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h @@ -76,10 +76,10 @@ static inline void set_fs(mm_segment_t fs) /* We use 33-bit arithmetic here... */ #define __range_ok(addr,size) ({ \ - unsigned long flag, sum; \ + unsigned long flag, roksum; \ __chk_user_ptr(addr); \ __asm__("adds %1, %2, %3; sbcccs %1, %1, %0; movcc %0, #0" \ - : "=&r" (flag), "=&r" (sum) \ + : "=&r" (flag), "=&r" (roksum) \ : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \ : "cc"); \ flag; }) -- cgit v1.2.3 From c530cba649692512070e8c0131ba3eccade09269 Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Sat, 10 Feb 2007 01:46:17 -0800 Subject: [PATCH] Remove the last reference to rwlock_is_locked() macro. Remove the lone, remaining reference to the long-deceased rwlock_is_locked() macro. Signed-off-by: Robert P. J. Day Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/spinlock.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/asm-arm') diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h index 861092fbaa5..800ba5254da 100644 --- a/include/asm-arm/spinlock.h +++ b/include/asm-arm/spinlock.h @@ -85,7 +85,6 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) * Write locks are easy - we just set bit 31. When unlocking, we can * just write zero since the lock is exclusively held. */ -#define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0) static inline void __raw_write_lock(raw_rwlock_t *rw) { -- cgit v1.2.3 From 69c202afa8ad6d6c1c673d8f9d47b43a0a3604e5 Mon Sep 17 00:00:00 2001 From: Andrea Paterniani Date: Mon, 12 Feb 2007 00:52:39 -0800 Subject: [PATCH] SPI: Freescale iMX SPI controller driver (BIS+) Add the SPI controller driver for Freescale i.MX(S/L/1). Main features summary: > Per chip setup via board specific code and/or protocol driver. > Per transfer setup. > PIO transfers. > DMA transfers. > Managing of NULL tx / rx buffer for rd only / wr only transfers. This patch replace patch-2.6.20-rc4-spi_imx with the following changes: > Few cosmetic changes. > Function map_dma_buffers now return 0 for success and -1 for failure. > Solved a bug inside spi_imx_probe function (wrong error path). > Solved a bug inside setup function (bad undo setup for max_speed_hz). > For read-only transfers, always write zero bytes. This is almost the same as the 'BIS' version sent by Andrea, except for updating the 'DUMMY' byte so that read-only transfers shift out zeroes. That part of the API changed recently, since some half duplex peripheral chips require that semantic. Signed-off-by: Andrea Paterniani Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-imx/spi_imx.h | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 include/asm-arm/arch-imx/spi_imx.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-imx/spi_imx.h b/include/asm-arm/arch-imx/spi_imx.h new file mode 100644 index 00000000000..2165449e976 --- /dev/null +++ b/include/asm-arm/arch-imx/spi_imx.h @@ -0,0 +1,72 @@ +/* + * include/asm-arm/arch-imx/spi_imx.h + * + * Copyright (C) 2006 SWAPP + * Andrea Paterniani + * + * Initial version inspired by: + * linux-2.6.17-rc3-mm1/include/asm-arm/arch-pxa/pxa2xx_spi.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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef SPI_IMX_H_ +#define SPI_IMX_H_ + + +/*-------------------------------------------------------------------------*/ +/** + * struct spi_imx_master - device.platform_data for SPI controller devices. + * @num_chipselect: chipselects are used to distinguish individual + * SPI slaves, and are numbered from zero to num_chipselects - 1. + * each slave has a chipselect signal, but it's common that not + * every chipselect is connected to a slave. + * @enable_dma: if true enables DMA driven transfers. +*/ +struct spi_imx_master { + u8 num_chipselect; + u8 enable_dma:1; +}; +/*-------------------------------------------------------------------------*/ + + +/*-------------------------------------------------------------------------*/ +/** + * struct spi_imx_chip - spi_board_info.controller_data for SPI + * slave devices, copied to spi_device.controller_data. + * @enable_loopback : used for test purpouse to internally connect RX and TX + * sections. + * @enable_dma : enables dma transfer (provided that controller driver has + * dma enabled too). + * @ins_ss_pulse : enable /SS pulse insertion between SPI burst. + * @bclk_wait : number of bclk waits between each bits_per_word SPI burst. + * @cs_control : function pointer to board-specific function to assert/deassert + * I/O port to control HW generation of devices chip-select. +*/ +struct spi_imx_chip { + u8 enable_loopback:1; + u8 enable_dma:1; + u8 ins_ss_pulse:1; + u16 bclk_wait:15; + void (*cs_control)(u32 control); +}; + +/* Chip-select state */ +#define SPI_CS_ASSERT (1 << 0) +#define SPI_CS_DEASSERT (1 << 1) +/*-------------------------------------------------------------------------*/ + + +#endif /* SPI_IMX_H_*/ -- cgit v1.2.3 From 4c20386c8d0719b42503efe65abe47ad3fb3d711 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 12 Feb 2007 00:53:11 -0800 Subject: [PATCH] GPIO core This defines a simple and minimalist programming interface for GPIO APIs: - Documentation/gpio.txt ... describes things (read it) - include/asm-arm/gpio.h ... defines the ARM hook, which just punts to for any implementation - include/asm-generic/gpio.h ... implement "can sleep" variants as calling the normal ones, for systems that don't handle i2c expanders. The immediate need for such a cross-architecture API convention is to support drivers that work the same on AT91 ARM and AVR32 AP7000 chips, which embed many of the same controllers but have different CPUs. However, several other users have been reported, including a driver for a hardware watchdog chip and some handhelds.org multi-CPU button drivers. Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/gpio.h | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 include/asm-arm/gpio.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/gpio.h b/include/asm-arm/gpio.h new file mode 100644 index 00000000000..fff4f800ee4 --- /dev/null +++ b/include/asm-arm/gpio.h @@ -0,0 +1,7 @@ +#ifndef _ARCH_ARM_GPIO_H +#define _ARCH_ARM_GPIO_H + +/* not all ARM platforms necessarily support this API ... */ +#include + +#endif /* _ARCH_ARM_GPIO_H */ -- cgit v1.2.3 From 3c729f1ecd23b86a2d6b211d646f57f9da8dfeb1 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 12 Feb 2007 00:53:12 -0800 Subject: [PATCH] OMAP GPIO wrappers This teaches OMAP how to implement the cross-platform GPIO interfaces. [akpm@osdl.org: cleanups] Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-omap/gpio.h | 66 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h index f486b72070e..3762a6ae6a7 100644 --- a/include/asm-arm/arch-omap/gpio.h +++ b/include/asm-arm/arch-omap/gpio.h @@ -76,4 +76,70 @@ extern void omap_set_gpio_direction(int gpio, int is_input); extern void omap_set_gpio_dataout(int gpio, int enable); extern int omap_get_gpio_datain(int gpio); +/*-------------------------------------------------------------------------*/ + +/* wrappers for "new style" GPIO calls. the old OMAP-specfic ones should + * eventually be removed (along with this errno.h inclusion), and maybe + * gpios should put MPUIOs last too. + */ + +#include + +static inline int gpio_request(unsigned gpio, const char *label) +{ + return omap_request_gpio(gpio); +} + +static inline void gpio_free(unsigned gpio) +{ + omap_free_gpio(gpio); +} + +static inline int __gpio_set_direction(unsigned gpio, int is_input) +{ + if (cpu_class_is_omap2()) { + if (gpio > OMAP_MAX_GPIO_LINES) + return -EINVAL; + } else { + if (gpio > (OMAP_MAX_GPIO_LINES + 16 /* MPUIO */)) + return -EINVAL; + } + omap_set_gpio_direction(gpio, is_input); + return 0; +} + +static inline int gpio_direction_input(unsigned gpio) +{ + return __gpio_set_direction(gpio, 1); +} + +static inline int gpio_direction_output(unsigned gpio) +{ + return __gpio_set_direction(gpio, 0); +} + +static inline int gpio_get_value(unsigned gpio) +{ + return omap_get_gpio_datain(gpio); +} + +static inline void gpio_set_value(unsigned gpio, int value) +{ + omap_set_gpio_dataout(gpio, value); +} + +#include /* cansleep wrappers */ + +static inline int gpio_to_irq(unsigned gpio) +{ + return OMAP_GPIO_IRQ(gpio); +} + +static inline int irq_to_gpio(unsigned irq) +{ + if (cpu_class_is_omap1() && (irq < (IH_MPUIO_BASE + 16))) + return (irq - IH_MPUIO_BASE) + OMAP_MAX_GPIO_LINES; + return irq - IH_GPIO_BASE; +} + #endif -- cgit v1.2.3 From a31c4eea2127ee52b5c7c1befada4664963ad030 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 12 Feb 2007 00:53:13 -0800 Subject: [PATCH] AT91 GPIO wrappers This is a first cut at making the AT91 code use the generic GPIO calls. Note that the original AT91 GPIO calls merged the "mux pin as GPIO" and "set GPIO direction" functionality into one API call, contrary to what's specified as a cross-platform portable model. So this involved a few non-inlinable functions. [akpm@osdl.org: cleanups] Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-at91rm9200/gpio.h | 48 ++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-at91rm9200/gpio.h b/include/asm-arm/arch-at91rm9200/gpio.h index a011d27876a..e09d6528fad 100644 --- a/include/asm-arm/arch-at91rm9200/gpio.h +++ b/include/asm-arm/arch-at91rm9200/gpio.h @@ -179,6 +179,7 @@ #ifndef __ASSEMBLY__ /* setup setup routines, called from board init or driver probe() */ +extern int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup); extern int __init_or_module at91_set_A_periph(unsigned pin, int use_pullup); extern int __init_or_module at91_set_B_periph(unsigned pin, int use_pullup); extern int __init_or_module at91_set_gpio_input(unsigned pin, int use_pullup); @@ -193,7 +194,50 @@ extern int at91_get_gpio_value(unsigned pin); /* callable only from core power-management code */ extern void at91_gpio_suspend(void); extern void at91_gpio_resume(void); -#endif -#endif +/*-------------------------------------------------------------------------*/ + +/* wrappers for "new style" GPIO calls. the old AT91-specfic ones should + * eventually be removed (along with this errno.h inclusion), and the + * gpio request/free calls should probably be implemented. + */ + +#include + +static inline int gpio_request(unsigned gpio, const char *label) +{ + return 0; +} + +static inline void gpio_free(unsigned gpio) +{ +} + +extern int gpio_direction_input(unsigned gpio); +extern int gpio_direction_output(unsigned gpio); +static inline int gpio_get_value(unsigned gpio) +{ + return at91_get_gpio_value(gpio); +} + +static inline void gpio_set_value(unsigned gpio, int value) +{ + at91_set_gpio_value(gpio, value); +} + +#include /* cansleep wrappers */ + +static inline int gpio_to_irq(unsigned gpio) +{ + return gpio; +} + +static inline int irq_to_gpio(unsigned irq) +{ + return irq; +} + +#endif /* __ASSEMBLY__ */ + +#endif -- cgit v1.2.3 From 8a898f1c366c858f8dbcb667c1cfcc282b727795 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Mon, 12 Feb 2007 00:53:14 -0800 Subject: [PATCH] PXA GPIO wrappers Arch-neutral GPIO calls for PXA. Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-pxa/gpio.h | 72 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 include/asm-arm/arch-pxa/gpio.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h new file mode 100644 index 00000000000..e67c2382101 --- /dev/null +++ b/include/asm-arm/arch-pxa/gpio.h @@ -0,0 +1,72 @@ +/* + * linux/include/asm-arm/arch-pxa/gpio.h + * + * PXA GPIO wrappers for arch-neutral GPIO calls + * + * Written by Philipp Zabel + * + * 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 + * + */ + +#ifndef __ASM_ARCH_PXA_GPIO_H +#define __ASM_ARCH_PXA_GPIO_H + +#include +#include +#include + +#include + +static inline int gpio_request(unsigned gpio, const char *label) +{ + return 0; +} + +static inline void gpio_free(unsigned gpio) +{ + return; +} + +static inline int gpio_direction_input(unsigned gpio) +{ + if (gpio > PXA_LAST_GPIO) + return -EINVAL; + pxa_gpio_mode(gpio | GPIO_IN); +} + +static inline int gpio_direction_output(unsigned gpio) +{ + if (gpio > PXA_LAST_GPIO) + return -EINVAL; + pxa_gpio_mode(gpio | GPIO_OUT); +} + +/* REVISIT these macros are correct, but suffer code explosion + * for non-constant parameters. Provide out-line versions too. + */ +#define gpio_get_value(gpio) \ + (GPLR(gpio) & GPIO_bit(gpio)) + +#define gpio_set_value(gpio,value) \ + ((value) ? (GPSR(gpio) = GPIO_bit(gpio)):(GPCR(gpio) = GPIO_bit(gpio))) + +#include /* cansleep wrappers */ + +#define gpio_to_irq(gpio) IRQ_GPIO(gpio) +#define irq_to_gpio(irq) IRQ_TO_GPIO(irq) + + +#endif -- cgit v1.2.3 From 920fe7a8d0aba9782d1f924a02ece146acbf6686 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Mon, 12 Feb 2007 00:53:14 -0800 Subject: [PATCH] SA1100 GPIO wrappers Arch-neutral GPIO calls for SA-1100. Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-sa1100/gpio.h | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 include/asm-arm/arch-sa1100/gpio.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h new file mode 100644 index 00000000000..a331fe3f6e4 --- /dev/null +++ b/include/asm-arm/arch-sa1100/gpio.h @@ -0,0 +1,81 @@ +/* + * linux/include/asm-arm/arch-pxa/gpio.h + * + * SA1100 GPIO wrappers for arch-neutral GPIO calls + * + * Written by Philipp Zabel + * + * 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 + * + */ + +#ifndef __ASM_ARCH_SA1100_GPIO_H +#define __ASM_ARCH_SA1100_GPIO_H + +#include +#include +#include + +#include + +static inline int gpio_request(unsigned gpio, const char *label) +{ + return 0; +} + +static inline void gpio_free(unsigned gpio) +{ + return; +} + +static inline int gpio_direction_input(unsigned gpio) +{ + if (gpio > GPIO_MAX) + return -EINVAL; + GPDR = (GPDR_In << gpio) 0 +} + +static inline int gpio_direction_output(unsigned gpio) +{ + if (gpio > GPIO_MAX) + return -EINVAL; + GPDR = (GPDR_Out << gpio) 0 +} + +#define gpio_get_value(gpio) \ + (GPLR & GPIO_GPIO(gpio)) + +#define gpio_set_value(gpio,value) \ + ((value) ? (GPSR = GPIO_GPIO(gpio)) : (GPCR(gpio) = GPIO_GPIO(gpio))) + +#include /* cansleep wrappers */ + +static inline unsigned gpio_to_irq(unsigned gpio) +{ + if (gpio < 11) + return IRQ_GPIO0 + gpio; + else + return IRQ_GPIO11 - 11 + gpio; +} + +static inline unsigned irq_to_gpio(unsigned irq) +{ + if (irq < IRQ_GPIO11_27) + return irq - IRQ_GPIO0; + else + return irq - IRQ_GPIO11 + 11; +} + +#endif -- cgit v1.2.3 From 390414badebe45a2f556a04ece1fd99191aa6397 Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Mon, 12 Feb 2007 00:53:15 -0800 Subject: [PATCH] S3C2410 GPIO wrappers Arch-neutral GPIO calls for S3C24xx. Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/arch-s3c2410/gpio.h | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 include/asm-arm/arch-s3c2410/gpio.h (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-s3c2410/gpio.h b/include/asm-arm/arch-s3c2410/gpio.h new file mode 100644 index 00000000000..67b8b9ab22e --- /dev/null +++ b/include/asm-arm/arch-s3c2410/gpio.h @@ -0,0 +1,65 @@ +/* + * linux/include/asm-arm/arch-pxa/gpio.h + * + * S3C2400 GPIO wrappers for arch-neutral GPIO calls + * + * Written by Philipp Zabel + * + * 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 + * + */ + +#ifndef __ASM_ARCH_PXA_GPIO_H +#define __ASM_ARCH_PXA_GPIO_H + +#include +#include +#include + +#include + +static inline int gpio_request(unsigned gpio, const char *label) +{ + return 0; +} + +static inline void gpio_free(unsigned gpio) +{ + return; +} + +static inline int gpio_direction_input(unsigned gpio) +{ + s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_INPUT); + return 0; +} + +static inline int gpio_direction_output(unsigned gpio) +{ + s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT); + return 0; +} + +#define gpio_get_value(gpio) s3c2410_gpio_getpin(gpio) +#define gpio_set_value(gpio,value) s3c2410_gpio_setpin(gpio, value) + +#include /* cansleep wrappers */ + +/* FIXME or maybe s3c2400_gpio_getirq() ... */ +#define gpio_to_irq(gpio) s3c2410_gpio_getirq(gpio) + +/* FIXME implement irq_to_gpio() */ + +#endif -- cgit v1.2.3 From c5a69d57eb48e36f84c0737b5b24ec277d7dbfba Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 17 Feb 2007 20:11:19 +0100 Subject: Storage class should be before const qualifier The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by: Tobias Klauser Signed-off-by: Adrian Bunk --- include/asm-arm/uaccess.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/asm-arm') diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index c92df958802..4c1a3fa9f25 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h @@ -109,7 +109,7 @@ extern int __get_user_4(void *); #define get_user(x,p) \ ({ \ - const register typeof(*(p)) __user *__p asm("r0") = (p);\ + register const typeof(*(p)) __user *__p asm("r0") = (p);\ register unsigned long __r2 asm("r2"); \ register int __e asm("r0"); \ switch (sizeof(*(__p))) { \ @@ -143,8 +143,8 @@ extern int __put_user_8(void *, unsigned long long); #define put_user(x,p) \ ({ \ - const register typeof(*(p)) __r2 asm("r2") = (x); \ - const register typeof(*(p)) __user *__p asm("r0") = (p);\ + register const typeof(*(p)) __r2 asm("r2") = (x); \ + register const typeof(*(p)) __user *__p asm("r0") = (p);\ register int __e asm("r0"); \ switch (sizeof(*(__p))) { \ case 1: \ -- cgit v1.2.3 From 37985b449310b17a815511045455934ede5a90c0 Mon Sep 17 00:00:00 2001 From: Ozzy Date: Mon, 19 Feb 2007 15:05:42 +0100 Subject: [ARM] 4223/1: ixdp2351 : Fix for a define error Fix syntax error for a define in ixdp2351.h Signed-off-by: ozzy Signed-off-by: Russell King --- include/asm-arm/arch-ixp23xx/ixdp2351.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-ixp23xx/ixdp2351.h b/include/asm-arm/arch-ixp23xx/ixdp2351.h index 4a24f8f1565..d5e8a43d7bb 100644 --- a/include/asm-arm/arch-ixp23xx/ixdp2351.h +++ b/include/asm-arm/arch-ixp23xx/ixdp2351.h @@ -46,7 +46,7 @@ #define IXDP2351_VIRT_NVRAM_BASE IXDP2351_BB_AREA_BASE(0x0) #define IXDP2351_NVRAM_SIZE (0x20000) -#define IXDP2351_VIRT_MB_IXF1104_BASE IXDP3251_BB_AREA_BASE(0x00020000) +#define IXDP2351_VIRT_MB_IXF1104_BASE IXDP2351_BB_AREA_BASE(0x00020000) #define IXDP2351_VIRT_ADD_UART_BASE IXDP2351_BB_AREA_BASE(0x000240C0) #define IXDP2351_VIRT_FIC_BASE IXDP2351_BB_AREA_BASE(0x00200000) #define IXDP2351_VIRT_DB0_BASE IXDP2351_BB_AREA_BASE(0x00400000) -- cgit v1.2.3 From 97e412fa9e31414030c1e9ac5e96a985d946af83 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 20 Feb 2007 16:11:11 +0000 Subject: [ARM] Fix s3c2410 ALSA audio for typedef elimination Signed-off-by: Russell King --- include/asm-arm/arch-s3c2410/audio.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/asm-arm') diff --git a/include/asm-arm/arch-s3c2410/audio.h b/include/asm-arm/arch-s3c2410/audio.h index 65e0acffa1a..0a6977fb577 100644 --- a/include/asm-arm/arch-s3c2410/audio.h +++ b/include/asm-arm/arch-s3c2410/audio.h @@ -31,9 +31,9 @@ struct s3c24xx_iis_ops { int (*suspend)(struct s3c24xx_iis_ops *me); int (*resume)(struct s3c24xx_iis_ops *me); - int (*open)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm); - int (*close)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm); - int (*prepare)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm, snd_pcm_runtime_t *rt); + int (*open)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm); + int (*close)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm); + int (*prepare)(struct s3c24xx_iis_ops *me, struct snd_pcm_substream *strm, struct snd_pcm_runtime *rt); }; struct s3c24xx_platdata_iis { -- cgit v1.2.3