Merge branch 'for-2.6.19' of git://brick.kernel.dk/data/git/linux-2.6-block
authorLinus Torvalds <torvalds@g5.osdl.org>
Wed, 4 Oct 2006 17:44:01 +0000 (10:44 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 4 Oct 2006 17:44:01 +0000 (10:44 -0700)
* 'for-2.6.19' of git://brick.kernel.dk/data/git/linux-2.6-block:
  [PATCH] Document bi_sector and sector_t
  [PATCH] helper function for retrieving scsi_cmd given host based block layer tag

214 files changed:
Documentation/video4linux/CARDLIST.saa7134
arch/alpha/kernel/setup.c
arch/alpha/kernel/systbls.S
arch/arm/configs/at91rm9200dk_defconfig
arch/arm/configs/at91rm9200ek_defconfig
arch/arm/configs/ateb9200_defconfig
arch/arm/configs/carmeva_defconfig
arch/arm/configs/csb337_defconfig
arch/arm/configs/csb637_defconfig
arch/arm/configs/kafa_defconfig
arch/arm/configs/kb9202_defconfig
arch/arm/configs/onearm_defconfig
arch/arm/kernel/crunch.c
arch/arm/kernel/iwmmxt-notifier.c
arch/arm/mach-at91rm9200/board-1arm.c
arch/arm/mach-at91rm9200/board-carmeva.c
arch/arm/mach-at91rm9200/board-eb9200.c
arch/arm/mach-at91rm9200/board-kafa.c
arch/arm/mach-at91rm9200/board-kb9202.c
arch/arm/mach-at91rm9200/devices.c
arch/arm/mach-ep93xx/edb9302.c
arch/arm/mach-ep93xx/edb9312.c
arch/arm/mach-ep93xx/edb9315.c
arch/arm/mach-ep93xx/edb9315a.c
arch/arm/mach-lh7a40x/clcd.c
arch/arm/mach-lh7a40x/clocks.c
arch/arm/mach-omap2/pm-domain.c
arch/arm/mach-pnx4008/gpio.c
arch/arm/mach-pnx4008/sleep.S
arch/arm/mach-pnx4008/time.c
arch/arm/mach-pxa/leds-trizeps4.c
arch/arm/tools/gen-mach-types
arch/arm26/lib/ecard.S
arch/arm26/lib/io-acorn.S
arch/avr32/boards/atstk1000/atstk1002.c
arch/avr32/configs/atstk1002_defconfig
arch/avr32/kernel/setup.c
arch/avr32/mach-at32ap/at32ap.c
arch/avr32/mach-at32ap/at32ap7000.c
arch/frv/kernel/time.c
arch/h8300/kernel/time.c
arch/i386/lib/semaphore.S
arch/m32r/mm/mmu.S
arch/m68k/kernel/time.c
arch/m68knommu/platform/532x/config.c
arch/m68knommu/platform/68328/romvec.S
arch/mips/Kconfig
arch/mips/philips/pnx8550/common/int.c
arch/mips/philips/pnx8550/common/platform.c
arch/mips/philips/pnx8550/common/prom.c
arch/mips/philips/pnx8550/common/setup.c
arch/parisc/kernel/head.S
arch/parisc/kernel/syscall.S
arch/powerpc/platforms/83xx/mpc834x_itx.c
arch/powerpc/platforms/85xx/mpc85xx_ads.h
arch/powerpc/platforms/85xx/mpc85xx_cds.c
arch/powerpc/platforms/cell/cbe_regs.c
arch/powerpc/platforms/cell/ras.c
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
arch/powerpc/platforms/pasemi/setup.c
arch/powerpc/platforms/pasemi/time.c
arch/powerpc/sysdev/tsi108_dev.c
arch/ppc/amiga/time.c
arch/ppc/platforms/4xx/cpci405.h
arch/s390/kernel/kprobes.c
arch/sparc/kernel/ioport.c
arch/sparc/kernel/of_device.c
arch/sparc64/kernel/auxio.c
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/prom.c
arch/um/drivers/hostaudio_kern.c
arch/um/drivers/net_kern.c
arch/um/drivers/slip_kern.c
arch/um/drivers/ssl.c
arch/um/drivers/stdio_console.c
arch/um/drivers/ubd_kern.c
arch/um/include/mconsole_kern.h
arch/um/include/mode_kern.h
arch/um/include/skas/mmu-skas.h
arch/um/include/sysdep-ppc/ptrace.h
arch/um/include/um_uaccess.h
arch/um/kernel/init_task.c
arch/um/kernel/irq.c
arch/um/kernel/ksyms.c
arch/um/kernel/signal.c
arch/um/kernel/skas/mem.c
arch/um/kernel/skas/mmu.c
arch/um/kernel/skas/tlb.c
arch/um/kernel/smp.c
arch/um/kernel/sysrq.c
arch/um/kernel/trap.c
arch/um/kernel/tt/gdb_kern.c
arch/um/kernel/tt/mem.c
arch/um/kernel/um_arch.c
arch/um/sys-i386/ldt.c
arch/um/sys-i386/sysrq.c
arch/um/sys-i386/tls.c
arch/v850/kernel/time.c
arch/x86_64/boot/video.S
arch/x86_64/ia32/ia32_binfmt.c
arch/x86_64/kernel/pci-calgary.c
arch/x86_64/kernel/tce.c
arch/x86_64/kernel/x8664_ksyms.c
arch/x86_64/lib/copy_page.S
arch/x86_64/lib/delay.c
arch/x86_64/lib/memcpy.S
arch/x86_64/lib/memset.S
arch/x86_64/lib/thunk.S
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/char/briq_panel.c
drivers/char/ftape/lowlevel/fdc-io.c
drivers/char/ftape/zftape/zftape-rw.c
drivers/char/ftape/zftape/zftape-rw.h
drivers/char/hw_random/ixp4xx-rng.c
drivers/char/mspec.c
drivers/char/nsc_gpio.c
drivers/char/pcmcia/synclink_cs.c
drivers/char/sx.c
drivers/char/synclink.c
drivers/char/watchdog/iTCO_wdt.c
drivers/char/watchdog/omap_wdt.c
drivers/char/watchdog/pcwd.c
drivers/char/watchdog/pcwd_pci.c
drivers/char/watchdog/pnx4008_wdt.c
drivers/hwmon/w83791d.c
drivers/i2c/busses/i2c-ocores.c
drivers/ide/pci/generic.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/rz1000.c
drivers/infiniband/hw/ipath/ipath_mmap.c
drivers/leds/leds-ams-delta.c
drivers/media/Kconfig
drivers/media/dvb/dvb-usb/Kconfig
drivers/media/dvb/dvb-usb/usb-urb.c
drivers/media/radio/radio-gemtek-pci.c
drivers/media/video/saa7134/saa7134-cards.c
drivers/media/video/saa7134/saa7134-dvb.c
drivers/media/video/saa7134/saa7134-tvaudio.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/saa7134/saa7134.h
drivers/media/video/tveeprom.c
drivers/media/video/zoran_card.c
drivers/media/video/zr36120.c
drivers/net/arm/ep93xx_eth.c
drivers/net/fs_enet/mii-fec.c
drivers/net/pcnet32.c
drivers/net/phy/fixed.c
drivers/net/ucc_geth_phy.c
drivers/rtc/rtc-max6902.c
drivers/scsi/aic94xx/aic94xx_init.c
drivers/scsi/imm.h
drivers/scsi/ppa.h
drivers/serial/Kconfig
drivers/serial/Makefile
drivers/serial/at91_serial.c [deleted file]
drivers/serial/atmel_serial.c [new file with mode: 0644]
drivers/serial/atmel_serial.h [new file with mode: 0644]
drivers/serial/cpm_uart/cpm_uart.h
drivers/serial/netx-serial.c
drivers/serial/sh-sci.c
drivers/serial/sh-sci.h
drivers/spi/spi_s3c24xx.c
drivers/spi/spi_s3c24xx_gpio.c
drivers/usb/core/generic.c
drivers/usb/gadget/gmidi.c
drivers/usb/host/u132-hcd.c
drivers/usb/input/usbtouchscreen.c
drivers/usb/misc/appledisplay.c
drivers/usb/misc/ftdi-elan.c
drivers/usb/misc/sisusbvga/sisusb.c
drivers/usb/misc/sisusbvga/sisusb_con.c
drivers/video/intelfb/intelfb_i2c.c
fs/isofs/namei.c
fs/nfs/client.c
fs/nfs/getroot.c
fs/nfs/namespace.c
fs/nfs/nfs4namespace.c
fs/nfs/nfsroot.c
fs/nfs/super.c
fs/reiserfs/file.c
include/asm-arm/arch-at91rm9200/at91rm9200_usart.h [deleted file]
include/asm-arm/arch-at91rm9200/board.h
include/asm-arm/arch-at91rm9200/hardware.h
include/asm-arm/arch-lh7a40x/clocks.h
include/asm-arm/mach/serial_at91.h
include/asm-arm/pgtable-nommu.h
include/asm-avr32/arch-at32ap/at91rm9200_usart.h [deleted file]
include/asm-avr32/arch-at32ap/board.h
include/asm-avr32/arch-at32ap/init.h
include/asm-avr32/mach/serial_at91.h
include/asm-i386/alternative-asm.i
include/asm-i386/frame.i
include/asm-mips/mach-pnx8550/uart.h
include/asm-powerpc/irq.h
include/asm-powerpc/pci-bridge.h
include/asm-sparc64/compat_signal.h
include/asm-x86_64/alternative-asm.i
include/linux/Kbuild
include/linux/config.h
include/linux/serial_core.h
include/net/netdma.h
init/do_mounts.h
kernel/rtmutex-debug.c
kernel/rtmutex-tester.c
mm/filemap.h
mm/slab.c
mm/vmstat.c
net/atm/lec.h
net/core/fib_rules.c
net/ipv6/fib6_rules.c
net/ipv6/mip6.c
sound/aoa/soundbus/sysfs.c
sound/core/memory.c

index 6fb82ac..53ce6a3 100644 (file)
@@ -98,3 +98,4 @@
  97 -> LifeView FlyDVB-S /Acorp TV134DS         [5168:0300,4e42:0300]
  98 -> Proteus Pro 2309                         [0919:2003]
  99 -> AVerMedia TV Hybrid A16AR                [1461:2c00]
+100 -> Asus Europa2 OEM                         [1043:4860]
index fd4a8fa..a94e6d9 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/a.out.h>
 #include <linux/screen_info.h>
 #include <linux/delay.h>
-#include <linux/config.h>      /* CONFIG_ALPHA_LCA etc */
 #include <linux/mc146818rtc.h>
 #include <linux/console.h>
 #include <linux/cpu.h>
index 4342cea..f6cfe8c 100644 (file)
@@ -4,7 +4,6 @@
  * The system call table. 
  */
 
-#include <linux/config.h>                      /* CONFIG_OSF4_COMPAT */
 #include <asm/unistd.h>
 
        .data
index 4f3d8d3..c82e466 100644 (file)
@@ -553,9 +553,9 @@ CONFIG_HW_CONSOLE=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
-# CONFIG_SERIAL_AT91_TTYAT is not set
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 08b5dc3..b983fc5 100644 (file)
@@ -534,9 +534,9 @@ CONFIG_HW_CONSOLE=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
-# CONFIG_SERIAL_AT91_TTYAT is not set
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index bee7813..15e6b0b 100644 (file)
@@ -656,9 +656,9 @@ CONFIG_HW_CONSOLE=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
-# CONFIG_SERIAL_AT91_TTYAT is not set
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 8a075c8..d24ae87 100644 (file)
@@ -455,8 +455,8 @@ CONFIG_HW_CONSOLE=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index cf3fa5c..a2d6fd3 100644 (file)
@@ -591,9 +591,9 @@ CONFIG_HW_CONSOLE=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
-# CONFIG_SERIAL_AT91_TTYAT is not set
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 640d70c..2a1ac6c 100644 (file)
@@ -591,9 +591,9 @@ CONFIG_HW_CONSOLE=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
-# CONFIG_SERIAL_AT91_TTYAT is not set
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 1db633e..54fcd75 100644 (file)
@@ -536,9 +536,9 @@ CONFIG_HW_CONSOLE=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
-# CONFIG_SERIAL_AT91_TTYAT is not set
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 45396e0..b4cd4b4 100644 (file)
@@ -418,8 +418,8 @@ CONFIG_HW_CONSOLE=y
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 6a93e3a..cb1d94f 100644 (file)
@@ -583,9 +583,9 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
-# CONFIG_SERIAL_AT91_TTYAT is not set
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 7481759..cec8378 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
index 44a86c3..0d1a1db 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
index 36eecd7..971c3e2 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 50e5136..9820874 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index c6e0d51..65e867b 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 91e3019..6ef3c48 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 272fe43..35a954a 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 0152553..0598243 100644 (file)
@@ -544,7 +544,7 @@ void __init at91_init_leds(u8 cpu_led, u8 timer_led) {}
  *  UART
  * -------------------------------------------------------------------- */
 
-#if defined(CONFIG_SERIAL_AT91)
+#if defined(CONFIG_SERIAL_ATMEL)
 static struct resource dbgu_resources[] = {
        [0] = {
                .start  = AT91_VA_BASE_SYS + AT91_DBGU,
@@ -558,13 +558,14 @@ static struct resource dbgu_resources[] = {
        },
 };
 
-static struct at91_uart_data dbgu_data = {
+static struct atmel_uart_data dbgu_data = {
        .use_dma_tx     = 0,
        .use_dma_rx     = 0,            /* DBGU not capable of receive DMA */
+       .regs           = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
 };
 
 static struct platform_device at91rm9200_dbgu_device = {
-       .name           = "at91_usart",
+       .name           = "atmel_usart",
        .id             = 0,
        .dev            = {
                                .platform_data  = &dbgu_data,
@@ -593,13 +594,13 @@ static struct resource uart0_resources[] = {
        },
 };
 
-static struct at91_uart_data uart0_data = {
+static struct atmel_uart_data uart0_data = {
        .use_dma_tx     = 1,
        .use_dma_rx     = 1,
 };
 
 static struct platform_device at91rm9200_uart0_device = {
-       .name           = "at91_usart",
+       .name           = "atmel_usart",
        .id             = 1,
        .dev            = {
                                .platform_data  = &uart0_data,
@@ -635,13 +636,13 @@ static struct resource uart1_resources[] = {
        },
 };
 
-static struct at91_uart_data uart1_data = {
+static struct atmel_uart_data uart1_data = {
        .use_dma_tx     = 1,
        .use_dma_rx     = 1,
 };
 
 static struct platform_device at91rm9200_uart1_device = {
-       .name           = "at91_usart",
+       .name           = "atmel_usart",
        .id             = 2,
        .dev            = {
                                .platform_data  = &uart1_data,
@@ -676,13 +677,13 @@ static struct resource uart2_resources[] = {
        },
 };
 
-static struct at91_uart_data uart2_data = {
+static struct atmel_uart_data uart2_data = {
        .use_dma_tx     = 1,
        .use_dma_rx     = 1,
 };
 
 static struct platform_device at91rm9200_uart2_device = {
-       .name           = "at91_usart",
+       .name           = "atmel_usart",
        .id             = 3,
        .dev            = {
                                .platform_data  = &uart2_data,
@@ -711,13 +712,13 @@ static struct resource uart3_resources[] = {
        },
 };
 
-static struct at91_uart_data uart3_data = {
+static struct atmel_uart_data uart3_data = {
        .use_dma_tx     = 1,
        .use_dma_rx     = 1,
 };
 
 static struct platform_device at91rm9200_uart3_device = {
-       .name           = "at91_usart",
+       .name           = "atmel_usart",
        .id             = 4,
        .dev            = {
                                .platform_data  = &uart3_data,
@@ -733,8 +734,8 @@ static inline void configure_usart3_pins(void)
        at91_set_B_periph(AT91_PIN_PA6, 0);             /* RXD3 */
 }
 
-struct platform_device *at91_uarts[AT91_NR_UART];      /* the UARTs to use */
-struct platform_device *at91_default_console_device;   /* the serial console device */
+struct platform_device *at91_uarts[ATMEL_MAX_UART];    /* the UARTs to use */
+struct platform_device *atmel_default_console_device;  /* the serial console device */
 
 void __init at91_init_serial(struct at91_uart_config *config)
 {
@@ -775,9 +776,9 @@ void __init at91_init_serial(struct at91_uart_config *config)
        }
 
        /* Set serial console device */
-       if (config->console_tty < AT91_NR_UART)
-               at91_default_console_device = at91_uarts[config->console_tty];
-       if (!at91_default_console_device)
+       if (config->console_tty < ATMEL_MAX_UART)
+               atmel_default_console_device = at91_uarts[config->console_tty];
+       if (!atmel_default_console_device)
                printk(KERN_INFO "AT91: No default serial console defined.\n");
 }
 
@@ -785,7 +786,7 @@ void __init at91_add_device_serial(void)
 {
        int i;
 
-       for (i = 0; i < AT91_NR_UART; i++) {
+       for (i = 0; i < ATMEL_MAX_UART; i++) {
                if (at91_uarts[i])
                        platform_device_register(at91_uarts[i]);
        }
index 62a8efd..0315615 100644 (file)
@@ -10,7 +10,6 @@
  * your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 9e39921..e310e4d 100644 (file)
@@ -11,7 +11,6 @@
  * your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index ef7482f..249ca9e 100644 (file)
@@ -10,7 +10,6 @@
  * your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index fa958e9..7ca0e61 100644 (file)
@@ -10,7 +10,6 @@
  * your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
index 93751fe..1992db4 100644 (file)
@@ -8,7 +8,7 @@
  *  version 2 as published by the Free Software Foundation.
  *
  */
-#include <linux/config.h>
+
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
index 2291afe..7530a95 100644 (file)
@@ -8,7 +8,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/cpufreq.h>
 #include <asm/hardware.h>
 #include <asm/arch/clocks.h>
index 5e20e74..2494091 100644 (file)
@@ -15,7 +15,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/clk.h>
index e1ce050..1ab84ce 100644 (file)
@@ -14,7 +14,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 93c802b..fea1e17 100644 (file)
@@ -11,7 +11,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/hardware.h>
index 756228d..b986065 100644 (file)
@@ -11,7 +11,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
index 14cfc85..2271d20 100644 (file)
@@ -10,7 +10,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 
 #include <asm/hardware.h>
index 2f9c9b5..ce319ef 100644 (file)
@@ -28,7 +28,6 @@ END   {
          printf(" */\n\n");
          printf("#ifndef __ASM_ARM_MACH_TYPE_H\n");
          printf("#define __ASM_ARM_MACH_TYPE_H\n\n");
-         printf("#include <linux/config.h>\n\n");
          printf("#ifndef __ASSEMBLY__\n");
          printf("/* The type of machine we're running on */\n");
          printf("extern unsigned int __machine_arch_type;\n");
index b463315..658bc45 100644 (file)
@@ -7,7 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h> /* for CONFIG_CPU_nn */
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/hardware.h>
index f6c3e30..5f62ade 100644 (file)
@@ -7,7 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#include <linux/config.h> /* for CONFIG_CPU_nn */
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/hardware.h>
index 49164e9..cced73c 100644 (file)
@@ -10,6 +10,7 @@
 #include <linux/init.h>
 
 #include <asm/arch/board.h>
+#include <asm/arch/init.h>
 
 struct eth_platform_data __initdata eth0_data = {
        .valid          = 1,
@@ -20,13 +21,22 @@ struct eth_platform_data __initdata eth0_data = {
 
 extern struct lcdc_platform_data atstk1000_fb0_data;
 
+void __init setup_board(void)
+{
+       at32_map_usart(1, 0);   /* /dev/ttyS0 */
+       at32_map_usart(2, 1);   /* /dev/ttyS1 */
+       at32_map_usart(3, 2);   /* /dev/ttyS2 */
+
+       at32_setup_serial_console(0);
+}
+
 static int __init atstk1002_init(void)
 {
        at32_add_system_devices();
 
-       at32_add_device_usart(1);       /* /dev/ttyS0 */
-       at32_add_device_usart(2);       /* /dev/ttyS1 */
-       at32_add_device_usart(3);       /* /dev/ttyS2 */
+       at32_add_device_usart(0);
+       at32_add_device_usart(1);
+       at32_add_device_usart(2);
 
        at32_add_device_eth(0, &eth0_data);
        at32_add_device_spi(0);
index 1d22255..6c2c5e0 100644 (file)
@@ -385,9 +385,9 @@ CONFIG_PPP_DEFLATE=m
 #
 # Non-8250 serial port support
 #
-CONFIG_SERIAL_AT91=y
-CONFIG_SERIAL_AT91_CONSOLE=y
-# CONFIG_SERIAL_AT91_TTYAT is not set
+CONFIG_SERIAL_ATMEL=y
+CONFIG_SERIAL_ATMEL_CONSOLE=y
+# CONFIG_SERIAL_ATMEL_TTYAT is not set
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 5d68f3c..ea2d1ff 100644 (file)
@@ -292,6 +292,7 @@ void __init setup_arch (char **cmdline_p)
 
        setup_processor();
        setup_platform();
+       setup_board();
 
        cpu_clk = clk_get(NULL, "cpu");
        if (IS_ERR(cpu_clk)) {
index f7cedf5..90f207e 100644 (file)
@@ -48,9 +48,6 @@ void __init setup_platform(void)
        at32_sm_init();
        at32_clock_init();
        at32_portmux_init();
-
-       /* FIXME: This doesn't belong here */
-       at32_setup_serial_console(1);
 }
 
 static int __init pdc_probe(struct platform_device *pdev)
index 37982b6..7ff6ad8 100644 (file)
@@ -523,33 +523,49 @@ void __init at32_add_system_devices(void)
  *  USART
  * -------------------------------------------------------------------- */
 
-static struct resource usart0_resource[] = {
+static struct atmel_uart_data atmel_usart0_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+static struct resource atmel_usart0_resource[] = {
        PBMEM(0xffe00c00),
        IRQ(7),
 };
-DEFINE_DEV(usart, 0);
-DEV_CLK(usart, usart0, pba, 4);
+DEFINE_DEV_DATA(atmel_usart, 0);
+DEV_CLK(usart, atmel_usart0, pba, 4);
 
-static struct resource usart1_resource[] = {
+static struct atmel_uart_data atmel_usart1_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+static struct resource atmel_usart1_resource[] = {
        PBMEM(0xffe01000),
        IRQ(7),
 };
-DEFINE_DEV(usart, 1);
-DEV_CLK(usart, usart1, pba, 4);
+DEFINE_DEV_DATA(atmel_usart, 1);
+DEV_CLK(usart, atmel_usart1, pba, 4);
 
-static struct resource usart2_resource[] = {
+static struct atmel_uart_data atmel_usart2_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+static struct resource atmel_usart2_resource[] = {
        PBMEM(0xffe01400),
        IRQ(8),
 };
-DEFINE_DEV(usart, 2);
-DEV_CLK(usart, usart2, pba, 5);
+DEFINE_DEV_DATA(atmel_usart, 2);
+DEV_CLK(usart, atmel_usart2, pba, 5);
 
-static struct resource usart3_resource[] = {
+static struct atmel_uart_data atmel_usart3_data = {
+       .use_dma_tx     = 1,
+       .use_dma_rx     = 1,
+};
+static struct resource atmel_usart3_resource[] = {
        PBMEM(0xffe01800),
        IRQ(9),
 };
-DEFINE_DEV(usart, 3);
-DEV_CLK(usart, usart3, pba, 6);
+DEFINE_DEV_DATA(atmel_usart, 3);
+DEV_CLK(usart, atmel_usart3, pba, 6);
 
 static inline void configure_usart0_pins(void)
 {
@@ -575,51 +591,54 @@ static inline void configure_usart3_pins(void)
        portmux_set_func(PIOB, 17, FUNC_B);     /* TXD  */
 }
 
-static struct platform_device *setup_usart(unsigned int id)
+static struct platform_device *at32_usarts[4];
+
+void __init at32_map_usart(unsigned int hw_id, unsigned int line)
 {
        struct platform_device *pdev;
 
-       switch (id) {
+       switch (hw_id) {
        case 0:
-               pdev = &usart0_device;
+               pdev = &atmel_usart0_device;
                configure_usart0_pins();
                break;
        case 1:
-               pdev = &usart1_device;
+               pdev = &atmel_usart1_device;
                configure_usart1_pins();
                break;
        case 2:
-               pdev = &usart2_device;
+               pdev = &atmel_usart2_device;
                configure_usart2_pins();
                break;
        case 3:
-               pdev = &usart3_device;
+               pdev = &atmel_usart3_device;
                configure_usart3_pins();
                break;
        default:
-               pdev = NULL;
-               break;
+               return;
        }
 
-       return pdev;
+       if (PXSEG(pdev->resource[0].start) == P4SEG) {
+               /* Addresses in the P4 segment are permanently mapped 1:1 */
+               struct atmel_uart_data *data = pdev->dev.platform_data;
+               data->regs = (void __iomem *)pdev->resource[0].start;
+       }
+
+       pdev->id = line;
+       at32_usarts[line] = pdev;
 }
 
 struct platform_device *__init at32_add_device_usart(unsigned int id)
 {
-       struct platform_device *pdev;
-
-       pdev = setup_usart(id);
-       if (pdev)
-               platform_device_register(pdev);
-
-       return pdev;
+       platform_device_register(at32_usarts[id]);
+       return at32_usarts[id];
 }
 
-struct platform_device *at91_default_console_device;
+struct platform_device *atmel_default_console_device;
 
 void __init at32_setup_serial_console(unsigned int usart_id)
 {
-       at91_default_console_device = setup_usart(usart_id);
+       atmel_default_console_device = at32_usarts[usart_id];
 }
 
 /* --------------------------------------------------------------------
@@ -813,10 +832,10 @@ struct clk *at32_clock_list[] = {
        &pio1_mck,
        &pio2_mck,
        &pio3_mck,
-       &usart0_usart,
-       &usart1_usart,
-       &usart2_usart,
-       &usart3_usart,
+       &atmel_usart0_usart,
+       &atmel_usart1_usart,
+       &atmel_usart2_usart,
+       &atmel_usart3_usart,
        &macb0_hclk,
        &macb0_pclk,
        &spi0_mck,
index 7e55884..44a9aeb 100644 (file)
@@ -10,7 +10,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h> /* CONFIG_HEARTBEAT */
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
index e569d17..8abab3b 100644 (file)
@@ -16,7 +16,6 @@
  *             "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
 
-#include <linux/config.h> /* CONFIG_HEARTBEAT */
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 01f80b5..ef6ad9e 100644 (file)
@@ -13,7 +13,6 @@
  * rw semaphores implemented November 1999 by Benjamin LaHaise <bcrl@kvack.org>
  */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/rwlock.h>
 #include <asm/alternative-asm.i>
index 0c28f11..9a4d40b 100644 (file)
@@ -6,7 +6,6 @@
 
 /* $Id: mmu.S,v 1.15 2004/03/16 02:56:27 takata Exp $ */
 
-#include <linux/config.h>      /* CONFIG_MMU */
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/smp.h>
index 6cfc984..28b2fef 100644 (file)
@@ -10,7 +10,6 @@
  *             "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
 
-#include <linux/config.h> /* CONFIG_HEARTBEAT */
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index ceef9bc..c7d6ad5 100644 (file)
@@ -17,7 +17,6 @@
 
 /***************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/param.h>
index 3e7fe1e..3108446 100644 (file)
@@ -10,8 +10,6 @@
  * Copyright 2006 Greg Ungerer <gerg@snapgear.com>
  */
 
-#include <linux/config.h>
-
 .global _start
 .global _buserr
 .global trap
index bfab055..8a49884 100644 (file)
@@ -440,13 +440,11 @@ config MIPS_XXS1500
 
 config PNX8550_V2PCI
        bool "Philips PNX8550 based Viper2-PCI board"
-       depends on BROKEN
        select PNX8550
        select SYS_SUPPORTS_LITTLE_ENDIAN
 
 config PNX8550_JBS
        bool "Philips PNX8550 based JBS board"
-       depends on BROKEN
        select PNX8550
        select SYS_SUPPORTS_LITTLE_ENDIAN
 
index 099679a..3c93512 100644 (file)
@@ -90,7 +90,7 @@ asmlinkage void plat_irq_dispatch(struct pt_regs *regs)
        unsigned int pending = read_c0_status() & read_c0_cause();
 
        if (pending & STATUSF_IP2)
-               do_IRQ(2, regs);
+               hw0_irqdispatch(2, regs);
        else if (pending & STATUSF_IP7) {
                if (read_c0_config7() & 0x01c0)
                        timer_irqdispatch(7, regs);
index 5436b4b..d43f56e 100644 (file)
 #include <linux/init.h>
 #include <linux/resource.h>
 #include <linux/serial.h>
-#include <linux/serial_ip3106.h>
+#include <linux/serial_pnx8xxx.h>
 #include <linux/platform_device.h>
 
 #include <int.h>
 #include <usb.h>
 #include <uart.h>
 
-extern struct uart_ops ip3106_pops;
-
 static struct resource pnx8550_usb_ohci_resources[] = {
        [0] = {
                .start          = PNX8550_USB_OHCI_OP_BASE,
@@ -63,31 +61,29 @@ static struct resource pnx8550_uart_resources[] = {
        },
 };
 
-struct ip3106_port ip3106_ports[] = {
+struct pnx8xxx_port pnx8xxx_ports[] = {
        [0] = {
                .port   = {
-                       .type           = PORT_IP3106,
+                       .type           = PORT_PNX8XXX,
                        .iotype         = UPIO_MEM,
                        .membase        = (void __iomem *)PNX8550_UART_PORT0,
                        .mapbase        = PNX8550_UART_PORT0,
                        .irq            = PNX8550_UART_INT(0),
                        .uartclk        = 3692300,
                        .fifosize       = 16,
-                       .ops            = &ip3106_pops,
                        .flags          = UPF_BOOT_AUTOCONF,
                        .line           = 0,
                },
        },
        [1] = {
                .port   = {
-                       .type           = PORT_IP3106,
+                       .type           = PORT_PNX8XXX,
                        .iotype         = UPIO_MEM,
                        .membase        = (void __iomem *)PNX8550_UART_PORT1,
                        .mapbase        = PNX8550_UART_PORT1,
                        .irq            = PNX8550_UART_INT(1),
                        .uartclk        = 3692300,
                        .fifosize       = 16,
-                       .ops            = &ip3106_pops,
                        .flags          = UPF_BOOT_AUTOCONF,
                        .line           = 1,
                },
@@ -111,12 +107,12 @@ static struct platform_device pnx8550_usb_ohci_device = {
 };
 
 static struct platform_device pnx8550_uart_device = {
-       .name           = "ip3106-uart",
+       .name           = "pnx8xxx-uart",
        .id             = -1,
        .dev = {
                .dma_mask               = &uart_dmamask,
                .coherent_dma_mask      = 0xffffffff,
-               .platform_data = ip3106_ports,
+               .platform_data = pnx8xxx_ports,
        },
        .num_resources  = ARRAY_SIZE(pnx8550_uart_resources),
        .resource       = pnx8550_uart_resources,
index 70aac97..f8952c1 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/string.h>
-#include <linux/serial_ip3106.h>
+#include <linux/serial_pnx8xxx.h>
 
 #include <asm/bootinfo.h>
 #include <uart.h>
@@ -126,7 +126,7 @@ void prom_putchar(char c)
 {
        if (pnx8550_console_port != -1) {
                /* Wait until FIFO not full */
-               while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) & IP3106_UART_FIFO_TXFIFO) >> 16) >= 16)
+               while( ((ip3106_fifo(UART_BASE, pnx8550_console_port) & PNX8XXX_UART_FIFO_TXFIFO) >> 16) >= 16)
                        ;
                /* Send one char */
                ip3106_fifo(UART_BASE, pnx8550_console_port) = c;
index 36b0c8b..e62123c 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/mm.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <linux/serial_ip3106.h>
+#include <linux/serial_pnx8xxx.h>
 #include <linux/pm.h>
 
 #include <asm/cpu.h>
@@ -56,7 +56,7 @@ extern char *prom_getcmdline(void);
 
 struct resource standard_io_resources[] = {
        {
-               .start  = .0x00,
+               .start  = 0x00,
                .end    = 0x1f,
                .name   = "dma1",
                .flags  = IORESOURCE_BUSY
@@ -144,7 +144,7 @@ void __init plat_mem_setup(void)
                /* We must initialize the UART (console) before prom_printf */
                /* Set LCR to 8-bit and BAUD to 38400 (no 5)                */
                ip3106_lcr(UART_BASE, pnx8550_console_port) =
-                       IP3106_UART_LCR_8BIT;
+                       PNX8XXX_UART_LCR_8BIT;
                ip3106_baud(UART_BASE, pnx8550_console_port) = 5;
        }
 
index 3e79e62..eaad232 100644 (file)
@@ -12,8 +12,6 @@
  * Initial Version 04-23-1999 by Helge Deller <deller@gmx.de>
  */
 
-#include <linux/config.h>      /* for CONFIG_SMP */
-
 #include <asm/asm-offsets.h>
 #include <asm/psw.h>
 #include <asm/pdc.h>
index 9670a89..a058004 100644 (file)
@@ -6,7 +6,6 @@
  * thanks to Philipp Rumpf, Mike Shaver and various others
  * sorry about the wall, puffin..
  */
-#include <linux/config.h> /* for CONFIG_SMP */
 
 #include <asm/asm-offsets.h>
 #include <asm/unistd.h>
index 8c676d7..5446bab 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index effcbf7..46c3532 100644 (file)
@@ -18,7 +18,6 @@
 #ifndef __MACH_MPC85XXADS_H
 #define __MACH_MPC85XXADS_H
 
-#include <linux/config.h>
 #include <linux/initrd.h>
 #include <sysdev/fsl_soc.h>
 
index 4c1fede..193a5d7 100644 (file)
@@ -11,7 +11,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 3f3859d..2f194ba 100644 (file)
@@ -6,8 +6,6 @@
  * (c) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
  */
 
-
-#include <linux/config.h>
 #include <linux/percpu.h>
 #include <linux/types.h>
 
index 033ad6e..0984c70 100644 (file)
@@ -1,6 +1,5 @@
 #define DEBUG
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/smp.h>
index e4f2b9d..cb6f084 100644 (file)
@@ -18,7 +18,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
index 6284826..106896c 100644 (file)
@@ -22,7 +22,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index 9bd410b..fa54351 100644 (file)
@@ -17,7 +17,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 
 #include <asm/time.h>
index f303846..11de090 100644 (file)
@@ -9,7 +9,6 @@
  * option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 0073527..8c880c0 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h> /* CONFIG_HEARTBEAT */
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index f5a5c0c..a6c0a13 100644 (file)
@@ -13,7 +13,6 @@
 #ifndef __CPCI405_H__
 #define __CPCI405_H__
 
-#include <linux/config.h>
 #include <platforms/4xx/ibm405gp.h>
 #include <asm/ppcboot.h>
 
index 4d9ff5c..67914fe 100644 (file)
@@ -20,7 +20,6 @@
  * s390 port, used ppc64 as template. Mike Grundy <grundym@us.ibm.com>
  */
 
-#include <linux/config.h>
 #include <linux/kprobes.h>
 #include <linux/ptrace.h>
 #include <linux/preempt.h>
index d33f8a0..54d51b4 100644 (file)
@@ -25,7 +25,6 @@
  * <zaitcev> Sounds reasonable
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 97bf87e..74bef2a 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 718350a..826118e 100644 (file)
@@ -5,7 +5,6 @@
  * Refactoring for unified NCR/PCIO support 2002 Eric Brower (ebrower@usa.net)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 238bbf6..7f92045 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
index 5cc5ab6..e21cd6a 100644 (file)
@@ -15,7 +15,6 @@
  *      2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/string.h>
index d247ef4..a0d148e 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/module.h"
 #include "linux/init.h"
 #include "linux/slab.h"
index 300a54a..c1c5604 100644 (file)
@@ -5,7 +5,6 @@
  * Licensed under the GPL.
  */
 
-#include "linux/config.h"
 #include "linux/kernel.h"
 #include "linux/netdevice.h"
 #include "linux/rtnetlink.h"
index ccea2d7..788da54 100644 (file)
@@ -1,4 +1,3 @@
-#include "linux/config.h"
 #include "linux/kernel.h"
 #include "linux/stddef.h"
 #include "linux/init.h"
index 6f13e7c..ed9c590 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/fs.h"
 #include "linux/tty.h"
 #include "linux/tty_driver.h"
index e4bfcfe..7a4897e 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/posix_types.h"
 #include "linux/tty.h"
 #include "linux/tty_flip.h"
index fda4a39..f0b0668 100644 (file)
@@ -20,7 +20,6 @@
 #define MAJOR_NR UBD_MAJOR
 #define UBD_SHIFT 4
 
-#include "linux/config.h"
 #include "linux/module.h"
 #include "linux/blkdev.h"
 #include "linux/hdreg.h"
index d86ee14..d0b6901 100644 (file)
@@ -6,7 +6,6 @@
 #ifndef __MCONSOLE_KERN_H__
 #define __MCONSOLE_KERN_H__
 
-#include "linux/config.h"
 #include "linux/list.h"
 #include "mconsole.h"
 
index e7539a8..88e5e77 100644 (file)
@@ -6,8 +6,6 @@
 #ifndef __MODE_KERN_H__
 #define __MODE_KERN_H__
 
-#include "linux/config.h"
-
 #ifdef CONFIG_MODE_TT
 #include "mode_kern_tt.h"
 #endif
index d8869a6..b26986c 100644 (file)
@@ -6,7 +6,6 @@
 #ifndef __SKAS_MMU_H
 #define __SKAS_MMU_H
 
-#include "linux/config.h"
 #include "mm_id.h"
 #include "asm/ldt.h"
 
index 8a27353..df2397d 100644 (file)
@@ -5,7 +5,6 @@
 #ifndef __SYS_PTRACE_PPC_H
 #define __SYS_PTRACE_PPC_H
 
-#include "linux/config.h"
 #include "linux/types.h"
 
 /* the following taken from <asm-ppc/ptrace.h> */
index 4567f1e..5126a99 100644 (file)
@@ -6,7 +6,6 @@
 #ifndef __ARCH_UM_UACCESS_H
 #define __ARCH_UM_UACCESS_H
 
-#include "linux/config.h"
 #include "choose-mode.h"
 
 #ifdef CONFIG_MODE_TT
index 49ed5dd..8cde431 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/mm.h"
 #include "linux/module.h"
 #include "linux/sched.h"
index ce7f233..eee97bb 100644 (file)
@@ -5,7 +5,6 @@
  *     Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
  */
 
-#include "linux/config.h"
 #include "linux/kernel.h"
 #include "linux/module.h"
 #include "linux/smp.h"
index f030e44..0e00cf9 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/module.h"
 #include "linux/string.h"
 #include "linux/smp_lock.h"
index 4aa9808..2a32e5e 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/stddef.h"
 #include "linux/sys.h"
 #include "linux/sched.h"
index 27bbf54..0d2cce6 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/mm.h"
 #include "asm/pgtable.h"
 #include "mem_user.h"
index 4cd2ff5..c17eddc 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/sched.h"
 #include "linux/list.h"
 #include "linux/spinlock.h"
index 6e84963..27eb29c 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "linux/stddef.h"
 #include "linux/sched.h"
-#include "linux/config.h"
 #include "linux/mm.h"
 #include "asm/page.h"
 #include "asm/pgtable.h"
index 511116a..759b070 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/percpu.h"
 #include "asm/pgalloc.h"
 #include "asm/tlb.h"
index b331e97..239c980 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/sched.h"
 #include "linux/kernel.h"
 #include "linux/module.h"
index c7b195c..b5f124a 100644 (file)
@@ -8,7 +8,6 @@
 #include "linux/sched.h"
 #include "linux/mm.h"
 #include "linux/spinlock.h"
-#include "linux/config.h"
 #include "linux/init.h"
 #include "linux/ptrace.h"
 #include "asm/semaphore.h"
index 2650638..68e1bf6 100644 (file)
@@ -4,7 +4,6 @@
  */
 
 #include "linux/init.h"
-#include "linux/config.h"
 #include "mconsole_kern.h"
 
 #ifdef CONFIG_MCONSOLE
index 84a23b1..4d1929d 100644 (file)
@@ -4,7 +4,6 @@
  */
 
 #include "linux/stddef.h"
-#include "linux/config.h"
 #include "linux/mm.h"
 #include "asm/uaccess.h"
 #include "mem_user.h"
index 97d88e7..66f43c9 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/kernel.h"
 #include "linux/sched.h"
 #include "linux/notifier.h"
index 69971b7..e299ee5 100644 (file)
@@ -4,7 +4,6 @@
  */
 
 #include "linux/stddef.h"
-#include "linux/config.h"
 #include "linux/sched.h"
 #include "linux/slab.h"
 #include "linux/types.h"
index d5244f0..171b3e9 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/kernel.h"
 #include "linux/smp.h"
 #include "linux/sched.h"
index 71b9796..643dab5 100644 (file)
@@ -3,7 +3,6 @@
  * Licensed under the GPL
  */
 
-#include "linux/config.h"
 #include "linux/kernel.h"
 #include "linux/sched.h"
 #include "linux/slab.h"
index f4d1a4d..cd06f47 100644 (file)
@@ -10,7 +10,6 @@
  *             "A Kernel Model for Precision Timekeeping" by Dave Mills
  */
 
-#include <linux/config.h> /* CONFIG_HEARTBEAT */
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 2aa565c..d6ff88f 100644 (file)
@@ -11,8 +11,6 @@
  *
  */
 
-#include <linux/config.h> /* for CONFIG_VIDEO_* */
-
 /* Enable autodetection of SVGA adapters and modes. */
 #undef CONFIG_VIDEO_SVGA
 
index 2fd5a67..82ef182 100644 (file)
@@ -6,7 +6,6 @@
  * of ugly preprocessor tricks. Talk about very very poor man's inheritance.
  */ 
 #include <linux/types.h>
-#include <linux/config.h> 
 #include <linux/stddef.h>
 #include <linux/rwsem.h>
 #include <linux/sched.h>
index cfb09b0..f760045 100644 (file)
@@ -21,7 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/types.h>
index cbabfdf..f61fb8e 100644 (file)
@@ -23,7 +23,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
index c3454af..6d77e47 100644 (file)
@@ -1,7 +1,6 @@
 /* Exports for assembly files.
    All C exports should go in the respective C files. */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/smp.h>
 
index 0ebb03b..727a5d4 100644 (file)
@@ -1,6 +1,5 @@
 /* Written 2003 by Andi Kleen, based on a kernel by Evandro Menezes */
-       
-#include <linux/config.h>
+
 #include <linux/linkage.h>
 #include <asm/dwarf2.h>
 
index b6cd3cc..50be909 100644 (file)
@@ -8,7 +8,6 @@
  *     depends wildly on alignment on many x86 processors. 
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
index 967b22f..0ea0ddc 100644 (file)
@@ -1,6 +1,5 @@
 /* Copyright 2002 Andi Kleen */
-       
-#include <linux/config.h>
+
 #include <linux/linkage.h>
 #include <asm/dwarf2.h>
 #include <asm/cpufeature.h>
index 09ed1f6..2c59481 100644 (file)
@@ -1,6 +1,5 @@
 /* Copyright 2002 Andi Kleen, SuSE Labs */
 
-#include <linux/config.h>
 #include <linux/linkage.h>
 #include <asm/dwarf2.h>
 
index 0025535..55e586d 100644 (file)
@@ -5,7 +5,6 @@
  * Subject to the GNU public license, v.2. No warranty of any kind.
  */
 
-       #include <linux/config.h>
        #include <linux/linkage.h>
        #include <asm/dwarf2.h>
        #include <asm/calling.h>                        
index 99f87ef..36b88f6 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>      /* CONFIG_PROC_FS */
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/types.h>
index 4abc193..ada68e6 100644 (file)
@@ -19,7 +19,6 @@
  *    Questions/Comments/Bugfixes to iss_storagedev@hp.com
  *
  */
-#include <linux/config.h>      /* CONFIG_PROC_FS */
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/pci.h>
index b8c2225..9f8082f 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/sched.h>
 #include <linux/tty.h>
 #include <linux/timer.h>
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/wait.h>
 #include <linux/string.h>
index 65c9d2e..2165324 100644 (file)
@@ -26,7 +26,6 @@
  *      Linux.
  */
 
-#include <linux/config.h> /* for CONFIG_FT_* */
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/ioport.h>
index a61ef50..dab6346 100644 (file)
@@ -24,7 +24,6 @@
  *      zftape.
  */
 
-#include <linux/config.h> /* for CONFIG_ZFT_DFLT_BLK_SZ */
 #include <linux/errno.h>
 #include <linux/mm.h>
 
index 14c07f0..1ceec22 100644 (file)
@@ -28,7 +28,6 @@
  *
  */
 
-#include <linux/config.h> /* for CONFIG_ZFT_DFLT_BLK_SZ */
 #include "../zftape/zftape-buffers.h"
 
 #define SEGMENTS_PER_TAPE  (ft_segments_per_track * ft_tracks_per_tape)
index 3cf4d64..c9caff5 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index 5426b1e..5c0dec3 100644 (file)
@@ -30,7 +30,6 @@
  * processor from ever speculating a cache line from this page.
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
index 7719bd7..4d47d79 100644 (file)
@@ -7,7 +7,6 @@
    Copyright (c) 2005      Jim Cromie <jim.cromie@gmail.com>
 */
 
-#include <linux/config.h>
 #include <linux/fs.h>
 #include <linux/module.h>
 #include <linux/errno.h>
index d1ecb2c..73e3242 100644 (file)
@@ -35,7 +35,6 @@
 
 #define MAX_DEVICE_COUNT 4
 
-#include <linux/config.h>      
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
index 57e31e5..8fd71a5 100644 (file)
 #define RCS_ID "$Id: sx.c,v 1.33 2000/03/08 10:01:02 wolff, pvdl Exp $"
 #define RCS_REV "$Revision: 1.33 $"
 
-
 #include <linux/module.h>
-#include <linux/config.h> 
 #include <linux/kdev_t.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index 38d9498..a4150c4 100644 (file)
@@ -63,7 +63,6 @@
 #define MAX_PCI_DEVICES 10
 #define MAX_TOTAL_DEVICES 20
 
-#include <linux/config.h>      
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
index 8f89948..aaac94d 100644 (file)
@@ -49,7 +49,6 @@
 #define PFX            DRV_NAME ": "
 
 /* Includes */
-#include <linux/config.h>              /* For CONFIG_WATCHDOG_NOWAYOUT/... */
 #include <linux/module.h>              /* For module specific items */
 #include <linux/moduleparam.h>         /* For new moduleparam's */
 #include <linux/types.h>               /* For standard types (like size_t) */
index 8f90b90..5dbd7dc 100644 (file)
@@ -27,7 +27,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
index 6f8515d..8e1e6e4 100644 (file)
@@ -49,7 +49,6 @@
  *     More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/
  */
 
-#include <linux/config.h>      /* For CONFIG_WATCHDOG_NOWAYOUT/... */
 #include <linux/module.h>      /* For module specific items */
 #include <linux/moduleparam.h> /* For new moduleparam's */
 #include <linux/types.h>       /* For standard types (like size_t) */
index 2de6e49..f4872c8 100644 (file)
@@ -31,7 +31,6 @@
  *     Includes, defines, variables, module parameters, ...
  */
 
-#include <linux/config.h>      /* For CONFIG_WATCHDOG_NOWAYOUT/... */
 #include <linux/module.h>      /* For module specific items */
 #include <linux/moduleparam.h> /* For new moduleparam's */
 #include <linux/types.h>       /* For standard types (like size_t) */
index db2731b..3a55fc6 100644 (file)
@@ -14,7 +14,6 @@
  * or implied.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/types.h>
index d965d07..371ed4f 100644 (file)
@@ -32,7 +32,6 @@
     The w83791g chip is the same as the w83791d but lead-free.
 */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
index 952a28d..3e276e9 100644 (file)
@@ -9,7 +9,6 @@
  * kind, whether express or implied.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 0cb7b9b..965c436 100644 (file)
@@ -23,7 +23,6 @@
 
 #undef REALLY_SLOW_IO          /* most systems can safely undef this */
 
-#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 68c74bb..c1cec23 100644 (file)
@@ -5,7 +5,6 @@
  *  May be copied or modified under the terms of the GNU General Public License
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/pci.h>
index 608cd76..5f6950c 100644 (file)
@@ -17,7 +17,6 @@
 
 #undef REALLY_SLOW_IO          /* most systems can safely undef this */
 
-#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 11b7378..a82157d 100644 (file)
@@ -30,7 +30,6 @@
  * SOFTWARE.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
index e9f0611..599878c 100644 (file)
@@ -8,7 +8,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
index ed4aa4e..9f7e1fe 100644 (file)
@@ -54,6 +54,7 @@ config VIDEO_V4L1_COMPAT
 
 config VIDEO_V4L2
        bool
+       depends on VIDEO_DEV
        default y
 
 source "drivers/media/video/Kconfig"
index 67cefdd..2cc5caa 100644 (file)
@@ -69,7 +69,6 @@ config DVB_USB_DIBUSB_MC
 config DVB_USB_DIB0700
        tristate "DiBcom DiB0700 USB DVB devices (see help for supported devices)"
        depends on DVB_USB
-       select DVB_DIB7000M
        select DVB_DIB3000MC
        select DVB_TUNER_MT2060
        help
index 8728cf3..572b2d9 100644 (file)
@@ -122,8 +122,9 @@ static int usb_allocate_stream_buffers(struct usb_data_stream *stream, int num,
                        usb_free_stream_buffers(stream);
                        return -ENOMEM;
                }
-               deb_mem("buffer %d: %p (dma: %u)\n",
-                       stream->buf_num, stream->buf_list[stream->buf_num], stream->dma_addr[stream->buf_num]);
+               deb_mem("buffer %d: %p (dma: %Lu)\n",
+                       stream->buf_num,
+stream->buf_list[stream->buf_num], (long long)stream->dma_addr[stream->buf_num]);
                memset(stream->buf_list[stream->buf_num],0,size);
                stream->state |= USB_STATE_URB_BUF;
        }
index cfab57d..eb14106 100644 (file)
@@ -449,7 +449,7 @@ static int __init gemtek_pci_init_module( void )
 
 static void __exit gemtek_pci_cleanup_module( void )
 {
-       return pci_unregister_driver( &gemtek_pci_driver );
+       pci_unregister_driver(&gemtek_pci_driver);
 }
 
 MODULE_AUTHOR( "Vladimir Shebordaev <vshebordaev@mail.ru>" );
index fe3c83c..c9d8e3b 100644 (file)
@@ -2994,6 +2994,34 @@ struct saa7134_board saa7134_boards[] = {
                        .amux = LINE1,
                },
        },
+       [SAA7134_BOARD_ASUS_EUROPA2_HYBRID] = {
+               .name           = "Asus Europa2 OEM",
+               .audio_clock    = 0x00187de7,
+               .tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .tda9887_conf   = TDA9887_PRESENT| TDA9887_PORT1_ACTIVE | TDA9887_PORT2_ACTIVE,
+               .mpeg           = SAA7134_MPEG_DVB,
+               .inputs = {{
+                       .name   = name_tv,
+                       .vmux   = 3,
+                       .amux   = TV,
+                       .tv     = 1,
+               },{
+                       .name   = name_comp1,
+                       .vmux   = 4,
+                       .amux   = LINE2,
+               },{
+                       .name   = name_svideo,
+                       .vmux   = 8,
+                       .amux   = LINE2,
+               }},
+               .radio = {
+                       .name   = name_radio,
+                       .amux   = LINE1,
+               },
+       },
 };
 
 const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -3596,6 +3624,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
                .subvendor    = 0x1461,
                .subdevice    = 0x2c00,
                .driver_data  = SAA7134_BOARD_AVERMEDIA_A16AR,
+       },{
+               .vendor       = PCI_VENDOR_ID_PHILIPS,
+               .device       = PCI_DEVICE_ID_PHILIPS_SAA7134,
+               .subvendor    = 0x1043,
+               .subdevice    = 0x4860,
+               .driver_data  = SAA7134_BOARD_ASUS_EUROPA2_HYBRID,
        },{
                /* --- boards without eeprom + subsystem ID --- */
                .vendor       = PCI_VENDOR_ID_PHILIPS,
@@ -3871,6 +3905,7 @@ int saa7134_board_init2(struct saa7134_dev *dev)
                break;
        case SAA7134_BOARD_PHILIPS_EUROPA:
        case SAA7134_BOARD_VIDEOMATE_DVBT_300:
+       case SAA7134_BOARD_ASUS_EUROPA2_HYBRID:
                /* The Philips EUROPA based hybrid boards have the tuner connected through
                 * the channel decoder. We have to make it transparent to find it
                 */
index fb741fa..1ba53b5 100644 (file)
@@ -874,6 +874,34 @@ static struct tda1004x_config philips_tiger_config = {
 
 /* ------------------------------------------------------------------ */
 
+static int asus_p7131_dual_tuner_init(struct dvb_frontend *fe)
+{
+       struct saa7134_dev *dev = fe->dvb->priv;
+       static u8 data[] = { 0x3c, 0x33, 0x6a};
+       struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
+
+       if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
+               return -EIO;
+       /* make sure the DVB-T antenna input is set */
+       saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0200000);
+       return 0;
+}
+
+static int asus_p7131_dual_tuner_sleep(struct dvb_frontend *fe)
+{
+       struct saa7134_dev *dev = fe->dvb->priv;
+       static u8 data[] = { 0x3c, 0x33, 0x68};
+       struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
+
+       i2c_transfer(&dev->i2c_adap, &msg, 1);
+       philips_tda827xa_tuner_sleep( 0x61, fe);
+       /* reset antenna inputs for analog usage */
+       saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0200000);
+       return 0;
+}
+
+/* ------------------------------------------------------------------ */
+
 static int lifeview_trio_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
 {
        int ret;
@@ -1148,8 +1176,8 @@ static int dvb_init(struct saa7134_dev *dev)
                                               &philips_tiger_config,
                                               &dev->i2c_adap);
                if (dev->dvb.frontend) {
-                       dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
-                       dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep;
+                       dev->dvb.frontend->ops.tuner_ops.init = asus_p7131_dual_tuner_init;
+                       dev->dvb.frontend->ops.tuner_ops.sleep = asus_p7131_dual_tuner_sleep;
                        dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
                }
                break;
@@ -1240,6 +1268,18 @@ static int dvb_init(struct saa7134_dev *dev)
                        }
                }
                break;
+       case SAA7134_BOARD_ASUS_EUROPA2_HYBRID:
+               dev->dvb.frontend = tda10046_attach(&medion_cardbus,
+                                                   &dev->i2c_adap);
+               if (dev->dvb.frontend) {
+                       dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
+                       dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
+                       dev->dvb.frontend->ops.tuner_ops.init = philips_fmd1216_tuner_init;
+                       dev->dvb.frontend->ops.tuner_ops.sleep = philips_fmd1216_tuner_sleep;
+                       dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params;
+               }
+               break;
+
        default:
                printk("%s: Huh? unknown DVB card?\n",dev->name);
                break;
index d31220d..dd759d6 100644 (file)
@@ -72,12 +72,12 @@ static struct mainscan {
        int          carr;
 } mainscan[] = {
        {
-               .name = "M",
-               .std  = V4L2_STD_NTSC | V4L2_STD_PAL_M,
+               .name = "MN",
+               .std  = V4L2_STD_MN,
                .carr = 4500,
        },{
-               .name = "BG",
-               .std  = V4L2_STD_PAL_BG,
+               .name = "BGH",
+               .std  = V4L2_STD_B | V4L2_STD_GH,
                .carr = 5500,
        },{
                .name = "I",
@@ -85,7 +85,7 @@ static struct mainscan {
                .carr = 6000,
        },{
                .name = "DKL",
-               .std  = V4L2_STD_PAL_DK | V4L2_STD_SECAM,
+               .std  = V4L2_STD_DK | V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC,
                .carr = 6500,
        }
 };
@@ -93,76 +93,70 @@ static struct mainscan {
 static struct saa7134_tvaudio tvaudio[] = {
        {
                .name          = "PAL-B/G FM-stereo",
-               .std           = V4L2_STD_PAL,
+               .std           = V4L2_STD_PAL_BG,
                .mode          = TVAUDIO_FM_BG_STEREO,
                .carr1         = 5500,
                .carr2         = 5742,
        },{
                .name          = "PAL-D/K1 FM-stereo",
-               .std           = V4L2_STD_PAL,
+               .std           = V4L2_STD_PAL_DK,
                .carr1         = 6500,
                .carr2         = 6258,
                .mode          = TVAUDIO_FM_BG_STEREO,
        },{
                .name          = "PAL-D/K2 FM-stereo",
-               .std           = V4L2_STD_PAL,
+               .std           = V4L2_STD_PAL_DK,
                .carr1         = 6500,
                .carr2         = 6742,
                .mode          = TVAUDIO_FM_BG_STEREO,
        },{
                .name          = "PAL-D/K3 FM-stereo",
-               .std           = V4L2_STD_PAL,
+               .std           = V4L2_STD_PAL_DK,
                .carr1         = 6500,
                .carr2         = 5742,
                .mode          = TVAUDIO_FM_BG_STEREO,
        },{
                .name          = "PAL-B/G NICAM",
-               .std           = V4L2_STD_PAL,
+               .std           = V4L2_STD_PAL_BG,
                .carr1         = 5500,
                .carr2         = 5850,
                .mode          = TVAUDIO_NICAM_FM,
        },{
                .name          = "PAL-I NICAM",
-               .std           = V4L2_STD_PAL,
+               .std           = V4L2_STD_PAL_I,
                .carr1         = 6000,
                .carr2         = 6552,
                .mode          = TVAUDIO_NICAM_FM,
        },{
                .name          = "PAL-D/K NICAM",
-               .std           = V4L2_STD_PAL,
+               .std           = V4L2_STD_PAL_DK,
                .carr1         = 6500,
                .carr2         = 5850,
                .mode          = TVAUDIO_NICAM_FM,
        },{
                .name          = "SECAM-L NICAM",
-               .std           = V4L2_STD_SECAM,
+               .std           = V4L2_STD_SECAM_L,
                .carr1         = 6500,
                .carr2         = 5850,
                .mode          = TVAUDIO_NICAM_AM,
        },{
-               .name          = "SECAM-L MONO",
-               .std           = V4L2_STD_SECAM,
+               .name          = "SECAM-D/K NICAM",
+               .std           = V4L2_STD_SECAM_DK,
                .carr1         = 6500,
-               .carr2         = -1,
-               .mode          = TVAUDIO_AM_MONO,
+               .carr2         = 5850,
+               .mode          = TVAUDIO_NICAM_FM,
        },{
-               .name          = "SECAM-D/K",
-               .std           = V4L2_STD_SECAM,
-               .carr1         = 6500,
-               .carr2         = -1,
-               .mode          = TVAUDIO_FM_MONO,
+               .name          = "NTSC-A2 FM-stereo",
+               .std           = V4L2_STD_NTSC,
+               .carr1         = 4500,
+               .carr2         = 4724,
+               .mode          = TVAUDIO_FM_K_STEREO,
        },{
                .name          = "NTSC-M",
                .std           = V4L2_STD_NTSC,
                .carr1         = 4500,
                .carr2         = -1,
                .mode          = TVAUDIO_FM_MONO,
-       },{
-               .name          = "NTSC-A2 FM-stereo",
-               .std           = V4L2_STD_NTSC,
-               .carr1         = 4500,
-               .carr2         = 4724,
-               .mode          = TVAUDIO_FM_K_STEREO,
        }
 };
 #define TVAUDIO (sizeof(tvaudio)/sizeof(struct saa7134_tvaudio))
@@ -340,12 +334,6 @@ static void tvaudio_setmode(struct saa7134_dev *dev,
                saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT,  0xa1);
                saa_writeb(SAA7134_NICAM_CONFIG,              0x00);
                break;
-       case TVAUDIO_AM_MONO:
-               saa_writeb(SAA7134_DEMODULATOR,               0x12);
-               saa_writeb(SAA7134_DCXO_IDENT_CTRL,           0x00);
-               saa_writeb(SAA7134_FM_DEEMPHASIS,             0x44);
-               saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT,  0xa0);
-               break;
        case TVAUDIO_FM_SAT_STEREO:
                /* not implemented (yet) */
                break;
@@ -390,7 +378,6 @@ static int tvaudio_checkcarrier(struct saa7134_dev *dev, struct mainscan *scan)
                }
                printk("\n");
        }
-
        if (dev->tvnorm->id & scan->std) {
                tvaudio_setcarrier(dev,scan->carr-90,scan->carr-90);
                saa_readl(SAA7134_LEVEL_READOUT1 >> 2);
@@ -426,7 +413,6 @@ static int tvaudio_getstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
 
        switch (audio->mode) {
        case TVAUDIO_FM_MONO:
-       case TVAUDIO_AM_MONO:
                return V4L2_TUNER_SUB_MONO;
        case TVAUDIO_FM_K_STEREO:
        case TVAUDIO_FM_BG_STEREO:
@@ -495,7 +481,6 @@ static int tvaudio_setstereo(struct saa7134_dev *dev, struct saa7134_tvaudio *au
 
        switch (audio->mode) {
        case TVAUDIO_FM_MONO:
-       case TVAUDIO_AM_MONO:
                /* nothing to do ... */
                break;
        case TVAUDIO_FM_K_STEREO:
@@ -556,6 +541,7 @@ static int tvaudio_thread(void *data)
 
                if (1 == nscan) {
                        /* only one candidate -- skip scan ;) */
+                       dprintk("only one main carrier candidate - skipping scan\n");
                        max1 = 12345;
                        carrier = default_carrier;
                } else {
@@ -603,7 +589,6 @@ static int tvaudio_thread(void *data)
                dev->automute = 0;
                saa_andorb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0x30, 0x00);
                saa7134_tvaudio_setmute(dev);
-
                /* find the exact tv audio norm */
                for (audio = UNSET, i = 0; i < TVAUDIO; i++) {
                        if (dev->tvnorm->id != UNSET &&
@@ -611,7 +596,7 @@ static int tvaudio_thread(void *data)
                                continue;
                        if (tvaudio[i].carr1 != carrier)
                                continue;
-
+                       /* Note: at least the primary carrier is right here */
                        if (UNSET == audio)
                                audio = i;
                        tvaudio_setmode(dev,&tvaudio[i],"trying");
@@ -626,6 +611,7 @@ static int tvaudio_thread(void *data)
                if (UNSET == audio)
                        continue;
                tvaudio_setmode(dev,&tvaudio[audio],"using");
+
                tvaudio_setstereo(dev,&tvaudio[audio],V4L2_TUNER_MODE_MONO);
                dev->tvaudio = &tvaudio[audio];
 
@@ -750,7 +736,6 @@ static int mute_input_7133(struct saa7134_dev *dev)
        int mask;
        struct saa7134_input *in;
 
-       /* Hac 0506 route OSS sound simultanously  */
        xbarin = 0x03;
        switch (dev->input->amux) {
        case TV:
@@ -834,18 +819,16 @@ static int tvaudio_thread_ddep(void *data)
                } else {
                        /* (let chip) scan for sound carrier */
                        norms = 0;
-                       if (dev->tvnorm->id & V4L2_STD_PAL) {
-                               dprintk("PAL scan\n");
-                               norms |= 0x2c; /* B/G + D/K + I */
-                       }
-                       if (dev->tvnorm->id & V4L2_STD_NTSC) {
-                               dprintk("NTSC scan\n");
-                               norms |= 0x40; /* M */
-                       }
-                       if (dev->tvnorm->id & V4L2_STD_SECAM) {
-                               dprintk("SECAM scan\n");
-                               norms |= 0x18; /* L + D/K */
-                       }
+                       if (dev->tvnorm->id & (V4L2_STD_B | V4L2_STD_GH))
+                               norms |= 0x04;
+                       if (dev->tvnorm->id & V4L2_STD_PAL_I)
+                               norms |= 0x20;
+                       if (dev->tvnorm->id & V4L2_STD_DK)
+                               norms |= 0x08;
+                       if (dev->tvnorm->id & V4L2_STD_MN)
+                               norms |= 0x40;
+                       if (dev->tvnorm->id & (V4L2_STD_SECAM_L | V4L2_STD_SECAM_LC))
+                               norms |= 0x10;
                        if (0 == norms)
                                norms = 0x7c; /* all */
                        dprintk("scanning:%s%s%s%s%s\n",
@@ -1034,7 +1017,11 @@ int saa7134_tvaudio_fini(struct saa7134_dev *dev)
 
 int saa7134_tvaudio_do_scan(struct saa7134_dev *dev)
 {
-       if (dev->thread.pid >= 0) {
+       if (dev->input->amux != TV) {
+               dprintk("sound IF not in use, skipping scan\n");
+               dev->automute = 0;
+               saa7134_tvaudio_setmute(dev);
+       } else if (dev->thread.pid >= 0) {
                dev->thread.mode = UNSET;
                dev->thread.scan2++;
                wake_up_interruptible(&dev->thread.wq);
index 2c171af..203302f 100644 (file)
@@ -43,12 +43,16 @@ static unsigned int gbuffers      = 8;
 static unsigned int noninterlaced = 1;
 static unsigned int gbufsize      = 720*576*4;
 static unsigned int gbufsize_max  = 720*576*4;
+static char secam[] = "--";
 module_param(video_debug, int, 0644);
 MODULE_PARM_DESC(video_debug,"enable debug messages [video]");
 module_param(gbuffers, int, 0444);
 MODULE_PARM_DESC(gbuffers,"number of capture buffers, range 2-32");
 module_param(noninterlaced, int, 0644);
 MODULE_PARM_DESC(noninterlaced,"capture non interlaced video");
+module_param_string(secam, secam, sizeof(secam), 0644);
+MODULE_PARM_DESC(secam, "force SECAM variant, either DK,L or Lc");
+
 
 #define dprintk(fmt, arg...)   if (video_debug) \
        printk(KERN_DEBUG "%s/video: " fmt, dev->name , ## arg)
@@ -279,7 +283,43 @@ static struct saa7134_tvnorm tvnorms[] = {
                .id            = V4L2_STD_SECAM,
                NORM_625_50,
 
-               .sync_control  = 0x18, /* old: 0x58, */
+               .sync_control  = 0x18,
+               .luma_control  = 0x1b,
+               .chroma_ctrl1  = 0xd1,
+               .chroma_gain   = 0x80,
+               .chroma_ctrl2  = 0x00,
+               .vgate_misc    = 0x1c,
+
+       },{
+               .name          = "SECAM-DK",
+               .id            = V4L2_STD_SECAM_DK,
+               NORM_625_50,
+
+               .sync_control  = 0x18,
+               .luma_control  = 0x1b,
+               .chroma_ctrl1  = 0xd1,
+               .chroma_gain   = 0x80,
+               .chroma_ctrl2  = 0x00,
+               .vgate_misc    = 0x1c,
+
+       },{
+               .name          = "SECAM-L",
+               .id            = V4L2_STD_SECAM_L,
+               NORM_625_50,
+
+               .sync_control  = 0x18,
+               .luma_control  = 0x1b,
+               .chroma_ctrl1  = 0xd1,
+               .chroma_gain   = 0x80,
+               .chroma_ctrl2  = 0x00,
+               .vgate_misc    = 0x1c,
+
+       },{
+               .name          = "SECAM-Lc",
+               .id            = V4L2_STD_SECAM_LC,
+               NORM_625_50,
+
+               .sync_control  = 0x18,
                .luma_control  = 0x1b,
                .chroma_ctrl1  = 0xd1,
                .chroma_gain   = 0x80,
@@ -1769,6 +1809,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
        {
                v4l2_std_id *id = arg;
                unsigned int i;
+               v4l2_std_id fixup;
 
                for (i = 0; i < TVNORMS; i++)
                        if (*id == tvnorms[i].id)
@@ -1779,7 +1820,22 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
                                        break;
                if (i == TVNORMS)
                        return -EINVAL;
-
+               if ((*id & V4L2_STD_SECAM) && (secam[0] != '-')) {
+                       if (secam[0] == 'L' || secam[0] == 'l') {
+                               if (secam[1] == 'C' || secam[1] == 'c')
+                                       fixup = V4L2_STD_SECAM_LC;
+                               else
+                                       fixup = V4L2_STD_SECAM_L;
+                       } else {
+                               if (secam[0] == 'D' || secam[0] == 'd')
+                                       fixup = V4L2_STD_SECAM_DK;
+                               else
+                                       fixup = V4L2_STD_SECAM;
+                       }
+                       for (i = 0; i < TVNORMS; i++)
+                               if (fixup == tvnorms[i].id)
+                                       break;
+               }
                mutex_lock(&dev->lock);
                if (res_check(fh, RESOURCE_OVERLAY)) {
                        spin_lock_irqsave(&dev->slock,flags);
index 701a909..7cf96b4 100644 (file)
@@ -61,7 +61,6 @@ enum saa7134_tvaudio_mode {
        TVAUDIO_FM_K_STEREO   = 4,
        TVAUDIO_NICAM_AM      = 5,
        TVAUDIO_NICAM_FM      = 6,
-       TVAUDIO_AM_MONO       = 7
 };
 
 enum saa7134_audio_in {
@@ -227,6 +226,7 @@ struct saa7134_format {
 #define SAA7134_BOARD_FLYDVBS_LR300 97
 #define SAA7134_BOARD_PROTEUS_2309 98
 #define SAA7134_BOARD_AVERMEDIA_A16AR   99
+#define SAA7134_BOARD_ASUS_EUROPA2_HYBRID 100
 
 #define SAA7134_MAXBOARDS 8
 #define SAA7134_INPUT_MAX 8
index cd1502a..e6baaee 100644 (file)
@@ -222,8 +222,8 @@ hauppauge_tuner[] =
        { TUNER_TCL_2002MB,    "TCL M2523_3DB_E"},
        { TUNER_ABSENT,        "Philips 8275A"},
        { TUNER_ABSENT,        "Microtune MT2060"},
-       { TUNER_ABSENT,        "Philips FM1236 MK5"},
-       { TUNER_ABSENT,        "Philips FM1216ME MK5"},
+       { TUNER_PHILIPS_FM1236_MK3, "Philips FM1236 MK5"},
+       { TUNER_PHILIPS_FM1216ME_MK3, "Philips FM1216ME MK5"},
        { TUNER_ABSENT,        "TCL M2523_3DI_E"},
        { TUNER_ABSENT,        "Samsung THPD5222FG30A"},
        /* 120-129 */
index 9f21d0b..653822c 100644 (file)
@@ -1278,9 +1278,7 @@ find_zr36057 (void)
 
        zoran_num = 0;
        while (zoran_num < BUZ_MAX &&
-              (dev =
-               pci_find_device(PCI_VENDOR_ID_ZORAN,
-                               PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
+              (dev = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
                card_num = card[zoran_num];
                zr = &zoran[zoran_num];
                memset(zr, 0, sizeof(struct zoran));    // Just in case if previous cycle failed
@@ -1541,7 +1539,8 @@ find_zr36057 (void)
                                goto zr_detach_vfe;
                        }
                }
-
+               /* Success so keep the pci_dev referenced */
+               pci_dev_get(zr->pci_dev);
                zoran_num++;
                continue;
 
@@ -1563,6 +1562,9 @@ find_zr36057 (void)
                iounmap(zr->zr36057_mem);
                continue;
        }
+       if (dev)        /* Clean up ref count on early exit */
+               pci_dev_put(dev);
+
        if (zoran_num == 0) {
                dprintk(1, KERN_INFO "No known MJPEG cards found.\n");
        }
index 9240638..b5ffe53 100644 (file)
@@ -1840,16 +1840,16 @@ int __init find_zoran(void)
        struct zoran *ztv;
        struct pci_dev *dev = NULL;
        unsigned char revision;
-       int zoran_num=0;
+       int zoran_num = 0;
 
-       while ((dev = pci_find_device(PCI_VENDOR_ID_ZORAN,PCI_DEVICE_ID_ZORAN_36120, dev)))
+       while ((dev = pci_get_device(PCI_VENDOR_ID_ZORAN,PCI_DEVICE_ID_ZORAN_36120, dev)))
        {
                /* Ok, a ZR36120/ZR36125 found! */
                ztv = &zorans[zoran_num];
                ztv->dev = dev;
 
                if (pci_enable_device(dev))
-                       return -EIO;
+                       continue;
 
                pci_read_config_byte(dev, PCI_CLASS_REVISION, &revision);
                printk(KERN_INFO "zoran: Zoran %x (rev %d) ",
@@ -1867,17 +1867,18 @@ int __init find_zoran(void)
                {
                        iounmap(ztv->zoran_mem);
                        printk(KERN_ERR "zoran: Bad irq number or handler\n");
-                       return -EINVAL;
+                       continue;
                }
                if (result==-EBUSY)
                        printk(KERN_ERR "zoran: IRQ %d busy, change your PnP config in BIOS\n",dev->irq);
                if (result < 0) {
                        iounmap(ztv->zoran_mem);
-                       return result;
+                       continue;
                }
                /* Enable bus-mastering */
                pci_set_master(dev);
-
+               /* Keep a reference */
+               pci_dev_get(dev);
                zoran_num++;
        }
        if(zoran_num)
@@ -2041,6 +2042,9 @@ void release_zoran(int max)
                if (ztv->zoran_mem)
                        iounmap(ztv->zoran_mem);
 
+               /* Drop PCI device */
+               pci_dev_put(ztv->dev);
+
                video_unregister_device(&ztv->video_dev);
                video_unregister_device(&ztv->vbi_dev);
        }
@@ -2057,13 +2061,12 @@ int __init zr36120_init(void)
 
        handle_chipset();
        zoran_cards = find_zoran();
-       if (zoran_cards<0)
-               /* no cards found, no need for a driver */
+       if (zoran_cards <= 0)
                return -EIO;
 
        /* initialize Zorans */
        for (card=0; card<zoran_cards; card++) {
-               if (init_zoran(card)<0) {
+               if (init_zoran(card) < 0) {
                        /* only release the zorans we have registered */
                        release_zoran(card);
                        return -EIO;
index cef0074..d231efa 100644 (file)
@@ -9,7 +9,6 @@
  * (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index 1328e10..baaae3d 100644 (file)
@@ -12,8 +12,6 @@
  * kind, whether express or implied.
  */
 
-
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
index 21dc68e..a43e242 100644 (file)
@@ -21,8 +21,6 @@
  *
  *************************************************************************/
 
-#include <linux/config.h>
-
 #define DRV_NAME       "pcnet32"
 #ifdef CONFIG_PCNET32_NAPI
 #define DRV_VERSION    "1.33-NAPI"
index 94b47c8..f14e992 100644 (file)
@@ -13,7 +13,6 @@
  * option) any later version.
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index f91028c..67260eb 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
index 2f0b777..0b20dfa 100644 (file)
@@ -19,7 +19,6 @@
  *                - Initial driver creation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 
index ee2ccad..734adc9 100644 (file)
@@ -24,7 +24,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
index ece936a..8f6f32f 100644 (file)
@@ -66,7 +66,6 @@
  */
 /* ------ END OF USER CONFIGURABLE PARAMETERS ----- */
 
-#include  <linux/config.h>
 #include  <linux/stddef.h>
 #include  <linux/module.h>
 #include  <linux/kernel.h>
index 7511df3..ba80214 100644 (file)
@@ -73,7 +73,6 @@
  */
 /* ------ END OF USER CONFIGURABLE PARAMETERS ----- */
 
-#include  <linux/config.h>
 #include  <linux/stddef.h>
 #include  <linux/module.h>
 #include  <linux/kernel.h>
index 8edee74..b0d5026 100644 (file)
@@ -299,33 +299,33 @@ config SERIAL_AMBA_PL011_CONSOLE
          your boot loader (lilo or loadlin) about how to pass options to the
          kernel at boot time.)
 
-config SERIAL_AT91
-       bool "AT91RM9200 / AT91SAM9261 serial port support"
-       depends on ARM && (ARCH_AT91RM9200 || ARCH_AT91SAM9261)
+config SERIAL_ATMEL
+       bool "AT91 / AT32 on-chip serial port support"
+       depends on (ARM && ARCH_AT91) || AVR32
        select SERIAL_CORE
        help
          This enables the driver for the on-chip UARTs of the Atmel
-         AT91RM9200 and AT91SAM926 processor.
+         AT91 and AT32 processors.
 
-config SERIAL_AT91_CONSOLE
-       bool "Support for console on AT91RM9200 / AT91SAM9261 serial port"
-       depends on SERIAL_AT91=y
+config SERIAL_ATMEL_CONSOLE
+       bool "Support for console on AT91 / AT32 serial port"
+       depends on SERIAL_ATMEL=y
        select SERIAL_CORE_CONSOLE
        help
-         Say Y here if you wish to use a UART on the Atmel AT91RM9200 or
-         AT91SAM9261 as the system console (the system console is the device
-         which receives all kernel messages and warnings and which allows
-         logins in single user mode).
+         Say Y here if you wish to use an on-chip UART on a Atmel
+         AT91 or AT32 processor as the system console (the system
+         console is the device which receives all kernel messages and
+         warnings and which allows logins in single user mode).
 
-config SERIAL_AT91_TTYAT
-       bool "Install as device ttyAT0-4 instead of ttyS0-4"
-       depends on SERIAL_AT91=y
+config SERIAL_ATMEL_TTYAT
+       bool "Install as device ttyATn instead of ttySn"
+       depends on SERIAL_ATMEL=y
        help
-         Say Y here if you wish to have the five internal AT91RM9200 UARTs
-         appear as /dev/ttyAT0-4 (major 204, minor 154-158) instead of the
-         normal /dev/ttyS0-4 (major 4, minor 64-68). This is necessary if
-         you also want other UARTs, such as external 8250/16C550 compatible
-         UARTs.
+         Say Y here if you wish to have the internal AT91 / AT32 UARTs
+         appear as /dev/ttyATn (major 204, minor starting at 154)
+         instead of the normal /dev/ttySn (major 4, minor starting at
+         64). This is necessary if you also want other UARTs, such as
+         external 8250/16C550 compatible UARTs.
          The ttySn nodes are legally reserved for the 8250 serial driver
          but are often misused by other serial drivers.
 
index 927faee..b4d8a7c 100644 (file)
@@ -54,5 +54,5 @@ obj-$(CONFIG_SERIAL_TXX9) += serial_txx9.o
 obj-$(CONFIG_SERIAL_VR41XX) += vr41xx_siu.o
 obj-$(CONFIG_SERIAL_SGI_IOC4) += ioc4_serial.o
 obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
-obj-$(CONFIG_SERIAL_AT91) += at91_serial.o
+obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
 obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
diff --git a/drivers/serial/at91_serial.c b/drivers/serial/at91_serial.c
deleted file mode 100644 (file)
index bf4bf10..0000000
+++ /dev/null
@@ -1,980 +0,0 @@
-/*
- *  linux/drivers/char/at91_serial.c
- *
- *  Driver for Atmel AT91RM9200 Serial ports
- *  Copyright (C) 2003 Rick Bronson
- *
- *  Based on drivers/char/serial_sa1100.c, by Deep Blue Solutions Ltd.
- *  Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-#include <linux/module.h>
-#include <linux/tty.h>
-#include <linux/ioport.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/serial.h>
-#include <linux/clk.h>
-#include <linux/console.h>
-#include <linux/sysrq.h>
-#include <linux/tty_flip.h>
-#include <linux/platform_device.h>
-
-#include <asm/io.h>
-
-#include <asm/arch/at91rm9200_usart.h>
-#include <asm/arch/at91rm9200_pdc.h>
-#include <asm/mach/serial_at91.h>
-#include <asm/arch/board.h>
-#include <asm/arch/system.h>
-#include <asm/arch/gpio.h>
-
-#if defined(CONFIG_SERIAL_AT91_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
-#define SUPPORT_SYSRQ
-#endif
-
-#include <linux/serial_core.h>
-
-#ifdef CONFIG_SERIAL_AT91_TTYAT
-
-/* Use device name ttyAT, major 204 and minor 154-169.  This is necessary if we
- * should coexist with the 8250 driver, such as if we have an external 16C550
- * UART. */
-#define SERIAL_AT91_MAJOR      204
-#define MINOR_START            154
-#define AT91_DEVICENAME                "ttyAT"
-
-#else
-
-/* Use device name ttyS, major 4, minor 64-68.  This is the usual serial port
- * name, but it is legally reserved for the 8250 driver. */
-#define SERIAL_AT91_MAJOR      TTY_MAJOR
-#define MINOR_START            64
-#define AT91_DEVICENAME                "ttyS"
-
-#endif
-
-#define AT91_ISR_PASS_LIMIT    256
-
-#define UART_PUT_CR(port,v)    writel(v, (port)->membase + AT91_US_CR)
-#define UART_GET_MR(port)      readl((port)->membase + AT91_US_MR)
-#define UART_PUT_MR(port,v)    writel(v, (port)->membase + AT91_US_MR)
-#define UART_PUT_IER(port,v)   writel(v, (port)->membase + AT91_US_IER)
-#define UART_PUT_IDR(port,v)   writel(v, (port)->membase + AT91_US_IDR)
-#define UART_GET_IMR(port)     readl((port)->membase + AT91_US_IMR)
-#define UART_GET_CSR(port)     readl((port)->membase + AT91_US_CSR)
-#define UART_GET_CHAR(port)    readl((port)->membase + AT91_US_RHR)
-#define UART_PUT_CHAR(port,v)  writel(v, (port)->membase + AT91_US_THR)
-#define UART_GET_BRGR(port)    readl((port)->membase + AT91_US_BRGR)
-#define UART_PUT_BRGR(port,v)  writel(v, (port)->membase + AT91_US_BRGR)
-#define UART_PUT_RTOR(port,v)  writel(v, (port)->membase + AT91_US_RTOR)
-
-// #define UART_GET_CR(port)   readl((port)->membase + AT91_US_CR)             // is write-only
-
- /* PDC registers */
-#define UART_PUT_PTCR(port,v)  writel(v, (port)->membase + AT91_PDC_PTCR)
-#define UART_GET_PTSR(port)    readl((port)->membase + AT91_PDC_PTSR)
-
-#define UART_PUT_RPR(port,v)   writel(v, (port)->membase + AT91_PDC_RPR)
-#define UART_GET_RPR(port)     readl((port)->membase + AT91_PDC_RPR)
-#define UART_PUT_RCR(port,v)   writel(v, (port)->membase + AT91_PDC_RCR)
-#define UART_PUT_RNPR(port,v)  writel(v, (port)->membase + AT91_PDC_RNPR)
-#define UART_PUT_RNCR(port,v)  writel(v, (port)->membase + AT91_PDC_RNCR)
-
-#define UART_PUT_TPR(port,v)   writel(v, (port)->membase + AT91_PDC_TPR)
-#define UART_PUT_TCR(port,v)   writel(v, (port)->membase + AT91_PDC_TCR)
-//#define UART_PUT_TNPR(port,v)        writel(v, (port)->membase + AT91_PDC_TNPR)
-//#define UART_PUT_TNCR(port,v)        writel(v, (port)->membase + AT91_PDC_TNCR)
-
-static int (*at91_open)(struct uart_port *);
-static void (*at91_close)(struct uart_port *);
-
-/*
- * We wrap our port structure around the generic uart_port.
- */
-struct at91_uart_port {
-       struct uart_port        uart;           /* uart */
-       struct clk              *clk;           /* uart clock */
-       unsigned short          suspended;      /* is port suspended? */
-};
-
-static struct at91_uart_port at91_ports[AT91_NR_UART];
-
-#ifdef SUPPORT_SYSRQ
-static struct console at91_console;
-#endif
-
-/*
- * Return TIOCSER_TEMT when transmitter FIFO and Shift register is empty.
- */
-static u_int at91_tx_empty(struct uart_port *port)
-{
-       return (UART_GET_CSR(port) & AT91_US_TXEMPTY) ? TIOCSER_TEMT : 0;
-}
-
-/*
- * Set state of the modem control output lines
- */
-static void at91_set_mctrl(struct uart_port *port, u_int mctrl)
-{
-       unsigned int control = 0;
-       unsigned int mode;
-
-       if (arch_identify() == ARCH_ID_AT91RM9200) {
-               /*
-                * AT91RM9200 Errata #39: RTS0 is not internally connected to PA21.
-                *  We need to drive the pin manually.
-                */
-               if (port->mapbase == AT91RM9200_BASE_US0) {
-                       if (mctrl & TIOCM_RTS)
-                               at91_set_gpio_value(AT91_PIN_PA21, 0);
-                       else
-                               at91_set_gpio_value(AT91_PIN_PA21, 1);
-               }
-       }
-
-       if (mctrl & TIOCM_RTS)
-               control |= AT91_US_RTSEN;
-       else
-               control |= AT91_US_RTSDIS;
-
-       if (mctrl & TIOCM_DTR)
-               control |= AT91_US_DTREN;
-       else
-               control |= AT91_US_DTRDIS;
-
-       UART_PUT_CR(port, control);
-
-       /* Local loopback mode? */
-       mode = UART_GET_MR(port) & ~AT91_US_CHMODE;
-       if (mctrl & TIOCM_LOOP)
-               mode |= AT91_US_CHMODE_LOC_LOOP;
-       else
-               mode |= AT91_US_CHMODE_NORMAL;
-       UART_PUT_MR(port, mode);
-}
-
-/*
- * Get state of the modem control input lines
- */
-static u_int at91_get_mctrl(struct uart_port *port)
-{
-       unsigned int status, ret = 0;
-
-       status = UART_GET_CSR(port);
-
-       /*
-        * The control signals are active low.
-        */
-       if (!(status & AT91_US_DCD))
-               ret |= TIOCM_CD;
-       if (!(status & AT91_US_CTS))
-               ret |= TIOCM_CTS;
-       if (!(status & AT91_US_DSR))
-               ret |= TIOCM_DSR;
-       if (!(status & AT91_US_RI))
-               ret |= TIOCM_RI;
-
-       return ret;
-}
-
-/*
- * Stop transmitting.
- */
-static void at91_stop_tx(struct uart_port *port)
-{
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-
-       UART_PUT_IDR(port, AT91_US_TXRDY);
-}
-
-/*
- * Start transmitting.
- */
-static void at91_start_tx(struct uart_port *port)
-{
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-
-       UART_PUT_IER(port, AT91_US_TXRDY);
-}
-
-/*
- * Stop receiving - port is in process of being closed.
- */
-static void at91_stop_rx(struct uart_port *port)
-{
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-
-       UART_PUT_IDR(port, AT91_US_RXRDY);
-}
-
-/*
- * Enable modem status interrupts
- */
-static void at91_enable_ms(struct uart_port *port)
-{
-       UART_PUT_IER(port, AT91_US_RIIC | AT91_US_DSRIC | AT91_US_DCDIC | AT91_US_CTSIC);
-}
-
-/*
- * Control the transmission of a break signal
- */
-static void at91_break_ctl(struct uart_port *port, int break_state)
-{
-       if (break_state != 0)
-               UART_PUT_CR(port, AT91_US_STTBRK);      /* start break */
-       else
-               UART_PUT_CR(port, AT91_US_STPBRK);      /* stop break */
-}
-
-/*
- * Characters received (called from interrupt handler)
- */
-static void at91_rx_chars(struct uart_port *port, struct pt_regs *regs)
-{
-       struct tty_struct *tty = port->info->tty;
-       unsigned int status, ch, flg;
-
-       status = UART_GET_CSR(port);
-       while (status & AT91_US_RXRDY) {
-               ch = UART_GET_CHAR(port);
-
-               port->icount.rx++;
-
-               flg = TTY_NORMAL;
-
-               /*
-                * note that the error handling code is
-                * out of the main execution path
-                */
-               if (unlikely(status & (AT91_US_PARE | AT91_US_FRAME | AT91_US_OVRE | AT91_US_RXBRK))) {
-                       UART_PUT_CR(port, AT91_US_RSTSTA);      /* clear error */
-                       if (status & AT91_US_RXBRK) {
-                               status &= ~(AT91_US_PARE | AT91_US_FRAME);      /* ignore side-effect */
-                               port->icount.brk++;
-                               if (uart_handle_break(port))
-                                       goto ignore_char;
-                       }
-                       if (status & AT91_US_PARE)
-                               port->icount.parity++;
-                       if (status & AT91_US_FRAME)
-                               port->icount.frame++;
-                       if (status & AT91_US_OVRE)
-                               port->icount.overrun++;
-
-                       status &= port->read_status_mask;
-
-                       if (status & AT91_US_RXBRK)
-                               flg = TTY_BREAK;
-                       else if (status & AT91_US_PARE)
-                               flg = TTY_PARITY;
-                       else if (status & AT91_US_FRAME)
-                               flg = TTY_FRAME;
-               }
-
-               if (uart_handle_sysrq_char(port, ch, regs))
-                       goto ignore_char;
-
-               uart_insert_char(port, status, AT91_US_OVRE, ch, flg);
-
-       ignore_char:
-               status = UART_GET_CSR(port);
-       }
-
-       tty_flip_buffer_push(tty);
-}
-
-/*
- * Transmit characters (called from interrupt handler)
- */
-static void at91_tx_chars(struct uart_port *port)
-{
-       struct circ_buf *xmit = &port->info->xmit;
-
-       if (port->x_char) {
-               UART_PUT_CHAR(port, port->x_char);
-               port->icount.tx++;
-               port->x_char = 0;
-               return;
-       }
-       if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
-               at91_stop_tx(port);
-               return;
-       }
-
-       while (UART_GET_CSR(port) & AT91_US_TXRDY) {
-               UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
-               xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
-               port->icount.tx++;
-               if (uart_circ_empty(xmit))
-                       break;
-       }
-
-       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
-               uart_write_wakeup(port);
-
-       if (uart_circ_empty(xmit))
-               at91_stop_tx(port);
-}
-
-/*
- * Interrupt handler
- */
-static irqreturn_t at91_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-{
-       struct uart_port *port = dev_id;
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-       unsigned int status, pending, pass_counter = 0;
-
-       status = UART_GET_CSR(port);
-       pending = status & UART_GET_IMR(port);
-       while (pending) {
-               /* Interrupt receive */
-               if (pending & AT91_US_RXRDY)
-                       at91_rx_chars(port, regs);
-
-               // TODO: All reads to CSR will clear these interrupts!
-               if (pending & AT91_US_RIIC) port->icount.rng++;
-               if (pending & AT91_US_DSRIC) port->icount.dsr++;
-               if (pending & AT91_US_DCDIC)
-                       uart_handle_dcd_change(port, !(status & AT91_US_DCD));
-               if (pending & AT91_US_CTSIC)
-                       uart_handle_cts_change(port, !(status & AT91_US_CTS));
-               if (pending & (AT91_US_RIIC | AT91_US_DSRIC | AT91_US_DCDIC | AT91_US_CTSIC))
-                       wake_up_interruptible(&port->info->delta_msr_wait);
-
-               /* Interrupt transmit */
-               if (pending & AT91_US_TXRDY)
-                       at91_tx_chars(port);
-
-               if (pass_counter++ > AT91_ISR_PASS_LIMIT)
-                       break;
-
-               status = UART_GET_CSR(port);
-               pending = status & UART_GET_IMR(port);
-       }
-       return IRQ_HANDLED;
-}
-
-/*
- * Perform initialization and enable port for reception
- */
-static int at91_startup(struct uart_port *port)
-{
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-       int retval;
-
-       /*
-        * Ensure that no interrupts are enabled otherwise when
-        * request_irq() is called we could get stuck trying to
-        * handle an unexpected interrupt
-        */
-       UART_PUT_IDR(port, -1);
-
-       /*
-        * Allocate the IRQ
-        */
-       retval = request_irq(port->irq, at91_interrupt, IRQF_SHARED, "at91_serial", port);
-       if (retval) {
-               printk("at91_serial: at91_startup - Can't get irq\n");
-               return retval;
-       }
-
-       /*
-        * If there is a specific "open" function (to register
-        * control line interrupts)
-        */
-       if (at91_open) {
-               retval = at91_open(port);
-               if (retval) {
-                       free_irq(port->irq, port);
-                       return retval;
-               }
-       }
-
-       /*
-        * Finally, enable the serial port
-        */
-       UART_PUT_CR(port, AT91_US_RSTSTA | AT91_US_RSTRX);
-       UART_PUT_CR(port, AT91_US_TXEN | AT91_US_RXEN);         /* enable xmit & rcvr */
-
-       UART_PUT_IER(port, AT91_US_RXRDY);              /* enable receive only */
-
-       return 0;
-}
-
-/*
- * Disable the port
- */
-static void at91_shutdown(struct uart_port *port)
-{
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-
-       /*
-        * Disable all interrupts, port and break condition.
-        */
-       UART_PUT_CR(port, AT91_US_RSTSTA);
-       UART_PUT_IDR(port, -1);
-
-       /*
-        * Free the interrupt
-        */
-       free_irq(port->irq, port);
-
-       /*
-        * If there is a specific "close" function (to unregister
-        * control line interrupts)
-        */
-       if (at91_close)
-               at91_close(port);
-}
-
-/*
- * Power / Clock management.
- */
-static void at91_serial_pm(struct uart_port *port, unsigned int state, unsigned int oldstate)
-{
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-
-       switch (state) {
-               case 0:
-                       /*
-                        * Enable the peripheral clock for this serial port.
-                        * This is called on uart_open() or a resume event.
-                        */
-                       clk_enable(at91_port->clk);
-                       break;
-               case 3:
-                       /*
-                        * Disable the peripheral clock for this serial port.
-                        * This is called on uart_close() or a suspend event.
-                        */
-                       clk_disable(at91_port->clk);
-                       break;
-               default:
-                       printk(KERN_ERR "at91_serial: unknown pm %d\n", state);
-       }
-}
-
-/*
- * Change the port parameters
- */
-static void at91_set_termios(struct uart_port *port, struct termios * termios, struct termios * old)
-{
-       unsigned long flags;
-       unsigned int mode, imr, quot, baud;
-
-       baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
-       quot = uart_get_divisor(port, baud);
-
-       /* Get current mode register */
-       mode = UART_GET_MR(port) & ~(AT91_US_CHRL | AT91_US_NBSTOP | AT91_US_PAR);
-
-       /* byte size */
-       switch (termios->c_cflag & CSIZE) {
-       case CS5:
-               mode |= AT91_US_CHRL_5;
-               break;
-       case CS6:
-               mode |= AT91_US_CHRL_6;
-               break;
-       case CS7:
-               mode |= AT91_US_CHRL_7;
-               break;
-       default:
-               mode |= AT91_US_CHRL_8;
-               break;
-       }
-
-       /* stop bits */
-       if (termios->c_cflag & CSTOPB)
-               mode |= AT91_US_NBSTOP_2;
-
-       /* parity */
-       if (termios->c_cflag & PARENB) {
-               if (termios->c_cflag & CMSPAR) {                        /* Mark or Space parity */
-                       if (termios->c_cflag & PARODD)
-                               mode |= AT91_US_PAR_MARK;
-                       else
-                               mode |= AT91_US_PAR_SPACE;
-               }
-               else if (termios->c_cflag & PARODD)
-                       mode |= AT91_US_PAR_ODD;
-               else
-                       mode |= AT91_US_PAR_EVEN;
-       }
-       else
-               mode |= AT91_US_PAR_NONE;
-
-       spin_lock_irqsave(&port->lock, flags);
-
-       port->read_status_mask = AT91_US_OVRE;
-       if (termios->c_iflag & INPCK)
-               port->read_status_mask |= (AT91_US_FRAME | AT91_US_PARE);
-       if (termios->c_iflag & (BRKINT | PARMRK))
-               port->read_status_mask |= AT91_US_RXBRK;
-
-       /*
-        * Characters to ignore
-        */
-       port->ignore_status_mask = 0;
-       if (termios->c_iflag & IGNPAR)
-               port->ignore_status_mask |= (AT91_US_FRAME | AT91_US_PARE);
-       if (termios->c_iflag & IGNBRK) {
-               port->ignore_status_mask |= AT91_US_RXBRK;
-               /*
-                * If we're ignoring parity and break indicators,
-                * ignore overruns too (for real raw support).
-                */
-               if (termios->c_iflag & IGNPAR)
-                       port->ignore_status_mask |= AT91_US_OVRE;
-       }
-
-       // TODO: Ignore all characters if CREAD is set.
-
-       /* update the per-port timeout */
-       uart_update_timeout(port, termios->c_cflag, baud);
-
-       /* disable interrupts and drain transmitter */
-       imr = UART_GET_IMR(port);       /* get interrupt mask */
-       UART_PUT_IDR(port, -1);         /* disable all interrupts */
-       while (!(UART_GET_CSR(port) & AT91_US_TXEMPTY)) { barrier(); }
-
-       /* disable receiver and transmitter */
-       UART_PUT_CR(port, AT91_US_TXDIS | AT91_US_RXDIS);
-
-       /* set the parity, stop bits and data size */
-       UART_PUT_MR(port, mode);
-
-       /* set the baud rate */
-       UART_PUT_BRGR(port, quot);
-       UART_PUT_CR(port, AT91_US_RSTSTA | AT91_US_RSTRX);
-       UART_PUT_CR(port, AT91_US_TXEN | AT91_US_RXEN);
-
-       /* restore interrupts */
-       UART_PUT_IER(port, imr);
-
-       /* CTS flow-control and modem-status interrupts */
-       if (UART_ENABLE_MS(port, termios->c_cflag))
-               port->ops->enable_ms(port);
-
-       spin_unlock_irqrestore(&port->lock, flags);
-}
-
-/*
- * Return string describing the specified port
- */
-static const char *at91_type(struct uart_port *port)
-{
-       return (port->type == PORT_AT91) ? "AT91_SERIAL" : NULL;
-}
-
-/*
- * Release the memory region(s) being used by 'port'.
- */
-static void at91_release_port(struct uart_port *port)
-{
-       struct platform_device *pdev = to_platform_device(port->dev);
-       int size = pdev->resource[0].end - pdev->resource[0].start + 1;
-
-       release_mem_region(port->mapbase, size);
-
-       if (port->flags & UPF_IOREMAP) {
-               iounmap(port->membase);
-               port->membase = NULL;
-       }
-}
-
-/*
- * Request the memory region(s) being used by 'port'.
- */
-static int at91_request_port(struct uart_port *port)
-{
-       struct platform_device *pdev = to_platform_device(port->dev);
-       int size = pdev->resource[0].end - pdev->resource[0].start + 1;
-
-       if (!request_mem_region(port->mapbase, size, "at91_serial"))
-               return -EBUSY;
-
-       if (port->flags & UPF_IOREMAP) {
-               port->membase = ioremap(port->mapbase, size);
-               if (port->membase == NULL) {
-                       release_mem_region(port->mapbase, size);
-                       return -ENOMEM;
-               }
-       }
-
-       return 0;
-}
-
-/*
- * Configure/autoconfigure the port.
- */
-static void at91_config_port(struct uart_port *port, int flags)
-{
-       if (flags & UART_CONFIG_TYPE) {
-               port->type = PORT_AT91;
-               at91_request_port(port);
-       }
-}
-
-/*
- * Verify the new serial_struct (for TIOCSSERIAL).
- */
-static int at91_verify_port(struct uart_port *port, struct serial_struct *ser)
-{
-       int ret = 0;
-       if (ser->type != PORT_UNKNOWN && ser->type != PORT_AT91)
-               ret = -EINVAL;
-       if (port->irq != ser->irq)
-               ret = -EINVAL;
-       if (ser->io_type != SERIAL_IO_MEM)
-               ret = -EINVAL;
-       if (port->uartclk / 16 != ser->baud_base)
-               ret = -EINVAL;
-       if ((void *)port->mapbase != ser->iomem_base)
-               ret = -EINVAL;
-       if (port->iobase != ser->port)
-               ret = -EINVAL;
-       if (ser->hub6 != 0)
-               ret = -EINVAL;
-       return ret;
-}
-
-static struct uart_ops at91_pops = {
-       .tx_empty       = at91_tx_empty,
-       .set_mctrl      = at91_set_mctrl,
-       .get_mctrl      = at91_get_mctrl,
-       .stop_tx        = at91_stop_tx,
-       .start_tx       = at91_start_tx,
-       .stop_rx        = at91_stop_rx,
-       .enable_ms      = at91_enable_ms,
-       .break_ctl      = at91_break_ctl,
-       .startup        = at91_startup,
-       .shutdown       = at91_shutdown,
-       .set_termios    = at91_set_termios,
-       .type           = at91_type,
-       .release_port   = at91_release_port,
-       .request_port   = at91_request_port,
-       .config_port    = at91_config_port,
-       .verify_port    = at91_verify_port,
-       .pm             = at91_serial_pm,
-};
-
-/*
- * Configure the port from the platform device resource info.
- */
-static void __devinit at91_init_port(struct at91_uart_port *at91_port, struct platform_device *pdev)
-{
-       struct uart_port *port = &at91_port->uart;
-       struct at91_uart_data *data = pdev->dev.platform_data;
-
-       port->iotype    = UPIO_MEM;
-       port->flags     = UPF_BOOT_AUTOCONF;
-       port->ops       = &at91_pops;
-       port->fifosize  = 1;
-       port->line      = pdev->id;
-       port->dev       = &pdev->dev;
-
-       port->mapbase   = pdev->resource[0].start;
-       port->irq       = pdev->resource[1].start;
-
-       if (port->mapbase == AT91_VA_BASE_SYS + AT91_DBGU)              /* Part of system perpherals - already mapped */
-               port->membase = (void __iomem *) port->mapbase;
-       else {
-               port->flags     |= UPF_IOREMAP;
-               port->membase   = NULL;
-       }
-
-       if (!at91_port->clk) {          /* for console, the clock could already be configured */
-               at91_port->clk = clk_get(&pdev->dev, "usart");
-               clk_enable(at91_port->clk);
-               port->uartclk = clk_get_rate(at91_port->clk);
-       }
-}
-
-/*
- * Register board-specific modem-control line handlers.
- */
-void __init at91_register_uart_fns(struct at91_port_fns *fns)
-{
-       if (fns->enable_ms)
-               at91_pops.enable_ms = fns->enable_ms;
-       if (fns->get_mctrl)
-               at91_pops.get_mctrl = fns->get_mctrl;
-       if (fns->set_mctrl)
-               at91_pops.set_mctrl = fns->set_mctrl;
-       at91_open          = fns->open;
-       at91_close         = fns->close;
-       at91_pops.pm       = fns->pm;
-       at91_pops.set_wake = fns->set_wake;
-}
-
-
-#ifdef CONFIG_SERIAL_AT91_CONSOLE
-static void at91_console_putchar(struct uart_port *port, int ch)
-{
-       while (!(UART_GET_CSR(port) & AT91_US_TXRDY))
-               barrier();
-       UART_PUT_CHAR(port, ch);
-}
-
-/*
- * Interrupts are disabled on entering
- */
-static void at91_console_write(struct console *co, const char *s, u_int count)
-{
-       struct uart_port *port = &at91_ports[co->index].uart;
-       unsigned int status, imr;
-
-       /*
-        *      First, save IMR and then disable interrupts
-        */
-       imr = UART_GET_IMR(port);       /* get interrupt mask */
-       UART_PUT_IDR(port, AT91_US_RXRDY | AT91_US_TXRDY);
-
-       uart_console_write(port, s, count, at91_console_putchar);
-
-       /*
-        *      Finally, wait for transmitter to become empty
-        *      and restore IMR
-        */
-       do {
-               status = UART_GET_CSR(port);
-       } while (!(status & AT91_US_TXRDY));
-       UART_PUT_IER(port, imr);        /* set interrupts back the way they were */
-}
-
-/*
- * If the port was already initialised (eg, by a boot loader), try to determine
- * the current setup.
- */
-static void __init at91_console_get_options(struct uart_port *port, int *baud, int *parity, int *bits)
-{
-       unsigned int mr, quot;
-
-// TODO: CR is a write-only register
-//     unsigned int cr;
-//
-//     cr = UART_GET_CR(port) & (AT91_US_RXEN | AT91_US_TXEN);
-//     if (cr == (AT91_US_RXEN | AT91_US_TXEN)) {
-//             /* ok, the port was enabled */
-//     }
-
-       mr = UART_GET_MR(port) & AT91_US_CHRL;
-       if (mr == AT91_US_CHRL_8)
-               *bits = 8;
-       else
-               *bits = 7;
-
-       mr = UART_GET_MR(port) & AT91_US_PAR;
-       if (mr == AT91_US_PAR_EVEN)
-               *parity = 'e';
-       else if (mr == AT91_US_PAR_ODD)
-               *parity = 'o';
-
-       quot = UART_GET_BRGR(port);
-       *baud = port->uartclk / (16 * (quot));
-}
-
-static int __init at91_console_setup(struct console *co, char *options)
-{
-       struct uart_port *port = &at91_ports[co->index].uart;
-       int baud = 115200;
-       int bits = 8;
-       int parity = 'n';
-       int flow = 'n';
-
-       if (port->membase == 0)         /* Port not initialized yet - delay setup */
-               return -ENODEV;
-
-       UART_PUT_IDR(port, -1);                         /* disable interrupts */
-       UART_PUT_CR(port, AT91_US_RSTSTA | AT91_US_RSTRX);
-       UART_PUT_CR(port, AT91_US_TXEN | AT91_US_RXEN);
-
-       if (options)
-               uart_parse_options(options, &baud, &parity, &bits, &flow);
-       else
-               at91_console_get_options(port, &baud, &parity, &bits);
-
-       return uart_set_options(port, co, baud, parity, bits, flow);
-}
-
-static struct uart_driver at91_uart;
-
-static struct console at91_console = {
-       .name           = AT91_DEVICENAME,
-       .write          = at91_console_write,
-       .device         = uart_console_device,
-       .setup          = at91_console_setup,
-       .flags          = CON_PRINTBUFFER,
-       .index          = -1,
-       .data           = &at91_uart,
-};
-
-#define AT91_CONSOLE_DEVICE    &at91_console
-
-/*
- * Early console initialization (before VM subsystem initialized).
- */
-static int __init at91_console_init(void)
-{
-       if (at91_default_console_device) {
-               add_preferred_console(AT91_DEVICENAME, at91_default_console_device->id, NULL);
-               at91_init_port(&(at91_ports[at91_default_console_device->id]), at91_default_console_device);
-               register_console(&at91_console);
-       }
-
-       return 0;
-}
-console_initcall(at91_console_init);
-
-/*
- * Late console initialization.
- */
-static int __init at91_late_console_init(void)
-{
-       if (at91_default_console_device && !(at91_console.flags & CON_ENABLED))
-               register_console(&at91_console);
-
-       return 0;
-}
-core_initcall(at91_late_console_init);
-
-#else
-#define AT91_CONSOLE_DEVICE    NULL
-#endif
-
-static struct uart_driver at91_uart = {
-       .owner                  = THIS_MODULE,
-       .driver_name            = "at91_serial",
-       .dev_name               = AT91_DEVICENAME,
-       .major                  = SERIAL_AT91_MAJOR,
-       .minor                  = MINOR_START,
-       .nr                     = AT91_NR_UART,
-       .cons                   = AT91_CONSOLE_DEVICE,
-};
-
-#ifdef CONFIG_PM
-static int at91_serial_suspend(struct platform_device *pdev, pm_message_t state)
-{
-       struct uart_port *port = platform_get_drvdata(pdev);
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-
-       if (device_may_wakeup(&pdev->dev) && !at91_suspend_entering_slow_clock())
-               enable_irq_wake(port->irq);
-       else {
-               disable_irq_wake(port->irq);
-               uart_suspend_port(&at91_uart, port);
-               at91_port->suspended = 1;
-       }
-
-       return 0;
-}
-
-static int at91_serial_resume(struct platform_device *pdev)
-{
-       struct uart_port *port = platform_get_drvdata(pdev);
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-
-       if (at91_port->suspended) {
-               uart_resume_port(&at91_uart, port);
-               at91_port->suspended = 0;
-       }
-
-       return 0;
-}
-#else
-#define at91_serial_suspend NULL
-#define at91_serial_resume NULL
-#endif
-
-static int __devinit at91_serial_probe(struct platform_device *pdev)
-{
-       struct at91_uart_port *port;
-       int ret;
-
-       port = &at91_ports[pdev->id];
-       at91_init_port(port, pdev);
-
-       ret = uart_add_one_port(&at91_uart, &port->uart);
-       if (!ret) {
-               device_init_wakeup(&pdev->dev, 1);
-               platform_set_drvdata(pdev, port);
-       }
-
-       return ret;
-}
-
-static int __devexit at91_serial_remove(struct platform_device *pdev)
-{
-       struct uart_port *port = platform_get_drvdata(pdev);
-       struct at91_uart_port *at91_port = (struct at91_uart_port *) port;
-       int ret = 0;
-
-       clk_disable(at91_port->clk);
-       clk_put(at91_port->clk);
-
-       device_init_wakeup(&pdev->dev, 0);
-       platform_set_drvdata(pdev, NULL);
-
-       if (port) {
-               ret = uart_remove_one_port(&at91_uart, port);
-               kfree(port);
-       }
-
-       return ret;
-}
-
-static struct platform_driver at91_serial_driver = {
-       .probe          = at91_serial_probe,
-       .remove         = __devexit_p(at91_serial_remove),
-       .suspend        = at91_serial_suspend,
-       .resume         = at91_serial_resume,
-       .driver         = {
-               .name   = "at91_usart",
-               .owner  = THIS_MODULE,
-       },
-};
-
-static int __init at91_serial_init(void)
-{
-       int ret;
-
-       ret = uart_register_driver(&at91_uart);
-       if (ret)
-               return ret;
-
-       ret = platform_driver_register(&at91_serial_driver);
-       if (ret)
-               uart_unregister_driver(&at91_uart);
-
-       return ret;
-}
-
-static void __exit at91_serial_exit(void)
-{
-       platform_driver_unregister(&at91_serial_driver);
-       uart_unregister_driver(&at91_uart);
-}
-
-module_init(at91_serial_init);
-module_exit(at91_serial_exit);
-
-MODULE_AUTHOR("Rick Bronson");
-MODULE_DESCRIPTION("AT91 generic serial port driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
new file mode 100644 (file)
index 0000000..955c46d
--- /dev/null
@@ -0,0 +1,992 @@
+/*
+ *  linux/drivers/char/at91_serial.c
+ *
+ *  Driver for Atmel AT91 / AT32 Serial ports
+ *  Copyright (C) 2003 Rick Bronson
+ *
+ *  Based on drivers/char/serial_sa1100.c, by Deep Blue Solutions Ltd.
+ *  Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+#include <linux/module.h>
+#include <linux/tty.h>
+#include <linux/ioport.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/serial.h>
+#include <linux/clk.h>
+#include <linux/console.h>
+#include <linux/sysrq.h>
+#include <linux/tty_flip.h>
+#include <linux/platform_device.h>
+
+#include <asm/io.h>
+
+#include <asm/arch/at91rm9200_pdc.h>
+#include <asm/mach/serial_at91.h>
+#include <asm/arch/board.h>
+#ifdef CONFIG_ARM
+#include <asm/arch/system.h>
+#include <asm/arch/gpio.h>
+#endif
+
+#include "atmel_serial.h"
+
+#if defined(CONFIG_SERIAL_ATMEL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
+#include <linux/serial_core.h>
+
+#ifdef CONFIG_SERIAL_ATMEL_TTYAT
+
+/* Use device name ttyAT, major 204 and minor 154-169.  This is necessary if we
+ * should coexist with the 8250 driver, such as if we have an external 16C550
+ * UART. */
+#define SERIAL_ATMEL_MAJOR     204
+#define MINOR_START            154
+#define ATMEL_DEVICENAME       "ttyAT"
+
+#else
+
+/* Use device name ttyS, major 4, minor 64-68.  This is the usual serial port
+ * name, but it is legally reserved for the 8250 driver. */
+#define SERIAL_ATMEL_MAJOR     TTY_MAJOR
+#define MINOR_START            64
+#define ATMEL_DEVICENAME       "ttyS"
+
+#endif
+
+#define ATMEL_ISR_PASS_LIMIT   256
+
+#define UART_PUT_CR(port,v)    writel(v, (port)->membase + ATMEL_US_CR)
+#define UART_GET_MR(port)      readl((port)->membase + ATMEL_US_MR)
+#define UART_PUT_MR(port,v)    writel(v, (port)->membase + ATMEL_US_MR)
+#define UART_PUT_IER(port,v)   writel(v, (port)->membase + ATMEL_US_IER)
+#define UART_PUT_IDR(port,v)   writel(v, (port)->membase + ATMEL_US_IDR)
+#define UART_GET_IMR(port)     readl((port)->membase + ATMEL_US_IMR)
+#define UART_GET_CSR(port)     readl((port)->membase + ATMEL_US_CSR)
+#define UART_GET_CHAR(port)    readl((port)->membase + ATMEL_US_RHR)
+#define UART_PUT_CHAR(port,v)  writel(v, (port)->membase + ATMEL_US_THR)
+#define UART_GET_BRGR(port)    readl((port)->membase + ATMEL_US_BRGR)
+#define UART_PUT_BRGR(port,v)  writel(v, (port)->membase + ATMEL_US_BRGR)
+#define UART_PUT_RTOR(port,v)  writel(v, (port)->membase + ATMEL_US_RTOR)
+
+// #define UART_GET_CR(port)   readl((port)->membase + ATMEL_US_CR)            // is write-only
+
+ /* PDC registers */
+#define UART_PUT_PTCR(port,v)  writel(v, (port)->membase + ATMEL_PDC_PTCR)
+#define UART_GET_PTSR(port)    readl((port)->membase + ATMEL_PDC_PTSR)
+
+#define UART_PUT_RPR(port,v)   writel(v, (port)->membase + ATMEL_PDC_RPR)
+#define UART_GET_RPR(port)     readl((port)->membase + ATMEL_PDC_RPR)
+#define UART_PUT_RCR(port,v)   writel(v, (port)->membase + ATMEL_PDC_RCR)
+#define UART_PUT_RNPR(port,v)  writel(v, (port)->membase + ATMEL_PDC_RNPR)
+#define UART_PUT_RNCR(port,v)  writel(v, (port)->membase + ATMEL_PDC_RNCR)
+
+#define UART_PUT_TPR(port,v)   writel(v, (port)->membase + ATMEL_PDC_TPR)
+#define UART_PUT_TCR(port,v)   writel(v, (port)->membase + ATMEL_PDC_TCR)
+//#define UART_PUT_TNPR(port,v)        writel(v, (port)->membase + ATMEL_PDC_TNPR)
+//#define UART_PUT_TNCR(port,v)        writel(v, (port)->membase + ATMEL_PDC_TNCR)
+
+static int (*atmel_open_hook)(struct uart_port *);
+static void (*atmel_close_hook)(struct uart_port *);
+
+/*
+ * We wrap our port structure around the generic uart_port.
+ */
+struct atmel_uart_port {
+       struct uart_port        uart;           /* uart */
+       struct clk              *clk;           /* uart clock */
+       unsigned short          suspended;      /* is port suspended? */
+};
+
+static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART];
+
+#ifdef SUPPORT_SYSRQ
+static struct console atmel_console;
+#endif
+
+/*
+ * Return TIOCSER_TEMT when transmitter FIFO and Shift register is empty.
+ */
+static u_int atmel_tx_empty(struct uart_port *port)
+{
+       return (UART_GET_CSR(port) & ATMEL_US_TXEMPTY) ? TIOCSER_TEMT : 0;
+}
+
+/*
+ * Set state of the modem control output lines
+ */
+static void atmel_set_mctrl(struct uart_port *port, u_int mctrl)
+{
+       unsigned int control = 0;
+       unsigned int mode;
+
+#ifdef CONFIG_ARM
+       if (arch_identify() == ARCH_ID_AT91RM9200) {
+               /*
+                * AT91RM9200 Errata #39: RTS0 is not internally connected to PA21.
+                *  We need to drive the pin manually.
+                */
+               if (port->mapbase == AT91RM9200_BASE_US0) {
+                       if (mctrl & TIOCM_RTS)
+                               at91_set_gpio_value(AT91_PIN_PA21, 0);
+                       else
+                               at91_set_gpio_value(AT91_PIN_PA21, 1);
+               }
+       }
+#endif
+
+       if (mctrl & TIOCM_RTS)
+               control |= ATMEL_US_RTSEN;
+       else
+               control |= ATMEL_US_RTSDIS;
+
+       if (mctrl & TIOCM_DTR)
+               control |= ATMEL_US_DTREN;
+       else
+               control |= ATMEL_US_DTRDIS;
+
+       UART_PUT_CR(port, control);
+
+       /* Local loopback mode? */
+       mode = UART_GET_MR(port) & ~ATMEL_US_CHMODE;
+       if (mctrl & TIOCM_LOOP)
+               mode |= ATMEL_US_CHMODE_LOC_LOOP;
+       else
+               mode |= ATMEL_US_CHMODE_NORMAL;
+       UART_PUT_MR(port, mode);
+}
+
+/*
+ * Get state of the modem control input lines
+ */
+static u_int atmel_get_mctrl(struct uart_port *port)
+{
+       unsigned int status, ret = 0;
+
+       status = UART_GET_CSR(port);
+
+       /*
+        * The control signals are active low.
+        */
+       if (!(status & ATMEL_US_DCD))
+               ret |= TIOCM_CD;
+       if (!(status & ATMEL_US_CTS))
+               ret |= TIOCM_CTS;
+       if (!(status & ATMEL_US_DSR))
+               ret |= TIOCM_DSR;
+       if (!(status & ATMEL_US_RI))
+               ret |= TIOCM_RI;
+
+       return ret;
+}
+
+/*
+ * Stop transmitting.
+ */
+static void atmel_stop_tx(struct uart_port *port)
+{
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+
+       UART_PUT_IDR(port, ATMEL_US_TXRDY);
+}
+
+/*
+ * Start transmitting.
+ */
+static void atmel_start_tx(struct uart_port *port)
+{
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+
+       UART_PUT_IER(port, ATMEL_US_TXRDY);
+}
+
+/*
+ * Stop receiving - port is in process of being closed.
+ */
+static void atmel_stop_rx(struct uart_port *port)
+{
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+
+       UART_PUT_IDR(port, ATMEL_US_RXRDY);
+}
+
+/*
+ * Enable modem status interrupts
+ */
+static void atmel_enable_ms(struct uart_port *port)
+{
+       UART_PUT_IER(port, ATMEL_US_RIIC | ATMEL_US_DSRIC | ATMEL_US_DCDIC | ATMEL_US_CTSIC);
+}
+
+/*
+ * Control the transmission of a break signal
+ */
+static void atmel_break_ctl(struct uart_port *port, int break_state)
+{
+       if (break_state != 0)
+               UART_PUT_CR(port, ATMEL_US_STTBRK);     /* start break */
+       else
+               UART_PUT_CR(port, ATMEL_US_STPBRK);     /* stop break */
+}
+
+/*
+ * Characters received (called from interrupt handler)
+ */
+static void atmel_rx_chars(struct uart_port *port, struct pt_regs *regs)
+{
+       struct tty_struct *tty = port->info->tty;
+       unsigned int status, ch, flg;
+
+       status = UART_GET_CSR(port);
+       while (status & ATMEL_US_RXRDY) {
+               ch = UART_GET_CHAR(port);
+
+               port->icount.rx++;
+
+               flg = TTY_NORMAL;
+
+               /*
+                * note that the error handling code is
+                * out of the main execution path
+                */
+               if (unlikely(status & (ATMEL_US_PARE | ATMEL_US_FRAME | ATMEL_US_OVRE | ATMEL_US_RXBRK))) {
+                       UART_PUT_CR(port, ATMEL_US_RSTSTA);     /* clear error */
+                       if (status & ATMEL_US_RXBRK) {
+                               status &= ~(ATMEL_US_PARE | ATMEL_US_FRAME);    /* ignore side-effect */
+                               port->icount.brk++;
+                               if (uart_handle_break(port))
+                                       goto ignore_char;
+                       }
+                       if (status & ATMEL_US_PARE)
+                               port->icount.parity++;
+                       if (status & ATMEL_US_FRAME)
+                               port->icount.frame++;
+                       if (status & ATMEL_US_OVRE)
+                               port->icount.overrun++;
+
+                       status &= port->read_status_mask;
+
+                       if (status & ATMEL_US_RXBRK)
+                               flg = TTY_BREAK;
+                       else if (status & ATMEL_US_PARE)
+                               flg = TTY_PARITY;
+                       else if (status & ATMEL_US_FRAME)
+                               flg = TTY_FRAME;
+               }
+
+               if (uart_handle_sysrq_char(port, ch, regs))
+                       goto ignore_char;
+
+               uart_insert_char(port, status, ATMEL_US_OVRE, ch, flg);
+
+       ignore_char:
+               status = UART_GET_CSR(port);
+       }
+
+       tty_flip_buffer_push(tty);
+}
+
+/*
+ * Transmit characters (called from interrupt handler)
+ */
+static void atmel_tx_chars(struct uart_port *port)
+{
+       struct circ_buf *xmit = &port->info->xmit;
+
+       if (port->x_char) {
+               UART_PUT_CHAR(port, port->x_char);
+               port->icount.tx++;
+               port->x_char = 0;
+               return;
+       }
+       if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
+               atmel_stop_tx(port);
+               return;
+       }
+
+       while (UART_GET_CSR(port) & ATMEL_US_TXRDY) {
+               UART_PUT_CHAR(port, xmit->buf[xmit->tail]);
+               xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
+               port->icount.tx++;
+               if (uart_circ_empty(xmit))
+                       break;
+       }
+
+       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+               uart_write_wakeup(port);
+
+       if (uart_circ_empty(xmit))
+               atmel_stop_tx(port);
+}
+
+/*
+ * Interrupt handler
+ */
+static irqreturn_t atmel_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+       struct uart_port *port = dev_id;
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+       unsigned int status, pending, pass_counter = 0;
+
+       status = UART_GET_CSR(port);
+       pending = status & UART_GET_IMR(port);
+       while (pending) {
+               /* Interrupt receive */
+               if (pending & ATMEL_US_RXRDY)
+                       atmel_rx_chars(port, regs);
+
+               // TODO: All reads to CSR will clear these interrupts!
+               if (pending & ATMEL_US_RIIC) port->icount.rng++;
+               if (pending & ATMEL_US_DSRIC) port->icount.dsr++;
+               if (pending & ATMEL_US_DCDIC)
+                       uart_handle_dcd_change(port, !(status & ATMEL_US_DCD));
+               if (pending & ATMEL_US_CTSIC)
+                       uart_handle_cts_change(port, !(status & ATMEL_US_CTS));
+               if (pending & (ATMEL_US_RIIC | ATMEL_US_DSRIC | ATMEL_US_DCDIC | ATMEL_US_CTSIC))
+                       wake_up_interruptible(&port->info->delta_msr_wait);
+
+               /* Interrupt transmit */
+               if (pending & ATMEL_US_TXRDY)
+                       atmel_tx_chars(port);
+
+               if (pass_counter++ > ATMEL_ISR_PASS_LIMIT)
+                       break;
+
+               status = UART_GET_CSR(port);
+               pending = status & UART_GET_IMR(port);
+       }
+       return IRQ_HANDLED;
+}
+
+/*
+ * Perform initialization and enable port for reception
+ */
+static int atmel_startup(struct uart_port *port)
+{
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+       int retval;
+
+       /*
+        * Ensure that no interrupts are enabled otherwise when
+        * request_irq() is called we could get stuck trying to
+        * handle an unexpected interrupt
+        */
+       UART_PUT_IDR(port, -1);
+
+       /*
+        * Allocate the IRQ
+        */
+       retval = request_irq(port->irq, atmel_interrupt, IRQF_SHARED, "atmel_serial", port);
+       if (retval) {
+               printk("atmel_serial: atmel_startup - Can't get irq\n");
+               return retval;
+       }
+
+       /*
+        * If there is a specific "open" function (to register
+        * control line interrupts)
+        */
+       if (atmel_open_hook) {
+               retval = atmel_open_hook(port);
+               if (retval) {
+                       free_irq(port->irq, port);
+                       return retval;
+               }
+       }
+
+       /*
+        * Finally, enable the serial port
+        */
+       UART_PUT_CR(port, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);
+       UART_PUT_CR(port, ATMEL_US_TXEN | ATMEL_US_RXEN);               /* enable xmit & rcvr */
+
+       UART_PUT_IER(port, ATMEL_US_RXRDY);             /* enable receive only */
+
+       return 0;
+}
+
+/*
+ * Disable the port
+ */
+static void atmel_shutdown(struct uart_port *port)
+{
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+
+       /*
+        * Disable all interrupts, port and break condition.
+        */
+       UART_PUT_CR(port, ATMEL_US_RSTSTA);
+       UART_PUT_IDR(port, -1);
+
+       /*
+        * Free the interrupt
+        */
+       free_irq(port->irq, port);
+
+       /*
+        * If there is a specific "close" function (to unregister
+        * control line interrupts)
+        */
+       if (atmel_close_hook)
+               atmel_close_hook(port);
+}
+
+/*
+ * Power / Clock management.
+ */
+static void atmel_serial_pm(struct uart_port *port, unsigned int state, unsigned int oldstate)
+{
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+
+       switch (state) {
+               case 0:
+                       /*
+                        * Enable the peripheral clock for this serial port.
+                        * This is called on uart_open() or a resume event.
+                        */
+                       clk_enable(atmel_port->clk);
+                       break;
+               case 3:
+                       /*
+                        * Disable the peripheral clock for this serial port.
+                        * This is called on uart_close() or a suspend event.
+                        */
+                       clk_disable(atmel_port->clk);
+                       break;
+               default:
+                       printk(KERN_ERR "atmel_serial: unknown pm %d\n", state);
+       }
+}
+
+/*
+ * Change the port parameters
+ */
+static void atmel_set_termios(struct uart_port *port, struct termios * termios, struct termios * old)
+{
+       unsigned long flags;
+       unsigned int mode, imr, quot, baud;
+
+       baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
+       quot = uart_get_divisor(port, baud);
+
+       /* Get current mode register */
+       mode = UART_GET_MR(port) & ~(ATMEL_US_CHRL | ATMEL_US_NBSTOP | ATMEL_US_PAR);
+
+       /* byte size */
+       switch (termios->c_cflag & CSIZE) {
+       case CS5:
+               mode |= ATMEL_US_CHRL_5;
+               break;
+       case CS6:
+               mode |= ATMEL_US_CHRL_6;
+               break;
+       case CS7:
+               mode |= ATMEL_US_CHRL_7;
+               break;
+       default:
+               mode |= ATMEL_US_CHRL_8;
+               break;
+       }
+
+       /* stop bits */
+       if (termios->c_cflag & CSTOPB)
+               mode |= ATMEL_US_NBSTOP_2;
+
+       /* parity */
+       if (termios->c_cflag & PARENB) {
+               if (termios->c_cflag & CMSPAR) {                        /* Mark or Space parity */
+                       if (termios->c_cflag & PARODD)
+                               mode |= ATMEL_US_PAR_MARK;
+                       else
+                               mode |= ATMEL_US_PAR_SPACE;
+               }
+               else if (termios->c_cflag & PARODD)
+                       mode |= ATMEL_US_PAR_ODD;
+               else
+                       mode |= ATMEL_US_PAR_EVEN;
+       }
+       else
+               mode |= ATMEL_US_PAR_NONE;
+
+       spin_lock_irqsave(&port->lock, flags);
+
+       port->read_status_mask = ATMEL_US_OVRE;
+       if (termios->c_iflag & INPCK)
+               port->read_status_mask |= (ATMEL_US_FRAME | ATMEL_US_PARE);
+       if (termios->c_iflag & (BRKINT | PARMRK))
+               port->read_status_mask |= ATMEL_US_RXBRK;
+
+       /*
+        * Characters to ignore
+        */
+       port->ignore_status_mask = 0;
+       if (termios->c_iflag & IGNPAR)
+               port->ignore_status_mask |= (ATMEL_US_FRAME | ATMEL_US_PARE);
+       if (termios->c_iflag & IGNBRK) {
+               port->ignore_status_mask |= ATMEL_US_RXBRK;
+               /*
+                * If we're ignoring parity and break indicators,
+                * ignore overruns too (for real raw support).
+                */
+               if (termios->c_iflag & IGNPAR)
+                       port->ignore_status_mask |= ATMEL_US_OVRE;
+       }
+
+       // TODO: Ignore all characters if CREAD is set.
+
+       /* update the per-port timeout */
+       uart_update_timeout(port, termios->c_cflag, baud);
+
+       /* disable interrupts and drain transmitter */
+       imr = UART_GET_IMR(port);       /* get interrupt mask */
+       UART_PUT_IDR(port, -1);         /* disable all interrupts */
+       while (!(UART_GET_CSR(port) & ATMEL_US_TXEMPTY)) { barrier(); }
+
+       /* disable receiver and transmitter */
+       UART_PUT_CR(port, ATMEL_US_TXDIS | ATMEL_US_RXDIS);
+
+       /* set the parity, stop bits and data size */
+       UART_PUT_MR(port, mode);
+
+       /* set the baud rate */
+       UART_PUT_BRGR(port, quot);
+       UART_PUT_CR(port, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);
+       UART_PUT_CR(port, ATMEL_US_TXEN | ATMEL_US_RXEN);
+
+       /* restore interrupts */
+       UART_PUT_IER(port, imr);
+
+       /* CTS flow-control and modem-status interrupts */
+       if (UART_ENABLE_MS(port, termios->c_cflag))
+               port->ops->enable_ms(port);
+
+       spin_unlock_irqrestore(&port->lock, flags);
+}
+
+/*
+ * Return string describing the specified port
+ */
+static const char *atmel_type(struct uart_port *port)
+{
+       return (port->type == PORT_ATMEL) ? "ATMEL_SERIAL" : NULL;
+}
+
+/*
+ * Release the memory region(s) being used by 'port'.
+ */
+static void atmel_release_port(struct uart_port *port)
+{
+       struct platform_device *pdev = to_platform_device(port->dev);
+       int size = pdev->resource[0].end - pdev->resource[0].start + 1;
+
+       release_mem_region(port->mapbase, size);
+
+       if (port->flags & UPF_IOREMAP) {
+               iounmap(port->membase);
+               port->membase = NULL;
+       }
+}
+
+/*
+ * Request the memory region(s) being used by 'port'.
+ */
+static int atmel_request_port(struct uart_port *port)
+{
+       struct platform_device *pdev = to_platform_device(port->dev);
+       int size = pdev->resource[0].end - pdev->resource[0].start + 1;
+
+       if (!request_mem_region(port->mapbase, size, "atmel_serial"))
+               return -EBUSY;
+
+       if (port->flags & UPF_IOREMAP) {
+               port->membase = ioremap(port->mapbase, size);
+               if (port->membase == NULL) {
+                       release_mem_region(port->mapbase, size);
+                       return -ENOMEM;
+               }
+       }
+
+       return 0;
+}
+
+/*
+ * Configure/autoconfigure the port.
+ */
+static void atmel_config_port(struct uart_port *port, int flags)
+{
+       if (flags & UART_CONFIG_TYPE) {
+               port->type = PORT_ATMEL;
+               atmel_request_port(port);
+       }
+}
+
+/*
+ * Verify the new serial_struct (for TIOCSSERIAL).
+ */
+static int atmel_verify_port(struct uart_port *port, struct serial_struct *ser)
+{
+       int ret = 0;
+       if (ser->type != PORT_UNKNOWN && ser->type != PORT_ATMEL)
+               ret = -EINVAL;
+       if (port->irq != ser->irq)
+               ret = -EINVAL;
+       if (ser->io_type != SERIAL_IO_MEM)
+               ret = -EINVAL;
+       if (port->uartclk / 16 != ser->baud_base)
+               ret = -EINVAL;
+       if ((void *)port->mapbase != ser->iomem_base)
+               ret = -EINVAL;
+       if (port->iobase != ser->port)
+               ret = -EINVAL;
+       if (ser->hub6 != 0)
+               ret = -EINVAL;
+       return ret;
+}
+
+static struct uart_ops atmel_pops = {
+       .tx_empty       = atmel_tx_empty,
+       .set_mctrl      = atmel_set_mctrl,
+       .get_mctrl      = atmel_get_mctrl,
+       .stop_tx        = atmel_stop_tx,
+       .start_tx       = atmel_start_tx,
+       .stop_rx        = atmel_stop_rx,
+       .enable_ms      = atmel_enable_ms,
+       .break_ctl      = atmel_break_ctl,
+       .startup        = atmel_startup,
+       .shutdown       = atmel_shutdown,
+       .set_termios    = atmel_set_termios,
+       .type           = atmel_type,
+       .release_port   = atmel_release_port,
+       .request_port   = atmel_request_port,
+       .config_port    = atmel_config_port,
+       .verify_port    = atmel_verify_port,
+       .pm             = atmel_serial_pm,
+};
+
+/*
+ * Configure the port from the platform device resource info.
+ */
+static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, struct platform_device *pdev)
+{
+       struct uart_port *port = &atmel_port->uart;
+       struct atmel_uart_data *data = pdev->dev.platform_data;
+
+       port->iotype    = UPIO_MEM;
+       port->flags     = UPF_BOOT_AUTOCONF;
+       port->ops       = &atmel_pops;
+       port->fifosize  = 1;
+       port->line      = pdev->id;
+       port->dev       = &pdev->dev;
+
+       port->mapbase   = pdev->resource[0].start;
+       port->irq       = pdev->resource[1].start;
+
+       if (data->regs)
+               /* Already mapped by setup code */
+               port->membase = data->regs;
+       else {
+               port->flags     |= UPF_IOREMAP;
+               port->membase   = NULL;
+       }
+
+       if (!atmel_port->clk) {         /* for console, the clock could already be configured */
+               atmel_port->clk = clk_get(&pdev->dev, "usart");
+               clk_enable(atmel_port->clk);
+               port->uartclk = clk_get_rate(atmel_port->clk);
+       }
+}
+
+/*
+ * Register board-specific modem-control line handlers.
+ */
+void __init atmel_register_uart_fns(struct atmel_port_fns *fns)
+{
+       if (fns->enable_ms)
+               atmel_pops.enable_ms = fns->enable_ms;
+       if (fns->get_mctrl)
+               atmel_pops.get_mctrl = fns->get_mctrl;
+       if (fns->set_mctrl)
+               atmel_pops.set_mctrl = fns->set_mctrl;
+       atmel_open_hook         = fns->open;
+       atmel_close_hook        = fns->close;
+       atmel_pops.pm           = fns->pm;
+       atmel_pops.set_wake     = fns->set_wake;
+}
+
+
+#ifdef CONFIG_SERIAL_ATMEL_CONSOLE
+static void atmel_console_putchar(struct uart_port *port, int ch)
+{
+       while (!(UART_GET_CSR(port) & ATMEL_US_TXRDY))
+               barrier();
+       UART_PUT_CHAR(port, ch);
+}
+
+/*
+ * Interrupts are disabled on entering
+ */
+static void atmel_console_write(struct console *co, const char *s, u_int count)
+{
+       struct uart_port *port = &atmel_ports[co->index].uart;
+       unsigned int status, imr;
+
+       /*
+        *      First, save IMR and then disable interrupts
+        */
+       imr = UART_GET_IMR(port);       /* get interrupt mask */
+       UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY);
+
+       uart_console_write(port, s, count, atmel_console_putchar);
+
+       /*
+        *      Finally, wait for transmitter to become empty
+        *      and restore IMR
+        */
+       do {
+               status = UART_GET_CSR(port);
+       } while (!(status & ATMEL_US_TXRDY));
+       UART_PUT_IER(port, imr);        /* set interrupts back the way they were */
+}
+
+/*
+ * If the port was already initialised (eg, by a boot loader), try to determine
+ * the current setup.
+ */
+static void __init atmel_console_get_options(struct uart_port *port, int *baud, int *parity, int *bits)
+{
+       unsigned int mr, quot;
+
+// TODO: CR is a write-only register
+//     unsigned int cr;
+//
+//     cr = UART_GET_CR(port) & (ATMEL_US_RXEN | ATMEL_US_TXEN);
+//     if (cr == (ATMEL_US_RXEN | ATMEL_US_TXEN)) {
+//             /* ok, the port was enabled */
+//     }
+
+       mr = UART_GET_MR(port) & ATMEL_US_CHRL;
+       if (mr == ATMEL_US_CHRL_8)
+               *bits = 8;
+       else
+               *bits = 7;
+
+       mr = UART_GET_MR(port) & ATMEL_US_PAR;
+       if (mr == ATMEL_US_PAR_EVEN)
+               *parity = 'e';
+       else if (mr == ATMEL_US_PAR_ODD)
+               *parity = 'o';
+
+       /*
+        * The serial core only rounds down when matching this to a
+        * supported baud rate. Make sure we don't end up slightly
+        * lower than one of those, as it would make us fall through
+        * to a much lower baud rate than we really want.
+        */
+       quot = UART_GET_BRGR(port);
+       *baud = port->uartclk / (16 * (quot - 1));
+}
+
+static int __init atmel_console_setup(struct console *co, char *options)
+{
+       struct uart_port *port = &atmel_ports[co->index].uart;
+       int baud = 115200;
+       int bits = 8;
+       int parity = 'n';
+       int flow = 'n';
+
+       if (port->membase == 0)         /* Port not initialized yet - delay setup */
+               return -ENODEV;
+
+       UART_PUT_IDR(port, -1);                         /* disable interrupts */
+       UART_PUT_CR(port, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);
+       UART_PUT_CR(port, ATMEL_US_TXEN | ATMEL_US_RXEN);
+
+       if (options)
+               uart_parse_options(options, &baud, &parity, &bits, &flow);
+       else
+               atmel_console_get_options(port, &baud, &parity, &bits);
+
+       return uart_set_options(port, co, baud, parity, bits, flow);
+}
+
+static struct uart_driver atmel_uart;
+
+static struct console atmel_console = {
+       .name           = ATMEL_DEVICENAME,
+       .write          = atmel_console_write,
+       .device         = uart_console_device,
+       .setup          = atmel_console_setup,
+       .flags          = CON_PRINTBUFFER,
+       .index          = -1,
+       .data           = &atmel_uart,
+};
+
+#define ATMEL_CONSOLE_DEVICE   &atmel_console
+
+/*
+ * Early console initialization (before VM subsystem initialized).
+ */
+static int __init atmel_console_init(void)
+{
+       if (atmel_default_console_device) {
+               add_preferred_console(ATMEL_DEVICENAME, atmel_default_console_device->id, NULL);
+               atmel_init_port(&(atmel_ports[atmel_default_console_device->id]), atmel_default_console_device);
+               register_console(&atmel_console);
+       }
+
+       return 0;
+}
+console_initcall(atmel_console_init);
+
+/*
+ * Late console initialization.
+ */
+static int __init atmel_late_console_init(void)
+{
+       if (atmel_default_console_device && !(atmel_console.flags & CON_ENABLED))
+               register_console(&atmel_console);
+
+       return 0;
+}
+core_initcall(atmel_late_console_init);
+
+#else
+#define ATMEL_CONSOLE_DEVICE   NULL
+#endif
+
+static struct uart_driver atmel_uart = {
+       .owner                  = THIS_MODULE,
+       .driver_name            = "atmel_serial",
+       .dev_name               = ATMEL_DEVICENAME,
+       .major                  = SERIAL_ATMEL_MAJOR,
+       .minor                  = MINOR_START,
+       .nr                     = ATMEL_MAX_UART,
+       .cons                   = ATMEL_CONSOLE_DEVICE,
+};
+
+#ifdef CONFIG_PM
+static int atmel_serial_suspend(struct platform_device *pdev, pm_message_t state)
+{
+       struct uart_port *port = platform_get_drvdata(pdev);
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+
+       if (device_may_wakeup(&pdev->dev) && !at91_suspend_entering_slow_clock())
+               enable_irq_wake(port->irq);
+       else {
+               disable_irq_wake(port->irq);
+               uart_suspend_port(&atmel_uart, port);
+               atmel_port->suspended = 1;
+       }
+
+       return 0;
+}
+
+static int atmel_serial_resume(struct platform_device *pdev)
+{
+       struct uart_port *port = platform_get_drvdata(pdev);
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+
+       if (atmel_port->suspended) {
+               uart_resume_port(&atmel_uart, port);
+               atmel_port->suspended = 0;
+       }
+
+       return 0;
+}
+#else
+#define atmel_serial_suspend NULL
+#define atmel_serial_resume NULL
+#endif
+
+static int __devinit atmel_serial_probe(struct platform_device *pdev)
+{
+       struct atmel_uart_port *port;
+       int ret;
+
+       port = &atmel_ports[pdev->id];
+       atmel_init_port(port, pdev);
+
+       ret = uart_add_one_port(&atmel_uart, &port->uart);
+       if (!ret) {
+               device_init_wakeup(&pdev->dev, 1);
+               platform_set_drvdata(pdev, port);
+       }
+
+       return ret;
+}
+
+static int __devexit atmel_serial_remove(struct platform_device *pdev)
+{
+       struct uart_port *port = platform_get_drvdata(pdev);
+       struct atmel_uart_port *atmel_port = (struct atmel_uart_port *) port;
+       int ret = 0;
+
+       clk_disable(atmel_port->clk);
+       clk_put(atmel_port->clk);
+
+       device_init_wakeup(&pdev->dev, 0);
+       platform_set_drvdata(pdev, NULL);
+
+       if (port) {
+               ret = uart_remove_one_port(&atmel_uart, port);
+               kfree(port);
+       }
+
+       return ret;
+}
+
+static struct platform_driver atmel_serial_driver = {
+       .probe          = atmel_serial_probe,
+       .remove         = __devexit_p(atmel_serial_remove),
+       .suspend        = atmel_serial_suspend,
+       .resume         = atmel_serial_resume,
+       .driver         = {
+               .name   = "atmel_usart",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static int __init atmel_serial_init(void)
+{
+       int ret;
+
+       ret = uart_register_driver(&atmel_uart);
+       if (ret)
+               return ret;
+
+       ret = platform_driver_register(&atmel_serial_driver);
+       if (ret)
+               uart_unregister_driver(&atmel_uart);
+
+       return ret;
+}
+
+static void __exit atmel_serial_exit(void)
+{
+       platform_driver_unregister(&atmel_serial_driver);
+       uart_unregister_driver(&atmel_uart);
+}
+
+module_init(atmel_serial_init);
+module_exit(atmel_serial_exit);
+
+MODULE_AUTHOR("Rick Bronson");
+MODULE_DESCRIPTION("Atmel AT91 / AT32 serial port driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/serial/atmel_serial.h b/drivers/serial/atmel_serial.h
new file mode 100644 (file)
index 0000000..eced2ad
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * drivers/serial/atmel_serial.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * USART registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef ATMEL_SERIAL_H
+#define ATMEL_SERIAL_H
+
+#define ATMEL_US_CR            0x00                    /* Control Register */
+#define                ATMEL_US_RSTRX          (1 <<  2)               /* Reset Receiver */
+#define                ATMEL_US_RSTTX          (1 <<  3)               /* Reset Transmitter */
+#define                ATMEL_US_RXEN           (1 <<  4)               /* Receiver Enable */
+#define                ATMEL_US_RXDIS          (1 <<  5)               /* Receiver Disable */
+#define                ATMEL_US_TXEN           (1 <<  6)               /* Transmitter Enable */
+#define                ATMEL_US_TXDIS          (1 <<  7)               /* Transmitter Disable */
+#define                ATMEL_US_RSTSTA         (1 <<  8)               /* Reset Status Bits */
+#define                ATMEL_US_STTBRK         (1 <<  9)               /* Start Break */
+#define                ATMEL_US_STPBRK         (1 << 10)               /* Stop Break */
+#define                ATMEL_US_STTTO          (1 << 11)               /* Start Time-out */
+#define                ATMEL_US_SENDA          (1 << 12)               /* Send Address */
+#define                ATMEL_US_RSTIT          (1 << 13)               /* Reset Iterations */
+#define                ATMEL_US_RSTNACK        (1 << 14)               /* Reset Non Acknowledge */
+#define                ATMEL_US_RETTO          (1 << 15)               /* Rearm Time-out */
+#define                ATMEL_US_DTREN          (1 << 16)               /* Data Terminal Ready Enable */
+#define                ATMEL_US_DTRDIS         (1 << 17)               /* Data Terminal Ready Disable */
+#define                ATMEL_US_RTSEN          (1 << 18)               /* Request To Send Enable */
+#define                ATMEL_US_RTSDIS         (1 << 19)               /* Request To Send Disable */
+
+#define ATMEL_US_MR            0x04                    /* Mode Register */
+#define                ATMEL_US_USMODE         (0xf <<  0)             /* Mode of the USART */
+#define                        ATMEL_US_USMODE_NORMAL          0
+#define                        ATMEL_US_USMODE_RS485           1
+#define                        ATMEL_US_USMODE_HWHS            2
+#define                        ATMEL_US_USMODE_MODEM           3
+#define                        ATMEL_US_USMODE_ISO7816_T0      4
+#define                        ATMEL_US_USMODE_ISO7816_T1      6
+#define                        ATMEL_US_USMODE_IRDA            8
+#define                ATMEL_US_USCLKS         (3   <<  4)             /* Clock Selection */
+#define                ATMEL_US_CHRL           (3   <<  6)             /* Character Length */
+#define                        ATMEL_US_CHRL_5                 (0 <<  6)
+#define                        ATMEL_US_CHRL_6                 (1 <<  6)
+#define                        ATMEL_US_CHRL_7                 (2 <<  6)
+#define                        ATMEL_US_CHRL_8                 (3 <<  6)
+#define                ATMEL_US_SYNC           (1 <<  8)               /* Synchronous Mode Select */
+#define                ATMEL_US_PAR            (7 <<  9)               /* Parity Type */
+#define                        ATMEL_US_PAR_EVEN               (0 <<  9)
+#define                        ATMEL_US_PAR_ODD                (1 <<  9)
+#define                        ATMEL_US_PAR_SPACE              (2 <<  9)
+#define                        ATMEL_US_PAR_MARK               (3 <<  9)
+#define                        ATMEL_US_PAR_NONE               (4 <<  9)
+#define                        ATMEL_US_PAR_MULTI_DROP         (6 <<  9)
+#define                ATMEL_US_NBSTOP         (3 << 12)               /* Number of Stop Bits */
+#define                        ATMEL_US_NBSTOP_1               (0 << 12)
+#define                        ATMEL_US_NBSTOP_1_5             (1 << 12)
+#define                        ATMEL_US_NBSTOP_2               (2 << 12)
+#define                ATMEL_US_CHMODE         (3 << 14)               /* Channel Mode */
+#define                        ATMEL_US_CHMODE_NORMAL          (0 << 14)
+#define                        ATMEL_US_CHMODE_ECHO            (1 << 14)
+#define                        ATMEL_US_CHMODE_LOC_LOOP        (2 << 14)
+#define                        ATMEL_US_CHMODE_REM_LOOP        (3 << 14)
+#define                ATMEL_US_MSBF           (1 << 16)               /* Bit Order */
+#define                ATMEL_US_MODE9          (1 << 17)               /* 9-bit Character Length */
+#define                ATMEL_US_CLKO           (1 << 18)               /* Clock Output Select */
+#define                ATMEL_US_OVER           (1 << 19)               /* Oversampling Mode */
+#define                ATMEL_US_INACK          (1 << 20)               /* Inhibit Non Acknowledge */
+#define                ATMEL_US_DSNACK         (1 << 21)               /* Disable Successive NACK */
+#define                ATMEL_US_MAX_ITER       (7 << 24)               /* Max Iterations */
+#define                ATMEL_US_FILTER         (1 << 28)               /* Infrared Receive Line Filter */
+
+#define ATMEL_US_IER           0x08                    /* Interrupt Enable Register */
+#define                ATMEL_US_RXRDY          (1 <<  0)               /* Receiver Ready */
+#define                ATMEL_US_TXRDY          (1 <<  1)               /* Transmitter Ready */
+#define                ATMEL_US_RXBRK          (1 <<  2)               /* Break Received / End of Break */
+#define                ATMEL_US_ENDRX          (1 <<  3)               /* End of Receiver Transfer */
+#define                ATMEL_US_ENDTX          (1 <<  4)               /* End of Transmitter Transfer */
+#define                ATMEL_US_OVRE           (1 <<  5)               /* Overrun Error */
+#define                ATMEL_US_FRAME          (1 <<  6)               /* Framing Error */
+#define                ATMEL_US_PARE           (1 <<  7)               /* Parity Error */
+#define                ATMEL_US_TIMEOUT        (1 <<  8)               /* Receiver Time-out */
+#define                ATMEL_US_TXEMPTY        (1 <<  9)               /* Transmitter Empty */
+#define                ATMEL_US_ITERATION      (1 << 10)               /* Max number of Repetitions Reached */
+#define                ATMEL_US_TXBUFE         (1 << 11)               /* Transmission Buffer Empty */
+#define                ATMEL_US_RXBUFF         (1 << 12)               /* Reception Buffer Full */
+#define                ATMEL_US_NACK           (1 << 13)               /* Non Acknowledge */
+#define                ATMEL_US_RIIC           (1 << 16)               /* Ring Indicator Input Change */
+#define                ATMEL_US_DSRIC          (1 << 17)               /* Data Set Ready Input Change */
+#define                ATMEL_US_DCDIC          (1 << 18)               /* Data Carrier Detect Input Change */
+#define                ATMEL_US_CTSIC          (1 << 19)               /* Clear to Send Input Change */
+#define                ATMEL_US_RI             (1 << 20)               /* RI */
+#define                ATMEL_US_DSR            (1 << 21)               /* DSR */
+#define                ATMEL_US_DCD            (1 << 22)               /* DCD */
+#define                ATMEL_US_CTS            (1 << 23)               /* CTS */
+
+#define ATMEL_US_IDR           0x0c                    /* Interrupt Disable Register */
+#define ATMEL_US_IMR           0x10                    /* Interrupt Mask Register */
+#define ATMEL_US_CSR           0x14                    /* Channel Status Register */
+#define ATMEL_US_RHR           0x18                    /* Receiver Holding Register */
+#define ATMEL_US_THR           0x1c                    /* Transmitter Holding Register */
+
+#define ATMEL_US_BRGR          0x20                    /* Baud Rate Generator Register */
+#define                ATMEL_US_CD             (0xffff << 0)           /* Clock Divider */
+
+#define ATMEL_US_RTOR          0x24                    /* Receiver Time-out Register */
+#define                ATMEL_US_TO             (0xffff << 0)           /* Time-out Value */
+
+#define ATMEL_US_TTGR          0x28                    /* Transmitter Timeguard Register */
+#define                ATMEL_US_TG             (0xff << 0)             /* Timeguard Value */
+
+#define ATMEL_US_FIDI          0x40                    /* FI DI Ratio Register */
+#define ATMEL_US_NER           0x44                    /* Number of Errors Register */
+#define ATMEL_US_IF            0x4c                    /* IrDA Filter Register */
+
+#endif
index 3b35cb7..a8f894c 100644 (file)
@@ -16,7 +16,6 @@
 #ifndef CPM_UART_H
 #define CPM_UART_H
 
-#include <linux/config.h>
 #include <linux/platform_device.h>
 #include <linux/fs_uart_pd.h>
 
index c1adc9e..7502109 100644 (file)
@@ -17,8 +17,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <linux/config.h>
-
 #if defined(CONFIG_SERIAL_NETX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
 #endif
index f336ba6..5c025d1 100644 (file)
@@ -20,7 +20,6 @@
 
 #undef DEBUG
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/timer.h>
index 28643c4..7ee9921 100644 (file)
@@ -10,7 +10,6 @@
  *  Modified to support SH7300(SH-Mobile) SCIF. Takashi Kusuda (Jun 2003).
  *  Modified to support H8/300 Series Yoshinori Sato (Feb 2004).
  */
-#include <linux/config.h>
 #include <linux/serial_core.h>
 #include <asm/io.h>
 
index 5fc1456..20eb6e9 100644 (file)
@@ -13,7 +13,6 @@
 
 //#define DEBUG
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
index aacdceb..a5d2cdf 100644 (file)
@@ -11,7 +11,6 @@
  *
 */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/delay.h>
index 16332cc..ebb20ff 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/usb.h>
 #include "usb.h"
 
index 83601d4..64554ac 100644 (file)
@@ -21,7 +21,6 @@
 #define DEBUG 1
 // #define VERBOSE
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
index cb2e2a6..0a31520 100644 (file)
@@ -35,7 +35,6 @@
 * via an ELAN U132 adapter.
 *
 */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
index 4640d10..923e22d 100644 (file)
@@ -35,7 +35,6 @@
 
 //#define DEBUG
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/input.h>
index bfde82f..fc6cc14 100644 (file)
@@ -20,7 +20,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index b88a094..c6f2f48 100644 (file)
@@ -35,7 +35,6 @@
 * via an ELAN U132 adapter.
 *
 */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
index a44124c..a287836 100644 (file)
@@ -36,7 +36,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/mutex.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index fb48fec..bf26c3c 100644 (file)
@@ -47,7 +47,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/mutex.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
index c1113d6..5686e21 100644 (file)
@@ -25,7 +25,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 **************************************************************************/
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
index e7ba0c3..c04b3a1 100644 (file)
@@ -6,7 +6,6 @@
  *  (C) 1991  Linus Torvalds - minix filesystem
  */
 
-#include <linux/config.h>      /* Joliet? */
 #include <linux/smp_lock.h>
 #include "isofs.h"
 
index 8106f3b..6e4e48c 100644 (file)
@@ -10,7 +10,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 76b08ae..20c6f39 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index 6040864..ec1114b 100644 (file)
@@ -7,8 +7,6 @@
  * NFS namespace
  */
 
-#include <linux/config.h>
-
 #include <linux/dcache.h>
 #include <linux/mount.h>
 #include <linux/namei.h>
index 24e47f3..b872779 100644 (file)
@@ -7,8 +7,6 @@
  * NFSv4 namespace
  */
 
-#include <linux/config.h>
-
 #include <linux/dcache.h>
 #include <linux/mount.h>
 #include <linux/namei.h>
index 1d656a6..8dfefe4 100644 (file)
@@ -69,7 +69,6 @@
  *     Fabian Frederick:       Option parser rebuilt (using parser lib)
 */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
index e8d4003..28659a9 100644 (file)
@@ -20,7 +20,6 @@
  *   of another (see nfs_lookup())
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
index c093642..b67ce93 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright 2000 by Hans Reiser, licensing governed by reiserfs/README
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/reiserfs_fs.h>
 #include <linux/reiserfs_acl.h>
diff --git a/include/asm-arm/arch-at91rm9200/at91rm9200_usart.h b/include/asm-arm/arch-at91rm9200/at91rm9200_usart.h
deleted file mode 100644 (file)
index 79f851e..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91rm9200_usart.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * USART registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91RM9200_USART_H
-#define AT91RM9200_USART_H
-
-#define AT91_US_CR             0x00                    /* Control Register */
-#define                AT91_US_RSTRX           (1 <<  2)               /* Reset Receiver */
-#define                AT91_US_RSTTX           (1 <<  3)               /* Reset Transmitter */
-#define                AT91_US_RXEN            (1 <<  4)               /* Receiver Enable */
-#define                AT91_US_RXDIS           (1 <<  5)               /* Receiver Disable */
-#define                AT91_US_TXEN            (1 <<  6)               /* Transmitter Enable */
-#define                AT91_US_TXDIS           (1 <<  7)               /* Transmitter Disable */
-#define                AT91_US_RSTSTA          (1 <<  8)               /* Reset Status Bits */
-#define                AT91_US_STTBRK          (1 <<  9)               /* Start Break */
-#define                AT91_US_STPBRK          (1 << 10)               /* Stop Break */
-#define                AT91_US_STTTO           (1 << 11)               /* Start Time-out */
-#define                AT91_US_SENDA           (1 << 12)               /* Send Address */
-#define                AT91_US_RSTIT           (1 << 13)               /* Reset Iterations */
-#define                AT91_US_RSTNACK         (1 << 14)               /* Reset Non Acknowledge */
-#define                AT91_US_RETTO           (1 << 15)               /* Rearm Time-out */
-#define                AT91_US_DTREN           (1 << 16)               /* Data Terminal Ready Enable */
-#define                AT91_US_DTRDIS          (1 << 17)               /* Data Terminal Ready Disable */
-#define                AT91_US_RTSEN           (1 << 18)               /* Request To Send Enable */
-#define                AT91_US_RTSDIS          (1 << 19)               /* Request To Send Disable */
-
-#define AT91_US_MR             0x04                    /* Mode Register */
-#define                AT91_US_USMODE          (0xf <<  0)             /* Mode of the USART */
-#define                        AT91_US_USMODE_NORMAL           0
-#define                        AT91_US_USMODE_RS485            1
-#define                        AT91_US_USMODE_HWHS             2
-#define                        AT91_US_USMODE_MODEM            3
-#define                        AT91_US_USMODE_ISO7816_T0       4
-#define                        AT91_US_USMODE_ISO7816_T1       6
-#define                        AT91_US_USMODE_IRDA             8
-#define                AT91_US_USCLKS          (3   <<  4)             /* Clock Selection */
-#define                AT91_US_CHRL            (3   <<  6)             /* Character Length */
-#define                        AT91_US_CHRL_5                  (0 <<  6)
-#define                        AT91_US_CHRL_6                  (1 <<  6)
-#define                        AT91_US_CHRL_7                  (2 <<  6)
-#define                        AT91_US_CHRL_8                  (3 <<  6)
-#define                AT91_US_SYNC            (1 <<  8)               /* Synchronous Mode Select */
-#define                AT91_US_PAR             (7 <<  9)               /* Parity Type */
-#define                        AT91_US_PAR_EVEN                (0 <<  9)
-#define                        AT91_US_PAR_ODD                 (1 <<  9)
-#define                        AT91_US_PAR_SPACE               (2 <<  9)
-#define                        AT91_US_PAR_MARK                (3 <<  9)
-#define                        AT91_US_PAR_NONE                (4 <<  9)
-#define                        AT91_US_PAR_MULTI_DROP          (6 <<  9)
-#define                AT91_US_NBSTOP          (3 << 12)               /* Number of Stop Bits */
-#define                        AT91_US_NBSTOP_1                (0 << 12)
-#define                        AT91_US_NBSTOP_1_5              (1 << 12)
-#define                        AT91_US_NBSTOP_2                (2 << 12)
-#define                AT91_US_CHMODE          (3 << 14)               /* Channel Mode */
-#define                        AT91_US_CHMODE_NORMAL           (0 << 14)
-#define                        AT91_US_CHMODE_ECHO             (1 << 14)
-#define                        AT91_US_CHMODE_LOC_LOOP         (2 << 14)
-#define                        AT91_US_CHMODE_REM_LOOP         (3 << 14)
-#define                AT91_US_MSBF            (1 << 16)               /* Bit Order */
-#define                AT91_US_MODE9           (1 << 17)               /* 9-bit Character Length */
-#define                AT91_US_CLKO            (1 << 18)               /* Clock Output Select */
-#define                AT91_US_OVER            (1 << 19)               /* Oversampling Mode */
-#define                AT91_US_INACK           (1 << 20)               /* Inhibit Non Acknowledge */
-#define                AT91_US_DSNACK          (1 << 21)               /* Disable Successive NACK */
-#define                AT91_US_MAX_ITER        (7 << 24)               /* Max Iterations */
-#define                AT91_US_FILTER          (1 << 28)               /* Infrared Receive Line Filter */
-
-#define AT91_US_IER            0x08                    /* Interrupt Enable Register */
-#define                AT91_US_RXRDY           (1 <<  0)               /* Receiver Ready */
-#define                AT91_US_TXRDY           (1 <<  1)               /* Transmitter Ready */
-#define                AT91_US_RXBRK           (1 <<  2)               /* Break Received / End of Break */
-#define                AT91_US_ENDRX           (1 <<  3)               /* End of Receiver Transfer */
-#define                AT91_US_ENDTX           (1 <<  4)               /* End of Transmitter Transfer */
-#define                AT91_US_OVRE            (1 <<  5)               /* Overrun Error */
-#define                AT91_US_FRAME           (1 <<  6)               /* Framing Error */
-#define                AT91_US_PARE            (1 <<  7)               /* Parity Error */
-#define                AT91_US_TIMEOUT         (1 <<  8)               /* Receiver Time-out */
-#define                AT91_US_TXEMPTY         (1 <<  9)               /* Transmitter Empty */
-#define                AT91_US_ITERATION       (1 << 10)               /* Max number of Repetitions Reached */
-#define                AT91_US_TXBUFE          (1 << 11)               /* Transmission Buffer Empty */
-#define                AT91_US_RXBUFF          (1 << 12)               /* Reception Buffer Full */
-#define                AT91_US_NACK            (1 << 13)               /* Non Acknowledge */
-#define                AT91_US_RIIC            (1 << 16)               /* Ring Indicator Input Change */
-#define                AT91_US_DSRIC           (1 << 17)               /* Data Set Ready Input Change */
-#define                AT91_US_DCDIC           (1 << 18)               /* Data Carrier Detect Input Change */
-#define                AT91_US_CTSIC           (1 << 19)               /* Clear to Send Input Change */
-#define                AT91_US_RI              (1 << 20)               /* RI */
-#define                AT91_US_DSR             (1 << 21)               /* DSR */
-#define                AT91_US_DCD             (1 << 22)               /* DCD */
-#define                AT91_US_CTS             (1 << 23)               /* CTS */
-
-#define AT91_US_IDR            0x0c                    /* Interrupt Disable Register */
-#define AT91_US_IMR            0x10                    /* Interrupt Mask Register */
-#define AT91_US_CSR            0x14                    /* Channel Status Register */
-#define AT91_US_RHR            0x18                    /* Receiver Holding Register */
-#define AT91_US_THR            0x1c                    /* Transmitter Holding Register */
-
-#define AT91_US_BRGR           0x20                    /* Baud Rate Generator Register */
-#define                AT91_US_CD              (0xffff << 0)           /* Clock Divider */
-
-#define AT91_US_RTOR           0x24                    /* Receiver Time-out Register */
-#define                AT91_US_TO              (0xffff << 0)           /* Time-out Value */
-
-#define AT91_US_TTGR           0x28                    /* Transmitter Timeguard Register */
-#define                AT91_US_TG              (0xff << 0)             /* Timeguard Value */
-
-#define AT91_US_FIDI           0x40                    /* FI DI Ratio Register */
-#define AT91_US_NER            0x44                    /* Number of Errors Register */
-#define AT91_US_IF             0x4c                    /* IrDA Filter Register */
-
-#endif
index c1ca9a4..3cc9aec 100644 (file)
@@ -97,12 +97,13 @@ struct at91_uart_config {
        unsigned short  nr_tty;         /* number of serial tty's */
        short           tty_map[];      /* map UART to tty number */
 };
-extern struct platform_device *at91_default_console_device;
+extern struct platform_device *atmel_default_console_device;
 extern void __init at91_init_serial(struct at91_uart_config *config);
 
-struct at91_uart_data {
+struct atmel_uart_data {
        short           use_dma_tx;     /* use transmit DMA? */
        short           use_dma_rx;     /* use receive DMA? */
+       void __iomem    *regs;          /* virtual base address, if any */
 };
 extern void __init at91_add_device_serial(void);
 
index 6551b4d..9ca4cc9 100644 (file)
@@ -44,7 +44,7 @@
 #define AT91_SRAM_VIRT_BASE    (AT91_IO_VIRT_BASE - AT91RM9200_SRAM_SIZE)
 
 /* Serial ports */
-#define AT91_NR_UART           5               /* 4 USART3's and one DBGU port */
+#define ATMEL_MAX_UART         5               /* 4 USART3's and one DBGU port */
 
 /* FLASH */
 #define AT91_FLASH_BASE                0x10000000      /* NCS0: Flash physical base address */
index bee02fd..7d0ba18 100644 (file)
@@ -8,8 +8,6 @@
  *
  */
 
-#include <linux/config.h>
-
 #ifndef __ASM_ARCH_CLOCKS_H
 #define __ASM_ARCH_CLOCKS_H
 
index 1290bb3..55b317a 100644 (file)
@@ -14,7 +14,7 @@ struct uart_port;
  * This is a temporary structure for registering these
  * functions; it is intended to be discarded after boot.
  */
-struct at91_port_fns {
+struct atmel_port_fns {
        void    (*set_mctrl)(struct uart_port *, u_int);
        u_int   (*get_mctrl)(struct uart_port *);
        void    (*enable_ms)(struct uart_port *);
@@ -24,10 +24,10 @@ struct at91_port_fns {
        void    (*close)(struct uart_port *);
 };
 
-#if defined(CONFIG_SERIAL_AT91)
-void at91_register_uart_fns(struct at91_port_fns *fns);
+#if defined(CONFIG_SERIAL_ATMEL)
+void atmel_register_uart_fns(struct atmel_port_fns *fns);
 #else
-#define at91_register_uart_fns(fns) do { } while (0)
+#define atmel_register_uart_fns(fns) do { } while (0)
 #endif
 
 
index b13322d..c1b264d 100644 (file)
@@ -13,7 +13,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <linux/config.h>
 #include <linux/slab.h>
 #include <asm/processor.h>
 #include <asm/page.h>
diff --git a/include/asm-avr32/arch-at32ap/at91rm9200_usart.h b/include/asm-avr32/arch-at32ap/at91rm9200_usart.h
deleted file mode 100644 (file)
index 79f851e..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * include/asm-arm/arch-at91rm9200/at91rm9200_usart.h
- *
- * Copyright (C) 2005 Ivan Kokshaysky
- * Copyright (C) SAN People
- *
- * USART registers.
- * Based on AT91RM9200 datasheet revision E.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef AT91RM9200_USART_H
-#define AT91RM9200_USART_H
-
-#define AT91_US_CR             0x00                    /* Control Register */
-#define                AT91_US_RSTRX           (1 <<  2)               /* Reset Receiver */
-#define                AT91_US_RSTTX           (1 <<  3)               /* Reset Transmitter */
-#define                AT91_US_RXEN            (1 <<  4)               /* Receiver Enable */
-#define                AT91_US_RXDIS           (1 <<  5)               /* Receiver Disable */
-#define                AT91_US_TXEN            (1 <<  6)               /* Transmitter Enable */
-#define                AT91_US_TXDIS           (1 <<  7)               /* Transmitter Disable */
-#define                AT91_US_RSTSTA          (1 <<  8)               /* Reset Status Bits */
-#define                AT91_US_STTBRK          (1 <<  9)               /* Start Break */
-#define                AT91_US_STPBRK          (1 << 10)               /* Stop Break */
-#define                AT91_US_STTTO           (1 << 11)               /* Start Time-out */
-#define                AT91_US_SENDA           (1 << 12)               /* Send Address */
-#define                AT91_US_RSTIT           (1 << 13)               /* Reset Iterations */
-#define                AT91_US_RSTNACK         (1 << 14)               /* Reset Non Acknowledge */
-#define                AT91_US_RETTO           (1 << 15)               /* Rearm Time-out */
-#define                AT91_US_DTREN           (1 << 16)               /* Data Terminal Ready Enable */
-#define                AT91_US_DTRDIS          (1 << 17)               /* Data Terminal Ready Disable */
-#define                AT91_US_RTSEN           (1 << 18)               /* Request To Send Enable */
-#define                AT91_US_RTSDIS          (1 << 19)               /* Request To Send Disable */
-
-#define AT91_US_MR             0x04                    /* Mode Register */
-#define                AT91_US_USMODE          (0xf <<  0)             /* Mode of the USART */
-#define                        AT91_US_USMODE_NORMAL           0
-#define                        AT91_US_USMODE_RS485            1
-#define                        AT91_US_USMODE_HWHS             2
-#define                        AT91_US_USMODE_MODEM            3
-#define                        AT91_US_USMODE_ISO7816_T0       4
-#define                        AT91_US_USMODE_ISO7816_T1       6
-#define                        AT91_US_USMODE_IRDA             8
-#define                AT91_US_USCLKS          (3   <<  4)             /* Clock Selection */
-#define                AT91_US_CHRL            (3   <<  6)             /* Character Length */
-#define                        AT91_US_CHRL_5                  (0 <<  6)
-#define                        AT91_US_CHRL_6                  (1 <<  6)
-#define                        AT91_US_CHRL_7                  (2 <<  6)
-#define                        AT91_US_CHRL_8                  (3 <<  6)
-#define                AT91_US_SYNC            (1 <<  8)               /* Synchronous Mode Select */
-#define                AT91_US_PAR             (7 <<  9)               /* Parity Type */
-#define                        AT91_US_PAR_EVEN                (0 <<  9)
-#define                        AT91_US_PAR_ODD                 (1 <<  9)
-#define                        AT91_US_PAR_SPACE               (2 <<  9)
-#define                        AT91_US_PAR_MARK                (3 <<  9)
-#define                        AT91_US_PAR_NONE                (4 <<  9)
-#define                        AT91_US_PAR_MULTI_DROP          (6 <<  9)
-#define                AT91_US_NBSTOP          (3 << 12)               /* Number of Stop Bits */
-#define                        AT91_US_NBSTOP_1                (0 << 12)
-#define                        AT91_US_NBSTOP_1_5              (1 << 12)
-#define                        AT91_US_NBSTOP_2                (2 << 12)
-#define                AT91_US_CHMODE          (3 << 14)               /* Channel Mode */
-#define                        AT91_US_CHMODE_NORMAL           (0 << 14)
-#define                        AT91_US_CHMODE_ECHO             (1 << 14)
-#define                        AT91_US_CHMODE_LOC_LOOP         (2 << 14)
-#define                        AT91_US_CHMODE_REM_LOOP         (3 << 14)
-#define                AT91_US_MSBF            (1 << 16)               /* Bit Order */
-#define                AT91_US_MODE9           (1 << 17)               /* 9-bit Character Length */
-#define                AT91_US_CLKO            (1 << 18)               /* Clock Output Select */
-#define                AT91_US_OVER            (1 << 19)               /* Oversampling Mode */
-#define                AT91_US_INACK           (1 << 20)               /* Inhibit Non Acknowledge */
-#define                AT91_US_DSNACK          (1 << 21)               /* Disable Successive NACK */
-#define                AT91_US_MAX_ITER        (7 << 24)               /* Max Iterations */
-#define                AT91_US_FILTER          (1 << 28)               /* Infrared Receive Line Filter */
-
-#define AT91_US_IER            0x08                    /* Interrupt Enable Register */
-#define                AT91_US_RXRDY           (1 <<  0)               /* Receiver Ready */
-#define                AT91_US_TXRDY           (1 <<  1)               /* Transmitter Ready */
-#define                AT91_US_RXBRK           (1 <<  2)               /* Break Received / End of Break */
-#define                AT91_US_ENDRX           (1 <<  3)               /* End of Receiver Transfer */
-#define                AT91_US_ENDTX           (1 <<  4)               /* End of Transmitter Transfer */
-#define                AT91_US_OVRE            (1 <<  5)               /* Overrun Error */
-#define                AT91_US_FRAME           (1 <<  6)               /* Framing Error */
-#define                AT91_US_PARE            (1 <<  7)               /* Parity Error */
-#define                AT91_US_TIMEOUT         (1 <<  8)               /* Receiver Time-out */
-#define                AT91_US_TXEMPTY         (1 <<  9)               /* Transmitter Empty */
-#define                AT91_US_ITERATION       (1 << 10)               /* Max number of Repetitions Reached */
-#define                AT91_US_TXBUFE          (1 << 11)               /* Transmission Buffer Empty */
-#define                AT91_US_RXBUFF          (1 << 12)               /* Reception Buffer Full */
-#define                AT91_US_NACK            (1 << 13)               /* Non Acknowledge */
-#define                AT91_US_RIIC            (1 << 16)               /* Ring Indicator Input Change */
-#define                AT91_US_DSRIC           (1 << 17)               /* Data Set Ready Input Change */
-#define                AT91_US_DCDIC           (1 << 18)               /* Data Carrier Detect Input Change */
-#define                AT91_US_CTSIC           (1 << 19)               /* Clear to Send Input Change */
-#define                AT91_US_RI              (1 << 20)               /* RI */
-#define                AT91_US_DSR             (1 << 21)               /* DSR */
-#define                AT91_US_DCD             (1 << 22)               /* DCD */
-#define                AT91_US_CTS             (1 << 23)               /* CTS */
-
-#define AT91_US_IDR            0x0c                    /* Interrupt Disable Register */
-#define AT91_US_IMR            0x10                    /* Interrupt Mask Register */
-#define AT91_US_CSR            0x14                    /* Channel Status Register */
-#define AT91_US_RHR            0x18                    /* Receiver Holding Register */
-#define AT91_US_THR            0x1c                    /* Transmitter Holding Register */
-
-#define AT91_US_BRGR           0x20                    /* Baud Rate Generator Register */
-#define                AT91_US_CD              (0xffff << 0)           /* Clock Divider */
-
-#define AT91_US_RTOR           0x24                    /* Receiver Time-out Register */
-#define                AT91_US_TO              (0xffff << 0)           /* Time-out Value */
-
-#define AT91_US_TTGR           0x28                    /* Transmitter Timeguard Register */
-#define                AT91_US_TG              (0xff << 0)             /* Timeguard Value */
-
-#define AT91_US_FIDI           0x40                    /* FI DI Ratio Register */
-#define AT91_US_NER            0x44                    /* Number of Errors Register */
-#define AT91_US_IF             0x4c                    /* IrDA Filter Register */
-
-#endif
index 39368e1..a39b3e9 100644 (file)
@@ -9,9 +9,15 @@
 /* Add basic devices: system manager, interrupt controller, portmuxes, etc. */
 void at32_add_system_devices(void);
 
-#define AT91_NR_UART   4
-extern struct platform_device *at91_default_console_device;
+#define ATMEL_MAX_UART 4
+extern struct platform_device *atmel_default_console_device;
 
+struct atmel_uart_data {
+       short           use_dma_tx;     /* use transmit DMA? */
+       short           use_dma_rx;     /* use receive DMA? */
+       void __iomem    *regs;          /* virtual base address, if any */
+};
+void at32_map_usart(unsigned int hw_id, unsigned int line);
 struct platform_device *at32_add_device_usart(unsigned int id);
 
 struct eth_platform_data {
index 4372263..5e75d85 100644 (file)
@@ -11,6 +11,7 @@
 #define __ASM_AVR32_AT32AP_INIT_H__
 
 void setup_platform(void);
+void setup_board(void);
 
 /* Called by setup_platform */
 void at32_clock_init(void);
index 1290bb3..55b317a 100644 (file)
@@ -14,7 +14,7 @@ struct uart_port;
  * This is a temporary structure for registering these
  * functions; it is intended to be discarded after boot.
  */
-struct at91_port_fns {
+struct atmel_port_fns {
        void    (*set_mctrl)(struct uart_port *, u_int);
        u_int   (*get_mctrl)(struct uart_port *);
        void    (*enable_ms)(struct uart_port *);
@@ -24,10 +24,10 @@ struct at91_port_fns {
        void    (*close)(struct uart_port *);
 };
 
-#if defined(CONFIG_SERIAL_AT91)
-void at91_register_uart_fns(struct at91_port_fns *fns);
+#if defined(CONFIG_SERIAL_ATMEL)
+void atmel_register_uart_fns(struct atmel_port_fns *fns);
 #else
-#define at91_register_uart_fns(fns) do { } while (0)
+#define atmel_register_uart_fns(fns) do { } while (0)
 #endif
 
 
index 6c47e3b..f051020 100644 (file)
@@ -1,5 +1,3 @@
-#include <linux/config.h>
-
 #ifdef CONFIG_SMP
        .macro LOCK_PREFIX
 1:     lock
index 4d68ddc..0362025 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <asm/dwarf2.h>
 
 /* The annotation hides the frame from the unwinder and makes it look
index e32b9a2..814a7a1 100644 (file)
 #define PNX8550_UART_INT(x)            (PNX8550_INT_GIC_MIN+19+x)
 #define IRQ_TO_UART(x)                 (x-PNX8550_INT_GIC_MIN-19)
 
+/* early macros needed for prom/kgdb */
+
+#define ip3106_lcr(base,port)    *(volatile u32 *)(base+(port*0x1000) + 0x000)
+#define ip3106_mcr(base, port)   *(volatile u32 *)(base+(port*0x1000) + 0x004)
+#define ip3106_baud(base, port)  *(volatile u32 *)(base+(port*0x1000) + 0x008)
+#define ip3106_cfg(base, port)   *(volatile u32 *)(base+(port*0x1000) + 0x00C)
+#define ip3106_fifo(base, port)         *(volatile u32 *)(base+(port*0x1000) + 0x028)
+#define ip3106_istat(base, port) *(volatile u32 *)(base+(port*0x1000) + 0xFE0)
+#define ip3106_ien(base, port)   *(volatile u32 *)(base+(port*0x1000) + 0xFE4)
+#define ip3106_iclr(base, port)  *(volatile u32 *)(base+(port*0x1000) + 0xFE8)
+#define ip3106_iset(base, port)  *(volatile u32 *)(base+(port*0x1000) + 0xFEC)
+#define ip3106_pd(base, port)    *(volatile u32 *)(base+(port*0x1000) + 0xFF4)
+#define ip3106_mid(base, port)   *(volatile u32 *)(base+(port*0x1000) + 0xFFC)
+
 #endif
index 4da41ef..89ed545 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/threads.h>
 #include <linux/list.h>
 #include <linux/radix-tree.h>
index 4f55573..86ee46b 100644 (file)
@@ -6,7 +6,6 @@
 #include <asm-ppc/pci-bridge.h>
 #else
 
-#include <linux/config.h>
 #include <linux/pci.h>
 #include <linux/list.h>
 
index 7aefa30..b759eab 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef _COMPAT_SIGNAL_H
 #define _COMPAT_SIGNAL_H
 
-#include <linux/config.h>
 #include <linux/compat.h>
 #include <asm/signal.h>
 
index e4041f4..0b3f1a2 100644 (file)
@@ -1,5 +1,3 @@
-#include <linux/config.h>
-
 #ifdef CONFIG_SMP
        .macro LOCK_PREFIX
 1:     lock
index ea005c0..5114ff1 100644 (file)
@@ -100,7 +100,6 @@ header-y += ipx.h
 header-y += irda.h
 header-y += isdn_divertif.h
 header-y += iso_fs.h
-header-y += ite_gpio.h
 header-y += ixjuser.h
 header-y += jffs2.h
 header-y += keyctl.h
index a91f5e5..479ffb0 100644 (file)
@@ -3,6 +3,7 @@
 /* This file is no longer in use and kept only for backward compatibility.
  * autoconf.h is now included via -imacros on the commandline
  */
+#warning Including config.h is deprecated.
 #include <linux/autoconf.h>
 
 #endif
index de2e681..b661c19 100644 (file)
@@ -67,8 +67,8 @@
 /* Parisc type numbers. */
 #define PORT_MUX       48
 
-/* Atmel AT91xxx SoC */
-#define PORT_AT91      49
+/* Atmel AT91 / AT32 SoC */
+#define PORT_ATMEL     49
 
 /* Macintosh Zilog type numbers */
 #define PORT_MAC_ZILOG 50      /* m68k : not yet implemented */
index 7f53cd1..f28c6e0 100644 (file)
@@ -20,7 +20,6 @@
  */
 #ifndef NETDMA_H
 #define NETDMA_H
-#include <linux/config.h>
 #ifdef CONFIG_NET_DMA
 #include <linux/dmaengine.h>
 #include <linux/skbuff.h>
index e7f2e7f..735705d 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/syscalls.h>
index 0c1faa9..da8d6bf 100644 (file)
@@ -16,7 +16,6 @@
  *
  * See rt.c in preempt-rt for proper credits and further information
  */
-#include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/module.h>
index 948bd8f..6dcea9d 100644 (file)
@@ -6,7 +6,6 @@
  *  Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com>
  *
  */
-#include <linux/config.h>
 #include <linux/kthread.h>
 #include <linux/module.h>
 #include <linux/sched.h>
index 3f2a343..c2bff04 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/mm.h>
 #include <linux/highmem.h>
 #include <linux/uio.h>
-#include <linux/config.h>
 #include <linux/uaccess.h>
 
 size_t
index c23b992..e9a63b5 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -86,7 +86,6 @@
  *     All object allocations for a node occur from node specific slab lists.
  */
 
-#include       <linux/config.h>
 #include       <linux/slab.h>
 #include       <linux/mm.h>
 #include       <linux/poison.h>
index a2b6a9f..45b124e 100644 (file)
@@ -9,7 +9,6 @@
  *             Christoph Lameter <christoph@lameter.com>
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/cpu.h>
index 8ac6b73..877f509 100644 (file)
@@ -7,7 +7,6 @@
 #ifndef _LEC_H_
 #define _LEC_H_
 
-#include <linux/config.h>
 #include <linux/atmdev.h>
 #include <linux/netdevice.h>
 #include <linux/atmlec.h>
index a99d87d..6b0e63c 100644 (file)
@@ -8,7 +8,6 @@
  * Authors:    Thomas Graf <tgraf@suug.ch>
  */
 
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
index 34f5bfa..d8c1057 100644 (file)
@@ -13,7 +13,6 @@
  *     Ville Nuorvala          <vnuorval@tcs.hut.fi>
  */
 
-#include <linux/config.h>
 #include <linux/netdevice.h>
 
 #include <net/fib_rules.h>
index 99d116c..7ccdc8f 100644 (file)
@@ -22,7 +22,6 @@
  *     Masahide NAKAMURA @USAGI
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/time.h>
index d31f814..f580942 100644 (file)
@@ -1,4 +1,3 @@
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
 /* FIX UP */
index fe59850..93537ab 100644 (file)
@@ -20,7 +20,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>