]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 20 Jun 2009 00:34:46 +0000 (17:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 20 Jun 2009 00:34:46 +0000 (17:34 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin:
  Blackfin: convert page/tlb to asm-generic
  Blackfin: convert types to asm-generic
  Blackfin: convert irq/process to asm-generic
  Blackfin: convert signal/mmap to asm-generic
  Blackfin: convert locking primitives to asm-generic
  Blackfin: convert termios to asm-generic
  Blackfin: convert simple headers to asm-generic
  Blackfin: convert socket/poll to asm-generic
  Blackfin: convert user/elf to asm-generic
  Blackfin: convert shm/sysv/ipc to asm-generic
  Blackfin: convert asm/ioctls.h to asm-generic/ioctls.h
  Blackfin: only build irqpanic.c when needed
  Blackfin: pull in asm/io.h in ksyms for prototypes
  Blackfin: use common test_bit() rather than __test_bit()

27 files changed:
MAINTAINERS
arch/powerpc/boot/dts/mpc8610_hpcd.dts
arch/powerpc/platforms/86xx/mpc8610_hpcd.c
drivers/char/dtlk.c
drivers/char/istallion.c
drivers/char/moxa.c
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/pl061.c [new file with mode: 0644]
drivers/message/fusion/mptbase.c
drivers/net/igbvf/netdev.c
drivers/net/ixgbe/ixgbe_fcoe.c
drivers/rtc/interface.c
drivers/rtc/rtc-dev.c
drivers/rtc/rtc-ds1305.c
drivers/rtc/rtc-ds1307.c
drivers/rtc/rtc-ds1374.c
drivers/rtc/rtc-test.c
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/spi_mpc8xxx.c [moved from drivers/spi/spi_mpc83xx.c with 55% similarity]
drivers/video/Kconfig
include/linux/amba/pl061.h [new file with mode: 0644]
include/linux/dma-mapping.h
kernel/exit.c
mm/bootmem.c
sound/pci/lx6464es/lx6464es.c

index 035df9d266096c605a0d5111ffaaed166f25f699..a08882ea68612b8ca71f8c357f348656abb0438f 100644 (file)
@@ -946,7 +946,7 @@ M:  me@bobcopeland.com
 L:     linux-wireless@vger.kernel.org
 L:     ath5k-devel@lists.ath5k.org
 S:     Maintained
-F:     drivers/net/wireless/ath5k/
+F:     drivers/net/wireless/ath/ath5k/
 
 ATHEROS ATH9K WIRELESS DRIVER
 P:     Luis R. Rodriguez
@@ -962,7 +962,7 @@ M:  senthilkumar@atheros.com
 L:     linux-wireless@vger.kernel.org
 L:     ath9k-devel@lists.ath9k.org
 S:     Supported
-F:     drivers/net/wireless/ath9k/
+F:     drivers/net/wireless/ath/ath9k/
 
 ATHEROS AR9170 WIRELESS DRIVER
 P:     Christian Lamparter
@@ -970,7 +970,7 @@ M:  chunkeey@web.de
 L:     linux-wireless@vger.kernel.org
 W:     http://wireless.kernel.org/en/users/Drivers/ar9170
 S:     Maintained
-F:     drivers/net/wireless/ar9170/
+F:     drivers/net/wireless/ath/ar9170/
 
 ATI_REMOTE2 DRIVER
 P:     Ville Syrjala
@@ -2053,8 +2053,8 @@ F:        drivers/edac/i5400_edac.c
 
 EDAC-I82975X
 P:     Ranganathan Desikan
-P:     Arvind R.
 M:     rdesikan@jetzbroadband.com
+P:     Arvind R.
 M:     arvind@acarlab.com
 L:     bluesmoke-devel@lists.sourceforge.net (moderated for non-subscribers)
 W:     bluesmoke.sourceforge.net
@@ -2390,7 +2390,7 @@ FTRACE
 P:     Steven Rostedt
 M:     rostedt@goodmis.org
 S:     Maintained
-F:     Documentation/ftrace.txt
+F:     Documentation/trace/ftrace.txt
 F:     arch/*/*/*/ftrace.h
 F:     arch/*/kernel/ftrace.c
 F:     include/*/ftrace.h
@@ -2849,7 +2849,7 @@ W:        http://apps.sourceforge.net/trac/linux-zigbee
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/lumag/lowpan.git
 S:     Maintained
 F:     net/ieee802154/
-F:     drivers/ieee801254/
+F:     drivers/ieee802154/
 
 INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
 P:     Mimi Zohar
@@ -3406,7 +3406,7 @@ P:        Eduard - Gabriel Munteanu
 M:     eduard.munteanu@linux360.ro
 S:     Maintained
 F:     Documentation/trace/kmemtrace.txt
-F:     include/trace/kmemtrace.h
+F:     include/linux/kmemtrace.h
 F:     kernel/trace/kmemtrace.c
 
 KPROBES
@@ -4083,7 +4083,7 @@ T:        git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git
 S:     Maintained
 F:     net/wireless/
 F:     include/net/ieee80211*
-F:     include/net/wireless.h
+F:     include/linux/wireless.h
 
 NETWORKING DRIVERS
 L:     netdev@vger.kernel.org
index cfc2c60d1f5f4ccd9aee8484bf3d6f78db26513c..f468d215f71675df5414339a4d79fd063a3772cf 100644 (file)
                };
 
                board-control@3,0 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
                        compatible = "fsl,fpga-pixis";
                        reg = <3 0 0x20>;
+                       ranges = <0 3 0 0x20>;
+
+                       sdcsr_pio: gpio-controller@a {
+                               #gpio-cells = <2>;
+                               compatible = "fsl,fpga-pixis-gpio-bank";
+                               reg = <0xa 1>;
+                               gpio-controller;
+                       };
                };
        };
 
                        interrupt-parent = <&mpic>;
                };
 
+               spi@7000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "fsl,mpc8610-spi", "fsl,spi";
+                       reg = <0x7000 0x40>;
+                       cell-index = <0>;
+                       interrupts = <59 2>;
+                       interrupt-parent = <&mpic>;
+                       mode = "cpu";
+                       gpios = <&sdcsr_pio 7 0>;
+
+                       mmc-slot@0 {
+                               compatible = "fsl,mpc8610hpcd-mmc-slot",
+                                            "mmc-spi-slot";
+                               reg = <0>;
+                               gpios = <&sdcsr_pio 0 1   /* nCD */
+                                        &sdcsr_pio 1 0>; /*  WP */
+                               voltage-ranges = <3300 3300>;
+                               spi-max-frequency = <50000000>;
+                       };
+               };
+
                display@2c000 {
                        compatible = "fsl,diu";
                        reg = <0x2c000 100>;
index 51eec0cd5519a1d1dbf775899267327be06d64dd..627908a4cd77a974324bcdf3686c104624bdd340 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/of_platform.h>
 #include <sysdev/fsl_pci.h>
 #include <sysdev/fsl_soc.h>
+#include <sysdev/simple_gpio.h>
 
 #include "mpc86xx.h"
 
@@ -51,6 +52,9 @@ static struct of_device_id __initdata mpc8610_ids[] = {
 
 static int __init mpc8610_declare_of_platform_devices(void)
 {
+       /* Firstly, register PIXIS GPIOs. */
+       simple_gpiochip_init("fsl,fpga-pixis-gpio-bank");
+
        /* Without this call, the SSI device driver won't get probed. */
        of_platform_bus_probe(NULL, mpc8610_ids, NULL);
 
index 6b900b297cc615f7687b8a320fd7ebc4987338a7..52e06589821d8ed53edef8bf96e02e0a95a9d430 100644 (file)
@@ -571,7 +571,7 @@ static char dtlk_read_tts(void)
                portval = inb_p(dtlk_port_tts);
        } while ((portval & TTS_READABLE) == 0 &&
                 retries++ < DTLK_MAX_RETRIES);
-       if (retries == DTLK_MAX_RETRIES)
+       if (retries > DTLK_MAX_RETRIES)
                printk(KERN_ERR "dtlk_read_tts() timeout\n");
 
        ch = inb_p(dtlk_port_tts);      /* input from TTS port */
@@ -583,7 +583,7 @@ static char dtlk_read_tts(void)
                portval = inb_p(dtlk_port_tts);
        } while ((portval & TTS_READABLE) != 0 &&
                 retries++ < DTLK_MAX_RETRIES);
-       if (retries == DTLK_MAX_RETRIES)
+       if (retries > DTLK_MAX_RETRIES)
                printk(KERN_ERR "dtlk_read_tts() timeout\n");
 
        TRACE_RET;
@@ -640,7 +640,7 @@ static char dtlk_write_tts(char ch)
                while ((inb_p(dtlk_port_tts) & TTS_WRITABLE) == 0 &&
                       retries++ < DTLK_MAX_RETRIES)    /* DT ready? */
                        ;
-       if (retries == DTLK_MAX_RETRIES)
+       if (retries > DTLK_MAX_RETRIES)
                printk(KERN_ERR "dtlk_write_tts() timeout\n");
 
        outb_p(ch, dtlk_port_tts);      /* output to TTS port */
index e18800c400b10b60578b6fb9bb1d86a16dcbfd04..0c999f5bb3db6df69e0062609e9f82d1c0ee8955 100644 (file)
@@ -3785,7 +3785,7 @@ err:
        return retval;
 }
 
-static void stli_pciremove(struct pci_dev *pdev)
+static void __devexit stli_pciremove(struct pci_dev *pdev)
 {
        struct stlibrd *brdp = pci_get_drvdata(pdev);
 
index 65b6ff2442c6df4edfd839b37752ded8340df9c9..6799588b009976ca5d0efd98a065fd60f21d902d 100644 (file)
@@ -1189,6 +1189,11 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
                return -ENODEV;
        }
 
+       if (port % MAX_PORTS_PER_BOARD >= brd->numPorts) {
+               retval = -ENODEV;
+               goto out_unlock;
+       }
+
        ch = &brd->ports[port % MAX_PORTS_PER_BOARD];
        ch->port.count++;
        tty->driver_data = ch;
@@ -1213,8 +1218,8 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
                                moxa_close_port(tty);
        } else
                ch->port.flags |= ASYNC_NORMAL_ACTIVE;
+out_unlock:
        mutex_unlock(&moxa_openlock);
-
        return retval;
 }
 
index 11f373971fa5fe8cbedee6a5fce9a29bb4d02a83..3582c39f97258ee7f9a95612816fa0f1c83bc467 100644 (file)
@@ -67,6 +67,12 @@ config GPIO_SYSFS
 
 comment "Memory mapped GPIO expanders:"
 
