]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 20 Feb 2013 19:04:46 +0000 (11:04 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 20 Feb 2013 19:04:46 +0000 (11:04 -0800)
Pull device tree changes from Grant Likely:
 "All around device tree changes destined for v3.8.  Aside from the
  documentation updates the highlights in this branch include:

   - Kbuild changes for using CPP with .dts files
   - locking fix from preempt_rt patchset
   - include DT alias names in device uevent
   - Selftest bugfixes and improvements
   - New function for counting phandles stanzas in a property
   - constify argument to of_node_full_name()
   - Various bug fixes

  This tree did also contain a commit to use platform_device_add instead
  of open-coding the device add code, but it caused problems with amba
  devices and needed to be reverted."

* tag 'dt-for-linus' of git://git.secretlab.ca/git/linux: (23 commits)
  Revert "of: use platform_device_add"
  kbuild: limit dtc+cpp include path
  gpio: Make of_count_named_gpios() use new of_count_phandle_with_args()
  of: Create function for counting number of phandles in a property
  of/base: Clean up exit paths for of_parse_phandle_with_args()
  of/selftest: Use selftest() macro throughout
  of/selftest: Fix GPIOs selftest to cover the 7th case
  of: fix recursive locking in of_get_next_available_child()
  documentation/devicetree: Fix a typo in exynos-dw-mshc.txt
  OF: convert devtree lock from rw_lock to raw spinlock
  of/exynos_g2d: Add Bindings for exynos G2D driver
  kbuild: create a rule to run the pre-processor on *.dts files
  input: Extend matrix-keypad device tree binding
  devicetree: Move NS2 LEDs binding into LEDs directory
  of: use platform_device_add
  powerpc/5200: Fix size to request_mem_region() call
  documentation/devicetree: Fix typos
  of: add 'const' to of_node_full_name parameter
  of: Output devicetree alias names in uevent
  DT: add vendor prefixes for Renesas and Toshiba
  ...

1  2 
Documentation/devicetree/bindings/vendor-prefixes.txt
drivers/gpio/gpiolib-of.c
drivers/spi/spi-ppc4xx.c
drivers/spi/spi.c

index 15321373ec8d4113acfba3f4917aa30fe96bb53b,4519dff3f506d096669cbec0a55ac142e3ec103f..19e1ef73ab0d9f464d58373d175c38d56fa97aa6
@@@ -14,6 -14,7 +14,7 @@@ bosch Bosch Sensortec Gmb
  brcm  Broadcom Corporation
  cavium        Cavium, Inc.
  chrp  Common Hardware Reference Platform
+ cirrus        Cirrus Logic, Inc.
  cortina       Cortina Systems, Inc.
  dallas        Maxim Integrated Products (formerly Dallas Semiconductor)
  denx  Denx Software Engineering
@@@ -42,6 -43,7 +43,7 @@@ powervr       PowerVR (deprecated, use img
  qcom  Qualcomm, Inc.
  ramtron       Ramtron International
  realtek Realtek Semiconductor Corp.
+ renesas       Renesas Electronics Corporation
  samsung       Samsung Semiconductor
  sbs   Smart Battery System
  schindler     Schindler
@@@ -50,9 -52,9 +52,10 @@@ simte
  sirf  SiRF Technology, Inc.
  snps  Synopsys, Inc.
  st    STMicroelectronics
 +ste   ST-Ericsson
  stericsson    ST-Ericsson
  ti    Texas Instruments
+ toshiba       Toshiba Corporation
  via   VIA Technologies, Inc.
  wlf   Wolfson Microelectronics
  wm    Wondermedia Technologies, Inc.
index 25b1dbe8921d62705c3e76d10d5bb08437bb7d1b,dd8a2129222f179d3aedd14a5c9ed335764a25d7..a71a54a3e3f783a4151ed5919c01290ade8ffd5d
@@@ -88,41 -88,6 +88,6 @@@ int of_get_named_gpio_flags(struct devi
  }
  EXPORT_SYMBOL(of_get_named_gpio_flags);
  
- /**
-  * of_gpio_named_count - Count GPIOs for a device
-  * @np:               device node to count GPIOs for
-  * @propname: property name containing gpio specifier(s)
-  *
-  * The function returns the count of GPIOs specified for a node.
-  *
-  * Note that the empty GPIO specifiers counts too. For example,
-  *
-  * gpios = <0
-  *          &pio1 1 2
-  *          0
-  *          &pio2 3 4>;
-  *
-  * defines four GPIOs (so this function will return 4), two of which
-  * are not specified.
-  */
- unsigned int of_gpio_named_count(struct device_node *np, const char* propname)
- {
-       unsigned int cnt = 0;
-       do {
-               int ret;
-               ret = of_parse_phandle_with_args(np, propname, "#gpio-cells",
-                                                cnt, NULL);
-               /* A hole in the gpios = <> counts anyway. */
-               if (ret < 0 && ret != -EEXIST)
-                       break;
-       } while (++cnt);
-       return cnt;
- }
- EXPORT_SYMBOL(of_gpio_named_count);
  /**
   * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags
   * @gc:               pointer to the gpio_chip structure
@@@ -250,7 -215,7 +215,7 @@@ static void of_gpiochip_add_pin_range(s
                 * on the same GPIO chip.
                 */
                ret = gpiochip_add_pin_range(chip,
 -                                           pinctrl_dev_get_name(pctldev),
 +                                           pinctrl_dev_get_devname(pctldev),
                                             0, /* offset in gpiochip */
                                             pinspec.args[0],
                                             pinspec.args[1]);
diff --combined drivers/spi/spi-ppc4xx.c
index 424b333fab18583e13f79735c3f3211e3784c80d,af3e6e756dc931715eaeaa17b259f9035584451a..357f183a4fb7e06d813197d423acceed84e654aa
@@@ -389,7 -389,7 +389,7 @@@ static void free_gpios(struct ppc4xx_sp
  /*
   * platform_device layer stuff...
   */
 -static int __init spi_ppc4xx_of_probe(struct platform_device *op)
 +static int spi_ppc4xx_of_probe(struct platform_device *op)
  {
        struct ppc4xx_spi *hw;
        struct spi_master *master;
         * This includes both "null" gpio's and real ones.
         */
        num_gpios = of_gpio_count(np);
-       if (num_gpios) {
+       if (num_gpios > 0) {
                int i;
  
                hw->gpios = kzalloc(sizeof(int) * num_gpios, GFP_KERNEL);
                SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | SPI_LSB_FIRST;
  
        /* this many pins in all GPIO controllers */
-       bbp->master->num_chipselect = num_gpios;
+       bbp->master->num_chipselect = num_gpios > 0 ? num_gpios : 0;
  
        /* Get the clock for the OPB */
        opbnp = of_find_compatible_node(NULL, NULL, "ibm,opb");
@@@ -560,7 -560,7 +560,7 @@@ free_master
        return ret;
  }
  
 -static int __exit spi_ppc4xx_of_remove(struct platform_device *op)
 +static int spi_ppc4xx_of_remove(struct platform_device *op)
  {
        struct spi_master *master = dev_get_drvdata(&op->dev);
        struct ppc4xx_spi *hw = spi_master_get_devdata(master);
@@@ -583,7 -583,7 +583,7 @@@ MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_m
  
  static struct platform_driver spi_ppc4xx_of_driver = {
        .probe = spi_ppc4xx_of_probe,
 -      .remove = __exit_p(spi_ppc4xx_of_remove),
 +      .remove = spi_ppc4xx_of_remove,
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
diff --combined drivers/spi/spi.c
index 4fffb1f39def24d7ef6c87c2b89dd1c441ff8257,21c47482d9fddb76db9db908db6fe6d3f3d98681..6f193b02a9e835e9efa2b5a42fa86949d5053cef
@@@ -33,7 -33,7 +33,7 @@@
  #include <linux/of_gpio.h>
  #include <linux/pm_runtime.h>
  #include <linux/export.h>
 -#include <linux/sched.h>
 +#include <linux/sched/rt.h>
  #include <linux/delay.h>
  #include <linux/kthread.h>
  #include <linux/ioport.h>
@@@ -1059,15 -1059,14 +1059,14 @@@ EXPORT_SYMBOL_GPL(spi_alloc_master)
  #ifdef CONFIG_OF
  static int of_spi_register_master(struct spi_master *master)
  {
-       u16 nb;
-       int i, *cs;
+       int nb, i, *cs;
        struct device_node *np = master->dev.of_node;
  
        if (!np)
                return 0;
  
        nb = of_gpio_named_count(np, "cs-gpios");
-       master->num_chipselect = max(nb, master->num_chipselect);
+       master->num_chipselect = max(nb, (int)master->num_chipselect);
  
        if (nb < 1)
                return 0;
        if (!master->cs_gpios)
                return -ENOMEM;
  
 -      memset(cs, -EINVAL, master->num_chipselect);
 +      for (i = 0; i < master->num_chipselect; i++)
 +              cs[i] = -EINVAL;
  
        for (i = 0; i < nb; i++)
                cs[i] = of_get_named_gpio(np, "cs-gpios", i);
@@@ -1136,9 -1134,6 +1135,9 @@@ int spi_register_master(struct spi_mast
        if (master->num_chipselect == 0)
                return -EINVAL;
  
 +      if ((master->bus_num < 0) && master->dev.of_node)
 +              master->bus_num = of_alias_get_id(master->dev.of_node, "spi");
 +
        /* convention:  dynamically assigned bus IDs count down from the max */
        if (master->bus_num < 0) {
                /* FIXME switch to an IDR based scheme, something like
@@@ -1370,14 -1365,12 +1369,14 @@@ static int __spi_async(struct spi_devic
        }
  
        /**
 -       * Set transfer bits_per_word as spi device default if it is not
 -       * set for this transfer.
 +       * Set transfer bits_per_word and max speed as spi device default if
 +       * it is not set for this transfer.
         */
        list_for_each_entry(xfer, &message->transfers, transfer_list) {
                if (!xfer->bits_per_word)
                        xfer->bits_per_word = spi->bits_per_word;
 +              if (!xfer->speed_hz)
 +                      xfer->speed_hz = spi->max_speed_hz;
        }
  
        message->spi = spi;
@@@ -1662,8 -1655,7 +1661,8 @@@ int spi_write_then_read(struct spi_devi
         * using the pre-allocated buffer or the transfer is too large.
         */
        if ((n_tx + n_rx) > SPI_BUFSIZ || !mutex_trylock(&lock)) {
 -              local_buf = kmalloc(max((unsigned)SPI_BUFSIZ, n_tx + n_rx), GFP_KERNEL);
 +              local_buf = kmalloc(max((unsigned)SPI_BUFSIZ, n_tx + n_rx),
 +                                  GFP_KERNEL | GFP_DMA);
                if (!local_buf)
                        return -ENOMEM;
        } else {