From 759b22d676721e9396ed0b65c3bb548244c93225 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Thu, 29 Mar 2012 22:39:57 -0700 Subject: [PATCH] --- yaml --- r: 297826 b: refs/heads/master c: 7f55ba9c4ca9e365637e8ddee1884aea47cb20c6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/MAINTAINERS | 2 +- .../arm/plat-spear/include/plat/keyboard.h | 7 + trunk/arch/sh/Kconfig | 4 - trunk/arch/sh/boards/mach-ecovec24/setup.c | 104 +++---- trunk/arch/sh/drivers/dma/dma-g2.c | 4 +- trunk/arch/sh/drivers/dma/dmabrg.c | 4 +- trunk/arch/sh/drivers/pci/pci-sh7780.c | 15 +- trunk/arch/sh/include/asm/io.h | 25 +- trunk/arch/sh/include/asm/unistd.h | 37 --- trunk/arch/sh/include/asm/unistd_32.h | 102 ++++-- trunk/arch/sh/include/asm/unistd_64.h | 106 +++++-- .../sh/include/cpu-sh4/cpu/dma-register.h | 32 +- .../sh/include/mach-common/mach/mangle-port.h | 49 --- trunk/arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 20 -- trunk/arch/sh/kernel/cpufreq.c | 121 +++---- trunk/arch/sh/kernel/signal_32.c | 35 ++- trunk/arch/sh/kernel/signal_64.c | 40 ++- trunk/arch/sh/kernel/syscalls_32.S | 8 +- trunk/arch/sh/kernel/syscalls_64.S | 8 +- trunk/arch/sparc/include/asm/ptrace.h | 1 + trunk/drivers/input/joystick/amijoy.c | 3 - trunk/drivers/input/keyboard/gpio_keys.c | 259 ++++++--------- trunk/drivers/input/keyboard/tegra-kbc.c | 1 - trunk/drivers/input/mouse/sentelic.c | 294 +++++------------- trunk/drivers/input/mouse/sentelic.h | 35 +-- trunk/drivers/input/tablet/Kconfig | 1 - trunk/drivers/input/tablet/wacom.h | 9 - trunk/drivers/input/tablet/wacom_sys.c | 231 ++------------ trunk/drivers/input/tablet/wacom_wac.c | 49 +-- trunk/drivers/input/tablet/wacom_wac.h | 6 - trunk/drivers/sh/intc/chip.c | 37 ++- trunk/drivers/sh/intc/core.c | 11 +- trunk/drivers/sh/intc/handle.c | 5 +- trunk/drivers/sh/intc/internals.h | 9 +- trunk/drivers/tty/serial/sh-sci.c | 15 +- trunk/include/linux/gpio_keys.h | 3 +- trunk/kernel/cgroup.c | 2 +- 38 files changed, 577 insertions(+), 1119 deletions(-) delete mode 100644 trunk/arch/sh/include/mach-common/mach/mangle-port.h diff --git a/[refs] b/[refs] index 2f3c6b1515f3..9b71647a77c2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f52b69f86e27903d6896ed5fa7cd280fec8de532 +refs/heads/master: 7f55ba9c4ca9e365637e8ddee1884aea47cb20c6 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index eecf3441ac21..64168f6dd89e 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -1940,7 +1940,7 @@ F: drivers/connector/ CONTROL GROUPS (CGROUPS) M: Tejun Heo -M: Li Zefan +M: Li Zefan L: containers@lists.linux-foundation.org L: cgroups@vger.kernel.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git diff --git a/trunk/arch/arm/plat-spear/include/plat/keyboard.h b/trunk/arch/arm/plat-spear/include/plat/keyboard.h index 0562f134621d..c16cc31ecbed 100644 --- a/trunk/arch/arm/plat-spear/include/plat/keyboard.h +++ b/trunk/arch/arm/plat-spear/include/plat/keyboard.h @@ -159,4 +159,11 @@ struct kbd_platform_data { unsigned int mode; }; +/* This function is used to set platform data field of pdev->dev */ +static inline void +kbd_set_plat_data(struct platform_device *pdev, struct kbd_platform_data *data) +{ + pdev->dev.platform_data = data; +} + #endif /* __PLAT_KEYBOARD_H */ diff --git a/trunk/arch/sh/Kconfig b/trunk/arch/sh/Kconfig index ff9e033ce626..b190eb17a75b 100644 --- a/trunk/arch/sh/Kconfig +++ b/trunk/arch/sh/Kconfig @@ -5,7 +5,6 @@ config SUPERH select HAVE_IDE if HAS_IOPORT select HAVE_MEMBLOCK select HAVE_MEMBLOCK_NODE_MAP - select ARCH_DISCARD_MEMBLOCK select HAVE_OPROFILE select HAVE_GENERIC_DMA_COHERENT select HAVE_ARCH_TRACEHOOK @@ -162,9 +161,6 @@ config NO_IOPORT config IO_TRAPPED bool -config SWAP_IO_SPACE - bool - config DMA_COHERENT bool diff --git a/trunk/arch/sh/boards/mach-ecovec24/setup.c b/trunk/arch/sh/boards/mach-ecovec24/setup.c index d12fe9ddf3da..e5ac12b2ce65 100644 --- a/trunk/arch/sh/boards/mach-ecovec24/setup.c +++ b/trunk/arch/sh/boards/mach-ecovec24/setup.c @@ -522,18 +522,11 @@ static void sdhi0_set_pwr(struct platform_device *pdev, int state) gpio_set_value(GPIO_PTB6, state); } -static int sdhi0_get_cd(struct platform_device *pdev) -{ - return !gpio_get_value(GPIO_PTY7); -} - static struct sh_mobile_sdhi_info sdhi0_info = { .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, .set_pwr = sdhi0_set_pwr, - .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | - MMC_CAP_NEEDS_POLL, - .get_cd = sdhi0_get_cd, + .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD, }; static struct resource sdhi0_resources[] = { @@ -566,18 +559,11 @@ static void sdhi1_set_pwr(struct platform_device *pdev, int state) gpio_set_value(GPIO_PTB7, state); } -static int sdhi1_get_cd(struct platform_device *pdev) -{ - return !gpio_get_value(GPIO_PTW7); -} - static struct sh_mobile_sdhi_info sdhi1_info = { .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, - .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | - MMC_CAP_NEEDS_POLL, + .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD, .set_pwr = sdhi1_set_pwr, - .get_cd = sdhi1_get_cd, }; static struct resource sdhi1_resources[] = { @@ -1015,7 +1001,6 @@ extern char ecovec24_sdram_leave_end; static int __init arch_setup(void) { struct clk *clk; - bool cn12_enabled = false; /* register board specific self-refresh code */ sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF | @@ -1216,13 +1201,9 @@ static int __init arch_setup(void) gpio_direction_input(GPIO_PTR5); gpio_direction_input(GPIO_PTR6); - /* SD-card slot CN11 */ - /* Card-detect, used on CN11, either with SDHI0 or with SPI */ - gpio_request(GPIO_PTY7, NULL); - gpio_direction_input(GPIO_PTY7); - #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */ + gpio_request(GPIO_FN_SDHI0CD, NULL); gpio_request(GPIO_FN_SDHI0WP, NULL); gpio_request(GPIO_FN_SDHI0CMD, NULL); gpio_request(GPIO_FN_SDHI0CLK, NULL); @@ -1232,40 +1213,10 @@ static int __init arch_setup(void) gpio_request(GPIO_FN_SDHI0D0, NULL); gpio_request(GPIO_PTB6, NULL); gpio_direction_output(GPIO_PTB6, 0); -#else - /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ - gpio_request(GPIO_FN_MSIOF0_TXD, NULL); - gpio_request(GPIO_FN_MSIOF0_RXD, NULL); - gpio_request(GPIO_FN_MSIOF0_TSCK, NULL); - gpio_request(GPIO_PTM4, NULL); /* software CS control of TSYNC pin */ - gpio_direction_output(GPIO_PTM4, 1); /* active low CS */ - gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */ - gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */ - gpio_request(GPIO_PTY6, NULL); /* write protect */ - gpio_direction_input(GPIO_PTY6); - spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); -#endif - - /* MMC/SD-card slot CN12 */ -#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) - /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */ - gpio_request(GPIO_FN_MMC_D7, NULL); - gpio_request(GPIO_FN_MMC_D6, NULL); - gpio_request(GPIO_FN_MMC_D5, NULL); - gpio_request(GPIO_FN_MMC_D4, NULL); - gpio_request(GPIO_FN_MMC_D3, NULL); - gpio_request(GPIO_FN_MMC_D2, NULL); - gpio_request(GPIO_FN_MMC_D1, NULL); - gpio_request(GPIO_FN_MMC_D0, NULL); - gpio_request(GPIO_FN_MMC_CLK, NULL); - gpio_request(GPIO_FN_MMC_CMD, NULL); - gpio_request(GPIO_PTB7, NULL); - gpio_direction_output(GPIO_PTB7, 0); - - cn12_enabled = true; -#elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) +#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */ + gpio_request(GPIO_FN_SDHI1CD, NULL); gpio_request(GPIO_FN_SDHI1WP, NULL); gpio_request(GPIO_FN_SDHI1CMD, NULL); gpio_request(GPIO_FN_SDHI1CLK, NULL); @@ -1276,18 +1227,26 @@ static int __init arch_setup(void) gpio_request(GPIO_PTB7, NULL); gpio_direction_output(GPIO_PTB7, 0); - /* Card-detect, used on CN12 with SDHI1 */ - gpio_request(GPIO_PTW7, NULL); - gpio_direction_input(GPIO_PTW7); + /* I/O buffer drive ability is high for SDHI1 */ + __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); +#endif /* CONFIG_MMC_SH_MMCIF */ +#else + /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ + gpio_request(GPIO_FN_MSIOF0_TXD, NULL); + gpio_request(GPIO_FN_MSIOF0_RXD, NULL); + gpio_request(GPIO_FN_MSIOF0_TSCK, NULL); + gpio_request(GPIO_PTM4, NULL); /* software CS control of TSYNC pin */ + gpio_direction_output(GPIO_PTM4, 1); /* active low CS */ + gpio_request(GPIO_PTB6, NULL); /* 3.3V power control */ + gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */ + gpio_request(GPIO_PTY6, NULL); /* write protect */ + gpio_direction_input(GPIO_PTY6); + gpio_request(GPIO_PTY7, NULL); /* card detect */ + gpio_direction_input(GPIO_PTY7); - cn12_enabled = true; + spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); #endif - if (cn12_enabled) - /* I/O buffer drive ability is high for CN12 */ - __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000, - IODRIVEA); - /* enable Video */ gpio_request(GPIO_PTU2, NULL); gpio_direction_output(GPIO_PTU2, 1); @@ -1346,6 +1305,25 @@ static int __init arch_setup(void) gpio_request(GPIO_PTU5, NULL); gpio_direction_output(GPIO_PTU5, 0); +#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) + /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */ + gpio_request(GPIO_FN_MMC_D7, NULL); + gpio_request(GPIO_FN_MMC_D6, NULL); + gpio_request(GPIO_FN_MMC_D5, NULL); + gpio_request(GPIO_FN_MMC_D4, NULL); + gpio_request(GPIO_FN_MMC_D3, NULL); + gpio_request(GPIO_FN_MMC_D2, NULL); + gpio_request(GPIO_FN_MMC_D1, NULL); + gpio_request(GPIO_FN_MMC_D0, NULL); + gpio_request(GPIO_FN_MMC_CLK, NULL); + gpio_request(GPIO_FN_MMC_CMD, NULL); + gpio_request(GPIO_PTB7, NULL); + gpio_direction_output(GPIO_PTB7, 0); + + /* I/O buffer drive ability is high for MMCIF */ + __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); +#endif + /* enable I2C device */ i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); diff --git a/trunk/arch/sh/drivers/dma/dma-g2.c b/trunk/arch/sh/drivers/dma/dma-g2.c index e1ab6eb3c04b..be9ca7ca0ce4 100644 --- a/trunk/arch/sh/drivers/dma/dma-g2.c +++ b/trunk/arch/sh/drivers/dma/dma-g2.c @@ -181,14 +181,14 @@ static int __init g2_dma_init(void) ret = register_dmac(&g2_dma_info); if (unlikely(ret != 0)) - free_irq(HW_EVENT_G2_DMA, &g2_dma_info); + free_irq(HW_EVENT_G2_DMA, 0); return ret; } static void __exit g2_dma_exit(void) { - free_irq(HW_EVENT_G2_DMA, &g2_dma_info); + free_irq(HW_EVENT_G2_DMA, 0); unregister_dmac(&g2_dma_info); } diff --git a/trunk/arch/sh/drivers/dma/dmabrg.c b/trunk/arch/sh/drivers/dma/dmabrg.c index c0dd904483c7..3d66a32ce610 100644 --- a/trunk/arch/sh/drivers/dma/dmabrg.c +++ b/trunk/arch/sh/drivers/dma/dmabrg.c @@ -189,8 +189,8 @@ static int __init dmabrg_init(void) if (ret == 0) return ret; - free_irq(DMABRGI1, NULL); -out1: free_irq(DMABRGI0, NULL); + free_irq(DMABRGI1, 0); +out1: free_irq(DMABRGI0, 0); out0: kfree(dmabrg_handlers); return ret; } diff --git a/trunk/arch/sh/drivers/pci/pci-sh7780.c b/trunk/arch/sh/drivers/pci/pci-sh7780.c index 5a6dab6e27d9..fb8f14990743 100644 --- a/trunk/arch/sh/drivers/pci/pci-sh7780.c +++ b/trunk/arch/sh/drivers/pci/pci-sh7780.c @@ -21,13 +21,6 @@ #include #include -#if defined(CONFIG_CPU_BIG_ENDIAN) -# define PCICR_ENDIANNESS SH4_PCICR_BSWP -#else -# define PCICR_ENDIANNESS 0 -#endif - - static struct resource sh7785_pci_resources[] = { { .name = "PCI IO", @@ -261,7 +254,7 @@ static int __init sh7780_pci_init(void) __raw_writel(PCIECR_ENBL, PCIECR); /* Reset */ - __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_PRST | PCICR_ENDIANNESS, + __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_PRST, chan->reg_base + SH4_PCICR); /* @@ -297,8 +290,7 @@ static int __init sh7780_pci_init(void) * Now throw it in to register initialization mode and * start the real work. */ - __raw_writel(SH4_PCICR_PREFIX | PCICR_ENDIANNESS, - chan->reg_base + SH4_PCICR); + __raw_writel(SH4_PCICR_PREFIX, chan->reg_base + SH4_PCICR); memphys = __pa(memory_start); memsize = roundup_pow_of_two(memory_end - memory_start); @@ -388,8 +380,7 @@ static int __init sh7780_pci_init(void) * Initialization mode complete, release the control register and * enable round robin mode to stop device overruns/starvation. */ - __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO | - PCICR_ENDIANNESS, + __raw_writel(SH4_PCICR_PREFIX | SH4_PCICR_CFIN | SH4_PCICR_FTO, chan->reg_base + SH4_PCICR); ret = register_pci_controller(chan); diff --git a/trunk/arch/sh/include/asm/io.h b/trunk/arch/sh/include/asm/io.h index ec464a6b95fe..35fc8b077cb1 100644 --- a/trunk/arch/sh/include/asm/io.h +++ b/trunk/arch/sh/include/asm/io.h @@ -23,7 +23,6 @@ #define __IO_PREFIX generic #include #include -#include #define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile u8 __force *)(a) = (v)) #define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile u16 __force *)(a) = (v)) @@ -35,15 +34,21 @@ #define __raw_readl(a) (__chk_io_ptr(a), *(volatile u32 __force *)(a)) #define __raw_readq(a) (__chk_io_ptr(a), *(volatile u64 __force *)(a)) -#define readb_relaxed(c) ({ u8 __v = ioswabb(__raw_readb(c)); __v; }) -#define readw_relaxed(c) ({ u16 __v = ioswabw(__raw_readw(c)); __v; }) -#define readl_relaxed(c) ({ u32 __v = ioswabl(__raw_readl(c)); __v; }) -#define readq_relaxed(c) ({ u64 __v = ioswabq(__raw_readq(c)); __v; }) - -#define writeb_relaxed(v,c) ((void)__raw_writeb((__force u8)ioswabb(v),c)) -#define writew_relaxed(v,c) ((void)__raw_writew((__force u16)ioswabw(v),c)) -#define writel_relaxed(v,c) ((void)__raw_writel((__force u32)ioswabl(v),c)) -#define writeq_relaxed(v,c) ((void)__raw_writeq((__force u64)ioswabq(v),c)) +#define readb_relaxed(c) ({ u8 __v = __raw_readb(c); __v; }) +#define readw_relaxed(c) ({ u16 __v = le16_to_cpu((__force __le16) \ + __raw_readw(c)); __v; }) +#define readl_relaxed(c) ({ u32 __v = le32_to_cpu((__force __le32) \ + __raw_readl(c)); __v; }) +#define readq_relaxed(c) ({ u64 __v = le64_to_cpu((__force __le64) \ + __raw_readq(c)); __v; }) + +#define writeb_relaxed(v,c) ((void)__raw_writeb(v,c)) +#define writew_relaxed(v,c) ((void)__raw_writew((__force u16) \ + cpu_to_le16(v),c)) +#define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \ + cpu_to_le32(v),c)) +#define writeq_relaxed(v,c) ((void)__raw_writeq((__force u64) \ + cpu_to_le64(v),c)) #define readb(a) ({ u8 r_ = readb_relaxed(a); rmb(); r_; }) #define readw(a) ({ u16 r_ = readw_relaxed(a); rmb(); r_; }) diff --git a/trunk/arch/sh/include/asm/unistd.h b/trunk/arch/sh/include/asm/unistd.h index a42a5610a36a..65be656ead7d 100644 --- a/trunk/arch/sh/include/asm/unistd.h +++ b/trunk/arch/sh/include/asm/unistd.h @@ -1,46 +1,9 @@ #ifdef __KERNEL__ # ifdef CONFIG_SUPERH32 - # include "unistd_32.h" -# define __ARCH_WANT_SYS_RT_SIGSUSPEND - # else # include "unistd_64.h" # endif - -# define __ARCH_WANT_IPC_PARSE_VERSION -# define __ARCH_WANT_OLD_READDIR -# define __ARCH_WANT_OLD_STAT -# define __ARCH_WANT_STAT64 -# define __ARCH_WANT_SYS_ALARM -# define __ARCH_WANT_SYS_GETHOSTNAME -# define __ARCH_WANT_SYS_IPC -# define __ARCH_WANT_SYS_PAUSE -# define __ARCH_WANT_SYS_SGETMASK -# define __ARCH_WANT_SYS_SIGNAL -# define __ARCH_WANT_SYS_TIME -# define __ARCH_WANT_SYS_UTIME -# define __ARCH_WANT_SYS_WAITPID -# define __ARCH_WANT_SYS_SOCKETCALL -# define __ARCH_WANT_SYS_FADVISE64 -# define __ARCH_WANT_SYS_GETPGRP -# define __ARCH_WANT_SYS_LLSEEK -# define __ARCH_WANT_SYS_NICE -# define __ARCH_WANT_SYS_OLD_GETRLIMIT -# define __ARCH_WANT_SYS_OLD_UNAME -# define __ARCH_WANT_SYS_OLDUMOUNT -# define __ARCH_WANT_SYS_SIGPENDING -# define __ARCH_WANT_SYS_SIGPROCMASK -# define __ARCH_WANT_SYS_RT_SIGACTION - -/* - * "Conditional" syscalls - * - * What we want is __attribute__((weak,alias("sys_ni_syscall"))), - * but it doesn't work on all toolchains, so we just do it by hand - */ -# define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") - #else # ifdef __SH5__ # include "unistd_64.h" diff --git a/trunk/arch/sh/include/asm/unistd_32.h b/trunk/arch/sh/include/asm/unistd_32.h index 72fd1e061006..152b8627a184 100644 --- a/trunk/arch/sh/include/asm/unistd_32.h +++ b/trunk/arch/sh/include/asm/unistd_32.h @@ -1,5 +1,5 @@ -#ifndef __ASM_SH_UNISTD_32_H -#define __ASM_SH_UNISTD_32_H +#ifndef __ASM_SH_UNISTD_H +#define __ASM_SH_UNISTD_H /* * Copyright (C) 1999 Niibe Yutaka @@ -26,7 +26,7 @@ #define __NR_mknod 14 #define __NR_chmod 15 #define __NR_lchown 16 - /* 17 was sys_break */ +#define __NR_break 17 #define __NR_oldstat 18 #define __NR_lseek 19 #define __NR_getpid 20 @@ -40,11 +40,11 @@ #define __NR_oldfstat 28 #define __NR_pause 29 #define __NR_utime 30 - /* 31 was sys_stty */ - /* 32 was sys_gtty */ +#define __NR_stty 31 +#define __NR_gtty 32 #define __NR_access 33 #define __NR_nice 34 - /* 35 was sys_ftime */ +#define __NR_ftime 35 #define __NR_sync 36 #define __NR_kill 37 #define __NR_rename 38 @@ -53,7 +53,7 @@ #define __NR_dup 41 #define __NR_pipe 42 #define __NR_times 43 - /* 44 was sys_prof */ +#define __NR_prof 44 #define __NR_brk 45 #define __NR_setgid 46 #define __NR_getgid 47 @@ -62,13 +62,13 @@ #define __NR_getegid 50 #define __NR_acct 51 #define __NR_umount2 52 - /* 53 was sys_lock */ +#define __NR_lock 53 #define __NR_ioctl 54 #define __NR_fcntl 55 - /* 56 was sys_mpx */ +#define __NR_mpx 56 #define __NR_setpgid 57 - /* 58 was sys_ulimit */ - /* 59 was sys_olduname */ +#define __NR_ulimit 58 +#define __NR_oldolduname 59 #define __NR_umask 60 #define __NR_chroot 61 #define __NR_ustat 62 @@ -91,7 +91,7 @@ #define __NR_settimeofday 79 #define __NR_getgroups 80 #define __NR_setgroups 81 - /* 82 was sys_oldselect */ +#define __NR_select 82 #define __NR_symlink 83 #define __NR_oldlstat 84 #define __NR_readlink 85 @@ -107,10 +107,10 @@ #define __NR_fchown 95 #define __NR_getpriority 96 #define __NR_setpriority 97 - /* 98 was sys_profil */ +#define __NR_profil 98 #define __NR_statfs 99 #define __NR_fstatfs 100 - /* 101 was sys_ioperm */ +#define __NR_ioperm 101 #define __NR_socketcall 102 #define __NR_syslog 103 #define __NR_setitimer 104 @@ -119,10 +119,10 @@ #define __NR_lstat 107 #define __NR_fstat 108 #define __NR_olduname 109 - /* 110 was sys_iopl */ +#define __NR_iopl 110 #define __NR_vhangup 111 - /* 112 was sys_idle */ - /* 113 was sys_vm86old */ +#define __NR_idle 112 +#define __NR_vm86old 113 #define __NR_wait4 114 #define __NR_swapoff 115 #define __NR_sysinfo 116 @@ -136,17 +136,17 @@ #define __NR_adjtimex 124 #define __NR_mprotect 125 #define __NR_sigprocmask 126 - /* 127 was sys_create_module */ +#define __NR_create_module 127 #define __NR_init_module 128 #define __NR_delete_module 129 - /* 130 was sys_get_kernel_syms */ +#define __NR_get_kernel_syms 130 #define __NR_quotactl 131 #define __NR_getpgid 132 #define __NR_fchdir 133 #define __NR_bdflush 134 #define __NR_sysfs 135 #define __NR_personality 136 - /* 137 was sys_afs_syscall */ +#define __NR_afs_syscall 137 /* Syscall for Andrew File System */ #define __NR_setfsuid 138 #define __NR_setfsgid 139 #define __NR__llseek 140 @@ -175,8 +175,8 @@ #define __NR_mremap 163 #define __NR_setresuid 164 #define __NR_getresuid 165 - /* 166 was sys_vm86 */ - /* 167 was sys_query_module */ +#define __NR_vm86 166 +#define __NR_query_module 167 #define __NR_poll 168 #define __NR_nfsservctl 169 #define __NR_setresgid 170 @@ -197,8 +197,8 @@ #define __NR_capset 185 #define __NR_sigaltstack 186 #define __NR_sendfile 187 - /* 188 reserved for sys_getpmsg */ - /* 189 reserved for sys_putpmsg */ +#define __NR_streams1 188 /* some people actually want it */ +#define __NR_streams2 189 /* some people actually want it */ #define __NR_vfork 190 #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ #define __NR_mmap2 192 @@ -231,8 +231,7 @@ #define __NR_madvise 219 #define __NR_getdents64 220 #define __NR_fcntl64 221 - /* 222 is reserved for tux */ - /* 223 is unused */ +/* 223 is unused */ #define __NR_gettid 224 #define __NR_readahead 225 #define __NR_setxattr 226 @@ -252,15 +251,15 @@ #define __NR_futex 240 #define __NR_sched_setaffinity 241 #define __NR_sched_getaffinity 242 - /* 243 is reserved for set_thread_area */ - /* 244 is reserved for get_thread_area */ +#define __NR_set_thread_area 243 +#define __NR_get_thread_area 244 #define __NR_io_setup 245 #define __NR_io_destroy 246 #define __NR_io_getevents 247 #define __NR_io_submit 248 #define __NR_io_cancel 249 #define __NR_fadvise64 250 - /* 251 is unused */ + #define __NR_exit_group 252 #define __NR_lookup_dcookie 253 #define __NR_epoll_create 254 @@ -282,7 +281,7 @@ #define __NR_tgkill 270 #define __NR_utimes 271 #define __NR_fadvise64_64 272 - /* 273 is reserved for vserver */ +#define __NR_vserver 273 #define __NR_mbind 274 #define __NR_get_mempolicy 275 #define __NR_set_mempolicy 276 @@ -302,7 +301,7 @@ #define __NR_inotify_init 290 #define __NR_inotify_add_watch 291 #define __NR_inotify_rm_watch 292 - /* 293 is unused */ +/* 293 is unused */ #define __NR_migrate_pages 294 #define __NR_openat 295 #define __NR_mkdirat 296 @@ -381,4 +380,43 @@ #define NR_syscalls 367 -#endif /* __ASM_SH_UNISTD_32_H */ +#ifdef __KERNEL__ + +#define __ARCH_WANT_IPC_PARSE_VERSION +#define __ARCH_WANT_OLD_READDIR +#define __ARCH_WANT_OLD_STAT +#define __ARCH_WANT_STAT64 +#define __ARCH_WANT_SYS_ALARM +#define __ARCH_WANT_SYS_GETHOSTNAME +#define __ARCH_WANT_SYS_IPC +#define __ARCH_WANT_SYS_PAUSE +#define __ARCH_WANT_SYS_SGETMASK +#define __ARCH_WANT_SYS_SIGNAL +#define __ARCH_WANT_SYS_TIME +#define __ARCH_WANT_SYS_UTIME +#define __ARCH_WANT_SYS_WAITPID +#define __ARCH_WANT_SYS_SOCKETCALL +#define __ARCH_WANT_SYS_FADVISE64 +#define __ARCH_WANT_SYS_GETPGRP +#define __ARCH_WANT_SYS_LLSEEK +#define __ARCH_WANT_SYS_NICE +#define __ARCH_WANT_SYS_OLD_GETRLIMIT +#define __ARCH_WANT_SYS_OLD_UNAME +#define __ARCH_WANT_SYS_OLDUMOUNT +#define __ARCH_WANT_SYS_SIGPENDING +#define __ARCH_WANT_SYS_SIGPROCMASK +#define __ARCH_WANT_SYS_RT_SIGACTION +#define __ARCH_WANT_SYS_RT_SIGSUSPEND + +/* + * "Conditional" syscalls + * + * What we want is __attribute__((weak,alias("sys_ni_syscall"))), + * but it doesn't work on all toolchains, so we just do it by hand + */ +#ifndef cond_syscall +#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") +#endif + +#endif /* __KERNEL__ */ +#endif /* __ASM_SH_UNISTD_H */ diff --git a/trunk/arch/sh/include/asm/unistd_64.h b/trunk/arch/sh/include/asm/unistd_64.h index a28edc329692..c330c23db5a0 100644 --- a/trunk/arch/sh/include/asm/unistd_64.h +++ b/trunk/arch/sh/include/asm/unistd_64.h @@ -31,7 +31,7 @@ #define __NR_mknod 14 #define __NR_chmod 15 #define __NR_lchown 16 - /* 17 was sys_break */ +#define __NR_break 17 #define __NR_oldstat 18 #define __NR_lseek 19 #define __NR_getpid 20 @@ -45,11 +45,11 @@ #define __NR_oldfstat 28 #define __NR_pause 29 #define __NR_utime 30 - /* 31 was sys_stty */ - /* 32 was sys_gtty */ +#define __NR_stty 31 +#define __NR_gtty 32 #define __NR_access 33 #define __NR_nice 34 - /* 35 was sys_ftime */ +#define __NR_ftime 35 #define __NR_sync 36 #define __NR_kill 37 #define __NR_rename 38 @@ -58,7 +58,7 @@ #define __NR_dup 41 #define __NR_pipe 42 #define __NR_times 43 - /* 44 was sys_prof */ +#define __NR_prof 44 #define __NR_brk 45 #define __NR_setgid 46 #define __NR_getgid 47 @@ -67,13 +67,13 @@ #define __NR_getegid 50 #define __NR_acct 51 #define __NR_umount2 52 - /* 53 was sys_lock */ +#define __NR_lock 53 #define __NR_ioctl 54 #define __NR_fcntl 55 - /* 56 was sys_mpx */ +#define __NR_mpx 56 #define __NR_setpgid 57 - /* 58 was sys_ulimit */ - /* 59 was sys_olduname */ +#define __NR_ulimit 58 +#define __NR_oldolduname 59 #define __NR_umask 60 #define __NR_chroot 61 #define __NR_ustat 62 @@ -96,7 +96,7 @@ #define __NR_settimeofday 79 #define __NR_getgroups 80 #define __NR_setgroups 81 - /* 82 was sys_select */ +#define __NR_select 82 #define __NR_symlink 83 #define __NR_oldlstat 84 #define __NR_readlink 85 @@ -112,10 +112,10 @@ #define __NR_fchown 95 #define __NR_getpriority 96 #define __NR_setpriority 97 - /* 98 was sys_profil */ +#define __NR_profil 98 #define __NR_statfs 99 #define __NR_fstatfs 100 - /* 101 was sys_ioperm */ +#define __NR_ioperm 101 #define __NR_socketcall 102 /* old implementation of socket systemcall */ #define __NR_syslog 103 #define __NR_setitimer 104 @@ -124,10 +124,10 @@ #define __NR_lstat 107 #define __NR_fstat 108 #define __NR_olduname 109 - /* 110 was sys_iopl */ +#define __NR_iopl 110 #define __NR_vhangup 111 - /* 112 was sys_idle */ - /* 113 was sys_vm86old */ +#define __NR_idle 112 +#define __NR_vm86old 113 #define __NR_wait4 114 #define __NR_swapoff 115 #define __NR_sysinfo 116 @@ -141,17 +141,17 @@ #define __NR_adjtimex 124 #define __NR_mprotect 125 #define __NR_sigprocmask 126 - /* 127 was sys_create_module */ +#define __NR_create_module 127 #define __NR_init_module 128 #define __NR_delete_module 129 - /* 130 was sys_get_kernel_syms */ +#define __NR_get_kernel_syms 130 #define __NR_quotactl 131 #define __NR_getpgid 132 #define __NR_fchdir 133 #define __NR_bdflush 134 #define __NR_sysfs 135 #define __NR_personality 136 - /* 137 was sys_afs_syscall */ +#define __NR_afs_syscall 137 /* Syscall for Andrew File System */ #define __NR_setfsuid 138 #define __NR_setfsgid 139 #define __NR__llseek 140 @@ -180,8 +180,8 @@ #define __NR_mremap 163 #define __NR_setresuid 164 #define __NR_getresuid 165 - /* 166 was sys_vm86 */ - /* 167 was sys_query_module */ +#define __NR_vm86 166 +#define __NR_query_module 167 #define __NR_poll 168 #define __NR_nfsservctl 169 #define __NR_setresgid 170 @@ -202,8 +202,8 @@ #define __NR_capset 185 #define __NR_sigaltstack 186 #define __NR_sendfile 187 - /* 188 reserved for getpmsg */ - /* 189 reserved for putpmsg */ +#define __NR_streams1 188 /* some people actually want it */ +#define __NR_streams2 189 /* some people actually want it */ #define __NR_vfork 190 #define __NR_ugetrlimit 191 /* SuS compliant getrlimit */ #define __NR_mmap2 192 @@ -262,15 +262,16 @@ #define __NR_msgrcv 241 #define __NR_msgget 242 #define __NR_msgctl 243 -#define __NR_shmat 244 +#if 0 +#define __NR_shmatcall 244 +#endif #define __NR_shmdt 245 #define __NR_shmget 246 #define __NR_shmctl 247 #define __NR_getdents64 248 #define __NR_fcntl64 249 - /* 250 is reserved for tux */ - /* 251 is unused */ +/* 223 is unused */ #define __NR_gettid 252 #define __NR_readahead 253 #define __NR_setxattr 254 @@ -290,15 +291,14 @@ #define __NR_futex 268 #define __NR_sched_setaffinity 269 #define __NR_sched_getaffinity 270 - /* 271 is reserved for set_thread_area */ - /* 272 is reserved for get_thread_area */ +#define __NR_set_thread_area 271 +#define __NR_get_thread_area 272 #define __NR_io_setup 273 #define __NR_io_destroy 274 #define __NR_io_getevents 275 #define __NR_io_submit 276 #define __NR_io_cancel 277 #define __NR_fadvise64 278 - /* 279 is unused */ #define __NR_exit_group 280 #define __NR_lookup_dcookie 281 @@ -321,17 +321,17 @@ #define __NR_tgkill 298 #define __NR_utimes 299 #define __NR_fadvise64_64 300 - /* 301 is reserved for vserver */ - /* 302 is reserved for mbind */ - /* 303 is reserved for get_mempolicy */ - /* 304 is reserved for set_mempolicy */ +#define __NR_vserver 301 +#define __NR_mbind 302 +#define __NR_get_mempolicy 303 +#define __NR_set_mempolicy 304 #define __NR_mq_open 305 #define __NR_mq_unlink (__NR_mq_open+1) #define __NR_mq_timedsend (__NR_mq_open+2) #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) - /* 311 is reserved for kexec */ +#define __NR_kexec_load 311 #define __NR_waitid 312 #define __NR_add_key 313 #define __NR_request_key 314 @@ -341,7 +341,7 @@ #define __NR_inotify_init 318 #define __NR_inotify_add_watch 319 #define __NR_inotify_rm_watch 320 - /* 321 is unused */ +/* 321 is unused */ #define __NR_migrate_pages 322 #define __NR_openat 323 #define __NR_mkdirat 324 @@ -399,6 +399,44 @@ #define __NR_process_vm_readv 376 #define __NR_process_vm_writev 377 +#ifdef __KERNEL__ + #define NR_syscalls 378 +#define __ARCH_WANT_IPC_PARSE_VERSION +#define __ARCH_WANT_OLD_READDIR +#define __ARCH_WANT_OLD_STAT +#define __ARCH_WANT_STAT64 +#define __ARCH_WANT_SYS_ALARM +#define __ARCH_WANT_SYS_GETHOSTNAME +#define __ARCH_WANT_SYS_IPC +#define __ARCH_WANT_SYS_PAUSE +#define __ARCH_WANT_SYS_SGETMASK +#define __ARCH_WANT_SYS_SIGNAL +#define __ARCH_WANT_SYS_TIME +#define __ARCH_WANT_SYS_UTIME +#define __ARCH_WANT_SYS_WAITPID +#define __ARCH_WANT_SYS_SOCKETCALL +#define __ARCH_WANT_SYS_FADVISE64 +#define __ARCH_WANT_SYS_GETPGRP +#define __ARCH_WANT_SYS_LLSEEK +#define __ARCH_WANT_SYS_NICE +#define __ARCH_WANT_SYS_OLD_GETRLIMIT +#define __ARCH_WANT_SYS_OLD_UNAME +#define __ARCH_WANT_SYS_OLDUMOUNT +#define __ARCH_WANT_SYS_SIGPENDING +#define __ARCH_WANT_SYS_SIGPROCMASK +#define __ARCH_WANT_SYS_RT_SIGACTION + +/* + * "Conditional" syscalls + * + * What we want is __attribute__((weak,alias("sys_ni_syscall"))), + * but it doesn't work on all toolchains, so we just do it by hand + */ +#ifndef cond_syscall +#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") +#endif + +#endif /* __KERNEL__ */ #endif /* __ASM_SH_UNISTD_64_H */ diff --git a/trunk/arch/sh/include/cpu-sh4/cpu/dma-register.h b/trunk/arch/sh/include/cpu-sh4/cpu/dma-register.h index 02788b6a03b7..18fa80aba15e 100644 --- a/trunk/arch/sh/include/cpu-sh4/cpu/dma-register.h +++ b/trunk/arch/sh/include/cpu-sh4/cpu/dma-register.h @@ -16,29 +16,45 @@ #define DMAOR_INIT DMAOR_DME -#if defined(CONFIG_CPU_SUBTYPE_SH7343) +#if defined(CONFIG_CPU_SUBTYPE_SH7343) || \ + defined(CONFIG_CPU_SUBTYPE_SH7730) #define CHCR_TS_LOW_MASK 0x00000018 #define CHCR_TS_LOW_SHIFT 3 #define CHCR_TS_HIGH_MASK 0 #define CHCR_TS_HIGH_SHIFT 0 #elif defined(CONFIG_CPU_SUBTYPE_SH7722) || \ - defined(CONFIG_CPU_SUBTYPE_SH7723) || \ defined(CONFIG_CPU_SUBTYPE_SH7724) || \ - defined(CONFIG_CPU_SUBTYPE_SH7730) || \ defined(CONFIG_CPU_SUBTYPE_SH7786) #define CHCR_TS_LOW_MASK 0x00000018 #define CHCR_TS_LOW_SHIFT 3 #define CHCR_TS_HIGH_MASK 0x00300000 #define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */ -#elif defined(CONFIG_CPU_SUBTYPE_SH7757) || \ - defined(CONFIG_CPU_SUBTYPE_SH7763) || \ - defined(CONFIG_CPU_SUBTYPE_SH7764) || \ - defined(CONFIG_CPU_SUBTYPE_SH7780) || \ - defined(CONFIG_CPU_SUBTYPE_SH7785) +#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ + defined(CONFIG_CPU_SUBTYPE_SH7764) +#define CHCR_TS_LOW_MASK 0x00000018 +#define CHCR_TS_LOW_SHIFT 3 +#define CHCR_TS_HIGH_MASK 0 +#define CHCR_TS_HIGH_SHIFT 0 +#elif defined(CONFIG_CPU_SUBTYPE_SH7723) +#define CHCR_TS_LOW_MASK 0x00000018 +#define CHCR_TS_LOW_SHIFT 3 +#define CHCR_TS_HIGH_MASK 0 +#define CHCR_TS_HIGH_SHIFT 0 +#elif defined(CONFIG_CPU_SUBTYPE_SH7757) #define CHCR_TS_LOW_MASK 0x00000018 #define CHCR_TS_LOW_SHIFT 3 #define CHCR_TS_HIGH_MASK 0x00100000 #define CHCR_TS_HIGH_SHIFT (20 - 2) /* 2 bits for shifted low TS */ +#elif defined(CONFIG_CPU_SUBTYPE_SH7780) +#define CHCR_TS_LOW_MASK 0x00000018 +#define CHCR_TS_LOW_SHIFT 3 +#define CHCR_TS_HIGH_MASK 0 +#define CHCR_TS_HIGH_SHIFT 0 +#else /* SH7785 */ +#define CHCR_TS_LOW_MASK 0x00000018 +#define CHCR_TS_LOW_SHIFT 3 +#define CHCR_TS_HIGH_MASK 0 +#define CHCR_TS_HIGH_SHIFT 0 #endif /* Transmit sizes and respective CHCR register values */ diff --git a/trunk/arch/sh/include/mach-common/mach/mangle-port.h b/trunk/arch/sh/include/mach-common/mach/mangle-port.h deleted file mode 100644 index 4ca1769a0f12..000000000000 --- a/trunk/arch/sh/include/mach-common/mach/mangle-port.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * SH version cribbed from the MIPS copy: - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2003, 2004 Ralf Baechle - */ -#ifndef __MACH_COMMON_MANGLE_PORT_H -#define __MACH_COMMON_MANGLE_PORT_H - -/* - * Sane hardware offers swapping of PCI/ISA I/O space accesses in hardware; - * less sane hardware forces software to fiddle with this... - * - * Regardless, if the host bus endianness mismatches that of PCI/ISA, then - * you can't have the numerical value of data and byte addresses within - * multibyte quantities both preserved at the same time. Hence two - * variations of functions: non-prefixed ones that preserve the value - * and prefixed ones that preserve byte addresses. The latters are - * typically used for moving raw data between a peripheral and memory (cf. - * string I/O functions), hence the "__mem_" prefix. - */ -#if defined(CONFIG_SWAP_IO_SPACE) - -# define ioswabb(x) (x) -# define __mem_ioswabb(x) (x) -# define ioswabw(x) le16_to_cpu(x) -# define __mem_ioswabw(x) (x) -# define ioswabl(x) le32_to_cpu(x) -# define __mem_ioswabl(x) (x) -# define ioswabq(x) le64_to_cpu(x) -# define __mem_ioswabq(x) (x) - -#else - -# define ioswabb(x) (x) -# define __mem_ioswabb(x) (x) -# define ioswabw(x) (x) -# define __mem_ioswabw(x) cpu_to_le16(x) -# define ioswabl(x) (x) -# define __mem_ioswabl(x) cpu_to_le32(x) -# define ioswabq(x) (x) -# define __mem_ioswabq(x) cpu_to_le32(x) - -#endif - -#endif /* __MACH_COMMON_MANGLE_PORT_H */ diff --git a/trunk/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/trunk/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index c8836cffa216..2875e8be4f72 100644 --- a/trunk/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/trunk/arch/sh/kernel/cpu/sh4a/setup-sh7757.c @@ -680,25 +680,6 @@ static struct platform_device spi1_device = { .resource = spi1_resources, }; -static struct resource rspi_resources[] = { - { - .start = 0xfe480000, - .end = 0xfe4800ff, - .flags = IORESOURCE_MEM, - }, - { - .start = 220, - .flags = IORESOURCE_IRQ, - }, -}; - -static struct platform_device rspi_device = { - .name = "rspi", - .id = 2, - .num_resources = ARRAY_SIZE(rspi_resources), - .resource = rspi_resources, -}; - static struct resource usb_ehci_resources[] = { [0] = { .start = 0xfe4f1000, @@ -759,7 +740,6 @@ static struct platform_device *sh7757_devices[] __initdata = { &dma3_device, &spi0_device, &spi1_device, - &rspi_device, &usb_ehci_device, &usb_ohci_device, }; diff --git a/trunk/arch/sh/kernel/cpufreq.c b/trunk/arch/sh/kernel/cpufreq.c index e68b45b6f3f9..0fffacea6ed9 100644 --- a/trunk/arch/sh/kernel/cpufreq.c +++ b/trunk/arch/sh/kernel/cpufreq.c @@ -3,7 +3,7 @@ * * cpufreq driver for the SuperH processors. * - * Copyright (C) 2002 - 2012 Paul Mundt + * Copyright (C) 2002 - 2007 Paul Mundt * Copyright (C) 2002 M. R. Brown * * Clock framework bits from arch/avr32/mach-at32ap/cpufreq.c @@ -14,8 +14,6 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. */ -#define pr_fmt(fmt) "cpufreq: " fmt - #include #include #include @@ -23,18 +21,15 @@ #include #include #include -#include #include #include /* set_cpus_allowed() */ #include -#include -#include -static DEFINE_PER_CPU(struct clk, sh_cpuclk); +static struct clk *cpuclk; static unsigned int sh_cpufreq_get(unsigned int cpu) { - return (clk_get_rate(&per_cpu(sh_cpuclk, cpu)) + 500) / 1000; + return (clk_get_rate(cpuclk) + 500) / 1000; } /* @@ -45,10 +40,8 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy, unsigned int relation) { unsigned int cpu = policy->cpu; - struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); cpumask_t cpus_allowed; struct cpufreq_freqs freqs; - struct device *dev; long freq; if (!cpu_online(cpu)) @@ -59,15 +52,13 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy, BUG_ON(smp_processor_id() != cpu); - dev = get_cpu_device(cpu); - /* Convert target_freq from kHz to Hz */ freq = clk_round_rate(cpuclk, target_freq * 1000); if (freq < (policy->min * 1000) || freq > (policy->max * 1000)) return -EINVAL; - dev_dbg(dev, "requested frequency %u Hz\n", target_freq * 1000); + pr_debug("cpufreq: requested frequency %u Hz\n", target_freq * 1000); freqs.cpu = cpu; freqs.old = sh_cpufreq_get(cpu); @@ -79,112 +70,78 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy, clk_set_rate(cpuclk, freq); cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); - dev_dbg(dev, "set frequency %lu Hz\n", freq); - - return 0; -} - -static int sh_cpufreq_verify(struct cpufreq_policy *policy) -{ - struct clk *cpuclk = &per_cpu(sh_cpuclk, policy->cpu); - struct cpufreq_frequency_table *freq_table; - - freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; - if (freq_table) - return cpufreq_frequency_table_verify(policy, freq_table); - - cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, - policy->cpuinfo.max_freq); - - policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000; - policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; - - cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, - policy->cpuinfo.max_freq); + pr_debug("cpufreq: set frequency %lu Hz\n", freq); return 0; } static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) { - unsigned int cpu = policy->cpu; - struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); - struct cpufreq_frequency_table *freq_table; - struct device *dev; - - if (!cpu_online(cpu)) + if (!cpu_online(policy->cpu)) return -ENODEV; - dev = get_cpu_device(cpu); - - cpuclk = clk_get(dev, "cpu_clk"); + cpuclk = clk_get(NULL, "cpu_clk"); if (IS_ERR(cpuclk)) { - dev_err(dev, "couldn't get CPU clk\n"); + printk(KERN_ERR "cpufreq: couldn't get CPU#%d clk\n", + policy->cpu); return PTR_ERR(cpuclk); } - policy->cur = policy->min = policy->max = sh_cpufreq_get(cpu); + /* cpuinfo and default policy values */ + policy->cpuinfo.min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000; + policy->cpuinfo.max_freq = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; + policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; - freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; - if (freq_table) { - int result; + policy->cur = sh_cpufreq_get(policy->cpu); + policy->min = policy->cpuinfo.min_freq; + policy->max = policy->cpuinfo.max_freq; - result = cpufreq_frequency_table_cpuinfo(policy, freq_table); - if (!result) - cpufreq_frequency_table_get_attr(freq_table, cpu); - } else { - dev_notice(dev, "no frequency table found, falling back " - "to rate rounding.\n"); + /* + * Catch the cases where the clock framework hasn't been wired up + * properly to support scaling. + */ + if (unlikely(policy->min == policy->max)) { + printk(KERN_ERR "cpufreq: clock framework rate rounding " + "not supported on CPU#%d.\n", policy->cpu); - policy->cpuinfo.min_freq = - (clk_round_rate(cpuclk, 1) + 500) / 1000; - policy->cpuinfo.max_freq = - (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; + clk_put(cpuclk); + return -EINVAL; } - policy->min = policy->cpuinfo.min_freq; - policy->max = policy->cpuinfo.max_freq; - - policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; - - dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " + printk(KERN_INFO "cpufreq: CPU#%d Frequencies - Minimum %u.%03u MHz, " "Maximum %u.%03u MHz.\n", - policy->min / 1000, policy->min % 1000, + policy->cpu, policy->min / 1000, policy->min % 1000, policy->max / 1000, policy->max % 1000); return 0; } -static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy) +static int sh_cpufreq_verify(struct cpufreq_policy *policy) { - unsigned int cpu = policy->cpu; - struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); + cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, + policy->cpuinfo.max_freq); + return 0; +} - cpufreq_frequency_table_put_attr(cpu); +static int sh_cpufreq_exit(struct cpufreq_policy *policy) +{ clk_put(cpuclk); - return 0; } -static struct freq_attr *sh_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver sh_cpufreq_driver = { .owner = THIS_MODULE, .name = "sh", - .get = sh_cpufreq_get, - .target = sh_cpufreq_target, - .verify = sh_cpufreq_verify, .init = sh_cpufreq_cpu_init, - .exit = sh_cpufreq_cpu_exit, - .attr = sh_freq_attr, + .verify = sh_cpufreq_verify, + .target = sh_cpufreq_target, + .get = sh_cpufreq_get, + .exit = sh_cpufreq_exit, }; static int __init sh_cpufreq_module_init(void) { - pr_notice("SuperH CPU frequency driver.\n"); + printk(KERN_INFO "cpufreq: SuperH CPU frequency driver.\n"); return cpufreq_register_driver(&sh_cpufreq_driver); } diff --git a/trunk/arch/sh/kernel/signal_32.c b/trunk/arch/sh/kernel/signal_32.c index 5901fba3176e..0bc58866add1 100644 --- a/trunk/arch/sh/kernel/signal_32.c +++ b/trunk/arch/sh/kernel/signal_32.c @@ -57,13 +57,12 @@ sys_sigsuspend(old_sigset_t mask, unsigned long r5, unsigned long r6, unsigned long r7, struct pt_regs __regs) { - sigset_t blocked; - - current->saved_sigmask = current->blocked; - mask &= _BLOCKABLE; - siginitset(&blocked, mask); - set_current_blocked(&blocked); + spin_lock_irq(¤t->sighand->siglock); + current->saved_sigmask = current->blocked; + siginitset(¤t->blocked, mask); + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); current->state = TASK_INTERRUPTIBLE; schedule(); @@ -240,7 +239,11 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - set_current_blocked(&set); + + spin_lock_irq(¤t->sighand->siglock); + current->blocked = set; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->sc, &r0)) goto badframe; @@ -270,7 +273,10 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - set_current_blocked(&set); + spin_lock_irq(¤t->sighand->siglock); + current->blocked = set; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) goto badframe; @@ -541,8 +547,17 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, else ret = setup_frame(sig, ka, oldset, regs); - if (ret == 0) - block_sigmask(ka, sig); + if (ka->sa.sa_flags & SA_ONESHOT) + ka->sa.sa_handler = SIG_DFL; + + if (ret == 0) { + spin_lock_irq(¤t->sighand->siglock); + sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); + if (!(ka->sa.sa_flags & SA_NODEFER)) + sigaddset(¤t->blocked,sig); + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + } return ret; } diff --git a/trunk/arch/sh/kernel/signal_64.c b/trunk/arch/sh/kernel/signal_64.c index 3c9a6f7dcdce..6b5603fe274b 100644 --- a/trunk/arch/sh/kernel/signal_64.c +++ b/trunk/arch/sh/kernel/signal_64.c @@ -159,13 +159,14 @@ sys_sigsuspend(old_sigset_t mask, unsigned long r6, unsigned long r7, struct pt_regs * regs) { - sigset_t saveset, blocked; - - saveset = current->blocked; + sigset_t saveset; mask &= _BLOCKABLE; - siginitset(&blocked, mask); - set_current_blocked(&blocked); + spin_lock_irq(¤t->sighand->siglock); + saveset = current->blocked; + siginitset(¤t->blocked, mask); + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); REF_REG_RET = -EINTR; while (1) { @@ -197,8 +198,11 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, if (copy_from_user(&newset, unewset, sizeof(newset))) return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); + spin_lock_irq(¤t->sighand->siglock); saveset = current->blocked; - set_current_blocked(&newset); + current->blocked = newset; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); REF_REG_RET = -EINTR; while (1) { @@ -404,7 +408,11 @@ asmlinkage int sys_sigreturn(unsigned long r2, unsigned long r3, goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - set_current_blocked(&set); + + spin_lock_irq(¤t->sighand->siglock); + current->blocked = set; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->sc, &ret)) goto badframe; @@ -437,7 +445,10 @@ asmlinkage int sys_rt_sigreturn(unsigned long r2, unsigned long r3, goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); - set_current_blocked(&set); + spin_lock_irq(¤t->sighand->siglock); + current->blocked = set; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &ret)) goto badframe; @@ -723,8 +734,17 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, else ret = setup_frame(sig, ka, oldset, regs); - if (ret == 0) - block_sigmask(ka, sig); + if (ka->sa.sa_flags & SA_ONESHOT) + ka->sa.sa_handler = SIG_DFL; + + if (ret == 0) { + spin_lock_irq(¤t->sighand->siglock); + sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); + if (!(ka->sa.sa_flags & SA_NODEFER)) + sigaddset(¤t->blocked,sig); + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + } return ret; } diff --git a/trunk/arch/sh/kernel/syscalls_32.S b/trunk/arch/sh/kernel/syscalls_32.S index 4b68f0f79761..ee56a9b1a981 100644 --- a/trunk/arch/sh/kernel/syscalls_32.S +++ b/trunk/arch/sh/kernel/syscalls_32.S @@ -204,8 +204,8 @@ ENTRY(sys_call_table) .long sys_capset /* 185 */ .long sys_sigaltstack .long sys_sendfile - .long sys_ni_syscall /* getpmsg */ - .long sys_ni_syscall /* putpmsg */ + .long sys_ni_syscall /* streams1 */ + .long sys_ni_syscall /* streams2 */ .long sys_vfork /* 190 */ .long sys_getrlimit .long sys_mmap2 @@ -259,8 +259,8 @@ ENTRY(sys_call_table) .long sys_futex /* 240 */ .long sys_sched_setaffinity .long sys_sched_getaffinity - .long sys_ni_syscall /* reserved for set_thread_area */ - .long sys_ni_syscall /* reserved for get_thread_area */ + .long sys_ni_syscall + .long sys_ni_syscall .long sys_io_setup /* 245 */ .long sys_io_destroy .long sys_io_getevents diff --git a/trunk/arch/sh/kernel/syscalls_64.S b/trunk/arch/sh/kernel/syscalls_64.S index 0956345b36ef..9af7de26fb71 100644 --- a/trunk/arch/sh/kernel/syscalls_64.S +++ b/trunk/arch/sh/kernel/syscalls_64.S @@ -208,8 +208,8 @@ sys_call_table: .long sys_capset /* 185 */ .long sys_sigaltstack .long sys_sendfile - .long sys_ni_syscall /* getpmsg */ - .long sys_ni_syscall /* putpmsg */ + .long sys_ni_syscall /* streams1 */ + .long sys_ni_syscall /* streams2 */ .long sys_vfork /* 190 */ .long sys_getrlimit .long sys_mmap2 @@ -296,8 +296,8 @@ sys_call_table: .long sys_futex .long sys_sched_setaffinity .long sys_sched_getaffinity /* 270 */ - .long sys_ni_syscall /* reserved for set_thread_area */ - .long sys_ni_syscall /* reserved for get_thread_area */ + .long sys_ni_syscall + .long sys_ni_syscall .long sys_io_setup .long sys_io_destroy .long sys_io_getevents /* 275 */ diff --git a/trunk/arch/sparc/include/asm/ptrace.h b/trunk/arch/sparc/include/asm/ptrace.h index ef8c7c068f53..9835adc163fd 100644 --- a/trunk/arch/sparc/include/asm/ptrace.h +++ b/trunk/arch/sparc/include/asm/ptrace.h @@ -165,6 +165,7 @@ struct sparc_stackf { #ifdef __KERNEL__ #include +#include static inline int pt_regs_trap_type(struct pt_regs *regs) { diff --git a/trunk/drivers/input/joystick/amijoy.c b/trunk/drivers/input/joystick/amijoy.c index c65b5fa69f1e..24044dacbf70 100644 --- a/trunk/drivers/input/joystick/amijoy.c +++ b/trunk/drivers/input/joystick/amijoy.c @@ -107,9 +107,6 @@ static int __init amijoy_init(void) int i, j; int err; - if (!MACH_IS_AMIGA) - return -ENODEV; - for (i = 0; i < 2; i++) { if (!amijoy[i]) continue; diff --git a/trunk/drivers/input/keyboard/gpio_keys.c b/trunk/drivers/input/keyboard/gpio_keys.c index 62bfce468f9f..ed1ed469d085 100644 --- a/trunk/drivers/input/keyboard/gpio_keys.c +++ b/trunk/drivers/input/keyboard/gpio_keys.c @@ -28,18 +28,14 @@ #include #include #include -#include struct gpio_button_data { - const struct gpio_keys_button *button; + struct gpio_keys_button *button; struct input_dev *input; struct timer_list timer; struct work_struct work; - unsigned int timer_debounce; /* in msecs */ - unsigned int irq; - spinlock_t lock; + int timer_debounce; /* in msecs */ bool disabled; - bool key_pressed; }; struct gpio_keys_drvdata { @@ -118,7 +114,7 @@ static void gpio_keys_disable_button(struct gpio_button_data *bdata) /* * Disable IRQ and possible debouncing timer. */ - disable_irq(bdata->irq); + disable_irq(gpio_to_irq(bdata->button->gpio)); if (bdata->timer_debounce) del_timer_sync(&bdata->timer); @@ -139,7 +135,7 @@ static void gpio_keys_disable_button(struct gpio_button_data *bdata) static void gpio_keys_enable_button(struct gpio_button_data *bdata) { if (bdata->disabled) { - enable_irq(bdata->irq); + enable_irq(gpio_to_irq(bdata->button->gpio)); bdata->disabled = false; } } @@ -199,7 +195,7 @@ static ssize_t gpio_keys_attr_show_helper(struct gpio_keys_drvdata *ddata, * @type: button type (%EV_KEY, %EV_SW) * * This function parses stringified bitmap from @buf and disables/enables - * GPIO buttons accordingly. Returns 0 on success and negative error + * GPIO buttons accordinly. Returns 0 on success and negative error * on failure. */ static ssize_t gpio_keys_attr_store_helper(struct gpio_keys_drvdata *ddata, @@ -324,9 +320,9 @@ static struct attribute_group gpio_keys_attr_group = { .attrs = gpio_keys_attrs, }; -static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata) +static void gpio_keys_report_event(struct gpio_button_data *bdata) { - const struct gpio_keys_button *button = bdata->button; + struct gpio_keys_button *button = bdata->button; struct input_dev *input = bdata->input; unsigned int type = button->type ?: EV_KEY; int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low; @@ -340,26 +336,27 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata) input_sync(input); } -static void gpio_keys_gpio_work_func(struct work_struct *work) +static void gpio_keys_work_func(struct work_struct *work) { struct gpio_button_data *bdata = container_of(work, struct gpio_button_data, work); - gpio_keys_gpio_report_event(bdata); + gpio_keys_report_event(bdata); } -static void gpio_keys_gpio_timer(unsigned long _data) +static void gpio_keys_timer(unsigned long _data) { - struct gpio_button_data *bdata = (struct gpio_button_data *)_data; + struct gpio_button_data *data = (struct gpio_button_data *)_data; - schedule_work(&bdata->work); + schedule_work(&data->work); } -static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id) +static irqreturn_t gpio_keys_isr(int irq, void *dev_id) { struct gpio_button_data *bdata = dev_id; + struct gpio_keys_button *button = bdata->button; - BUG_ON(irq != bdata->irq); + BUG_ON(irq != gpio_to_irq(button->gpio)); if (bdata->timer_debounce) mod_timer(&bdata->timer, @@ -370,133 +367,50 @@ static irqreturn_t gpio_keys_gpio_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static void gpio_keys_irq_timer(unsigned long _data) -{ - struct gpio_button_data *bdata = (struct gpio_button_data *)_data; - struct input_dev *input = bdata->input; - unsigned long flags; - - spin_lock_irqsave(&bdata->lock, flags); - if (bdata->key_pressed) { - input_event(input, EV_KEY, bdata->button->code, 0); - input_sync(input); - bdata->key_pressed = false; - } - spin_unlock_irqrestore(&bdata->lock, flags); -} - -static irqreturn_t gpio_keys_irq_isr(int irq, void *dev_id) -{ - struct gpio_button_data *bdata = dev_id; - const struct gpio_keys_button *button = bdata->button; - struct input_dev *input = bdata->input; - unsigned long flags; - - BUG_ON(irq != bdata->irq); - - spin_lock_irqsave(&bdata->lock, flags); - - if (!bdata->key_pressed) { - input_event(input, EV_KEY, button->code, 1); - input_sync(input); - - if (!bdata->timer_debounce) { - input_event(input, EV_KEY, button->code, 0); - input_sync(input); - goto out; - } - - bdata->key_pressed = true; - } - - if (bdata->timer_debounce) - mod_timer(&bdata->timer, - jiffies + msecs_to_jiffies(bdata->timer_debounce)); -out: - spin_unlock_irqrestore(&bdata->lock, flags); - return IRQ_HANDLED; -} - static int __devinit gpio_keys_setup_key(struct platform_device *pdev, - struct input_dev *input, struct gpio_button_data *bdata, - const struct gpio_keys_button *button) + struct gpio_keys_button *button) { const char *desc = button->desc ? button->desc : "gpio_keys"; struct device *dev = &pdev->dev; - irq_handler_t isr; unsigned long irqflags; int irq, error; - bdata->input = input; - bdata->button = button; - spin_lock_init(&bdata->lock); - - if (gpio_is_valid(button->gpio)) { - - error = gpio_request(button->gpio, desc); - if (error < 0) { - dev_err(dev, "Failed to request GPIO %d, error %d\n", - button->gpio, error); - return error; - } - - error = gpio_direction_input(button->gpio); - if (error < 0) { - dev_err(dev, - "Failed to configure direction for GPIO %d, error %d\n", - button->gpio, error); - goto fail; - } - - if (button->debounce_interval) { - error = gpio_set_debounce(button->gpio, - button->debounce_interval * 1000); - /* use timer if gpiolib doesn't provide debounce */ - if (error < 0) - bdata->timer_debounce = - button->debounce_interval; - } - - irq = gpio_to_irq(button->gpio); - if (irq < 0) { - error = irq; - dev_err(dev, - "Unable to get irq number for GPIO %d, error %d\n", - button->gpio, error); - goto fail; - } - bdata->irq = irq; - - INIT_WORK(&bdata->work, gpio_keys_gpio_work_func); - setup_timer(&bdata->timer, - gpio_keys_gpio_timer, (unsigned long)bdata); + setup_timer(&bdata->timer, gpio_keys_timer, (unsigned long)bdata); + INIT_WORK(&bdata->work, gpio_keys_work_func); - isr = gpio_keys_gpio_isr; - irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING; - - } else { - if (!button->irq) { - dev_err(dev, "No IRQ specified\n"); - return -EINVAL; - } - bdata->irq = button->irq; - - if (button->type && button->type != EV_KEY) { - dev_err(dev, "Only EV_KEY allowed for IRQ buttons.\n"); - return -EINVAL; - } + error = gpio_request(button->gpio, desc); + if (error < 0) { + dev_err(dev, "failed to request GPIO %d, error %d\n", + button->gpio, error); + goto fail2; + } - bdata->timer_debounce = button->debounce_interval; - setup_timer(&bdata->timer, - gpio_keys_irq_timer, (unsigned long)bdata); + error = gpio_direction_input(button->gpio); + if (error < 0) { + dev_err(dev, "failed to configure" + " direction for GPIO %d, error %d\n", + button->gpio, error); + goto fail3; + } - isr = gpio_keys_irq_isr; - irqflags = 0; + if (button->debounce_interval) { + error = gpio_set_debounce(button->gpio, + button->debounce_interval * 1000); + /* use timer if gpiolib doesn't provide debounce */ + if (error < 0) + bdata->timer_debounce = button->debounce_interval; } - input_set_capability(input, button->type ?: EV_KEY, button->code); + irq = gpio_to_irq(button->gpio); + if (irq < 0) { + error = irq; + dev_err(dev, "Unable to get irq number for GPIO %d, error %d\n", + button->gpio, error); + goto fail3; + } + irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING; /* * If platform has specified that the button can be disabled, * we don't want it to share the interrupt line. @@ -504,19 +418,18 @@ static int __devinit gpio_keys_setup_key(struct platform_device *pdev, if (!button->can_disable) irqflags |= IRQF_SHARED; - error = request_any_context_irq(bdata->irq, isr, irqflags, desc, bdata); + error = request_threaded_irq(irq, NULL, gpio_keys_isr, irqflags, desc, bdata); if (error < 0) { dev_err(dev, "Unable to claim irq %d; error %d\n", - bdata->irq, error); - goto fail; + irq, error); + goto fail3; } return 0; -fail: - if (gpio_is_valid(button->gpio)) - gpio_free(button->gpio); - +fail3: + gpio_free(button->gpio); +fail2: return error; } @@ -634,19 +547,9 @@ static int gpio_keys_get_devtree_pdata(struct device *dev, #endif -static void gpio_remove_key(struct gpio_button_data *bdata) -{ - free_irq(bdata->irq, bdata); - if (bdata->timer_debounce) - del_timer_sync(&bdata->timer); - cancel_work_sync(&bdata->work); - if (gpio_is_valid(bdata->button->gpio)) - gpio_free(bdata->button->gpio); -} - static int __devinit gpio_keys_probe(struct platform_device *pdev) { - const struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; + struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; struct gpio_keys_drvdata *ddata; struct device *dev = &pdev->dev; struct gpio_keys_platform_data alt_pdata; @@ -696,15 +599,21 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) __set_bit(EV_REP, input->evbit); for (i = 0; i < pdata->nbuttons; i++) { - const struct gpio_keys_button *button = &pdata->buttons[i]; + struct gpio_keys_button *button = &pdata->buttons[i]; struct gpio_button_data *bdata = &ddata->data[i]; + unsigned int type = button->type ?: EV_KEY; + + bdata->input = input; + bdata->button = button; - error = gpio_keys_setup_key(pdev, input, bdata, button); + error = gpio_keys_setup_key(pdev, bdata, button); if (error) goto fail2; if (button->wakeup) wakeup = 1; + + input_set_capability(input, type, button->code); } error = sysfs_create_group(&pdev->dev.kobj, &gpio_keys_attr_group); @@ -721,12 +630,9 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) goto fail3; } - /* get current state of buttons that are connected to GPIOs */ - for (i = 0; i < pdata->nbuttons; i++) { - struct gpio_button_data *bdata = &ddata->data[i]; - if (gpio_is_valid(bdata->button->gpio)) - gpio_keys_gpio_report_event(bdata); - } + /* get current state of buttons */ + for (i = 0; i < pdata->nbuttons; i++) + gpio_keys_report_event(&ddata->data[i]); input_sync(input); device_init_wakeup(&pdev->dev, wakeup); @@ -736,8 +642,13 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) fail3: sysfs_remove_group(&pdev->dev.kobj, &gpio_keys_attr_group); fail2: - while (--i >= 0) - gpio_remove_key(&ddata->data[i]); + while (--i >= 0) { + free_irq(gpio_to_irq(pdata->buttons[i].gpio), &ddata->data[i]); + if (ddata->data[i].timer_debounce) + del_timer_sync(&ddata->data[i].timer); + cancel_work_sync(&ddata->data[i].work); + gpio_free(pdata->buttons[i].gpio); + } platform_set_drvdata(pdev, NULL); fail1: @@ -760,8 +671,14 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 0); - for (i = 0; i < ddata->n_buttons; i++) - gpio_remove_key(&ddata->data[i]); + for (i = 0; i < ddata->n_buttons; i++) { + int irq = gpio_to_irq(ddata->data[i].button->gpio); + free_irq(irq, &ddata->data[i]); + if (ddata->data[i].timer_debounce) + del_timer_sync(&ddata->data[i].timer); + cancel_work_sync(&ddata->data[i].work); + gpio_free(ddata->data[i].button->gpio); + } input_unregister_device(input); @@ -786,9 +703,11 @@ static int gpio_keys_suspend(struct device *dev) if (device_may_wakeup(dev)) { for (i = 0; i < ddata->n_buttons; i++) { - struct gpio_button_data *bdata = &ddata->data[i]; - if (bdata->button->wakeup) - enable_irq_wake(bdata->irq); + struct gpio_keys_button *button = ddata->data[i].button; + if (button->wakeup) { + int irq = gpio_to_irq(button->gpio); + enable_irq_wake(irq); + } } } @@ -801,12 +720,14 @@ static int gpio_keys_resume(struct device *dev) int i; for (i = 0; i < ddata->n_buttons; i++) { - struct gpio_button_data *bdata = &ddata->data[i]; - if (bdata->button->wakeup && device_may_wakeup(dev)) - disable_irq_wake(bdata->irq); - if (gpio_is_valid(bdata->button->gpio)) - gpio_keys_gpio_report_event(bdata); + struct gpio_keys_button *button = ddata->data[i].button; + if (button->wakeup && device_may_wakeup(dev)) { + int irq = gpio_to_irq(button->gpio); + disable_irq_wake(irq); + } + + gpio_keys_report_event(&ddata->data[i]); } input_sync(ddata->input); diff --git a/trunk/drivers/input/keyboard/tegra-kbc.c b/trunk/drivers/input/keyboard/tegra-kbc.c index fe4ac95ca6c8..21c42f852343 100644 --- a/trunk/drivers/input/keyboard/tegra-kbc.c +++ b/trunk/drivers/input/keyboard/tegra-kbc.c @@ -630,7 +630,6 @@ tegra_kbc_dt_parse_pdata(struct platform_device *pdev) if (!np) return NULL; - pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); if (!pdata) return NULL; diff --git a/trunk/drivers/input/mouse/sentelic.c b/trunk/drivers/input/mouse/sentelic.c index a977bfaa6821..2a77a52d2e62 100644 --- a/trunk/drivers/input/mouse/sentelic.c +++ b/trunk/drivers/input/mouse/sentelic.c @@ -2,7 +2,7 @@ * Finger Sensing Pad PS/2 mouse driver. * * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. - * Copyright (C) 2005-2012 Tai-hwa Liang, Sentelic Corporation. + * Copyright (C) 2005-2011 Tai-hwa Liang, Sentelic Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -21,7 +21,6 @@ #include #include -#include #include #include #include @@ -37,9 +36,6 @@ #define FSP_CMD_TIMEOUT 200 #define FSP_CMD_TIMEOUT2 30 -#define GET_ABS_X(packet) ((packet[1] << 2) | ((packet[3] >> 2) & 0x03)) -#define GET_ABS_Y(packet) ((packet[2] << 2) | (packet[3] & 0x03)) - /** Driver version. */ static const char fsp_drv_ver[] = "1.0.0-K"; @@ -132,9 +128,8 @@ static int fsp_reg_read(struct psmouse *psmouse, int reg_addr, int *reg_val) out: ps2_end_command(ps2dev); psmouse_activate(psmouse); - psmouse_dbg(psmouse, - "READ REG: 0x%02x is 0x%02x (rc = %d)\n", - reg_addr, *reg_val, rc); + dev_dbg(&ps2dev->serio->dev, "READ REG: 0x%02x is 0x%02x (rc = %d)\n", + reg_addr, *reg_val, rc); return rc; } @@ -184,9 +179,8 @@ static int fsp_reg_write(struct psmouse *psmouse, int reg_addr, int reg_val) out: ps2_end_command(ps2dev); - psmouse_dbg(psmouse, - "WRITE REG: 0x%02x to 0x%02x (rc = %d)\n", - reg_addr, reg_val, rc); + dev_dbg(&ps2dev->serio->dev, "WRITE REG: 0x%02x to 0x%02x (rc = %d)\n", + reg_addr, reg_val, rc); return rc; } @@ -243,9 +237,8 @@ static int fsp_page_reg_read(struct psmouse *psmouse, int *reg_val) out: ps2_end_command(ps2dev); psmouse_activate(psmouse); - psmouse_dbg(psmouse, - "READ PAGE REG: 0x%02x (rc = %d)\n", - *reg_val, rc); + dev_dbg(&ps2dev->serio->dev, "READ PAGE REG: 0x%02x (rc = %d)\n", + *reg_val, rc); return rc; } @@ -281,9 +274,8 @@ static int fsp_page_reg_write(struct psmouse *psmouse, int reg_val) out: ps2_end_command(ps2dev); - psmouse_dbg(psmouse, - "WRITE PAGE REG: to 0x%02x (rc = %d)\n", - reg_val, rc); + dev_dbg(&ps2dev->serio->dev, "WRITE PAGE REG: to 0x%02x (rc = %d)\n", + reg_val, rc); return rc; } @@ -327,7 +319,7 @@ static int fsp_opc_tag_enable(struct psmouse *psmouse, bool enable) int res = 0; if (fsp_reg_read(psmouse, FSP_REG_OPC_QDOWN, &v) == -1) { - psmouse_err(psmouse, "Unable get OPC state.\n"); + dev_err(&psmouse->ps2dev.serio->dev, "Unable get OPC state.\n"); return -EIO; } @@ -344,7 +336,8 @@ static int fsp_opc_tag_enable(struct psmouse *psmouse, bool enable) } if (res != 0) { - psmouse_err(psmouse, "Unable to enable OPC tag.\n"); + dev_err(&psmouse->ps2dev.serio->dev, + "Unable to enable OPC tag.\n"); res = -EIO; } @@ -622,40 +615,18 @@ static struct attribute_group fsp_attribute_group = { .attrs = fsp_attributes, }; -#ifdef FSP_DEBUG -static void fsp_packet_debug(struct psmouse *psmouse, unsigned char packet[]) +#ifdef FSP_DEBUG +static void fsp_packet_debug(unsigned char packet[]) { static unsigned int ps2_packet_cnt; static unsigned int ps2_last_second; unsigned int jiffies_msec; - const char *packet_type = "UNKNOWN"; - unsigned short abs_x = 0, abs_y = 0; - - /* Interpret & dump the packet data. */ - switch (packet[0] >> FSP_PKT_TYPE_SHIFT) { - case FSP_PKT_TYPE_ABS: - packet_type = "Absolute"; - abs_x = GET_ABS_X(packet); - abs_y = GET_ABS_Y(packet); - break; - case FSP_PKT_TYPE_NORMAL: - packet_type = "Normal"; - break; - case FSP_PKT_TYPE_NOTIFY: - packet_type = "Notify"; - break; - case FSP_PKT_TYPE_NORMAL_OPC: - packet_type = "Normal-OPC"; - break; - } ps2_packet_cnt++; jiffies_msec = jiffies_to_msecs(jiffies); psmouse_dbg(psmouse, - "%08dms %s packets: %02x, %02x, %02x, %02x; " - "abs_x: %d, abs_y: %d\n", - jiffies_msec, packet_type, - packet[0], packet[1], packet[2], packet[3], abs_x, abs_y); + "%08dms PS/2 packets: %02x, %02x, %02x, %02x\n", + jiffies_msec, packet[0], packet[1], packet[2], packet[3]); if (jiffies_msec - ps2_last_second > 1000) { psmouse_dbg(psmouse, "PS/2 packets/sec = %d\n", ps2_packet_cnt); @@ -664,29 +635,17 @@ static void fsp_packet_debug(struct psmouse *psmouse, unsigned char packet[]) } } #else -static void fsp_packet_debug(struct psmouse *psmouse, unsigned char packet[]) +static void fsp_packet_debug(unsigned char packet[]) { } #endif -static void fsp_set_slot(struct input_dev *dev, int slot, bool active, - unsigned int x, unsigned int y) -{ - input_mt_slot(dev, slot); - input_mt_report_slot_state(dev, MT_TOOL_FINGER, active); - if (active) { - input_report_abs(dev, ABS_MT_POSITION_X, x); - input_report_abs(dev, ABS_MT_POSITION_Y, y); - } -} - static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse) { struct input_dev *dev = psmouse->dev; struct fsp_data *ad = psmouse->private; unsigned char *packet = psmouse->packet; unsigned char button_status = 0, lscroll = 0, rscroll = 0; - unsigned short abs_x, abs_y, fgrs = 0; int rel_x, rel_y; if (psmouse->pktcnt < 4) @@ -696,76 +655,16 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse) * Full packet accumulated, process it */ - fsp_packet_debug(psmouse, packet); - switch (psmouse->packet[0] >> FSP_PKT_TYPE_SHIFT) { case FSP_PKT_TYPE_ABS: - abs_x = GET_ABS_X(packet); - abs_y = GET_ABS_Y(packet); - - if (packet[0] & FSP_PB0_MFMC) { - /* - * MFMC packet: assume that there are two fingers on - * pad - */ - fgrs = 2; - - /* MFMC packet */ - if (packet[0] & FSP_PB0_MFMC_FGR2) { - /* 2nd finger */ - if (ad->last_mt_fgr == 2) { - /* - * workaround for buggy firmware - * which doesn't clear MFMC bit if - * the 1st finger is up - */ - fgrs = 1; - fsp_set_slot(dev, 0, false, 0, 0); - } - ad->last_mt_fgr = 2; - - fsp_set_slot(dev, 1, fgrs == 2, abs_x, abs_y); - } else { - /* 1st finger */ - if (ad->last_mt_fgr == 1) { - /* - * workaround for buggy firmware - * which doesn't clear MFMC bit if - * the 2nd finger is up - */ - fgrs = 1; - fsp_set_slot(dev, 1, false, 0, 0); - } - ad->last_mt_fgr = 1; - fsp_set_slot(dev, 0, fgrs != 0, abs_x, abs_y); - } - } else { - /* SFAC packet */ - - /* no multi-finger information */ - ad->last_mt_fgr = 0; - - if (abs_x != 0 && abs_y != 0) - fgrs = 1; - - fsp_set_slot(dev, 0, fgrs > 0, abs_x, abs_y); - fsp_set_slot(dev, 1, false, 0, 0); - } - if (fgrs > 0) { - input_report_abs(dev, ABS_X, abs_x); - input_report_abs(dev, ABS_Y, abs_y); - } - input_report_key(dev, BTN_LEFT, packet[0] & 0x01); - input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); - input_report_key(dev, BTN_TOUCH, fgrs); - input_report_key(dev, BTN_TOOL_FINGER, fgrs == 1); - input_report_key(dev, BTN_TOOL_DOUBLETAP, fgrs == 2); + dev_warn(&psmouse->ps2dev.serio->dev, + "Unexpected absolute mode packet, ignored.\n"); break; case FSP_PKT_TYPE_NORMAL_OPC: /* on-pad click, filter it if necessary */ if ((ad->flags & FSPDRV_FLAG_EN_OPC) != FSPDRV_FLAG_EN_OPC) - packet[0] &= ~FSP_PB0_LBTN; + packet[0] &= ~BIT(0); /* fall through */ case FSP_PKT_TYPE_NORMAL: @@ -812,6 +711,8 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse) input_sync(dev); + fsp_packet_debug(packet); + return PSMOUSE_FULL_PACKET; } @@ -835,106 +736,42 @@ static int fsp_activate_protocol(struct psmouse *psmouse) ps2_command(ps2dev, param, PSMOUSE_CMD_GETID); if (param[0] != 0x04) { - psmouse_err(psmouse, - "Unable to enable 4 bytes packet format.\n"); + dev_err(&psmouse->ps2dev.serio->dev, + "Unable to enable 4 bytes packet format.\n"); return -EIO; } - if (pad->ver < FSP_VER_STL3888_C0) { - /* Preparing relative coordinates output for older hardware */ - if (fsp_reg_read(psmouse, FSP_REG_SYSCTL5, &val)) { - psmouse_err(psmouse, - "Unable to read SYSCTL5 register.\n"); - return -EIO; - } - - if (fsp_get_buttons(psmouse, &pad->buttons)) { - psmouse_err(psmouse, - "Unable to retrieve number of buttons.\n"); - return -EIO; - } - - val &= ~(FSP_BIT_EN_MSID7 | FSP_BIT_EN_MSID8 | FSP_BIT_EN_AUTO_MSID8); - /* Ensure we are not in absolute mode */ - val &= ~FSP_BIT_EN_PKT_G0; - if (pad->buttons == 0x06) { - /* Left/Middle/Right & Scroll Up/Down/Right/Left */ - val |= FSP_BIT_EN_MSID6; - } - - if (fsp_reg_write(psmouse, FSP_REG_SYSCTL5, val)) { - psmouse_err(psmouse, - "Unable to set up required mode bits.\n"); - return -EIO; - } + if (fsp_reg_read(psmouse, FSP_REG_SYSCTL5, &val)) { + dev_err(&psmouse->ps2dev.serio->dev, + "Unable to read SYSCTL5 register.\n"); + return -EIO; + } - /* - * Enable OPC tags such that driver can tell the difference - * between on-pad and real button click - */ - if (fsp_opc_tag_enable(psmouse, true)) - psmouse_warn(psmouse, - "Failed to enable OPC tag mode.\n"); - /* enable on-pad click by default */ - pad->flags |= FSPDRV_FLAG_EN_OPC; - - /* Enable on-pad vertical and horizontal scrolling */ - fsp_onpad_vscr(psmouse, true); - fsp_onpad_hscr(psmouse, true); - } else { - /* Enable absolute coordinates output for Cx/Dx hardware */ - if (fsp_reg_write(psmouse, FSP_REG_SWC1, - FSP_BIT_SWC1_EN_ABS_1F | - FSP_BIT_SWC1_EN_ABS_2F | - FSP_BIT_SWC1_EN_FUP_OUT | - FSP_BIT_SWC1_EN_ABS_CON)) { - psmouse_err(psmouse, - "Unable to enable absolute coordinates output.\n"); - return -EIO; - } + val &= ~(FSP_BIT_EN_MSID7 | FSP_BIT_EN_MSID8 | FSP_BIT_EN_AUTO_MSID8); + /* Ensure we are not in absolute mode */ + val &= ~FSP_BIT_EN_PKT_G0; + if (pad->buttons == 0x06) { + /* Left/Middle/Right & Scroll Up/Down/Right/Left */ + val |= FSP_BIT_EN_MSID6; } - return 0; -} + if (fsp_reg_write(psmouse, FSP_REG_SYSCTL5, val)) { + dev_err(&psmouse->ps2dev.serio->dev, + "Unable to set up required mode bits.\n"); + return -EIO; + } -static int fsp_set_input_params(struct psmouse *psmouse) -{ - struct input_dev *dev = psmouse->dev; - struct fsp_data *pad = psmouse->private; + /* + * Enable OPC tags such that driver can tell the difference between + * on-pad and real button click + */ + if (fsp_opc_tag_enable(psmouse, true)) + dev_warn(&psmouse->ps2dev.serio->dev, + "Failed to enable OPC tag mode.\n"); - if (pad->ver < FSP_VER_STL3888_C0) { - __set_bit(BTN_MIDDLE, dev->keybit); - __set_bit(BTN_BACK, dev->keybit); - __set_bit(BTN_FORWARD, dev->keybit); - __set_bit(REL_WHEEL, dev->relbit); - __set_bit(REL_HWHEEL, dev->relbit); - } else { - /* - * Hardware prior to Cx performs much better in relative mode; - * hence, only enable absolute coordinates output as well as - * multi-touch output for the newer hardware. - * - * Maximum coordinates can be computed as: - * - * number of scanlines * 64 - 57 - * - * where number of X/Y scanline lines are 16/12. - */ - int abs_x = 967, abs_y = 711; - - __set_bit(EV_ABS, dev->evbit); - __clear_bit(EV_REL, dev->evbit); - __set_bit(BTN_TOUCH, dev->keybit); - __set_bit(BTN_TOOL_FINGER, dev->keybit); - __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); - __set_bit(INPUT_PROP_SEMI_MT, dev->propbit); - - input_set_abs_params(dev, ABS_X, 0, abs_x, 0, 0); - input_set_abs_params(dev, ABS_Y, 0, abs_y, 0, 0); - input_mt_init_slots(dev, 2); - input_set_abs_params(dev, ABS_MT_POSITION_X, 0, abs_x, 0, 0); - input_set_abs_params(dev, ABS_MT_POSITION_Y, 0, abs_y, 0, 0); - } + /* Enable on-pad vertical and horizontal scrolling */ + fsp_onpad_vscr(psmouse, true); + fsp_onpad_hscr(psmouse, true); return 0; } @@ -992,16 +829,18 @@ static int fsp_reconnect(struct psmouse *psmouse) int fsp_init(struct psmouse *psmouse) { struct fsp_data *priv; - int ver, rev; + int ver, rev, buttons; int error; if (fsp_get_version(psmouse, &ver) || - fsp_get_revision(psmouse, &rev)) { + fsp_get_revision(psmouse, &rev) || + fsp_get_buttons(psmouse, &buttons)) { return -ENODEV; } - psmouse_info(psmouse, "Finger Sensing Pad, hw: %d.%d.%d, sw: %s\n", - ver >> 4, ver & 0x0F, rev, fsp_drv_ver); + psmouse_info(psmouse, + "Finger Sensing Pad, hw: %d.%d.%d, sw: %s, buttons: %d\n", + ver >> 4, ver & 0x0F, rev, fsp_drv_ver, buttons & 7); psmouse->private = priv = kzalloc(sizeof(struct fsp_data), GFP_KERNEL); if (!priv) @@ -1009,6 +848,17 @@ int fsp_init(struct psmouse *psmouse) priv->ver = ver; priv->rev = rev; + priv->buttons = buttons; + + /* enable on-pad click by default */ + priv->flags |= FSPDRV_FLAG_EN_OPC; + + /* Set up various supported input event bits */ + __set_bit(BTN_MIDDLE, psmouse->dev->keybit); + __set_bit(BTN_BACK, psmouse->dev->keybit); + __set_bit(BTN_FORWARD, psmouse->dev->keybit); + __set_bit(REL_WHEEL, psmouse->dev->relbit); + __set_bit(REL_HWHEEL, psmouse->dev->relbit); psmouse->protocol_handler = fsp_process_byte; psmouse->disconnect = fsp_disconnect; @@ -1016,20 +866,16 @@ int fsp_init(struct psmouse *psmouse) psmouse->cleanup = fsp_reset; psmouse->pktsize = 4; + /* set default packet output based on number of buttons we found */ error = fsp_activate_protocol(psmouse); if (error) goto err_out; - /* Set up various supported input event bits */ - error = fsp_set_input_params(psmouse); - if (error) - goto err_out; - error = sysfs_create_group(&psmouse->ps2dev.serio->dev.kobj, &fsp_attribute_group); if (error) { - psmouse_err(psmouse, - "Failed to create sysfs attributes (%d)", error); + dev_err(&psmouse->ps2dev.serio->dev, + "Failed to create sysfs attributes (%d)", error); goto err_out; } diff --git a/trunk/drivers/input/mouse/sentelic.h b/trunk/drivers/input/mouse/sentelic.h index 334de19e5ddb..2e4af24f8c15 100644 --- a/trunk/drivers/input/mouse/sentelic.h +++ b/trunk/drivers/input/mouse/sentelic.h @@ -2,7 +2,7 @@ * Finger Sensing Pad PS/2 mouse driver. * * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. - * Copyright (C) 2005-2012 Tai-hwa Liang, Sentelic Corporation. + * Copyright (C) 2005-2011 Tai-hwa Liang, Sentelic Corporation. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -55,16 +55,6 @@ #define FSP_BIT_FIX_HSCR BIT(5) #define FSP_BIT_DRAG_LOCK BIT(6) -#define FSP_REG_SWC1 (0x90) -#define FSP_BIT_SWC1_EN_ABS_1F BIT(0) -#define FSP_BIT_SWC1_EN_GID BIT(1) -#define FSP_BIT_SWC1_EN_ABS_2F BIT(2) -#define FSP_BIT_SWC1_EN_FUP_OUT BIT(3) -#define FSP_BIT_SWC1_EN_ABS_CON BIT(4) -#define FSP_BIT_SWC1_GST_GRP0 BIT(5) -#define FSP_BIT_SWC1_GST_GRP1 BIT(6) -#define FSP_BIT_SWC1_BX_COMPAT BIT(7) - /* Finger-sensing Pad packet formating related definitions */ /* absolute packet type */ @@ -74,32 +64,12 @@ #define FSP_PKT_TYPE_NORMAL_OPC (0x03) #define FSP_PKT_TYPE_SHIFT (6) -/* bit definitions for the first byte of report packet */ -#define FSP_PB0_LBTN BIT(0) -#define FSP_PB0_RBTN BIT(1) -#define FSP_PB0_MBTN BIT(2) -#define FSP_PB0_MFMC_FGR2 FSP_PB0_MBTN -#define FSP_PB0_MUST_SET BIT(3) -#define FSP_PB0_PHY_BTN BIT(4) -#define FSP_PB0_MFMC BIT(5) - -/* hardware revisions */ -#define FSP_VER_STL3888_A4 (0xC1) -#define FSP_VER_STL3888_B0 (0xD0) -#define FSP_VER_STL3888_B1 (0xD1) -#define FSP_VER_STL3888_B2 (0xD2) -#define FSP_VER_STL3888_C0 (0xE0) -#define FSP_VER_STL3888_C1 (0xE1) -#define FSP_VER_STL3888_D0 (0xE2) -#define FSP_VER_STL3888_D1 (0xE3) -#define FSP_VER_STL3888_E0 (0xE4) - #ifdef __KERNEL__ struct fsp_data { unsigned char ver; /* hardware version */ unsigned char rev; /* hardware revison */ - unsigned int buttons; /* Number of buttons */ + unsigned char buttons; /* Number of buttons */ unsigned int flags; #define FSPDRV_FLAG_EN_OPC (0x001) /* enable on-pad clicking */ @@ -108,7 +78,6 @@ struct fsp_data { unsigned char last_reg; /* Last register we requested read from */ unsigned char last_val; - unsigned int last_mt_fgr; /* Last seen finger(multitouch) */ }; #ifdef CONFIG_MOUSE_PS2_SENTELIC diff --git a/trunk/drivers/input/tablet/Kconfig b/trunk/drivers/input/tablet/Kconfig index bed7cbf84cfd..e53f4081a586 100644 --- a/trunk/drivers/input/tablet/Kconfig +++ b/trunk/drivers/input/tablet/Kconfig @@ -76,7 +76,6 @@ config TABLET_USB_KBTAB config TABLET_USB_WACOM tristate "Wacom Intuos/Graphire tablet support (USB)" depends on USB_ARCH_HAS_HCD - select POWER_SUPPLY select USB select NEW_LEDS select LEDS_CLASS diff --git a/trunk/drivers/input/tablet/wacom.h b/trunk/drivers/input/tablet/wacom.h index b4842d0e61dd..0783864a7dc2 100644 --- a/trunk/drivers/input/tablet/wacom.h +++ b/trunk/drivers/input/tablet/wacom.h @@ -88,7 +88,6 @@ #include #include #include -#include #include /* @@ -113,7 +112,6 @@ struct wacom { struct urb *irq; struct wacom_wac wacom_wac; struct mutex lock; - struct work_struct work; bool open; char phys[32]; struct wacom_led { @@ -122,15 +120,8 @@ struct wacom { u8 hlv; /* status led brightness button pressed (1..127) */ u8 img_lum; /* OLED matrix display brightness */ } led; - struct power_supply battery; }; -static inline void wacom_schedule_work(struct wacom_wac *wacom_wac) -{ - struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); - schedule_work(&wacom->work); -} - extern const struct usb_device_id wacom_ids[]; void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len); diff --git a/trunk/drivers/input/tablet/wacom_sys.c b/trunk/drivers/input/tablet/wacom_sys.c index 0d269212931e..ca28066dc81e 100644 --- a/trunk/drivers/input/tablet/wacom_sys.c +++ b/trunk/drivers/input/tablet/wacom_sys.c @@ -167,19 +167,6 @@ static void wacom_close(struct input_dev *dev) usb_autopm_put_interface(wacom->intf); } -/* - * Static values for max X/Y and resolution of Pen interface is stored in - * features. This mean physical size of active area can be computed. - * This is useful to do when Pen and Touch have same active area of tablet. - * This means for Touch device, we only need to find max X/Y value and we - * have enough information to compute resolution of touch. - */ -static void wacom_set_phy_from_res(struct wacom_features *features) -{ - features->x_phy = (features->x_max * 100) / features->x_resolution; - features->y_phy = (features->y_max * 100) / features->y_resolution; -} - static int wacom_parse_logical_collection(unsigned char *report, struct wacom_features *features) { @@ -191,7 +178,15 @@ static int wacom_parse_logical_collection(unsigned char *report, features->pktlen = WACOM_PKGLEN_BBTOUCH3; features->device_type = BTN_TOOL_FINGER; - wacom_set_phy_from_res(features); + /* + * Stylus and Touch have same active area + * so compute physical size based on stylus + * data before its overwritten. + */ + features->x_phy = + (features->x_max * 100) / features->x_resolution; + features->y_phy = + (features->y_max * 100) / features->y_resolution; features->x_max = features->y_max = get_unaligned_le16(&report[10]); @@ -427,7 +422,6 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat report_id, rep_data, 4, 1); } while ((error < 0 || rep_data[1] != 4) && limit++ < WAC_MSG_RETRIES); } else if (features->type != TABLETPC && - features->type != WIRELESS && features->device_type == BTN_TOOL_PEN) { do { rep_data[0] = 2; @@ -460,21 +454,6 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf, features->pressure_fuzz = 0; features->distance_fuzz = 0; - /* - * The wireless device HID is basic and layout conflicts with - * other tablets (monitor and touch interface can look like pen). - * Skip the query for this type and modify defaults based on - * interface number. - */ - if (features->type == WIRELESS) { - if (intf->cur_altsetting->desc.bInterfaceNumber == 0) { - features->device_type = 0; - } else if (intf->cur_altsetting->desc.bInterfaceNumber == 2) { - features->device_type = BTN_TOOL_DOUBLETAP; - features->pktlen = WACOM_PKGLEN_BBTOUCH3; - } - } - /* only Tablet PCs and Bamboo P&T need to retrieve the info */ if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) && (features->type != BAMBOO_PT)) @@ -843,152 +822,6 @@ static void wacom_destroy_leds(struct wacom *wacom) } } -static enum power_supply_property wacom_battery_props[] = { - POWER_SUPPLY_PROP_CAPACITY -}; - -static int wacom_battery_get_property(struct power_supply *psy, - enum power_supply_property psp, - union power_supply_propval *val) -{ - struct wacom *wacom = container_of(psy, struct wacom, battery); - int ret = 0; - - switch (psp) { - case POWER_SUPPLY_PROP_CAPACITY: - val->intval = - wacom->wacom_wac.battery_capacity * 100 / 31; - break; - default: - ret = -EINVAL; - break; - } - - return ret; -} - -static int wacom_initialize_battery(struct wacom *wacom) -{ - int error = 0; - - if (wacom->wacom_wac.features.quirks & WACOM_QUIRK_MONITOR) { - wacom->battery.properties = wacom_battery_props; - wacom->battery.num_properties = ARRAY_SIZE(wacom_battery_props); - wacom->battery.get_property = wacom_battery_get_property; - wacom->battery.name = "wacom_battery"; - wacom->battery.type = POWER_SUPPLY_TYPE_BATTERY; - wacom->battery.use_for_apm = 0; - - error = power_supply_register(&wacom->usbdev->dev, - &wacom->battery); - } - - return error; -} - -static void wacom_destroy_battery(struct wacom *wacom) -{ - if (wacom->wacom_wac.features.quirks & WACOM_QUIRK_MONITOR) - power_supply_unregister(&wacom->battery); -} - -static int wacom_register_input(struct wacom *wacom) -{ - struct input_dev *input_dev; - struct usb_interface *intf = wacom->intf; - struct usb_device *dev = interface_to_usbdev(intf); - struct wacom_wac *wacom_wac = &(wacom->wacom_wac); - int error; - - input_dev = input_allocate_device(); - if (!input_dev) - return -ENOMEM; - - input_dev->name = wacom_wac->name; - input_dev->dev.parent = &intf->dev; - input_dev->open = wacom_open; - input_dev->close = wacom_close; - usb_to_input_id(dev, &input_dev->id); - input_set_drvdata(input_dev, wacom); - - wacom_wac->input = input_dev; - wacom_setup_input_capabilities(input_dev, wacom_wac); - - error = input_register_device(input_dev); - if (error) { - input_free_device(input_dev); - wacom_wac->input = NULL; - } - - return error; -} - -static void wacom_wireless_work(struct work_struct *work) -{ - struct wacom *wacom = container_of(work, struct wacom, work); - struct usb_device *usbdev = wacom->usbdev; - struct wacom_wac *wacom_wac = &wacom->wacom_wac; - - /* - * Regardless if this is a disconnect or a new tablet, - * remove any existing input devices. - */ - - /* Stylus interface */ - wacom = usb_get_intfdata(usbdev->config->interface[1]); - if (wacom->wacom_wac.input) - input_unregister_device(wacom->wacom_wac.input); - wacom->wacom_wac.input = 0; - - /* Touch interface */ - wacom = usb_get_intfdata(usbdev->config->interface[2]); - if (wacom->wacom_wac.input) - input_unregister_device(wacom->wacom_wac.input); - wacom->wacom_wac.input = 0; - - if (wacom_wac->pid == 0) { - printk(KERN_INFO "wacom: wireless tablet disconnected\n"); - } else { - const struct usb_device_id *id = wacom_ids; - - printk(KERN_INFO - "wacom: wireless tablet connected with PID %x\n", - wacom_wac->pid); - - while (id->match_flags) { - if (id->idVendor == USB_VENDOR_ID_WACOM && - id->idProduct == wacom_wac->pid) - break; - id++; - } - - if (!id->match_flags) { - printk(KERN_INFO - "wacom: ignorning unknown PID.\n"); - return; - } - - /* Stylus interface */ - wacom = usb_get_intfdata(usbdev->config->interface[1]); - wacom_wac = &wacom->wacom_wac; - wacom_wac->features = - *((struct wacom_features *)id->driver_info); - wacom_wac->features.device_type = BTN_TOOL_PEN; - wacom_register_input(wacom); - - /* Touch interface */ - wacom = usb_get_intfdata(usbdev->config->interface[2]); - wacom_wac = &wacom->wacom_wac; - wacom_wac->features = - *((struct wacom_features *)id->driver_info); - wacom_wac->features.pktlen = WACOM_PKGLEN_BBTOUCH3; - wacom_wac->features.device_type = BTN_TOOL_FINGER; - wacom_set_phy_from_res(&wacom_wac->features); - wacom_wac->features.x_max = wacom_wac->features.y_max = 4096; - wacom_register_input(wacom); - } -} - static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_device *dev = interface_to_usbdev(intf); @@ -996,14 +829,18 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i struct wacom *wacom; struct wacom_wac *wacom_wac; struct wacom_features *features; + struct input_dev *input_dev; int error; if (!id->driver_info) return -EINVAL; wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); - if (!wacom) - return -ENOMEM; + input_dev = input_allocate_device(); + if (!wacom || !input_dev) { + error = -ENOMEM; + goto fail1; + } wacom_wac = &wacom->wacom_wac; wacom_wac->features = *((struct wacom_features *)id->driver_info); @@ -1029,10 +866,11 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i wacom->usbdev = dev; wacom->intf = intf; mutex_init(&wacom->lock); - INIT_WORK(&wacom->work, wacom_wireless_work); usb_make_path(dev, wacom->phys, sizeof(wacom->phys)); strlcat(wacom->phys, "/input0", sizeof(wacom->phys)); + wacom_wac->input = input_dev; + endpoint = &intf->cur_altsetting->endpoint[0].desc; /* Retrieve the physical and logical size for OEM devices */ @@ -1056,6 +894,15 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i goto fail3; } + input_dev->name = wacom_wac->name; + input_dev->dev.parent = &intf->dev; + input_dev->open = wacom_open; + input_dev->close = wacom_close; + usb_to_input_id(dev, &input_dev->id); + input_set_drvdata(input_dev, wacom); + + wacom_setup_input_capabilities(input_dev, wacom_wac); + usb_fill_int_urb(wacom->irq, dev, usb_rcvintpipe(dev, endpoint->bEndpointAddress), wacom_wac->data, features->pktlen, @@ -1067,34 +914,22 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i if (error) goto fail4; - error = wacom_initialize_battery(wacom); + error = input_register_device(input_dev); if (error) goto fail5; - if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) { - error = wacom_register_input(wacom); - if (error) - goto fail6; - } - /* Note that if query fails it is not a hard failure */ wacom_query_tablet_data(intf, features); usb_set_intfdata(intf, wacom); - - if (features->quirks & WACOM_QUIRK_MONITOR) { - if (usb_submit_urb(wacom->irq, GFP_KERNEL)) - goto fail5; - } - return 0; - fail6: wacom_destroy_battery(wacom); fail5: wacom_destroy_leds(wacom); fail4: wacom_remove_shared_data(wacom_wac); fail3: usb_free_urb(wacom->irq); fail2: usb_free_coherent(dev, WACOM_PKGLEN_MAX, wacom_wac->data, wacom->data_dma); - fail1: kfree(wacom); + fail1: input_free_device(input_dev); + kfree(wacom); return error; } @@ -1105,10 +940,7 @@ static void wacom_disconnect(struct usb_interface *intf) usb_set_intfdata(intf, NULL); usb_kill_urb(wacom->irq); - cancel_work_sync(&wacom->work); - if (wacom->wacom_wac.input) - input_unregister_device(wacom->wacom_wac.input); - wacom_destroy_battery(wacom); + input_unregister_device(wacom->wacom_wac.input); wacom_destroy_leds(wacom); usb_free_urb(wacom->irq); usb_free_coherent(interface_to_usbdev(intf), WACOM_PKGLEN_MAX, @@ -1140,8 +972,7 @@ static int wacom_resume(struct usb_interface *intf) wacom_query_tablet_data(intf, features); wacom_led_control(wacom); - if ((wacom->open || features->quirks & WACOM_QUIRK_MONITOR) - && usb_submit_urb(wacom->irq, GFP_NOIO) < 0) + if (wacom->open && usb_submit_urb(wacom->irq, GFP_NOIO) < 0) rv = -EIO; mutex_unlock(&wacom->lock); diff --git a/trunk/drivers/input/tablet/wacom_wac.c b/trunk/drivers/input/tablet/wacom_wac.c index cecd35c8f0b3..89a96427faa0 100644 --- a/trunk/drivers/input/tablet/wacom_wac.c +++ b/trunk/drivers/input/tablet/wacom_wac.c @@ -1044,35 +1044,6 @@ static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) return 0; } -static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len) -{ - unsigned char *data = wacom->data; - int connected; - - if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80) - return 0; - - connected = data[1] & 0x01; - if (connected) { - int pid, battery; - - pid = get_unaligned_be16(&data[6]); - battery = data[5] & 0x3f; - if (wacom->pid != pid) { - wacom->pid = pid; - wacom_schedule_work(wacom); - } - wacom->battery_capacity = battery; - } else if (wacom->pid != 0) { - /* disconnected while previously connected */ - wacom->pid = 0; - wacom_schedule_work(wacom); - wacom->battery_capacity = 0; - } - - return 0; -} - void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) { bool sync; @@ -1123,10 +1094,6 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) sync = wacom_bpt_irq(wacom_wac, len); break; - case WIRELESS: - sync = wacom_wireless_irq(wacom_wac, len); - break; - default: sync = false; break; @@ -1188,7 +1155,7 @@ void wacom_setup_device_quirks(struct wacom_features *features) /* these device have multiple inputs */ if (features->type == TABLETPC || features->type == TABLETPC2FG || - features->type == BAMBOO_PT || features->type == WIRELESS) + features->type == BAMBOO_PT) features->quirks |= WACOM_QUIRK_MULTI_INPUT; /* quirk for bamboo touch with 2 low res touches */ @@ -1200,16 +1167,6 @@ void wacom_setup_device_quirks(struct wacom_features *features) features->y_fuzz <<= 5; features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; } - - if (features->type == WIRELESS) { - - /* monitor never has input and pen/touch have delayed create */ - features->quirks |= WACOM_QUIRK_NO_INPUT; - - /* must be monitor interface if no device_type set */ - if (!features->device_type) - features->quirks |= WACOM_QUIRK_MONITOR; - } } static unsigned int wacom_calculate_touch_res(unsigned int logical_max, @@ -1683,9 +1640,6 @@ static const struct wacom_features wacom_features_0xEC = static const struct wacom_features wacom_features_0x47 = { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; -static const struct wacom_features wacom_features_0x84 = - { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0, - 0, WIRELESS, 0, 0 }; static const struct wacom_features wacom_features_0xD0 = { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; @@ -1812,7 +1766,6 @@ const struct usb_device_id wacom_ids[] = { { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID, USB_INTERFACE_SUBCLASS_BOOT, USB_INTERFACE_PROTOCOL_MOUSE) }, - { USB_DEVICE_WACOM(0x84) }, { USB_DEVICE_WACOM(0xD0) }, { USB_DEVICE_WACOM(0xD1) }, { USB_DEVICE_WACOM(0xD2) }, diff --git a/trunk/drivers/input/tablet/wacom_wac.h b/trunk/drivers/input/tablet/wacom_wac.h index ba5a334e54d6..4f0ba21b0196 100644 --- a/trunk/drivers/input/tablet/wacom_wac.h +++ b/trunk/drivers/input/tablet/wacom_wac.h @@ -24,7 +24,6 @@ #define WACOM_PKGLEN_BBTOUCH 20 #define WACOM_PKGLEN_BBTOUCH3 64 #define WACOM_PKGLEN_BBPEN 10 -#define WACOM_PKGLEN_WIRELESS 32 /* device IDs */ #define STYLUS_DEVICE_ID 0x02 @@ -46,8 +45,6 @@ /* device quirks */ #define WACOM_QUIRK_MULTI_INPUT 0x0001 #define WACOM_QUIRK_BBTOUCH_LOWRES 0x0002 -#define WACOM_QUIRK_NO_INPUT 0x0004 -#define WACOM_QUIRK_MONITOR 0x0008 enum { PENPARTNER = 0, @@ -57,7 +54,6 @@ enum { PL, DTU, BAMBOO_PT, - WIRELESS, INTUOS, INTUOS3S, INTUOS3, @@ -111,8 +107,6 @@ struct wacom_wac { struct wacom_features features; struct wacom_shared *shared; struct input_dev *input; - int pid; - int battery_capacity; }; #endif diff --git a/trunk/drivers/sh/intc/chip.c b/trunk/drivers/sh/intc/chip.c index 012df2676a26..7b246efa94ea 100644 --- a/trunk/drivers/sh/intc/chip.c +++ b/trunk/drivers/sh/intc/chip.c @@ -2,14 +2,13 @@ * IRQ chip definitions for INTC IRQs. * * Copyright (C) 2007, 2008 Magnus Damm - * Copyright (C) 2009 - 2012 Paul Mundt + * Copyright (C) 2009, 2010 Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include -#include #include #include "internals.h" @@ -59,6 +58,11 @@ static void intc_disable(struct irq_data *data) } } +static int intc_set_wake(struct irq_data *data, unsigned int on) +{ + return 0; /* allow wakeup, but setup hardware in intc_suspend() */ +} + #ifdef CONFIG_SMP /* * This is held with the irq desc lock held, so we don't require any @@ -74,7 +78,7 @@ static int intc_set_affinity(struct irq_data *data, cpumask_copy(data->affinity, cpumask); - return IRQ_SET_MASK_OK_NOCOPY; + return 0; } #endif @@ -118,12 +122,28 @@ static struct intc_handle_int *intc_find_irq(struct intc_handle_int *hp, unsigned int nr_hp, unsigned int irq) { - struct intc_handle_int key; + int i; + + /* + * this doesn't scale well, but... + * + * this function should only be used for cerain uncommon + * operations such as intc_set_priority() and intc_set_type() + * and in those rare cases performance doesn't matter that much. + * keeping the memory footprint low is more important. + * + * one rather simple way to speed this up and still keep the + * memory footprint down is to make sure the array is sorted + * and then perform a bisect to lookup the irq. + */ + for (i = 0; i < nr_hp; i++) { + if ((hp + i)->irq != irq) + continue; - key.irq = irq; - key.handle = 0; + return hp + i; + } - return bsearch(&key, hp, nr_hp, sizeof(*hp), intc_handle_int_cmp); + return NULL; } int intc_set_priority(unsigned int irq, unsigned int prio) @@ -203,9 +223,10 @@ struct irq_chip intc_irq_chip = { .irq_mask_ack = intc_mask_ack, .irq_enable = intc_enable, .irq_disable = intc_disable, + .irq_shutdown = intc_disable, .irq_set_type = intc_set_type, + .irq_set_wake = intc_set_wake, #ifdef CONFIG_SMP .irq_set_affinity = intc_set_affinity, #endif - .flags = IRQCHIP_SKIP_SET_WAKE, }; diff --git a/trunk/drivers/sh/intc/core.c b/trunk/drivers/sh/intc/core.c index 7e562ccb6997..2fde8970dfd0 100644 --- a/trunk/drivers/sh/intc/core.c +++ b/trunk/drivers/sh/intc/core.c @@ -2,7 +2,7 @@ * Shared interrupt handling code for IPR and INTC2 types of IRQs. * * Copyright (C) 2007, 2008 Magnus Damm - * Copyright (C) 2009 - 2012 Paul Mundt + * Copyright (C) 2009, 2010 Paul Mundt * * Based on intc2.c and ipr.c * @@ -31,12 +31,11 @@ #include #include #include -#include #include "internals.h" LIST_HEAD(intc_list); DEFINE_RAW_SPINLOCK(intc_big_lock); -static unsigned int nr_intc_controllers; +unsigned int nr_intc_controllers; /* * Default priority level @@ -268,9 +267,6 @@ int __init register_intc_controller(struct intc_desc *desc) k += save_reg(d, k, hw->prio_regs[i].set_reg, smp); k += save_reg(d, k, hw->prio_regs[i].clr_reg, smp); } - - sort(d->prio, hw->nr_prio_regs, sizeof(*d->prio), - intc_handle_int_cmp, NULL); } if (hw->sense_regs) { @@ -281,9 +277,6 @@ int __init register_intc_controller(struct intc_desc *desc) for (i = 0; i < hw->nr_sense_regs; i++) k += save_reg(d, k, hw->sense_regs[i].reg, 0); - - sort(d->sense, hw->nr_sense_regs, sizeof(*d->sense), - intc_handle_int_cmp, NULL); } if (hw->subgroups) diff --git a/trunk/drivers/sh/intc/handle.c b/trunk/drivers/sh/intc/handle.c index 7863a44918a2..f461d5300b81 100644 --- a/trunk/drivers/sh/intc/handle.c +++ b/trunk/drivers/sh/intc/handle.c @@ -172,8 +172,9 @@ intc_get_prio_handle(struct intc_desc *desc, struct intc_desc_int *d, return 0; } -static unsigned int intc_ack_data(struct intc_desc *desc, - struct intc_desc_int *d, intc_enum enum_id) +static unsigned int __init intc_ack_data(struct intc_desc *desc, + struct intc_desc_int *d, + intc_enum enum_id) { struct intc_mask_reg *mr = desc->hw.ack_regs; unsigned int i, j, fn, mode; diff --git a/trunk/drivers/sh/intc/internals.h b/trunk/drivers/sh/intc/internals.h index f034a979a16f..b0e9155ff739 100644 --- a/trunk/drivers/sh/intc/internals.h +++ b/trunk/drivers/sh/intc/internals.h @@ -108,14 +108,6 @@ static inline void activate_irq(int irq) #endif } -static inline int intc_handle_int_cmp(const void *a, const void *b) -{ - const struct intc_handle_int *_a = a; - const struct intc_handle_int *_b = b; - - return _a->irq - _b->irq; -} - /* access.c */ extern unsigned long (*intc_reg_fns[])(unsigned long addr, unsigned long h, unsigned long data); @@ -165,6 +157,7 @@ void _intc_enable(struct irq_data *data, unsigned long handle); /* core.c */ extern struct list_head intc_list; extern raw_spinlock_t intc_big_lock; +extern unsigned int nr_intc_controllers; extern struct bus_type intc_subsys; unsigned int intc_get_dfl_prio_level(void); diff --git a/trunk/drivers/tty/serial/sh-sci.c b/trunk/drivers/tty/serial/sh-sci.c index bf461cf99616..f8db8a70c14e 100644 --- a/trunk/drivers/tty/serial/sh-sci.c +++ b/trunk/drivers/tty/serial/sh-sci.c @@ -1229,20 +1229,17 @@ static void sci_dma_tx_complete(void *arg) port->icount.tx += sg_dma_len(&s->sg_tx); async_tx_ack(s->desc_tx); + s->cookie_tx = -EINVAL; s->desc_tx = NULL; if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port); if (!uart_circ_empty(xmit)) { - s->cookie_tx = 0; schedule_work(&s->work_tx); - } else { - s->cookie_tx = -EINVAL; - if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { - u16 ctrl = sci_in(port, SCSCR); - sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); - } + } else if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { + u16 ctrl = sci_in(port, SCSCR); + sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); } spin_unlock_irqrestore(&port->lock, flags); @@ -1504,10 +1501,8 @@ static void sci_start_tx(struct uart_port *port) } if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && - s->cookie_tx < 0) { - s->cookie_tx = 0; + s->cookie_tx < 0) schedule_work(&s->work_tx); - } #endif if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) { diff --git a/trunk/include/linux/gpio_keys.h b/trunk/include/linux/gpio_keys.h index a7e977ff4abf..004ff33ab38e 100644 --- a/trunk/include/linux/gpio_keys.h +++ b/trunk/include/linux/gpio_keys.h @@ -6,7 +6,7 @@ struct device; struct gpio_keys_button { /* Configuration parameters */ unsigned int code; /* input event code (KEY_*, SW_*) */ - int gpio; /* -1 if this key does not support gpio */ + int gpio; int active_low; const char *desc; unsigned int type; /* input event type (EV_KEY, EV_SW, EV_ABS) */ @@ -14,7 +14,6 @@ struct gpio_keys_button { int debounce_interval; /* debounce ticks interval in msecs */ bool can_disable; int value; /* axis value for EV_ABS */ - unsigned int irq; /* Irq number in case of interrupt keys */ }; struct gpio_keys_platform_data { diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c index ed64ccac67c9..f4ea4b6f3cf1 100644 --- a/trunk/kernel/cgroup.c +++ b/trunk/kernel/cgroup.c @@ -1883,7 +1883,7 @@ static void cgroup_task_migrate(struct cgroup *cgrp, struct cgroup *oldcgrp, */ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk) { - int retval = 0; + int retval; struct cgroup_subsys *ss, *failed_ss = NULL; struct cgroup *oldcgrp; struct cgroupfs_root *root = cgrp->root;