+config GPIO_PL061
+       bool "PrimeCell PL061 GPIO support"
+       depends on ARM_AMBA
+       help
+         Say yes here to support the PrimeCell PL061 GPIO device
+
 config GPIO_XILINX
        bool "Xilinx GPIO support"
        depends on PPC_OF || MICROBLAZE
index 49ac64e515e6690a02fc96a33fa879a6cf0135d1..ef90203e8f3c77df4c2f1b9cbe1433f50ce2b92a 100644 (file)
@@ -9,6 +9,7 @@ obj-$(CONFIG_GPIO_MAX732X)      += max732x.o
 obj-$(CONFIG_GPIO_MCP23S08)    += mcp23s08.o
 obj-$(CONFIG_GPIO_PCA953X)     += pca953x.o
 obj-$(CONFIG_GPIO_PCF857X)     += pcf857x.o
+obj-$(CONFIG_GPIO_PL061)       += pl061.o
 obj-$(CONFIG_GPIO_TWL4030)     += twl4030-gpio.o
 obj-$(CONFIG_GPIO_XILINX)      += xilinx_gpio.o
 obj-$(CONFIG_GPIO_BT8XX)       += bt8xxgpio.o
diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c
new file mode 100644 (file)
index 0000000..aa8e7cb
--- /dev/null
@@ -0,0 +1,341 @@
+/*
+ *  linux/drivers/gpio/pl061.c
+ *
+ *  Copyright (C) 2008, 2009 Provigent Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Driver for the ARM PrimeCell(tm) General Purpose Input/Output (PL061)
+ *
+ * Data sheet: ARM DDI 0190B, September 2000
+ */
+#include <linux/spinlock.h>
+#include <linux/errno.h>
+#include <linux/module.h>
+#include <linux/list.h>
+#include <linux/io.h>
+#include <linux/ioport.h>
+#include <linux/irq.h>
+#include <linux/bitops.h>
+#include <linux/workqueue.h>
+#include <linux/gpio.h>
+#include <linux/device.h>
+#include <linux/amba/bus.h>
+#include <linux/amba/pl061.h>
+
+#define GPIODIR 0x400
+#define GPIOIS  0x404
+#define GPIOIBE 0x408
+#define GPIOIEV 0x40C
+#define GPIOIE  0x410
+#define GPIORIS 0x414
+#define GPIOMIS 0x418
+#define GPIOIC  0x41C
+
+#define PL061_GPIO_NR  8
+
+struct pl061_gpio {
+       /* We use a list of pl061_gpio structs for each trigger IRQ in the main
+        * interrupts controller of the system. We need this to support systems
+        * in which more that one PL061s are connected to the same IRQ. The ISR
+        * interates through this list to find the source of the interrupt.
+        */
+       struct list_head        list;
+
+       /* Each of the two spinlocks protects a different set of hardware
+        * regiters and data structurs. This decouples the code of the IRQ from
+        * the GPIO code. This also makes the case of a GPIO routine call from
+        * the IRQ code simpler.
+        */
+       spinlock_t              lock;           /* GPIO registers */
+       spinlock_t              irq_lock;       /* IRQ registers */
+
+       void __iomem            *base;
+       unsigned                irq_base;
+       struct gpio_chip        gc;
+};
+
+static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)
+{
+       struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
+       unsigned long flags;
+       unsigned char gpiodir;
+
+       if (offset >= gc->ngpio)
+               return -EINVAL;
+
+       spin_lock_irqsave(&chip->lock, flags);
+       gpiodir = readb(chip->base + GPIODIR);
+       gpiodir &= ~(1 << offset);
+       writeb(gpiodir, chip->base + GPIODIR);
+       spin_unlock_irqrestore(&chip->lock, flags);
+
+       return 0;
+}
+
+static int pl061_direction_output(struct gpio_chip *gc, unsigned offset,
+               int value)
+{
+       struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
+       unsigned long flags;
+       unsigned char gpiodir;
+
+       if (offset >= gc->ngpio)
+               return -EINVAL;
+
+       spin_lock_irqsave(&chip->lock, flags);
+       writeb(!!value << offset, chip->base + (1 << (offset + 2)));
+       gpiodir = readb(chip->base + GPIODIR);
+       gpiodir |= 1 << offset;
+       writeb(gpiodir, chip->base + GPIODIR);
+       spin_unlock_irqrestore(&chip->lock, flags);
+
+       return 0;
+}
+
+static int pl061_get_value(struct gpio_chip *gc, unsigned offset)
+{
+       struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
+
+       return !!readb(chip->base + (1 << (offset + 2)));
+}
+
+static void pl061_set_value(struct gpio_chip *gc, unsigned offset, int value)
+{
+       struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
+
+       writeb(!!value << offset, chip->base + (1 << (offset + 2)));
+}
+
+/*
+ * PL061 GPIO IRQ
+ */
+static void pl061_irq_disable(unsigned irq)
+{
+       struct pl061_gpio *chip = get_irq_chip_data(irq);
+       int offset = irq - chip->irq_base;
+       unsigned long flags;
+       u8 gpioie;
+
+       spin_lock_irqsave(&chip->irq_lock, flags);
+       gpioie = readb(chip->base + GPIOIE);
+       gpioie &= ~(1 << offset);
+       writeb(gpioie, chip->base + GPIOIE);
+       spin_unlock_irqrestore(&chip->irq_lock, flags);
+}
+
+static void pl061_irq_enable(unsigned irq)
+{
+       struct pl061_gpio *chip = get_irq_chip_data(irq);
+       int offset = irq - chip->irq_base;
+       unsigned long flags;
+       u8 gpioie;
+
+       spin_lock_irqsave(&chip->irq_lock, flags);
+       gpioie = readb(chip->base + GPIOIE);
+       gpioie |= 1 << offset;
+       writeb(gpioie, chip->base + GPIOIE);
+       spin_unlock_irqrestore(&chip->irq_lock, flags);
+}
+
+static int pl061_irq_type(unsigned irq, unsigned trigger)
+{
+       struct pl061_gpio *chip = get_irq_chip_data(irq);
+       int offset = irq - chip->irq_base;
+       unsigned long flags;
+       u8 gpiois, gpioibe, gpioiev;
+
+       if (offset < 0 || offset > PL061_GPIO_NR)
+               return -EINVAL;
+
+       spin_lock_irqsave(&chip->irq_lock, flags);
+
+       gpioiev = readb(chip->base + GPIOIEV);
+
+       gpiois = readb(chip->base + GPIOIS);
+       if (trigger & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
+               gpiois |= 1 << offset;
+               if (trigger & IRQ_TYPE_LEVEL_HIGH)
+                       gpioiev |= 1 << offset;
+               else
+                       gpioiev &= ~(1 << offset);
+       } else
+               gpiois &= ~(1 << offset);
+       writeb(gpiois, chip->base + GPIOIS);
+
+       gpioibe = readb(chip->base + GPIOIBE);
+       if ((trigger & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH)
+               gpioibe |= 1 << offset;
+       else {
+               gpioibe &= ~(1 << offset);
+               if (trigger & IRQ_TYPE_EDGE_RISING)
+                       gpioiev |= 1 << offset;
+               else
+                       gpioiev &= ~(1 << offset);
+       }
+       writeb(gpioibe, chip->base + GPIOIBE);
+
+       writeb(gpioiev, chip->base + GPIOIEV);
+
+       spin_unlock_irqrestore(&chip->irq_lock, flags);
+
+       return 0;
+}
+
+static struct irq_chip pl061_irqchip = {
+       .name           = "GPIO",
+       .enable         = pl061_irq_enable,
+       .disable        = pl061_irq_disable,
+       .set_type       = pl061_irq_type,
+};
+
+static void pl061_irq_handler(unsigned irq, struct irq_desc *desc)
+{
+       struct list_head *chip_list = get_irq_chip_data(irq);
+       struct list_head *ptr;
+       struct pl061_gpio *chip;
+
+       desc->chip->ack(irq);
+       list_for_each(ptr, chip_list) {
+               unsigned long pending;
+               int gpio;
+
+               chip = list_entry(ptr, struct pl061_gpio, list);
+               pending = readb(chip->base + GPIOMIS);
+               writeb(pending, chip->base + GPIOIC);
+
+               if (pending == 0)
+                       continue;
+
+               for_each_bit(gpio, &pending, PL061_GPIO_NR)
+                       generic_handle_irq(gpio_to_irq(gpio));
+       }
+       desc->chip->unmask(irq);
+}
+
+static int __init pl061_probe(struct amba_device *dev, struct amba_id *id)
+{
+       struct pl061_platform_data *pdata;
+       struct pl061_gpio *chip;
+       struct list_head *chip_list;
+       int ret, irq, i;
+       static unsigned long init_irq[BITS_TO_LONGS(NR_IRQS)];
+
+       pdata = dev->dev.platform_data;
+       if (pdata == NULL)
+               return -ENODEV;
+
+       chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+       if (chip == NULL)
+               return -ENOMEM;
+
+       if (!request_mem_region(dev->res.start,
+                               resource_size(&dev->res), "pl061")) {
+               ret = -EBUSY;
+               goto free_mem;
+       }
+
+       chip->base = ioremap(dev->res.start, resource_size(&dev->res));
+       if (chip->base == NULL) {
+               ret = -ENOMEM;
+               goto release_region;
+       }
+
+       spin_lock_init(&chip->lock);
+       spin_lock_init(&chip->irq_lock);
+       INIT_LIST_HEAD(&chip->list);
+
+       chip->gc.direction_input = pl061_direction_input;
+       chip->gc.direction_output = pl061_direction_output;
+       chip->gc.get = pl061_get_value;
+       chip->gc.set = pl061_set_value;
+       chip->gc.base = pdata->gpio_base;
+       chip->gc.ngpio = PL061_GPIO_NR;
+       chip->gc.label = dev_name(&dev->dev);
+       chip->gc.dev = &dev->dev;
+       chip->gc.owner = THIS_MODULE;
+
+       chip->irq_base = pdata->irq_base;
+
+       ret = gpiochip_add(&chip->gc);
+       if (ret)
+               goto iounmap;
+
+       /*
+        * irq_chip support
+        */
+
+       if (chip->irq_base == (unsigned) -1)
+               return 0;
+
+       writeb(0, chip->base + GPIOIE); /* disable irqs */
+       irq = dev->irq[0];
+       if (irq < 0) {
+               ret = -ENODEV;
+               goto iounmap;
+       }
+       set_irq_chained_handler(irq, pl061_irq_handler);
+       if (!test_and_set_bit(irq, init_irq)) { /* list initialized? */
+               chip_list = kmalloc(sizeof(*chip_list), GFP_KERNEL);
+               if (chip_list == NULL) {
+                       ret = -ENOMEM;
+                       goto iounmap;
+               }
+               INIT_LIST_HEAD(chip_list);
+               set_irq_chip_data(irq, chip_list);
+       } else
+               chip_list = get_irq_chip_data(irq);
+       list_add(&chip->list, chip_list);
+
+       for (i = 0; i < PL061_GPIO_NR; i++) {
+               if (pdata->directions & (1 << i))
+                       pl061_direction_output(&chip->gc, i,
+                                       pdata->values & (1 << i));
+               else
+                       pl061_direction_input(&chip->gc, i);
+
+               set_irq_chip(i+chip->irq_base, &pl061_irqchip);
+               set_irq_handler(i+chip->irq_base, handle_simple_irq);
+               set_irq_flags(i+chip->irq_base, IRQF_VALID);
+               set_irq_chip_data(i+chip->irq_base, chip);
+       }
+
+       return 0;
+
+iounmap:
+       iounmap(chip->base);
+release_region:
+       release_mem_region(dev->res.start, resource_size(&dev->res));
+free_mem:
+       kfree(chip);
+
+       return ret;
+}
+
+static struct amba_id pl061_ids[] __initdata = {
+       {
+               .id     = 0x00041061,
+               .mask   = 0x000fffff,
+       },
+       { 0, 0 },
+};
+
+static struct amba_driver pl061_gpio_driver = {
+       .drv = {
+               .name   = "pl061_gpio",
+       },
+       .id_table       = pl061_ids,
+       .probe          = pl061_probe,
+};
+
+static int __init pl061_gpio_init(void)
+{
+       return amba_driver_register(&pl061_gpio_driver);
+}
+subsys_initcall(pl061_gpio_init);
+
+MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>");
+MODULE_DESCRIPTION("PL061 GPIO driver");
+MODULE_LICENSE("GPL");
index 0df065275cd3c5d7252350f8a4186b54adc45bb8..5d0ba4f5924ca5bf34547dabcab8cda8cbf2ff4a 100644 (file)
@@ -4414,11 +4414,11 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
                 * 1078 errata workaround for the 36GB limitation
                 */
                if (ioc->pcidev->device == MPI_MANUFACTPAGE_DEVID_SAS1078 &&
-                   ioc->dma_mask > DMA_35BIT_MASK) {
+                   ioc->dma_mask > DMA_BIT_MASK(35)) {
                        if (!pci_set_dma_mask(ioc->pcidev, DMA_BIT_MASK(32))
                            && !pci_set_consistent_dma_mask(ioc->pcidev,
                            DMA_BIT_MASK(32))) {
-                               dma_mask = DMA_35BIT_MASK;
+                               dma_mask = DMA_BIT_MASK(35);
                                d36memprintk(ioc, printk(MYIOC_s_DEBUG_FMT
                                    "setting 35 bit addressing for "
                                    "Request/Reply/Chain and Sense Buffers\n",
@@ -4575,7 +4575,7 @@ PrimeIocFifos(MPT_ADAPTER *ioc)
                alloc_dma += ioc->reply_sz;
        }
 
-       if (dma_mask == DMA_35BIT_MASK && !pci_set_dma_mask(ioc->pcidev,
+       if (dma_mask == DMA_BIT_MASK(35) && !pci_set_dma_mask(ioc->pcidev,
            ioc->dma_mask) && !pci_set_consistent_dma_mask(ioc->pcidev,
            ioc->dma_mask))
                d36memprintk(ioc, printk(MYIOC_s_DEBUG_FMT
@@ -4602,7 +4602,7 @@ out_fail:
                ioc->sense_buf_pool = NULL;
        }
 
-       if (dma_mask == DMA_35BIT_MASK && !pci_set_dma_mask(ioc->pcidev,
+       if (dma_mask == DMA_BIT_MASK(35) && !pci_set_dma_mask(ioc->pcidev,
            DMA_BIT_MASK(64)) && !pci_set_consistent_dma_mask(ioc->pcidev,
            DMA_BIT_MASK(64)))
                d36memprintk(ioc, printk(MYIOC_s_DEBUG_FMT
index 22aadb7884fa9ac028a4f1dc60d4aa3014c86c26..2bc9d63027dbe612eed84c1d337674e632e44d72 100644 (file)
@@ -1281,7 +1281,7 @@ static void igbvf_configure_tx(struct igbvf_adapter *adapter)
        /* Setup the HW Tx Head and Tail descriptor pointers */
        ew32(TDLEN(0), tx_ring->count * sizeof(union e1000_adv_tx_desc));
        tdba = tx_ring->dma;
-       ew32(TDBAL(0), (tdba & DMA_32BIT_MASK));
+       ew32(TDBAL(0), (tdba & DMA_BIT_MASK(32)));
        ew32(TDBAH(0), (tdba >> 32));
        ew32(TDH(0), 0);
        ew32(TDT(0), 0);
@@ -1367,7 +1367,7 @@ static void igbvf_configure_rx(struct igbvf_adapter *adapter)
         * the Base and Length of the Rx Descriptor Ring
         */
        rdba = rx_ring->dma;
-       ew32(RDBAL(0), (rdba & DMA_32BIT_MASK));
+       ew32(RDBAL(0), (rdba & DMA_BIT_MASK(32)));
        ew32(RDBAH(0), (rdba >> 32));
        ew32(RDLEN(0), rx_ring->count * sizeof(union e1000_adv_rx_desc));
        rx_ring->head = E1000_RDH(0);
@@ -2628,15 +2628,16 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
                return err;
 
        pci_using_dac = 0;
-       err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
+       err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
        if (!err) {
-               err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
+               err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
                if (!err)
                        pci_using_dac = 1;
        } else {
-               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+               err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
                if (err) {
-                       err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
+                       err = pci_set_consistent_dma_mask(pdev,
+                                                         DMA_BIT_MASK(32));
                        if (err) {
                                dev_err(&pdev->dev, "No usable DMA "
                                        "configuration, aborting\n");
index 3c3bf1f07b81d1f5227cf4136f3364e2e4748d9d..fa9f24e23683003d8d8b531f22793f87d1880cf7 100644 (file)
@@ -251,7 +251,7 @@ int ixgbe_fcoe_ddp_get(struct net_device *netdev, u16 xid,
        /* program DMA context */
        hw = &adapter->hw;
        spin_lock_bh(&fcoe->lock);
-       IXGBE_WRITE_REG(hw, IXGBE_FCPTRL, ddp->udp & DMA_32BIT_MASK);
+       IXGBE_WRITE_REG(hw, IXGBE_FCPTRL, ddp->udp & DMA_BIT_MASK(32));
        IXGBE_WRITE_REG(hw, IXGBE_FCPTRH, (u64)ddp->udp >> 32);
        IXGBE_WRITE_REG(hw, IXGBE_FCBUFF, fcbuff);
        IXGBE_WRITE_REG(hw, IXGBE_FCDMARW, fcdmarw);
index 4348c4b0d4536dde8fb556ad3fe34cfc2f37b611..4cdb31a362ca010e9d6c39aa7d332f683ed0f10a 100644 (file)
@@ -371,19 +371,21 @@ EXPORT_SYMBOL_GPL(rtc_update_irq_enable);
  * @rtc: the rtc device
  * @num: how many irqs are being reported (usually one)
  * @events: mask of RTC_IRQF with one or more of RTC_PF, RTC_AF, RTC_UF
- * Context: in_interrupt(), irqs blocked
+ * Context: any
  */
 void rtc_update_irq(struct rtc_device *rtc,
                unsigned long num, unsigned long events)
 {
-       spin_lock(&rtc->irq_lock);
+       unsigned long flags;
+
+       spin_lock_irqsave(&rtc->irq_lock, flags);
        rtc->irq_data = (rtc->irq_data + (num << 8)) | events;
-       spin_unlock(&rtc->irq_lock);
+       spin_unlock_irqrestore(&rtc->irq_lock, flags);
 
-       spin_lock(&rtc->irq_task_lock);
+       spin_lock_irqsave(&rtc->irq_task_lock, flags);
        if (rtc->irq_task)
                rtc->irq_task->func(rtc->irq_task->private_data);
-       spin_unlock(&rtc->irq_task_lock);
+       spin_unlock_irqrestore(&rtc->irq_task_lock, flags);
 
        wake_up_interruptible(&rtc->irq_queue);
        kill_fasync(&rtc->async_queue, SIGIO, POLL_IN);
index 45152f4952d66f5d28a99211f7e6e71d09649e12..8a11de9552cd06427e222f8eaba23409f3b49476 100644 (file)
@@ -60,8 +60,7 @@ static void rtc_uie_task(struct work_struct *work)
 
        err = rtc_read_time(rtc, &tm);
 
-       local_irq_disable();
-       spin_lock(&rtc->irq_lock);
+       spin_lock_irq(&rtc->irq_lock);
        if (rtc->stop_uie_polling || err) {
                rtc->uie_task_active = 0;
        } else if (rtc->oldsecs != tm.tm_sec) {
@@ -74,10 +73,9 @@ static void rtc_uie_task(struct work_struct *work)
        } else if (schedule_work(&rtc->uie_task) == 0) {
                rtc->uie_task_active = 0;
        }
-       spin_unlock(&rtc->irq_lock);
+       spin_unlock_irq(&rtc->irq_lock);
        if (num)
                rtc_update_irq(rtc, num, RTC_UF | RTC_IRQF);
-       local_irq_enable();
 }
 static void rtc_uie_timer(unsigned long data)
 {
index fc372df6534b5e93b3296913be692188cd5c1d41..8f410e59d9f536583c4a1509e65b2ecacd70bbcd 100644 (file)
@@ -499,10 +499,7 @@ static void ds1305_work(struct work_struct *work)
        if (!test_bit(FLAG_EXITING, &ds1305->flags))
                enable_irq(spi->irq);
 
-       /* rtc_update_irq() requires an IRQ-disabled context */
-       local_irq_disable();
        rtc_update_irq(ds1305->rtc, 1, RTC_AF | RTC_IRQF);
-       local_irq_enable();
 }
 
 /*
index 8a6f9a9f9cb83d98c8e5b6e20a8da8c8374bb004..47a93c022d91b20bc840bd8158bb1097514eaa7b 100644 (file)
@@ -267,12 +267,7 @@ static void ds1307_work(struct work_struct *work)
                control &= ~DS1337_BIT_A1IE;
                i2c_smbus_write_byte_data(client, DS1337_REG_CONTROL, control);
 
-               /* rtc_update_irq() assumes that it is called
-                * from IRQ-disabled context.
-                */
-               local_irq_disable();
                rtc_update_irq(ds1307->rtc, 1, RTC_AF | RTC_IRQF);
-               local_irq_enable();
        }
 
 out:
index 4d32e328f6cd6b7bb2e9cf9e72748b6031f30ef6..32b27739ec2a4567acd1d2cb2e38535c385d4f27 100644 (file)
@@ -296,12 +296,7 @@ static void ds1374_work(struct work_struct *work)
                control &= ~(DS1374_REG_CR_WACE | DS1374_REG_CR_AIE);
                i2c_smbus_write_byte_data(client, DS1374_REG_CR, control);
 
-               /* rtc_update_irq() assumes that it is called
-                * from IRQ-disabled context.
-                */
-               local_irq_disable();
                rtc_update_irq(ds1374->rtc, 1, RTC_AF | RTC_IRQF);
-               local_irq_enable();
        }
 
 out:
index e478280ff6283d130c9cd456d09189a17f5f472c..51725f7755b08ca8ec7dbc221d4d9e8d03bbde52 100644 (file)
@@ -93,7 +93,6 @@ static ssize_t test_irq_store(struct device *dev,
        struct rtc_device *rtc = platform_get_drvdata(plat_dev);
 
        retval = count;
-       local_irq_disable();
        if (strncmp(buf, "tick", 4) == 0)
                rtc_update_irq(rtc, 1, RTC_PF | RTC_IRQF);
        else if (strncmp(buf, "alarm", 5) == 0)
@@ -102,7 +101,6 @@ static ssize_t test_irq_store(struct device *dev,
                rtc_update_irq(rtc, 1, RTC_UF | RTC_IRQF);
        else
                retval = -EINVAL;
-       local_irq_enable();
 
        return retval;
 }
index e8aae227b5e0a3283702f5ee4f3ecd9fce3ce829..2c733c27db2f4dd95d938528d52104ab4c9d0a85 100644 (file)
@@ -139,17 +139,15 @@ config SPI_MPC52xx_PSC
          This enables using the Freescale MPC52xx Programmable Serial
          Controller in master SPI mode.
 
-config SPI_MPC83xx
-       tristate "Freescale MPC83xx/QUICC Engine SPI controller"
-       depends on (PPC_83xx || QUICC_ENGINE) && EXPERIMENTAL
+config SPI_MPC8xxx
+       tristate "Freescale MPC8xxx SPI controller"
+       depends on FSL_SOC
        help
-         This enables using the Freescale MPC83xx and QUICC Engine SPI
-         controllers in master mode.
+         This enables using the Freescale MPC8xxx SPI controllers in master
+         mode.
 
-         Note, this driver uniquely supports the SPI controller on the MPC83xx
-         family of PowerPC processors, plus processors with QUICC Engine
-         technology. This driver uses a simple set of shift registers for data
-         (opposed to the CPM based descriptor model).
+         This driver uses a simple set of shift registers for data (opposed
+         to the CPM based descriptor model).
 
 config SPI_OMAP_UWIRE
        tristate "OMAP1 MicroWire"
index ecfadb180482119f9f6b23f8563e14b2019b2db8..3de408d294bac6910a1ff71997367043bbd5b1f9 100644 (file)
@@ -25,7 +25,7 @@ obj-$(CONFIG_SPI_OMAP24XX)            += omap2_mcspi.o
 obj-$(CONFIG_SPI_ORION)                        += orion_spi.o
 obj-$(CONFIG_SPI_PL022)                        += amba-pl022.o
 obj-$(CONFIG_SPI_MPC52xx_PSC)          += mpc52xx_psc_spi.o
-obj-$(CONFIG_SPI_MPC83xx)              += spi_mpc83xx.o
+obj-$(CONFIG_SPI_MPC8xxx)              += spi_mpc8xxx.o
 obj-$(CONFIG_SPI_S3C24XX_GPIO)         += spi_s3c24xx_gpio.o
 obj-$(CONFIG_SPI_S3C24XX)              += spi_s3c24xx.o
 obj-$(CONFIG_SPI_TXX9)                 += spi_txx9.o
similarity index 55%
rename from drivers/spi/spi_mpc83xx.c
rename to drivers/spi/spi_mpc8xxx.c
index ce61be98e06defbf898522623f117177f46af2db..0fd0ec4d3a7d1899e742a5d7005f4f986eab7293 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * MPC83xx SPI controller driver.
+ * MPC8xxx SPI controller driver.
  *
  * Maintainer: Kumar Gala
  *
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
+#include <linux/bug.h>
 #include <linux/errno.h>
 #include <linux/err.h>
+#include <linux/io.h>
 #include <linux/completion.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 
 #include <sysdev/fsl_soc.h>
 #include <asm/irq.h>
-#include <asm/io.h>
 
 /* SPI Controller registers */
-struct mpc83xx_spi_reg {
+struct mpc8xxx_spi_reg {
        u8 res1[0x20];
        __be32 mode;
        __be32 event;
@@ -75,16 +76,16 @@ struct mpc83xx_spi_reg {
 #define        SPIM_NF         0x00000100      /* Not full */
 
 /* SPI Controller driver's private data. */
-struct mpc83xx_spi {
-       struct mpc83xx_spi_reg __iomem *base;
+struct mpc8xxx_spi {
+       struct mpc8xxx_spi_reg __iomem *base;
 
        /* rx & tx bufs from the spi_transfer */
        const void *tx;
        void *rx;
 
        /* functions to deal with different sized buffers */
-       void (*get_rx) (u32 rx_data, struct mpc83xx_spi *);
-       u32(*get_tx) (struct mpc83xx_spi *);
+       void (*get_rx) (u32 rx_data, struct mpc8xxx_spi *);
+       u32(*get_tx) (struct mpc8xxx_spi *);
 
        unsigned int count;
        unsigned int irq;
@@ -97,8 +98,6 @@ struct mpc83xx_spi {
 
        bool qe_mode;
 
-       u8 busy;
-
        struct workqueue_struct *workqueue;
        struct work_struct work;
 
@@ -108,44 +107,44 @@ struct mpc83xx_spi {
        struct completion done;
 };
 
-struct spi_mpc83xx_cs {
+struct spi_mpc8xxx_cs {
        /* functions to deal with different sized buffers */
-       void (*get_rx) (u32 rx_data, struct mpc83xx_spi *);
-       u32 (*get_tx) (struct mpc83xx_spi *);
+       void (*get_rx) (u32 rx_data, struct mpc8xxx_spi *);
+       u32 (*get_tx) (struct mpc8xxx_spi *);
        u32 rx_shift;           /* RX data reg shift when in qe mode */
        u32 tx_shift;           /* TX data reg shift when in qe mode */
        u32 hw_mode;            /* Holds HW mode register settings */
 };
 
-static inline void mpc83xx_spi_write_reg(__be32 __iomem * reg, u32 val)
+static inline void mpc8xxx_spi_write_reg(__be32 __iomem *reg, u32 val)
 {
        out_be32(reg, val);
 }
 
-static inline u32 mpc83xx_spi_read_reg(__be32 __iomem * reg)
+static inline u32 mpc8xxx_spi_read_reg(__be32 __iomem *reg)
 {
        return in_be32(reg);
 }
 
 #define MPC83XX_SPI_RX_BUF(type)                                         \
 static                                                                   \
-void mpc83xx_spi_rx_buf_##type(u32 data, struct mpc83xx_spi *mpc83xx_spi) \
+void mpc8xxx_spi_rx_buf_##type(u32 data, struct mpc8xxx_spi *mpc8xxx_spi) \
 {                                                                        \
-       type * rx = mpc83xx_spi->rx;                                      \
-       *rx++ = (type)(data >> mpc83xx_spi->rx_shift);                    \
-       mpc83xx_spi->rx = rx;                                             \
+       type *rx = mpc8xxx_spi->rx;                                       \
+       *rx++ = (type)(data >> mpc8xxx_spi->rx_shift);                    \
+       mpc8xxx_spi->rx = rx;                                             \
 }
 
 #define MPC83XX_SPI_TX_BUF(type)                               \
 static                                                         \
-u32 mpc83xx_spi_tx_buf_##type(struct mpc83xx_spi *mpc83xx_spi) \
+u32 mpc8xxx_spi_tx_buf_##type(struct mpc8xxx_spi *mpc8xxx_spi) \
 {                                                              \
        u32 data;                                               \
-       const type * tx = mpc83xx_spi->tx;                      \
+       const type *tx = mpc8xxx_spi->tx;                       \
        if (!tx)                                                \
                return 0;                                       \
-       data = *tx++ << mpc83xx_spi->tx_shift;                  \
-       mpc83xx_spi->tx = tx;                                   \
+       data = *tx++ << mpc8xxx_spi->tx_shift;                  \
+       mpc8xxx_spi->tx = tx;                                   \
        return data;                                            \
 }
 
@@ -156,12 +155,12 @@ MPC83XX_SPI_TX_BUF(u8)
 MPC83XX_SPI_TX_BUF(u16)
 MPC83XX_SPI_TX_BUF(u32)
 
-static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
+static void mpc8xxx_spi_chipselect(struct spi_device *spi, int value)
 {
-       struct mpc83xx_spi *mpc83xx_spi = spi_master_get_devdata(spi->master);
+       struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
        struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data;
        bool pol = spi->mode & SPI_CS_HIGH;
-       struct spi_mpc83xx_cs   *cs = spi->controller_state;
+       struct spi_mpc8xxx_cs   *cs = spi->controller_state;
 
        if (value == BITBANG_CS_INACTIVE) {
                if (pdata->cs_control)
@@ -169,16 +168,16 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
        }
 
        if (value == BITBANG_CS_ACTIVE) {
-               u32 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
+               u32 regval = mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->mode);
 
-               mpc83xx_spi->rx_shift = cs->rx_shift;
-               mpc83xx_spi->tx_shift = cs->tx_shift;
-               mpc83xx_spi->get_rx = cs->get_rx;
-               mpc83xx_spi->get_tx = cs->get_tx;
+               mpc8xxx_spi->rx_shift = cs->rx_shift;
+               mpc8xxx_spi->tx_shift = cs->tx_shift;
+               mpc8xxx_spi->get_rx = cs->get_rx;
+               mpc8xxx_spi->get_tx = cs->get_tx;
 
                if (cs->hw_mode != regval) {
                        unsigned long flags;
-                       __be32 __iomem *mode = &mpc83xx_spi->base->mode;
+                       __be32 __iomem *mode = &mpc8xxx_spi->base->mode;
 
                        regval = cs->hw_mode;
                        /* Turn off IRQs locally to minimize time that
@@ -186,8 +185,8 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
                         */
                        local_irq_save(flags);
                        /* Turn off SPI unit prior changing mode */
-                       mpc83xx_spi_write_reg(mode, regval & ~SPMODE_ENABLE);
-                       mpc83xx_spi_write_reg(mode, regval);
+                       mpc8xxx_spi_write_reg(mode, regval & ~SPMODE_ENABLE);
+                       mpc8xxx_spi_write_reg(mode, regval);
                        local_irq_restore(flags);
                }
                if (pdata->cs_control)
@@ -196,15 +195,15 @@ static void mpc83xx_spi_chipselect(struct spi_device *spi, int value)
 }
 
 static
-int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
+int mpc8xxx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
 {
-       struct mpc83xx_spi *mpc83xx_spi;
+       struct mpc8xxx_spi *mpc8xxx_spi;
        u32 regval;
        u8 bits_per_word, pm;
        u32 hz;
-       struct spi_mpc83xx_cs   *cs = spi->controller_state;
+       struct spi_mpc8xxx_cs   *cs = spi->controller_state;
 
-       mpc83xx_spi = spi_master_get_devdata(spi->master);
+       mpc8xxx_spi = spi_master_get_devdata(spi->master);
 
        if (t) {
                bits_per_word = t->bits_per_word;
@@ -229,26 +228,26 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
        cs->rx_shift = 0;
        cs->tx_shift = 0;
        if (bits_per_word <= 8) {
-               cs->get_rx = mpc83xx_spi_rx_buf_u8;
-               cs->get_tx = mpc83xx_spi_tx_buf_u8;
-               if (mpc83xx_spi->qe_mode) {
+               cs->get_rx = mpc8xxx_spi_rx_buf_u8;
+               cs->get_tx = mpc8xxx_spi_tx_buf_u8;
+               if (mpc8xxx_spi->qe_mode) {
                        cs->rx_shift = 16;
                        cs->tx_shift = 24;
                }
        } else if (bits_per_word <= 16) {
-               cs->get_rx = mpc83xx_spi_rx_buf_u16;
-               cs->get_tx = mpc83xx_spi_tx_buf_u16;
-               if (mpc83xx_spi->qe_mode) {
+               cs->get_rx = mpc8xxx_spi_rx_buf_u16;
+               cs->get_tx = mpc8xxx_spi_tx_buf_u16;
+               if (mpc8xxx_spi->qe_mode) {
                        cs->rx_shift = 16;
                        cs->tx_shift = 16;
                }
        } else if (bits_per_word <= 32) {
-               cs->get_rx = mpc83xx_spi_rx_buf_u32;
-               cs->get_tx = mpc83xx_spi_tx_buf_u32;
+               cs->get_rx = mpc8xxx_spi_rx_buf_u32;
+               cs->get_tx = mpc8xxx_spi_tx_buf_u32;
        } else
                return -EINVAL;
 
-       if (mpc83xx_spi->qe_mode && spi->mode & SPI_LSB_FIRST) {
+       if (mpc8xxx_spi->qe_mode && spi->mode & SPI_LSB_FIRST) {
                cs->tx_shift = 0;
                if (bits_per_word <= 8)
                        cs->rx_shift = 8;
@@ -256,10 +255,10 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
                        cs->rx_shift = 0;
        }
 
-       mpc83xx_spi->rx_shift = cs->rx_shift;
-       mpc83xx_spi->tx_shift = cs->tx_shift;
-       mpc83xx_spi->get_rx = cs->get_rx;
-       mpc83xx_spi->get_tx = cs->get_tx;
+       mpc8xxx_spi->rx_shift = cs->rx_shift;
+       mpc8xxx_spi->tx_shift = cs->tx_shift;
+       mpc8xxx_spi->get_rx = cs->get_rx;
+       mpc8xxx_spi->get_tx = cs->get_tx;
 
        if (bits_per_word == 32)
                bits_per_word = 0;
@@ -272,25 +271,25 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
 
        cs->hw_mode |= SPMODE_LEN(bits_per_word);
 
-       if ((mpc83xx_spi->spibrg / hz) > 64) {
+       if ((mpc8xxx_spi->spibrg / hz) > 64) {
                cs->hw_mode |= SPMODE_DIV16;
-               pm = mpc83xx_spi->spibrg / (hz * 64);
-               if (pm > 16) {
-                       dev_err(&spi->dev, "Requested speed is too "
-                               "low: %d Hz. Will use %d Hz instead.\n",
-                               hz, mpc83xx_spi->spibrg / 1024);
+               pm = mpc8xxx_spi->spibrg / (hz * 64);
+
+               WARN_ONCE(pm > 16, "%s: Requested speed is too low: %d Hz. "
+                         "Will use %d Hz instead.\n", dev_name(&spi->dev),
+                         hz, mpc8xxx_spi->spibrg / 1024);
+               if (pm > 16)
                        pm = 16;
-               }
        } else
-               pm = mpc83xx_spi->spibrg / (hz * 4);
+               pm = mpc8xxx_spi->spibrg / (hz * 4);
        if (pm)
                pm--;
 
        cs->hw_mode |= SPMODE_PM(pm);
-       regval =  mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
+       regval =  mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->mode);
        if (cs->hw_mode != regval) {
                unsigned long flags;
-               __be32 __iomem *mode = &mpc83xx_spi->base->mode;
+               __be32 __iomem *mode = &mpc8xxx_spi->base->mode;
 
                regval = cs->hw_mode;
                /* Turn off IRQs locally to minimize time
@@ -298,22 +297,22 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
                 */
                local_irq_save(flags);
                /* Turn off SPI unit prior changing mode */
-               mpc83xx_spi_write_reg(mode, regval & ~SPMODE_ENABLE);
-               mpc83xx_spi_write_reg(mode, regval);
+               mpc8xxx_spi_write_reg(mode, regval & ~SPMODE_ENABLE);
+               mpc8xxx_spi_write_reg(mode, regval);
                local_irq_restore(flags);
        }
        return 0;
 }
 
-static int mpc83xx_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
+static int mpc8xxx_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
 {
-       struct mpc83xx_spi *mpc83xx_spi;
+       struct mpc8xxx_spi *mpc8xxx_spi;
        u32 word, len, bits_per_word;
 
-       mpc83xx_spi = spi_master_get_devdata(spi->master);
+       mpc8xxx_spi = spi_master_get_devdata(spi->master);
 
-       mpc83xx_spi->tx = t->tx_buf;
-       mpc83xx_spi->rx = t->rx_buf;
+       mpc8xxx_spi->tx = t->tx_buf;
+       mpc8xxx_spi->rx = t->rx_buf;
        bits_per_word = spi->bits_per_word;
        if (t->bits_per_word)
                bits_per_word = t->bits_per_word;
@@ -330,101 +329,106 @@ static int mpc83xx_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
                        return -EINVAL;
                len /= 2;
        }
-       mpc83xx_spi->count = len;
+       mpc8xxx_spi->count = len;
 
-       INIT_COMPLETION(mpc83xx_spi->done);
+       INIT_COMPLETION(mpc8xxx_spi->done);
 
        /* enable rx ints */
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, SPIM_NE);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->mask, SPIM_NE);
 
        /* transmit word */
-       word = mpc83xx_spi->get_tx(mpc83xx_spi);
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word);
+       word = mpc8xxx_spi->get_tx(mpc8xxx_spi);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->transmit, word);
 
-       wait_for_completion(&mpc83xx_spi->done);
+       wait_for_completion(&mpc8xxx_spi->done);
 
        /* disable rx ints */
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, 0);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->mask, 0);
 
-       return mpc83xx_spi->count;
+       return mpc8xxx_spi->count;
 }
 
-static void mpc83xx_spi_work(struct work_struct *work)
+static void mpc8xxx_spi_do_one_msg(struct spi_message *m)
 {
-       struct mpc83xx_spi *mpc83xx_spi =
-               container_of(work, struct mpc83xx_spi, work);
-
-       spin_lock_irq(&mpc83xx_spi->lock);
-       mpc83xx_spi->busy = 1;
-       while (!list_empty(&mpc83xx_spi->queue)) {
-               struct spi_message *m;
-               struct spi_device *spi;
-               struct spi_transfer *t = NULL;
-               unsigned cs_change;
-               int status, nsecs = 50;
-
-               m = container_of(mpc83xx_spi->queue.next,
-                               struct spi_message, queue);
-               list_del_init(&m->queue);
-               spin_unlock_irq(&mpc83xx_spi->lock);
-
-               spi = m->spi;
-               cs_change = 1;
-               status = 0;
-               list_for_each_entry(t, &m->transfers, transfer_list) {
-                       if (t->bits_per_word || t->speed_hz) {
-                               /* Don't allow changes if CS is active */
-                               status = -EINVAL;
-
-                               if (cs_change)
-                                       status = mpc83xx_spi_setup_transfer(spi, t);
-                               if (status < 0)
-                                       break;
-                       }
+       struct spi_device *spi = m->spi;
+       struct spi_transfer *t;
+       unsigned int cs_change;
+       const int nsecs = 50;
+       int status;
+
+       cs_change = 1;
+       status = 0;
+       list_for_each_entry(t, &m->transfers, transfer_list) {
+               if (t->bits_per_word || t->speed_hz) {
+                       /* Don't allow changes if CS is active */
+                       status = -EINVAL;
 
                        if (cs_change)
-                               mpc83xx_spi_chipselect(spi, BITBANG_CS_ACTIVE);
-                       cs_change = t->cs_change;
-                       if (t->len)
-                               status = mpc83xx_spi_bufs(spi, t);
-                       if (status) {
-                               status = -EMSGSIZE;
+                               status = mpc8xxx_spi_setup_transfer(spi, t);
+                       if (status < 0)
                                break;
-                       }
-                       m->actual_length += t->len;
-
-                       if (t->delay_usecs)
-                               udelay(t->delay_usecs);
+               }
 
-                       if (cs_change) {
-                               ndelay(nsecs);
-                               mpc83xx_spi_chipselect(spi, BITBANG_CS_INACTIVE);
-                               ndelay(nsecs);
-                       }
+               if (cs_change) {
+                       mpc8xxx_spi_chipselect(spi, BITBANG_CS_ACTIVE);
+                       ndelay(nsecs);
+               }
+               cs_change = t->cs_change;
+               if (t->len)
+                       status = mpc8xxx_spi_bufs(spi, t);
+               if (status) {
+                       status = -EMSGSIZE;
+                       break;
                }
+               m->actual_length += t->len;
 
-               m->status = status;
-               m->complete(m->context);
+               if (t->delay_usecs)
+                       udelay(t->delay_usecs);
 
-               if (status || !cs_change) {
+               if (cs_change) {
+                       ndelay(nsecs);
+                       mpc8xxx_spi_chipselect(spi, BITBANG_CS_INACTIVE);
                        ndelay(nsecs);
-                       mpc83xx_spi_chipselect(spi, BITBANG_CS_INACTIVE);
                }
+       }
 
-               mpc83xx_spi_setup_transfer(spi, NULL);
+       m->status = status;
+       m->complete(m->context);
 
-               spin_lock_irq(&mpc83xx_spi->lock);
+       if (status || !cs_change) {
+               ndelay(nsecs);
+               mpc8xxx_spi_chipselect(spi, BITBANG_CS_INACTIVE);
        }
-       mpc83xx_spi->busy = 0;
-       spin_unlock_irq(&mpc83xx_spi->lock);
+
+       mpc8xxx_spi_setup_transfer(spi, NULL);
 }
 
-static int mpc83xx_spi_setup(struct spi_device *spi)
+static void mpc8xxx_spi_work(struct work_struct *work)
 {
-       struct mpc83xx_spi *mpc83xx_spi;
+       struct mpc8xxx_spi *mpc8xxx_spi = container_of(work, struct mpc8xxx_spi,
+                                                      work);
+
+       spin_lock_irq(&mpc8xxx_spi->lock);
+       while (!list_empty(&mpc8xxx_spi->queue)) {
+               struct spi_message *m = container_of(mpc8xxx_spi->queue.next,
+                                                  struct spi_message, queue);
+
+               list_del_init(&m->queue);
+               spin_unlock_irq(&mpc8xxx_spi->lock);
+
+               mpc8xxx_spi_do_one_msg(m);
+
+               spin_lock_irq(&mpc8xxx_spi->lock);
+       }
+       spin_unlock_irq(&mpc8xxx_spi->lock);
+}
+
+static int mpc8xxx_spi_setup(struct spi_device *spi)
+{
+       struct mpc8xxx_spi *mpc8xxx_spi;
        int retval;
        u32 hw_mode;
-       struct spi_mpc83xx_cs   *cs = spi->controller_state;
+       struct spi_mpc8xxx_cs   *cs = spi->controller_state;
 
        if (!spi->max_speed_hz)
                return -EINVAL;
@@ -435,10 +439,10 @@ static int mpc83xx_spi_setup(struct spi_device *spi)
                        return -ENOMEM;
                spi->controller_state = cs;
        }
-       mpc83xx_spi = spi_master_get_devdata(spi->master);
+       mpc8xxx_spi = spi_master_get_devdata(spi->master);
 
        hw_mode = cs->hw_mode; /* Save orginal settings */
-       cs->hw_mode = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode);
+       cs->hw_mode = mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->mode);
        /* mask out bits we are going to set */
        cs->hw_mode &= ~(SPMODE_CP_BEGIN_EDGECLK | SPMODE_CI_INACTIVEHIGH
                         | SPMODE_REV | SPMODE_LOOP);
@@ -452,42 +456,29 @@ static int mpc83xx_spi_setup(struct spi_device *spi)
        if (spi->mode & SPI_LOOP)
                cs->hw_mode |= SPMODE_LOOP;
 
-       retval = mpc83xx_spi_setup_transfer(spi, NULL);
+       retval = mpc8xxx_spi_setup_transfer(spi, NULL);
        if (retval < 0) {
                cs->hw_mode = hw_mode; /* Restore settings */
                return retval;
        }
-
-#if 0 /* Don't think this is needed */
-       /* NOTE we _need_ to call chipselect() early, ideally with adapter
-        * setup, unless the hardware defaults cooperate to avoid confusion
-        * between normal (active low) and inverted chipselects.
-        */
-
-       /* deselect chip (low or high) */
-       spin_lock(&mpc83xx_spi->lock);
-       if (!mpc83xx_spi->busy)
-               mpc83xx_spi_chipselect(spi, BITBANG_CS_INACTIVE);
-       spin_unlock(&mpc83xx_spi->lock);
-#endif
        return 0;
 }
 
-static irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
+static irqreturn_t mpc8xxx_spi_irq(s32 irq, void *context_data)
 {
-       struct mpc83xx_spi *mpc83xx_spi = context_data;
+       struct mpc8xxx_spi *mpc8xxx_spi = context_data;
        u32 event;
        irqreturn_t ret = IRQ_NONE;
 
        /* Get interrupt events(tx/rx) */
-       event = mpc83xx_spi_read_reg(&mpc83xx_spi->base->event);
+       event = mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->event);
 
        /* We need handle RX first */
        if (event & SPIE_NE) {
-               u32 rx_data = mpc83xx_spi_read_reg(&mpc83xx_spi->base->receive);
+               u32 rx_data = mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->receive);
 
-               if (mpc83xx_spi->rx)
-                       mpc83xx_spi->get_rx(rx_data, mpc83xx_spi);
+               if (mpc8xxx_spi->rx)
+                       mpc8xxx_spi->get_rx(rx_data, mpc8xxx_spi);
 
                ret = IRQ_HANDLED;
        }
@@ -495,56 +486,56 @@ static irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data)
        if ((event & SPIE_NF) == 0)
                /* spin until TX is done */
                while (((event =
-                        mpc83xx_spi_read_reg(&mpc83xx_spi->base->event)) &
+                        mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->event)) &
                                                SPIE_NF) == 0)
-                        cpu_relax();
+                       cpu_relax();
 
-       mpc83xx_spi->count -= 1;
-       if (mpc83xx_spi->count) {
-               u32 word = mpc83xx_spi->get_tx(mpc83xx_spi);
-               mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word);
+       mpc8xxx_spi->count -= 1;
+       if (mpc8xxx_spi->count) {
+               u32 word = mpc8xxx_spi->get_tx(mpc8xxx_spi);
+               mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->transmit, word);
        } else {
-               complete(&mpc83xx_spi->done);
+               complete(&mpc8xxx_spi->done);
        }
 
        /* Clear the events */
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->event, event);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->event, event);
 
        return ret;
 }
-static int mpc83xx_spi_transfer(struct spi_device *spi,
+static int mpc8xxx_spi_transfer(struct spi_device *spi,
                                struct spi_message *m)
 {
-       struct mpc83xx_spi *mpc83xx_spi = spi_master_get_devdata(spi->master);
+       struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
        unsigned long flags;
 
        m->actual_length = 0;
        m->status = -EINPROGRESS;
 
-       spin_lock_irqsave(&mpc83xx_spi->lock, flags);
-       list_add_tail(&m->queue, &mpc83xx_spi->queue);
-       queue_work(mpc83xx_spi->workqueue, &mpc83xx_spi->work);
-       spin_unlock_irqrestore(&mpc83xx_spi->lock, flags);
+       spin_lock_irqsave(&mpc8xxx_spi->lock, flags);
+       list_add_tail(&m->queue, &mpc8xxx_spi->queue);
+       queue_work(mpc8xxx_spi->workqueue, &mpc8xxx_spi->work);
+       spin_unlock_irqrestore(&mpc8xxx_spi->lock, flags);
 
        return 0;
 }
 
 
-static void mpc83xx_spi_cleanup(struct spi_device *spi)
+static void mpc8xxx_spi_cleanup(struct spi_device *spi)
 {
        kfree(spi->controller_state);
 }
 
 static struct spi_master * __devinit
-mpc83xx_spi_probe(struct device *dev, struct resource *mem, unsigned int irq)
+mpc8xxx_spi_probe(struct device *dev, struct resource *mem, unsigned int irq)
 {
        struct fsl_spi_platform_data *pdata = dev->platform_data;
        struct spi_master *master;
-       struct mpc83xx_spi *mpc83xx_spi;
+       struct mpc8xxx_spi *mpc8xxx_spi;
        u32 regval;
        int ret = 0;
 
-       master = spi_alloc_master(dev, sizeof(struct mpc83xx_spi));
+       master = spi_alloc_master(dev, sizeof(struct mpc8xxx_spi));
        if (master == NULL) {
                ret = -ENOMEM;
                goto err;
@@ -556,36 +547,36 @@ mpc83xx_spi_probe(struct device *dev, struct resource *mem, unsigned int irq)
        master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH
                        | SPI_LSB_FIRST | SPI_LOOP;
 
-       master->setup = mpc83xx_spi_setup;
-       master->transfer = mpc83xx_spi_transfer;
-       master->cleanup = mpc83xx_spi_cleanup;
-
-       mpc83xx_spi = spi_master_get_devdata(master);
-       mpc83xx_spi->qe_mode = pdata->qe_mode;
-       mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8;
-       mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8;
-       mpc83xx_spi->spibrg = pdata->sysclk;
-
-       mpc83xx_spi->rx_shift = 0;
-       mpc83xx_spi->tx_shift = 0;
-       if (mpc83xx_spi->qe_mode) {
-               mpc83xx_spi->rx_shift = 16;
-               mpc83xx_spi->tx_shift = 24;
+       master->setup = mpc8xxx_spi_setup;
+       master->transfer = mpc8xxx_spi_transfer;
+       master->cleanup = mpc8xxx_spi_cleanup;
+
+       mpc8xxx_spi = spi_master_get_devdata(master);
+       mpc8xxx_spi->qe_mode = pdata->qe_mode;
+       mpc8xxx_spi->get_rx = mpc8xxx_spi_rx_buf_u8;
+       mpc8xxx_spi->get_tx = mpc8xxx_spi_tx_buf_u8;
+       mpc8xxx_spi->spibrg = pdata->sysclk;
+
+       mpc8xxx_spi->rx_shift = 0;
+       mpc8xxx_spi->tx_shift = 0;
+       if (mpc8xxx_spi->qe_mode) {
+               mpc8xxx_spi->rx_shift = 16;
+               mpc8xxx_spi->tx_shift = 24;
        }
 
-       init_completion(&mpc83xx_spi->done);
+       init_completion(&mpc8xxx_spi->done);
 
-       mpc83xx_spi->base = ioremap(mem->start, mem->end - mem->start + 1);
-       if (mpc83xx_spi->base == NULL) {
+       mpc8xxx_spi->base = ioremap(mem->start, mem->end - mem->start + 1);
+       if (mpc8xxx_spi->base == NULL) {
                ret = -ENOMEM;
                goto put_master;
        }
 
-       mpc83xx_spi->irq = irq;
+       mpc8xxx_spi->irq = irq;
 
        /* Register for SPI Interrupt */
-       ret = request_irq(mpc83xx_spi->irq, mpc83xx_spi_irq,
-                         0, "mpc83xx_spi", mpc83xx_spi);
+       ret = request_irq(mpc8xxx_spi->irq, mpc8xxx_spi_irq,
+                         0, "mpc8xxx_spi", mpc8xxx_spi);
 
        if (ret != 0)
                goto unmap_io;
@@ -594,25 +585,25 @@ mpc83xx_spi_probe(struct device *dev, struct resource *mem, unsigned int irq)
        master->num_chipselect = pdata->max_chipselect;
 
        /* SPI controller initializations */
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, 0);
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, 0);
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->command, 0);
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->event, 0xffffffff);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->mode, 0);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->mask, 0);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->command, 0);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->event, 0xffffffff);
 
        /* Enable SPI interface */
        regval = pdata->initial_spmode | SPMODE_INIT_VAL | SPMODE_ENABLE;
        if (pdata->qe_mode)
                regval |= SPMODE_OP;
 
-       mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval);
-       spin_lock_init(&mpc83xx_spi->lock);
-       init_completion(&mpc83xx_spi->done);
-       INIT_WORK(&mpc83xx_spi->work, mpc83xx_spi_work);
-       INIT_LIST_HEAD(&mpc83xx_spi->queue);
+       mpc8xxx_spi_write_reg(&mpc8xxx_spi->base->mode, regval);
+       spin_lock_init(&mpc8xxx_spi->lock);
+       init_completion(&mpc8xxx_spi->done);
+       INIT_WORK(&mpc8xxx_spi->work, mpc8xxx_spi_work);
+       INIT_LIST_HEAD(&mpc8xxx_spi->queue);
 
-       mpc83xx_spi->workqueue = create_singlethread_workqueue(
+       mpc8xxx_spi->workqueue = create_singlethread_workqueue(
                dev_name(master->dev.parent));
-       if (mpc83xx_spi->workqueue == NULL) {
+       if (mpc8xxx_spi->workqueue == NULL) {
                ret = -EBUSY;
                goto free_irq;
        }
@@ -622,57 +613,57 @@ mpc83xx_spi_probe(struct device *dev, struct resource *mem, unsigned int irq)
                goto unreg_master;
 
        printk(KERN_INFO
-              "%s: MPC83xx SPI Controller driver at 0x%p (irq = %d)\n",
-              dev_name(dev), mpc83xx_spi->base, mpc83xx_spi->irq);
+              "%s: MPC8xxx SPI Controller driver at 0x%p (irq = %d)\n",
+              dev_name(dev), mpc8xxx_spi->base, mpc8xxx_spi->irq);
 
        return master;
 
 unreg_master:
-       destroy_workqueue(mpc83xx_spi->workqueue);
+       destroy_workqueue(mpc8xxx_spi->workqueue);
 free_irq:
-       free_irq(mpc83xx_spi->irq, mpc83xx_spi);
+       free_irq(mpc8xxx_spi->irq, mpc8xxx_spi);
 unmap_io:
-       iounmap(mpc83xx_spi->base);
+       iounmap(mpc8xxx_spi->base);
 put_master:
        spi_master_put(master);
 err:
        return ERR_PTR(ret);
 }
 
-static int __devexit mpc83xx_spi_remove(struct device *dev)
+static int __devexit mpc8xxx_spi_remove(struct device *dev)
 {
-       struct mpc83xx_spi *mpc83xx_spi;
+       struct mpc8xxx_spi *mpc8xxx_spi;
        struct spi_master *master;
 
        master = dev_get_drvdata(dev);
-       mpc83xx_spi = spi_master_get_devdata(master);
+       mpc8xxx_spi = spi_master_get_devdata(master);
 
-       flush_workqueue(mpc83xx_spi->workqueue);
-       destroy_workqueue(mpc83xx_spi->workqueue);
+       flush_workqueue(mpc8xxx_spi->workqueue);
+       destroy_workqueue(mpc8xxx_spi->workqueue);
        spi_unregister_master(master);
 
-       free_irq(mpc83xx_spi->irq, mpc83xx_spi);
-       iounmap(mpc83xx_spi->base);
+       free_irq(mpc8xxx_spi->irq, mpc8xxx_spi);
+       iounmap(mpc8xxx_spi->base);
 
        return 0;
 }
 
-struct mpc83xx_spi_probe_info {
+struct mpc8xxx_spi_probe_info {
        struct fsl_spi_platform_data pdata;
        int *gpios;
        bool *alow_flags;
 };
 
-static struct mpc83xx_spi_probe_info *
+static struct mpc8xxx_spi_probe_info *
 to_of_pinfo(struct fsl_spi_platform_data *pdata)
 {
-       return container_of(pdata, struct mpc83xx_spi_probe_info, pdata);
+       return container_of(pdata, struct mpc8xxx_spi_probe_info, pdata);
 }
 
-static void mpc83xx_spi_cs_control(struct spi_device *spi, bool on)
+static void mpc8xxx_spi_cs_control(struct spi_device *spi, bool on)
 {
        struct device *dev = spi->dev.parent;
-       struct mpc83xx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data);
+       struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(dev->platform_data);
        u16 cs = spi->chip_select;
        int gpio = pinfo->gpios[cs];
        bool alow = pinfo->alow_flags[cs];
@@ -680,11 +671,11 @@ static void mpc83xx_spi_cs_control(struct spi_device *spi, bool on)
        gpio_set_value(gpio, on ^ alow);
 }
 
-static int of_mpc83xx_spi_get_chipselects(struct device *dev)
+static int of_mpc8xxx_spi_get_chipselects(struct device *dev)
 {
        struct device_node *np = dev_archdata_get_node(&dev->archdata);
        struct fsl_spi_platform_data *pdata = dev->platform_data;
-       struct mpc83xx_spi_probe_info *pinfo = to_of_pinfo(pdata);
+       struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
        unsigned int ngpios;
        int i = 0;
        int ret;
@@ -740,7 +731,7 @@ static int of_mpc83xx_spi_get_chipselects(struct device *dev)
        }
 
        pdata->max_chipselect = ngpios;
-       pdata->cs_control = mpc83xx_spi_cs_control;
+       pdata->cs_control = mpc8xxx_spi_cs_control;
 
        return 0;
 
@@ -759,10 +750,10 @@ err_alloc_flags:
        return ret;
 }
 
-static int of_mpc83xx_spi_free_chipselects(struct device *dev)
+static int of_mpc8xxx_spi_free_chipselects(struct device *dev)
 {
        struct fsl_spi_platform_data *pdata = dev->platform_data;
-       struct mpc83xx_spi_probe_info *pinfo = to_of_pinfo(pdata);
+       struct mpc8xxx_spi_probe_info *pinfo = to_of_pinfo(pdata);
        int i;
 
        if (!pinfo->gpios)
@@ -778,12 +769,12 @@ static int of_mpc83xx_spi_free_chipselects(struct device *dev)
        return 0;
 }
 
-static int __devinit of_mpc83xx_spi_probe(struct of_device *ofdev,
+static int __devinit of_mpc8xxx_spi_probe(struct of_device *ofdev,
                                          const struct of_device_id *ofid)
 {
        struct device *dev = &ofdev->dev;
        struct device_node *np = ofdev->node;
-       struct mpc83xx_spi_probe_info *pinfo;
+       struct mpc8xxx_spi_probe_info *pinfo;
        struct fsl_spi_platform_data *pdata;
        struct spi_master *master;
        struct resource mem;
@@ -815,7 +806,7 @@ static int __devinit of_mpc83xx_spi_probe(struct of_device *ofdev,
        if (prop && !strcmp(prop, "cpu-qe"))
                pdata->qe_mode = 1;
 
-       ret = of_mpc83xx_spi_get_chipselects(dev);
+       ret = of_mpc8xxx_spi_get_chipselects(dev);
        if (ret)
                goto err;
 
@@ -829,7 +820,7 @@ static int __devinit of_mpc83xx_spi_probe(struct of_device *ofdev,
                goto err;
        }
 
-       master = mpc83xx_spi_probe(dev, &mem, irq.start);
+       master = mpc8xxx_spi_probe(dev, &mem, irq.start);
        if (IS_ERR(master)) {
                ret = PTR_ERR(master);
                goto err;
@@ -840,34 +831,34 @@ static int __devinit of_mpc83xx_spi_probe(struct of_device *ofdev,
        return 0;
 
 err:
-       of_mpc83xx_spi_free_chipselects(dev);
+       of_mpc8xxx_spi_free_chipselects(dev);
 err_clk:
        kfree(pinfo);
        return ret;
 }
 
-static int __devexit of_mpc83xx_spi_remove(struct of_device *ofdev)
+static int __devexit of_mpc8xxx_spi_remove(struct of_device *ofdev)
 {
        int ret;
 
-       ret = mpc83xx_spi_remove(&ofdev->dev);
+       ret = mpc8xxx_spi_remove(&ofdev->dev);
        if (ret)
                return ret;
-       of_mpc83xx_spi_free_chipselects(&ofdev->dev);
+       of_mpc8xxx_spi_free_chipselects(&ofdev->dev);
        return 0;
 }
 
-static const struct of_device_id of_mpc83xx_spi_match[] = {
+static const struct of_device_id of_mpc8xxx_spi_match[] = {
        { .compatible = "fsl,spi" },
        {},
 };
-MODULE_DEVICE_TABLE(of, of_mpc83xx_spi_match);
+MODULE_DEVICE_TABLE(of, of_mpc8xxx_spi_match);
 
-static struct of_platform_driver of_mpc83xx_spi_driver = {
-       .name           = "mpc83xx_spi",
-       .match_table    = of_mpc83xx_spi_match,
-       .probe          = of_mpc83xx_spi_probe,
-       .remove         = __devexit_p(of_mpc83xx_spi_remove),
+static struct of_platform_driver of_mpc8xxx_spi_driver = {
+       .name           = "mpc8xxx_spi",
+       .match_table    = of_mpc8xxx_spi_match,
+       .probe          = of_mpc8xxx_spi_probe,
+       .remove         = __devexit_p(of_mpc8xxx_spi_remove),
 };
 
 #ifdef CONFIG_MPC832x_RDB
@@ -878,7 +869,7 @@ static struct of_platform_driver of_mpc83xx_spi_driver = {
  * tree can work with OpenFirmware driver. But for now we support old trees
  * as well.
  */
-static int __devinit plat_mpc83xx_spi_probe(struct platform_device *pdev)
+static int __devinit plat_mpc8xxx_spi_probe(struct platform_device *pdev)
 {
        struct resource *mem;
        unsigned int irq;
@@ -895,23 +886,23 @@ static int __devinit plat_mpc83xx_spi_probe(struct platform_device *pdev)
        if (!irq)
                return -EINVAL;
 
-       master = mpc83xx_spi_probe(&pdev->dev, mem, irq);
+       master = mpc8xxx_spi_probe(&pdev->dev, mem, irq);
        if (IS_ERR(master))
                return PTR_ERR(master);
        return 0;
 }
 
-static int __devexit plat_mpc83xx_spi_remove(struct platform_device *pdev)
+static int __devexit plat_mpc8xxx_spi_remove(struct platform_device *pdev)
 {
-       return mpc83xx_spi_remove(&pdev->dev);
+       return mpc8xxx_spi_remove(&pdev->dev);
 }
 
-MODULE_ALIAS("platform:mpc83xx_spi");
-static struct platform_driver mpc83xx_spi_driver = {
-       .probe = plat_mpc83xx_spi_probe,
-       .remove = __exit_p(plat_mpc83xx_spi_remove),
+MODULE_ALIAS("platform:mpc8xxx_spi");
+static struct platform_driver mpc8xxx_spi_driver = {
+       .probe = plat_mpc8xxx_spi_probe,
+       .remove = __exit_p(plat_mpc8xxx_spi_remove),
        .driver = {
-               .name = "mpc83xx_spi",
+               .name = "mpc8xxx_spi",
                .owner = THIS_MODULE,
        },
 };
@@ -920,35 +911,35 @@ static bool legacy_driver_failed;
 
 static void __init legacy_driver_register(void)
 {
-       legacy_driver_failed = platform_driver_register(&mpc83xx_spi_driver);
+       legacy_driver_failed = platform_driver_register(&mpc8xxx_spi_driver);
 }
 
 static void __exit legacy_driver_unregister(void)
 {
        if (legacy_driver_failed)
                return;
-       platform_driver_unregister(&mpc83xx_spi_driver);
+       platform_driver_unregister(&mpc8xxx_spi_driver);
 }
 #else
 static void __init legacy_driver_register(void) {}
 static void __exit legacy_driver_unregister(void) {}
 #endif /* CONFIG_MPC832x_RDB */
 
-static int __init mpc83xx_spi_init(void)
+static int __init mpc8xxx_spi_init(void)
 {
        legacy_driver_register();
-       return of_register_platform_driver(&of_mpc83xx_spi_driver);
+       return of_register_platform_driver(&of_mpc8xxx_spi_driver);
 }
 
-static void __exit mpc83xx_spi_exit(void)
+static void __exit mpc8xxx_spi_exit(void)
 {
-       of_unregister_platform_driver(&of_mpc83xx_spi_driver);
+       of_unregister_platform_driver(&of_mpc8xxx_spi_driver);
        legacy_driver_unregister();
 }
 
-module_init(mpc83xx_spi_init);
-module_exit(mpc83xx_spi_exit);
+module_init(mpc8xxx_spi_init);
+module_exit(mpc8xxx_spi_exit);
 
 MODULE_AUTHOR("Kumar Gala");
-MODULE_DESCRIPTION("Simple MPC83xx SPI Driver");
+MODULE_DESCRIPTION("Simple MPC8xxx SPI Driver");
 MODULE_LICENSE("GPL");
index 932ffdbf86d98b542d3efe05087903926584a86d..d6d65ef85f541b3cdb49ad45bfaa0430c4cbeba4 100644 (file)
@@ -1122,12 +1122,14 @@ config FB_INTEL
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
-       select FB_BOOT_VESA_SUPPORT
+       select FB_BOOT_VESA_SUPPORT if FB_INTEL = y
        help
          This driver supports the on-board graphics built in to the Intel
           830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets.
           Say Y if you have and plan to use such a board.
 
+         To make FB_INTELFB=Y work you need to say AGP_INTEL=y too.
+
          To compile this driver as a module, choose M here: the
          module will be called intelfb.
 
@@ -1460,7 +1462,7 @@ config FB_SIS
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
-       select FB_BOOT_VESA_SUPPORT
+       select FB_BOOT_VESA_SUPPORT if FB_SIS = y
        help
          This is the frame buffer device driver for the SiS 300, 315, 330
          and 340 series as well as XGI V3XT, V5, V8, Z7 graphics chipsets.
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h
new file mode 100644 (file)
index 0000000..b4fbd98
--- /dev/null
@@ -0,0 +1,15 @@
+/* platform data for the PL061 GPIO driver */
+
+struct pl061_platform_data {
+       /* number of the first GPIO */
+       unsigned        gpio_base;
+
+       /* number of the first IRQ.
+        * If the IRQ functionality in not desired this must be set to
+        * (unsigned) -1.
+        */
+       unsigned        irq_base;
+
+       u8              directions;     /* startup directions, 1: out, 0: in */
+       u8              values;         /* startup values */
+};
index 8083b6a36a384c23ba1917b965328650d09535f3..07dfd460d2862110f019465c16571eb9a73097a3 100644 (file)
@@ -63,24 +63,26 @@ struct dma_map_ops {
 
 #define DMA_BIT_MASK(n)        (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
 
+typedef u64 DMA_nnBIT_MASK __deprecated;
+
 /*
  * NOTE: do not use the below macros in new code and do not add new definitions
  * here.
  *
  * Instead, just open-code DMA_BIT_MASK(n) within your driver
  */
-#define DMA_64BIT_MASK DMA_BIT_MASK(64)
-#define DMA_48BIT_MASK DMA_BIT_MASK(48)
-#define DMA_47BIT_MASK DMA_BIT_MASK(47)
-#define DMA_40BIT_MASK DMA_BIT_MASK(40)
-#define DMA_39BIT_MASK DMA_BIT_MASK(39)
-#define DMA_35BIT_MASK DMA_BIT_MASK(35)
-#define DMA_32BIT_MASK DMA_BIT_MASK(32)
-#define DMA_31BIT_MASK DMA_BIT_MASK(31)
-#define DMA_30BIT_MASK DMA_BIT_MASK(30)
-#define DMA_29BIT_MASK DMA_BIT_MASK(29)
-#define DMA_28BIT_MASK DMA_BIT_MASK(28)
-#define DMA_24BIT_MASK DMA_BIT_MASK(24)
+#define DMA_64BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(64)
+#define DMA_48BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(48)
+#define DMA_47BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(47)
+#define DMA_40BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(40)
+#define DMA_39BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(39)
+#define DMA_35BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(35)
+#define DMA_32BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(32)
+#define DMA_31BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(31)
+#define DMA_30BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(30)
+#define DMA_29BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(29)
+#define DMA_28BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(28)
+#define DMA_24BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(24)
 
 #define DMA_MASK_NONE  0x0ULL
 
@@ -107,9 +109,20 @@ static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
 #include <asm-generic/dma-mapping-broken.h>
 #endif
 
-/* Backwards compat, remove in 2.7.x */
-#define dma_sync_single                dma_sync_single_for_cpu
-#define dma_sync_sg            dma_sync_sg_for_cpu
+/* for backwards compatibility, removed soon */
+static inline void __deprecated dma_sync_single(struct device *dev,
+                                               dma_addr_t addr, size_t size,
+                                               enum dma_data_direction dir)
+{
+       dma_sync_single_for_cpu(dev, addr, size, dir);
+}
+
+static inline void __deprecated dma_sync_sg(struct device *dev,
+                                           struct scatterlist *sg, int nelems,
+                                           enum dma_data_direction dir)
+{
+       dma_sync_sg_for_cpu(dev, sg, nelems, dir);
+}
 
 static inline u64 dma_get_mask(struct device *dev)
 {
index 13ae64001fec08774f13653f619e7b9de95cbd1d..628d41f0dd54ed163e32f2d4d2e9ec6909ccd2ab 100644 (file)
@@ -1197,8 +1197,11 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
        }
 
        traced = ptrace_reparented(p);
-
-       if (likely(!traced)) {
+       /*
+        * It can be ptraced but not reparented, check
+        * !task_detached() to filter out sub-threads.
+        */
+       if (likely(!traced) && likely(!task_detached(p))) {
                struct signal_struct *psig;
                struct signal_struct *sig;
 
index 282df0a09e6f27ffb5245daf1eac4ae71f1195c5..d2a9ce952768fbcb88f559077d9878cb15e1d03c 100644 (file)
@@ -536,11 +536,15 @@ static void * __init alloc_arch_preferred_bootmem(bootmem_data_t *bdata,
                return kzalloc(size, GFP_NOWAIT);
 
 #ifdef CONFIG_HAVE_ARCH_BOOTMEM
-       bootmem_data_t *p_bdata;
-
-       p_bdata = bootmem_arch_preferred_node(bdata, size, align, goal, limit);
-       if (p_bdata)
-               return alloc_bootmem_core(p_bdata, size, align, goal, limit);
+       {
+               bootmem_data_t *p_bdata;
+
+               p_bdata = bootmem_arch_preferred_node(bdata, size, align,
+                                                       goal, limit);
+               if (p_bdata)
+                       return alloc_bootmem_core(p_bdata, size, align,
+                                                       goal, limit);
+       }
 #endif
        return NULL;
 }
index ccf1b38c88eacebb96b7d6a2a1ed17921e66df0c..18da2ef04d097903a7ae3097e811632a1ba2774b 100644 (file)
@@ -988,7 +988,7 @@ static int __devinit snd_lx6464es_create(struct snd_card *card,
        pci_set_master(pci);
 
        /* check if we can restrict PCI DMA transfers to 32 bits */
-       err = pci_set_dma_mask(pci, DMA_32BIT_MASK);
+       err = pci_set_dma_mask(pci, DMA_BIT_MASK(32));
        if (err < 0) {
                snd_printk(KERN_ERR "architecture does not support "
                           "32bit PCI busmaster DMA\n");