]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'pinctrl-for-v3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Jul 2013 18:48:03 +0000 (11:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Jul 2013 18:48:03 +0000 (11:48 -0700)
Pull pin control changes from Linus Walleij:

 - A large slew of improvements of the Genric pin configuration support,
   and deployment in four different platforms: Rockchip, Super-H PFC,
   ABx500 and TZ1090.  Support BIAS_BUS_HOLD, get device tree parsing
   and debugfs support into shape.

 - We also have device tree support with generic naming conventions for
   the generic pin configuration.

 - Delete the unused and confusing direct pinconf API.  Now state
   transitions is *the* way to control pins and multiplexing.

 - New drivers for Rockchip, TZ1090, and TZ1090 PDC.

 - Two pin control states related to power management are now handled in
   the device core: "sleep" and "idle", removing a lot of boilerplate
   code in drivers.  We do not yet know if this is the final word for
   pin PM, but it already make things a lot easier to handle.

 - Handle sparse GPIO ranges passing a list of disparate pins, and
   utilize these in the new BayTrail (x86 Atom SoC) driver.

 - Make the sunxi (AllWinner) driver handle external interrupts.

 - Make it possible for pinctrl-single to handle the case where several
   pins are managed by a single register, and augment it to handle sleep
   modes.

 - Cleanups and improvements for the abx500 drivers.

 - Move Sirf pin control drivers to their own directory, support
   save/restore of context and add support for the SiRFatlas6 SoC.

 - PMU muxing for the Dove pinctrl driver.

 - Finalization and support for VF610 in the i.MX6 pinctrl driver.

 - Smoothen out various Exynos rough edges.

 - Generic cleanups of various kinds.

* tag 'pinctrl-for-v3.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (82 commits)
  pinctrl: vt8500: wmt: remove redundant dev_err call in wmt_pinctrl_probe()
  pinctrl: remove bindings for pinconf options needing more thought
  pinctrl: remove slew-rate parameter from tz1090
  pinctrl: set unit for debounce time pinconfig to usec
  pinctrl: more clarifications for generic pull configs
  pinctrl: rip out the direct pinconf API
  pinctrl-tz1090-pdc: add TZ1090 PDC pinctrl driver
  pinctrl-tz1090: add TZ1090 pinctrl driver
  pinctrl: samsung: Staticize drvdata_list
  pinctrl: rockchip: Add missing irq_gc_unlock() call before return error
  pinctrl: abx500: rework error path
  pinctrl: abx500: suppress hardcoded value
  pinctrl: abx500: factorize code
  pinctrl: abx500: fix abx500_gpio_get()
  pinctrl: abx500: fix abx500_pin_config_set()
  pinctrl: abx500: Add device tree support
  sh-pfc: Guard DT parsing with #ifdef CONFIG_OF
  pinctrl: add Intel BayTrail GPIO/pinctrl support
  pinctrl: fix pinconf_ops::pin_config_dbg_parse_modify kerneldoc
  pinctrl: Staticize local symbols
  ...

Conflicts:
drivers/net/ethernet/ti/davinci_mdio.c
drivers/pinctrl/Makefile

13 files changed:
1  2 
MAINTAINERS
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/davinci_mdio.c
drivers/pinctrl/Kconfig
drivers/pinctrl/Makefile
drivers/pinctrl/pinctrl-coh901.c
drivers/pinctrl/pinctrl-exynos.c
drivers/pinctrl/pinctrl-nomadik.c
drivers/pinctrl/pinctrl-samsung.c
drivers/pinctrl/pinctrl-u300.c
drivers/pinctrl/sh-pfc/core.c
drivers/spi/spi-pl022.c
drivers/tty/serial/amba-pl011.c

diff --combined MAINTAINERS
index a98219eb132a011ae3c1f2c236222f91c0ebf576,4398182d9a529d3562e1a47ec1996c2c185a5d46..ff105830de63898f92c138f5c96445a5c4263ff5
@@@ -797,7 -797,6 +797,7 @@@ F: arch/arm/mach-gemini
  ARM/CSR SIRFPRIMA2 MACHINE SUPPORT
  M:    Barry Song <baohua.song@csr.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/baohua/linux.git
  S:    Maintained
  F:    arch/arm/mach-prima2/
  F:    drivers/dma/sirf-dma.c
@@@ -1136,7 -1135,6 +1136,7 @@@ L:      linux-samsung-soc@vger.kernel.org (m
  S:    Maintained
  F:    arch/arm/mach-s5p*/
  F:    arch/arm/mach-exynos*/
 +N:    exynos
  
  ARM/SAMSUNG MOBILE MACHINE SUPPORT
  M:    Kyungmin Park <kyungmin.park@samsung.com>
@@@ -1203,15 -1201,6 +1203,15 @@@ M:    Dinh Nguyen <dinguyen@altera.com
  S:    Maintained
  F:    drivers/clk/socfpga/
  
 +ARM/STI ARCHITECTURE
 +M:    Srinivas Kandagatla <srinivas.kandagatla@st.com>
 +M:    Stuart Menefy <stuart.menefy@st.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +L:    kernel@stlinux.com
 +W:    http://www.stlinux.com
 +S:    Maintained
 +F:    arch/arm/mach-sti/
 +
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:    Lennert Buytenhek <kernel@wantstofly.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -3231,7 -3220,7 +3231,7 @@@ F:      lib/fault-inject.
  
  FCOE SUBSYSTEM (libfc, libfcoe, fcoe)
  M:    Robert Love <robert.w.love@intel.com>
 -L:    devel@open-fcoe.org
 +L:    fcoe-devel@open-fcoe.org
  W:    www.Open-FCoE.org
  S:    Supported
  F:    drivers/scsi/libfc/
@@@ -3320,15 -3309,6 +3320,15 @@@ T:    git git://git.kernel.org/pub/scm/lin
  S:    Odd fixes
  F:    drivers/block/floppy.c
  
 +FMC SUBSYSTEM
 +M:    Alessandro Rubini <rubini@gnudd.com>
 +W:    http://www.ohwr.org/projects/fmc-bus
 +S:    Supported
 +F:    drivers/fmc/
 +F:    include/linux/fmc*.h
 +F:    include/linux/ipmi-fru.h
 +K:    fmc_d.*register
 +
  FPU EMULATOR
  M:    Bill Metzenthen <billm@melbpc.org.au>
  W:    http://floatingpoint.sourceforge.net/emulator/index.html
@@@ -3587,7 -3567,6 +3587,7 @@@ GPIO SUBSYSTE
  M:    Grant Likely <grant.likely@linaro.org>
  M:    Linus Walleij <linus.walleij@linaro.org>
  S:    Maintained
 +L:    linux-gpio@vger.kernel.org
  T:    git git://git.secretlab.ca/git/linux-2.6.git
  F:    Documentation/gpio.txt
  F:    drivers/gpio/
@@@ -4598,7 -4577,7 +4598,7 @@@ F:      fs/jbd2
  F:    include/linux/jbd2.h
  
  JSM Neo PCI based serial card
 -M:    Lucas Tavares <lucaskt@linux.vnet.ibm.com>
 +M:    Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
  L:    linux-serial@vger.kernel.org
  S:    Maintained
  F:    drivers/tty/serial/jsm/
@@@ -4740,15 -4719,6 +4740,15 @@@ F:    arch/arm/include/uapi/asm/kvm
  F:    arch/arm/include/asm/kvm*
  F:    arch/arm/kvm/
  
 +KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)
 +M:    Marc Zyngier <marc.zyngier@arm.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +L:    kvmarm@lists.cs.columbia.edu
 +S:    Maintained
 +F:    arch/arm64/include/uapi/asm/kvm*
 +F:    arch/arm64/include/asm/kvm*
 +F:    arch/arm64/kvm/
 +
  KEXEC
  M:    Eric Biederman <ebiederm@xmission.com>
  W:    http://kernel.org/pub/linux/utils/kernel/kexec/
@@@ -5796,7 -5766,7 +5796,7 @@@ M:      Matthew Wilcox <willy@linux.intel.co
  L:    linux-nvme@lists.infradead.org
  T:    git git://git.infradead.org/users/willy/linux-nvme.git
  S:    Supported
 -F:    drivers/block/nvme.c
 +F:    drivers/block/nvme*
  F:    include/linux/nvme.h
  
  OMAP SUPPORT
@@@ -6295,6 -6265,16 +6295,16 @@@ L:    linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    drivers/pinctrl/pinctrl-at91.c
  
+ PIN CONTROLLER - SAMSUNG
+ M:    Tomasz Figa <t.figa@samsung.com>
+ M:    Thomas Abraham <thomas.abraham@linaro.org>
+ L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+ L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
+ S:    Maintained
+ F:    drivers/pinctrl/pinctrl-exynos.*
+ F:    drivers/pinctrl/pinctrl-s3c*
+ F:    drivers/pinctrl/pinctrl-samsung.*
  PIN CONTROLLER - ST SPEAR
  M:    Viresh Kumar <viresh.linux@gmail.com>
  L:    spear-devel@list.st.com
@@@ -7654,7 -7634,7 +7664,7 @@@ F:      drivers/clk/spear
  SPI SUBSYSTEM
  M:    Mark Brown <broonie@kernel.org>
  M:    Grant Likely <grant.likely@linaro.org>
 -L:    spi-devel-general@lists.sourceforge.net
 +L:    linux-spi@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
  Q:    http://patchwork.kernel.org/project/spi-devel-general/list/
  S:    Maintained
@@@ -7697,7 -7677,6 +7707,7 @@@ STABLE BRANC
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  L:    stable@vger.kernel.org
  S:    Supported
 +F:    Documentation/stable_kernel_rules.txt
  
  STAGING SUBSYSTEM
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@@@ -7814,7 -7793,7 +7824,7 @@@ F:      drivers/staging/media/solo6x10
  STAGING - SPEAKUP CONSOLE SPEECH DRIVER
  M:    William Hubbs <w.d.hubbs@gmail.com>
  M:    Chris Brannon <chris@the-brannons.com>
 -M:    Kirk Reiser <kirk@braille.uwo.ca>
 +M:    Kirk Reiser <kirk@reisers.ca>
  M:    Samuel Thibault <samuel.thibault@ens-lyon.org>
  L:    speakup@braille.uwo.ca
  W:    http://www.linux-speakup.org/
@@@ -9035,7 -9014,7 +9045,7 @@@ S:      Maintaine
  F:    drivers/net/wireless/wl3501*
  
  WM97XX TOUCHSCREEN DRIVERS
 -M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
 +M:    Mark Brown <broonie@kernel.org>
  M:    Liam Girdwood <lrg@slimlogic.co.uk>
  L:    linux-input@vger.kernel.org
  T:    git git://opensource.wolfsonmicro.com/linux-2.6-touch
@@@ -9045,6 -9024,7 +9055,6 @@@ F:      drivers/input/touchscreen/*wm97
  F:    include/linux/wm97xx.h
  
  WOLFSON MICROELECTRONICS DRIVERS
 -M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
  L:    patches@opensource.wolfsonmicro.com
  T:    git git://opensource.wolfsonmicro.com/linux-2.6-asoc
  T:    git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
@@@ -9145,13 -9125,6 +9155,13 @@@ S:    Supporte
  F:    arch/arm/xen/
  F:    arch/arm/include/asm/xen/
  
 +XEN HYPERVISOR ARM64
 +M:    Stefano Stabellini <stefano.stabellini@eu.citrix.com>
 +L:    xen-devel@lists.xensource.com (moderated for non-subscribers)
 +S:    Supported
 +F:    arch/arm64/xen/
 +F:    arch/arm64/include/asm/xen/
 +
  XEN NETWORK BACKEND DRIVER
  M:    Ian Campbell <ian.campbell@citrix.com>
  L:    xen-devel@lists.xensource.com (moderated for non-subscribers)
index d1a769f35f9d284f852e1001c87434ae9e96180a,807b0e874cf2aec7915dad19dbfbcc9b3c29ae12..da4415d9dee6cbb8bfdc7667793765f175dd669d
@@@ -35,6 -35,7 +35,7 @@@
  #include <linux/if_vlan.h>
  
  #include <linux/platform_data/cpsw.h>
+ #include <linux/pinctrl/consumer.h>
  
  #include "cpsw_ale.h"
  #include "cpts.h"
@@@ -1679,7 -1680,7 +1680,7 @@@ static int cpsw_probe(struct platform_d
        priv->rx_packet_max = max(rx_packet_max, 128);
        priv->cpts = devm_kzalloc(&pdev->dev, sizeof(struct cpts), GFP_KERNEL);
        priv->irq_enabled = true;
 -      if (!ndev) {
 +      if (!priv->cpts) {
                pr_err("error allocating cpts\n");
                goto clean_ndev_ret;
        }
         */
        pm_runtime_enable(&pdev->dev);
  
+       /* Select default pin state */
+       pinctrl_pm_select_default_state(&pdev->dev);
        if (cpsw_probe_dt(&priv->data, pdev)) {
                pr_err("cpsw: platform data missing\n");
                ret = -ENODEV;
@@@ -1973,14 -1977,14 +1977,17 @@@ static int cpsw_suspend(struct device *
  {
        struct platform_device  *pdev = to_platform_device(dev);
        struct net_device       *ndev = platform_get_drvdata(pdev);
 +      struct cpsw_priv        *priv = netdev_priv(ndev);
  
        if (netif_running(ndev))
                cpsw_ndo_stop(ndev);
 +      soft_reset("sliver 0", &priv->slaves[0].sliver->soft_reset);
 +      soft_reset("sliver 1", &priv->slaves[1].sliver->soft_reset);
        pm_runtime_put_sync(&pdev->dev);
  
+       /* Select sleep pin state */
+       pinctrl_pm_select_sleep_state(&pdev->dev);
        return 0;
  }
  
@@@ -1990,6 -1994,10 +1997,10 @@@ static int cpsw_resume(struct device *d
        struct net_device       *ndev = platform_get_drvdata(pdev);
  
        pm_runtime_get_sync(&pdev->dev);
+       /* Select default pin state */
+       pinctrl_pm_select_default_state(&pdev->dev);
        if (netif_running(ndev))
                cpsw_ndo_open(ndev);
        return 0;
index c47f0dbcebb513d7a33c49c92725350e13d73c6e,5e361f411ea4f1d83e1e2fbda852f0491cd40eca..ce7c4991e41c6473fe0e05b18759127482416920
@@@ -38,6 -38,7 +38,7 @@@
  #include <linux/davinci_emac.h>
  #include <linux/of.h>
  #include <linux/of_device.h>
+ #include <linux/pinctrl/consumer.h>
  
  /*
   * This timeout definition is a worst-case ultra defensive measure against
@@@ -347,6 -348,9 +348,9 @@@ static int davinci_mdio_probe(struct pl
        data->bus->parent       = dev;
        data->bus->priv         = data;
  
+       /* Select default pin state */
+       pinctrl_pm_select_default_state(&pdev->dev);
        pm_runtime_enable(&pdev->dev);
        pm_runtime_get_sync(&pdev->dev);
        data->clk = clk_get(&pdev->dev, "fck");
@@@ -449,22 -453,32 +453,28 @@@ static int davinci_mdio_suspend(struct 
        __raw_writel(ctrl, &data->regs->control);
        wait_for_idle(data);
  
 -      pm_runtime_put_sync(data->dev);
 -
        data->suspended = true;
        spin_unlock(&data->lock);
 +      pm_runtime_put_sync(data->dev);
  
+       /* Select sleep pin state */
+       pinctrl_pm_select_sleep_state(dev);
        return 0;
  }
  
  static int davinci_mdio_resume(struct device *dev)
  {
        struct davinci_mdio_data *data = dev_get_drvdata(dev);
 -      u32 ctrl;
  
 -      spin_lock(&data->lock);
+       /* Select default pin state */
+       pinctrl_pm_select_default_state(dev);
        pm_runtime_get_sync(data->dev);
  
 +      spin_lock(&data->lock);
        /* restart the scan state machine */
 -      ctrl = __raw_readl(&data->regs->control);
 -      ctrl |= CONTROL_ENABLE;
 -      __raw_writel(ctrl, &data->regs->control);
 +      __davinci_mdio_reset(data);
  
        data->suspended = false;
        spin_unlock(&data->lock);
  }
  
  static const struct dev_pm_ops davinci_mdio_pm_ops = {
 -      .suspend        = davinci_mdio_suspend,
 -      .resume         = davinci_mdio_resume,
 +      .suspend_late   = davinci_mdio_suspend,
 +      .resume_early   = davinci_mdio_resume,
  };
  
  static const struct of_device_id davinci_mdio_of_mtable[] = {
diff --combined drivers/pinctrl/Kconfig
index 19396c8ffe45126c609f9852912b1bc0dc813380,74ec8348eed6456da4a7d9e2feef5f672e3b082c..5a8ad513931253766e976eb4dafff02480167b3c
@@@ -58,6 -58,18 +58,18 @@@ config PINCTRL_AT9
        help
          Say Y here to enable the at91 pinctrl driver
  
+ config PINCTRL_BAYTRAIL
+       bool "Intel Baytrail GPIO pin control"
+       depends on GPIOLIB && ACPI && X86
+         select IRQ_DOMAIN
+       help
+         driver for memory mapped GPIO functionality on Intel Baytrail
+         platforms. Supports 3 banks with 102, 28 and 44 gpios.
+         Most pins are usually muxed to some other functionality by firmware,
+         so only a small amount is available for gpio use.
+         Requires ACPI device enumeration code to set up a platform device.
  config PINCTRL_BCM2835
        bool
        select PINMUX
@@@ -108,6 -120,14 +120,14 @@@ config PINCTRL_IMX6S
        help
          Say Y here to enable the imx6sl pinctrl driver
  
+ config PINCTRL_VF610
+       bool "Freescale Vybrid VF610 pinctrl driver"
+       depends on OF
+       depends on SOC_VF610
+       select PINCTRL_IMX
+       help
+         Say Y here to enable the Freescale Vybrid VF610 pinctrl driver
  config PINCTRL_LANTIQ
        bool
        depends on LANTIQ
@@@ -150,6 -170,12 +170,12 @@@ config PINCTRL_DB854
        bool "DB8540 pin controller driver"
        depends on PINCTRL_NOMADIK && ARCH_U8500
  
+ config PINCTRL_ROCKCHIP
+       bool
+       select PINMUX
+       select GENERIC_PINCONF
+       select GENERIC_IRQ_CHIP
  config PINCTRL_SINGLE
        tristate "One-register-per-pin type device tree based pinctrl driver"
        depends on OF
@@@ -169,12 -195,6 +195,12 @@@ config PINCTRL_SUNX
        select PINMUX
        select GENERIC_PINCONF
  
 +config PINCTRL_ST
 +      bool
 +      depends on OF
 +      select PINMUX
 +      select PINCONF
 +
  config PINCTRL_TEGRA
        bool
        select PINMUX
@@@ -192,6 -212,18 +218,18 @@@ config PINCTRL_TEGRA11
        bool
        select PINCTRL_TEGRA
  
+ config PINCTRL_TZ1090
+       bool "Toumaz Xenif TZ1090 pin control driver"
+       depends on SOC_TZ1090
+       select PINMUX
+       select GENERIC_PINCONF
+ config PINCTRL_TZ1090_PDC
+       bool "Toumaz Xenif TZ1090 PDC pin control driver"
+       depends on SOC_TZ1090
+       select PINMUX
+       select PINCONF
  config PINCTRL_U300
        bool "U300 pin controller driver"
        depends on ARCH_U300
@@@ -213,21 -245,15 +251,21 @@@ config PINCTRL_SAMSUN
        select PINCONF
  
  config PINCTRL_EXYNOS
 -      bool "Pinctrl driver data for Samsung EXYNOS SoCs"
 -      depends on OF && GPIOLIB
 +      bool "Pinctrl driver data for Samsung EXYNOS SoCs other than 5440"
 +      depends on OF && GPIOLIB && ARCH_EXYNOS
        select PINCTRL_SAMSUNG
  
  config PINCTRL_EXYNOS5440
        bool "Samsung EXYNOS5440 SoC pinctrl driver"
 +      depends on SOC_EXYNOS5440
        select PINMUX
        select PINCONF
  
 +config PINCTRL_S3C24XX
 +      bool "Samsung S3C24XX SoC pinctrl driver"
 +      depends on ARCH_S3C24XX
 +      select PINCTRL_SAMSUNG
 +
  config PINCTRL_S3C64XX
        bool "Samsung S3C64XX SoC pinctrl driver"
        depends on ARCH_S3C64XX
diff --combined drivers/pinctrl/Makefile
index 76c937cbbb132aab8d47d5ff9c2051d03d4a43eb,cf699a519e9a28c38e9d2cf002bc81d60a590de9..d64563bf6fb4d83c12ff8f01ad566b72700c3092
@@@ -16,12 -16,14 +16,14 @@@ obj-$(CONFIG_PINCTRL_AB9540)       += pinctrl
  obj-$(CONFIG_PINCTRL_AB8505)  += pinctrl-ab8505.o
  obj-$(CONFIG_PINCTRL_AT91)    += pinctrl-at91.o
  obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o
+ obj-$(CONFIG_PINCTRL_BAYTRAIL)        += pinctrl-baytrail.o
  obj-$(CONFIG_PINCTRL_IMX)     += pinctrl-imx.o
  obj-$(CONFIG_PINCTRL_IMX35)   += pinctrl-imx35.o
  obj-$(CONFIG_PINCTRL_IMX51)   += pinctrl-imx51.o
  obj-$(CONFIG_PINCTRL_IMX53)   += pinctrl-imx53.o
  obj-$(CONFIG_PINCTRL_IMX6Q)   += pinctrl-imx6q.o
  obj-$(CONFIG_PINCTRL_IMX6Q)   += pinctrl-imx6dl.o
+ obj-$(CONFIG_PINCTRL_IMX6SL)  += pinctrl-imx6sl.o
  obj-$(CONFIG_PINCTRL_FALCON)  += pinctrl-falcon.o
  obj-$(CONFIG_PINCTRL_MXS)     += pinctrl-mxs.o
  obj-$(CONFIG_PINCTRL_IMX23)   += pinctrl-imx23.o
@@@ -30,23 -32,25 +32,27 @@@ obj-$(CONFIG_PINCTRL_NOMADIK)      += pinctr
  obj-$(CONFIG_PINCTRL_STN8815) += pinctrl-nomadik-stn8815.o
  obj-$(CONFIG_PINCTRL_DB8500)  += pinctrl-nomadik-db8500.o
  obj-$(CONFIG_PINCTRL_DB8540)  += pinctrl-nomadik-db8540.o
+ obj-$(CONFIG_PINCTRL_ROCKCHIP)        += pinctrl-rockchip.o
  obj-$(CONFIG_PINCTRL_SINGLE)  += pinctrl-single.o
- obj-$(CONFIG_PINCTRL_SIRF)    += pinctrl-sirf.o
+ obj-$(CONFIG_PINCTRL_SIRF)    += sirf/
  obj-$(CONFIG_PINCTRL_SUNXI)   += pinctrl-sunxi.o
  obj-$(CONFIG_PINCTRL_TEGRA)   += pinctrl-tegra.o
  obj-$(CONFIG_PINCTRL_TEGRA20) += pinctrl-tegra20.o
  obj-$(CONFIG_PINCTRL_TEGRA30) += pinctrl-tegra30.o
  obj-$(CONFIG_PINCTRL_TEGRA114)        += pinctrl-tegra114.o
+ obj-$(CONFIG_PINCTRL_TZ1090)  += pinctrl-tz1090.o
+ obj-$(CONFIG_PINCTRL_TZ1090_PDC)      += pinctrl-tz1090-pdc.o
  obj-$(CONFIG_PINCTRL_U300)    += pinctrl-u300.o
  obj-$(CONFIG_PINCTRL_COH901)  += pinctrl-coh901.o
  obj-$(CONFIG_PINCTRL_SAMSUNG) += pinctrl-samsung.o
  obj-$(CONFIG_PINCTRL_EXYNOS)  += pinctrl-exynos.o
  obj-$(CONFIG_PINCTRL_EXYNOS5440)      += pinctrl-exynos5440.o
 +obj-$(CONFIG_PINCTRL_S3C24XX) += pinctrl-s3c24xx.o
  obj-$(CONFIG_PINCTRL_S3C64XX) += pinctrl-s3c64xx.o
  obj-$(CONFIG_PINCTRL_XWAY)    += pinctrl-xway.o
  obj-$(CONFIG_PINCTRL_LANTIQ)  += pinctrl-lantiq.o
 +obj-$(CONFIG_PINCTRL_ST)      += pinctrl-st.o
+ obj-$(CONFIG_PINCTRL_VF610)   += pinctrl-vf610.o
  
  obj-$(CONFIG_PLAT_ORION)        += mvebu/
  obj-$(CONFIG_ARCH_SHMOBILE)   += sh-pfc/
index eeff7f7fc920d6b9362ee028d6e6a1f96e225cd0,ea98df9b3069a23c93a7bf887da1f0201310a12e..f22a2193d949a1915a9759a6466a94a2ecfed2f7
@@@ -22,6 -22,7 +22,6 @@@
  #include <linux/slab.h>
  #include <linux/pinctrl/consumer.h>
  #include <linux/pinctrl/pinconf-generic.h>
 -#include <linux/platform_data/pinctrl-coh901.h>
  #include "pinctrl-coh901.h"
  
  #define U300_GPIO_PORT_STRIDE                         (0x30)
@@@ -57,9 -58,8 +57,9 @@@
  #define U300_GPIO_PXICR_IRQ_CONFIG_RISING_EDGE                (0x00000001UL)
  
  /* 8 bits per port, no version has more than 7 ports */
 +#define U300_GPIO_NUM_PORTS 7
  #define U300_GPIO_PINS_PER_PORT 8
 -#define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * 7)
 +#define U300_GPIO_MAX (U300_GPIO_PINS_PER_PORT * U300_GPIO_NUM_PORTS)
  
  struct u300_gpio {
        struct gpio_chip chip;
@@@ -111,6 -111,9 +111,6 @@@ struct u300_gpio_confdata 
        int outval;
  };
  
 -/* BS335 has seven ports of 8 bits each = GPIO pins 0..55 */
 -#define BS335_GPIO_NUM_PORTS 7
 -
  #define U300_FLOATING_INPUT { \
        .bias_mode = PIN_CONFIG_BIAS_HIGH_IMPEDANCE, \
        .output = false, \
  
  /* Initial configuration */
  static const struct __initconst u300_gpio_confdata
 -bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
 +bs335_gpio_config[U300_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
        /* Port 0, pins 0-7 */
        {
                U300_FLOATING_INPUT,
@@@ -627,12 -630,13 +627,12 @@@ static void __init u300_gpio_init_pin(s
        }
  }
  
 -static void __init u300_gpio_init_coh901571(struct u300_gpio *gpio,
 -                                   struct u300_gpio_platform *plat)
 +static void __init u300_gpio_init_coh901571(struct u300_gpio *gpio)
  {
        int i, j;
  
        /* Write default config and values to all pins */
 -      for (i = 0; i < plat->ports; i++) {
 +      for (i = 0; i < U300_GPIO_NUM_PORTS; i++) {
                for (j = 0; j < 8; j++) {
                        const struct u300_gpio_confdata *conf;
                        int offset = (i*8) + j;
@@@ -689,6 -693,7 +689,6 @@@ static struct coh901_pinpair coh901_pin
  
  static int __init u300_gpio_probe(struct platform_device *pdev)
  {
 -      struct u300_gpio_platform *plat = dev_get_platdata(&pdev->dev);
        struct u300_gpio *gpio;
        struct resource *memres;
        int err = 0;
                return -ENOMEM;
  
        gpio->chip = u300_gpio_chip;
 -      gpio->chip.ngpio = plat->ports * U300_GPIO_PINS_PER_PORT;
 +      gpio->chip.ngpio = U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT;
        gpio->chip.dev = &pdev->dev;
 -      gpio->chip.base = plat->gpio_base;
 +      gpio->chip.base = 0;
        gpio->dev = &pdev->dev;
  
        memres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
                 ((val & 0x0000FE00) >> 9) * 8);
        writel(U300_GPIO_CR_BLOCK_CLKRQ_ENABLE,
               gpio->base + U300_GPIO_CR);
 -      u300_gpio_init_coh901571(gpio, plat);
 +      u300_gpio_init_coh901571(gpio);
  
        /* Add each port with its IRQ separately */
        INIT_LIST_HEAD(&gpio->port_list);
 -      for (portno = 0 ; portno < plat->ports; portno++) {
 +      for (portno = 0 ; portno < U300_GPIO_NUM_PORTS; portno++) {
                struct u300_gpio_port *port =
                        kmalloc(sizeof(struct u300_gpio_port), GFP_KERNEL);
  
                port->number = portno;
                port->gpio = gpio;
  
 -              port->irq = platform_get_irq_byname(pdev,
 -                                                  port->name);
 +              port->irq = platform_get_irq(pdev, portno);
  
                dev_dbg(gpio->dev, "register IRQ %d for port %s\n", port->irq,
                        port->name);
        }
        dev_dbg(gpio->dev, "initialized %d GPIO ports\n", portno);
  
 +#ifdef CONFIG_OF_GPIO
 +      gpio->chip.of_node = pdev->dev.of_node;
 +#endif
        err = gpiochip_add(&gpio->chip);
        if (err) {
                dev_err(gpio->dev, "unable to add gpiochip: %d\n", err);
@@@ -853,19 -856,12 +853,18 @@@ static int __exit u300_gpio_remove(stru
        }
        u300_gpio_free_ports(gpio);
        clk_disable_unprepare(gpio->clk);
-       platform_set_drvdata(pdev, NULL);
        return 0;
  }
  
 +static const struct of_device_id u300_gpio_match[] = {
 +      { .compatible = "stericsson,gpio-coh901" },
 +      {},
 +};
 +
  static struct platform_driver u300_gpio_driver = {
        .driver         = {
                .name   = "u300-gpio",
 +              .of_match_table = u300_gpio_match,
        },
        .remove         = __exit_p(u300_gpio_remove),
  };
index 5f58cf0e96e2e1e55660677193bd0b142eecf771,ef7532121556fc8b8896bafb1e35f0d8b8133729..a74b3cbd745163a8624930114eccc43f5dcdc90a
@@@ -50,37 -50,58 +50,58 @@@ static const struct of_device_id exynos
        { }
  };
  
- static void exynos_gpio_irq_unmask(struct irq_data *irqd)
+ static void exynos_gpio_irq_mask(struct irq_data *irqd)
  {
        struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
        struct samsung_pinctrl_drv_data *d = bank->drvdata;
        unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
        unsigned long mask;
+       unsigned long flags;
+       spin_lock_irqsave(&bank->slock, flags);
  
        mask = readl(d->virt_base + reg_mask);
-       mask &= ~(1 << irqd->hwirq);
+       mask |= 1 << irqd->hwirq;
        writel(mask, d->virt_base + reg_mask);
+       spin_unlock_irqrestore(&bank->slock, flags);
  }
  
- static void exynos_gpio_irq_mask(struct irq_data *irqd)
+ static void exynos_gpio_irq_ack(struct irq_data *irqd)
  {
        struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
        struct samsung_pinctrl_drv_data *d = bank->drvdata;
-       unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
-       unsigned long mask;
+       unsigned long reg_pend = d->ctrl->geint_pend + bank->eint_offset;
  
-       mask = readl(d->virt_base + reg_mask);
-       mask |= 1 << irqd->hwirq;
-       writel(mask, d->virt_base + reg_mask);
+       writel(1 << irqd->hwirq, d->virt_base + reg_pend);
  }
  
- static void exynos_gpio_irq_ack(struct irq_data *irqd)
+ static void exynos_gpio_irq_unmask(struct irq_data *irqd)
  {
        struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
        struct samsung_pinctrl_drv_data *d = bank->drvdata;
-       unsigned long reg_pend = d->ctrl->geint_pend + bank->eint_offset;
+       unsigned long reg_mask = d->ctrl->geint_mask + bank->eint_offset;
+       unsigned long mask;
+       unsigned long flags;
  
-       writel(1 << irqd->hwirq, d->virt_base + reg_pend);
+       /*
+        * Ack level interrupts right before unmask
+        *
+        * If we don't do this we'll get a double-interrupt.  Level triggered
+        * interrupts must not fire an interrupt if the level is not
+        * _currently_ active, even if it was active while the interrupt was
+        * masked.
+        */
+       if (irqd_get_trigger_type(irqd) & IRQ_TYPE_LEVEL_MASK)
+               exynos_gpio_irq_ack(irqd);
+       spin_lock_irqsave(&bank->slock, flags);
+       mask = readl(d->virt_base + reg_mask);
+       mask &= ~(1 << irqd->hwirq);
+       writel(mask, d->virt_base + reg_mask);
+       spin_unlock_irqrestore(&bank->slock, flags);
  }
  
  static int exynos_gpio_irq_set_type(struct irq_data *irqd, unsigned int type)
@@@ -258,37 -279,58 +279,58 @@@ err_domains
        return ret;
  }
  
- static void exynos_wkup_irq_unmask(struct irq_data *irqd)
+ static void exynos_wkup_irq_mask(struct irq_data *irqd)
  {
        struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
        struct samsung_pinctrl_drv_data *d = b->drvdata;
        unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
        unsigned long mask;
+       unsigned long flags;
+       spin_lock_irqsave(&b->slock, flags);
  
        mask = readl(d->virt_base + reg_mask);
-       mask &= ~(1 << irqd->hwirq);
+       mask |= 1 << irqd->hwirq;
        writel(mask, d->virt_base + reg_mask);
+       spin_unlock_irqrestore(&b->slock, flags);
  }
  
- static void exynos_wkup_irq_mask(struct irq_data *irqd)
+ static void exynos_wkup_irq_ack(struct irq_data *irqd)
  {
        struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
        struct samsung_pinctrl_drv_data *d = b->drvdata;
-       unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
-       unsigned long mask;
+       unsigned long pend = d->ctrl->weint_pend + b->eint_offset;
  
-       mask = readl(d->virt_base + reg_mask);
-       mask |= 1 << irqd->hwirq;
-       writel(mask, d->virt_base + reg_mask);
+       writel(1 << irqd->hwirq, d->virt_base + pend);
  }
  
- static void exynos_wkup_irq_ack(struct irq_data *irqd)
+ static void exynos_wkup_irq_unmask(struct irq_data *irqd)
  {
        struct samsung_pin_bank *b = irq_data_get_irq_chip_data(irqd);
        struct samsung_pinctrl_drv_data *d = b->drvdata;
-       unsigned long pend = d->ctrl->weint_pend + b->eint_offset;
+       unsigned long reg_mask = d->ctrl->weint_mask + b->eint_offset;
+       unsigned long mask;
+       unsigned long flags;
  
-       writel(1 << irqd->hwirq, d->virt_base + pend);
+       /*
+        * Ack level interrupts right before unmask
+        *
+        * If we don't do this we'll get a double-interrupt.  Level triggered
+        * interrupts must not fire an interrupt if the level is not
+        * _currently_ active, even if it was active while the interrupt was
+        * masked.
+        */
+       if (irqd_get_trigger_type(irqd) & IRQ_TYPE_LEVEL_MASK)
+               exynos_wkup_irq_ack(irqd);
+       spin_lock_irqsave(&b->slock, flags);
+       mask = readl(d->virt_base + reg_mask);
+       mask &= ~(1 << irqd->hwirq);
+       writel(mask, d->virt_base + reg_mask);
+       spin_unlock_irqrestore(&b->slock, flags);
  }
  
  static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type)
@@@ -941,121 -983,3 +983,121 @@@ struct samsung_pin_ctrl exynos5250_pin_
                .label          = "exynos5250-gpio-ctrl3",
        },
  };
 +
 +/* pin banks of exynos5420 pin-controller 0 */
 +static struct samsung_pin_bank exynos5420_pin_banks0[] = {
 +      EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpy7", 0x00),
 +      EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
 +      EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
 +      EXYNOS_PIN_BANK_EINTW(8, 0xC40, "gpx2", 0x08),
 +      EXYNOS_PIN_BANK_EINTW(8, 0xC60, "gpx3", 0x0c),
 +};
 +
 +/* pin banks of exynos5420 pin-controller 1 */
 +static struct samsung_pin_bank exynos5420_pin_banks1[] = {
 +      EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpc0", 0x00),
 +      EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpc1", 0x04),
 +      EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
 +      EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpc3", 0x0c),
 +      EXYNOS_PIN_BANK_EINTG(2, 0x080, "gpc4", 0x10),
 +      EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpd1", 0x14),
 +      EXYNOS_PIN_BANK_EINTN(6, 0x0C0, "gpy0"),
 +      EXYNOS_PIN_BANK_EINTN(4, 0x0E0, "gpy1"),
 +      EXYNOS_PIN_BANK_EINTN(6, 0x100, "gpy2"),
 +      EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpy3"),
 +      EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpy4"),
 +      EXYNOS_PIN_BANK_EINTN(8, 0x160, "gpy5"),
 +      EXYNOS_PIN_BANK_EINTN(8, 0x180, "gpy6"),
 +};
 +
 +/* pin banks of exynos5420 pin-controller 2 */
 +static struct samsung_pin_bank exynos5420_pin_banks2[] = {
 +      EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
 +      EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
 +      EXYNOS_PIN_BANK_EINTG(6, 0x040, "gpf0", 0x08),
 +      EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpf1", 0x0c),
 +      EXYNOS_PIN_BANK_EINTG(8, 0x080, "gpg0", 0x10),
 +      EXYNOS_PIN_BANK_EINTG(8, 0x0A0, "gpg1", 0x14),
 +      EXYNOS_PIN_BANK_EINTG(2, 0x0C0, "gpg2", 0x18),
 +      EXYNOS_PIN_BANK_EINTG(4, 0x0E0, "gpj4", 0x1c),
 +};
 +
 +/* pin banks of exynos5420 pin-controller 3 */
 +static struct samsung_pin_bank exynos5420_pin_banks3[] = {
 +      EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
 +      EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
 +      EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
 +      EXYNOS_PIN_BANK_EINTG(5, 0x060, "gpb0", 0x0c),
 +      EXYNOS_PIN_BANK_EINTG(5, 0x080, "gpb1", 0x10),
 +      EXYNOS_PIN_BANK_EINTG(4, 0x0A0, "gpb2", 0x14),
 +      EXYNOS_PIN_BANK_EINTG(8, 0x0C0, "gpb3", 0x18),
 +      EXYNOS_PIN_BANK_EINTG(2, 0x0E0, "gpb4", 0x1c),
 +      EXYNOS_PIN_BANK_EINTG(8, 0x100, "gph0", 0x20),
 +};
 +
 +/* pin banks of exynos5420 pin-controller 4 */
 +static struct samsung_pin_bank exynos5420_pin_banks4[] = {
 +      EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
 +};
 +
 +/*
 + * Samsung pinctrl driver data for Exynos5420 SoC. Exynos5420 SoC includes
 + * four gpio/pin-mux/pinconfig controllers.
 + */
 +struct samsung_pin_ctrl exynos5420_pin_ctrl[] = {
 +      {
 +              /* pin-controller instance 0 data */
 +              .pin_banks      = exynos5420_pin_banks0,
 +              .nr_banks       = ARRAY_SIZE(exynos5420_pin_banks0),
 +              .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
 +              .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
 +              .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
 +              .weint_con      = EXYNOS_WKUP_ECON_OFFSET,
 +              .weint_mask     = EXYNOS_WKUP_EMASK_OFFSET,
 +              .weint_pend     = EXYNOS_WKUP_EPEND_OFFSET,
 +              .svc            = EXYNOS_SVC_OFFSET,
 +              .eint_gpio_init = exynos_eint_gpio_init,
 +              .eint_wkup_init = exynos_eint_wkup_init,
 +              .label          = "exynos5420-gpio-ctrl0",
 +      }, {
 +              /* pin-controller instance 1 data */
 +              .pin_banks      = exynos5420_pin_banks1,
 +              .nr_banks       = ARRAY_SIZE(exynos5420_pin_banks1),
 +              .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
 +              .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
 +              .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
 +              .svc            = EXYNOS_SVC_OFFSET,
 +              .eint_gpio_init = exynos_eint_gpio_init,
 +              .label          = "exynos5420-gpio-ctrl1",
 +      }, {
 +              /* pin-controller instance 2 data */
 +              .pin_banks      = exynos5420_pin_banks2,
 +              .nr_banks       = ARRAY_SIZE(exynos5420_pin_banks2),
 +              .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
 +              .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
 +              .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
 +              .svc            = EXYNOS_SVC_OFFSET,
 +              .eint_gpio_init = exynos_eint_gpio_init,
 +              .label          = "exynos5420-gpio-ctrl2",
 +      }, {
 +              /* pin-controller instance 3 data */
 +              .pin_banks      = exynos5420_pin_banks3,
 +              .nr_banks       = ARRAY_SIZE(exynos5420_pin_banks3),
 +              .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
 +              .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
 +              .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
 +              .svc            = EXYNOS_SVC_OFFSET,
 +              .eint_gpio_init = exynos_eint_gpio_init,
 +              .label          = "exynos5420-gpio-ctrl3",
 +      }, {
 +              /* pin-controller instance 4 data */
 +              .pin_banks      = exynos5420_pin_banks4,
 +              .nr_banks       = ARRAY_SIZE(exynos5420_pin_banks4),
 +              .geint_con      = EXYNOS_GPIO_ECON_OFFSET,
 +              .geint_mask     = EXYNOS_GPIO_EMASK_OFFSET,
 +              .geint_pend     = EXYNOS_GPIO_EPEND_OFFSET,
 +              .svc            = EXYNOS_SVC_OFFSET,
 +              .eint_gpio_init = exynos_eint_gpio_init,
 +              .label          = "exynos5420-gpio-ctrl4",
 +      },
 +};
index 8a4f9c5c0b8ee7b456ba2608efb70591eae47246,b6e50441795c4d2fe2fa275f1639e5491be39a20..4a1cfdce22320aed2ad1579c61c30a7dbc955003
@@@ -1309,7 -1309,7 +1309,7 @@@ static int nmk_gpio_irq_map(struct irq_
        return 0;
  }
  
- const struct irq_domain_ops nmk_gpio_irq_simple_ops = {
static const struct irq_domain_ops nmk_gpio_irq_simple_ops = {
        .map = nmk_gpio_irq_map,
        .xlate = irq_domain_xlate_twocell,
  };
@@@ -1681,7 -1681,7 +1681,7 @@@ static bool nmk_pinctrl_dt_get_config(s
        return has_config;
  }
  
- int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
                struct device_node *np,
                struct pinctrl_map **map,
                unsigned *reserved_maps,
@@@ -1740,7 -1740,7 +1740,7 @@@ exit
        return ret;
  }
  
- int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
                                 struct device_node *np_config,
                                 struct pinctrl_map **map, unsigned *num_maps)
  {
@@@ -2104,15 -2104,15 +2104,15 @@@ static struct pinctrl_desc nmk_pinctrl_
  
  static const struct of_device_id nmk_pinctrl_match[] = {
        {
 -              .compatible = "stericsson,nmk-pinctrl-stn8815",
 +              .compatible = "stericsson,stn8815-pinctrl",
                .data = (void *)PINCTRL_NMK_STN8815,
        },
        {
 -              .compatible = "stericsson,nmk-pinctrl",
 +              .compatible = "stericsson,db8500-pinctrl",
                .data = (void *)PINCTRL_NMK_DB8500,
        },
        {
 -              .compatible = "stericsson,nmk-pinctrl-db8540",
 +              .compatible = "stericsson,db8540-pinctrl",
                .data = (void *)PINCTRL_NMK_DB8540,
        },
        {},
index 0a6c720b6655ba1860d282a453073ac89da9881e,a46694bee56b81ebb2d70548cda5268002a2f1e7..a7fa9e2d475137252de98d7ff635171ff6124540
@@@ -50,7 -50,7 +50,7 @@@ static struct pin_config 
  };
  
  /* Global list of devices (struct samsung_pinctrl_drv_data) */
- LIST_HEAD(drvdata_list);
static LIST_HEAD(drvdata_list);
  
  static unsigned int pin_base;
  
@@@ -1113,22 -1113,10 +1113,22 @@@ static const struct of_device_id samsun
                .data = (void *)exynos4x12_pin_ctrl },
        { .compatible = "samsung,exynos5250-pinctrl",
                .data = (void *)exynos5250_pin_ctrl },
 +      { .compatible = "samsung,exynos5420-pinctrl",
 +              .data = (void *)exynos5420_pin_ctrl },
  #endif
  #ifdef CONFIG_PINCTRL_S3C64XX
        { .compatible = "samsung,s3c64xx-pinctrl",
                .data = s3c64xx_pin_ctrl },
 +#endif
 +#ifdef CONFIG_PINCTRL_S3C24XX
 +      { .compatible = "samsung,s3c2412-pinctrl",
 +              .data = s3c2412_pin_ctrl },
 +      { .compatible = "samsung,s3c2416-pinctrl",
 +              .data = s3c2416_pin_ctrl },
 +      { .compatible = "samsung,s3c2440-pinctrl",
 +              .data = s3c2440_pin_ctrl },
 +      { .compatible = "samsung,s3c2450-pinctrl",
 +              .data = s3c2450_pin_ctrl },
  #endif
        {},
  };
index 06bfa09bb15c1bfb9ba41cef0c5dfe2691ac8736,195191a4f2dca5c65319a193f1a4e43f1caea11f..46a152d1735500fcb22320301fddd00d20f66c52
@@@ -1100,22 -1100,14 +1100,21 @@@ static int u300_pmx_remove(struct platf
        struct u300_pmx *upmx = platform_get_drvdata(pdev);
  
        pinctrl_unregister(upmx->pctl);
-       platform_set_drvdata(pdev, NULL);
  
        return 0;
  }
  
 +static const struct of_device_id u300_pinctrl_match[] = {
 +      { .compatible = "stericsson,pinctrl-u300" },
 +      {},
 +};
 +
 +
  static struct platform_driver u300_pmx_driver = {
        .driver = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
 +              .of_match_table = u300_pinctrl_match,
        },
        .probe = u300_pmx_probe,
        .remove = u300_pmx_remove,
index 3b2fd43ff2944ced1e8af02f1c8da50728816d0b,4eea849a1ad8b6f0c05e8943927bff5f47971e96..f3fc66b243701acc55faa8659e702dc69157ff34
@@@ -18,6 -18,8 +18,8 @@@
  #include <linux/ioport.h>
  #include <linux/kernel.h>
  #include <linux/module.h>
+ #include <linux/of.h>
+ #include <linux/of_device.h>
  #include <linux/pinctrl/machine.h>
  #include <linux/platform_device.h>
  #include <linux/slab.h>
@@@ -348,14 -350,72 +350,72 @@@ int sh_pfc_config_mux(struct sh_pfc *pf
        return 0;
  }
  
+ #ifdef CONFIG_OF
+ static const struct of_device_id sh_pfc_of_table[] = {
+ #ifdef CONFIG_PINCTRL_PFC_R8A73A4
+       {
+               .compatible = "renesas,pfc-r8a73a4",
+               .data = &r8a73a4_pinmux_info,
+       },
+ #endif
+ #ifdef CONFIG_PINCTRL_PFC_R8A7740
+       {
+               .compatible = "renesas,pfc-r8a7740",
+               .data = &r8a7740_pinmux_info,
+       },
+ #endif
+ #ifdef CONFIG_PINCTRL_PFC_R8A7778
+       {
+               .compatible = "renesas,pfc-r8a7778",
+               .data = &r8a7778_pinmux_info,
+       },
+ #endif
+ #ifdef CONFIG_PINCTRL_PFC_R8A7779
+       {
+               .compatible = "renesas,pfc-r8a7779",
+               .data = &r8a7779_pinmux_info,
+       },
+ #endif
+ #ifdef CONFIG_PINCTRL_PFC_R8A7790
+       {
+               .compatible = "renesas,pfc-r8a7790",
+               .data = &r8a7790_pinmux_info,
+       },
+ #endif
+ #ifdef CONFIG_PINCTRL_PFC_SH7372
+       {
+               .compatible = "renesas,pfc-sh7372",
+               .data = &sh7372_pinmux_info,
+       },
+ #endif
+ #ifdef CONFIG_PINCTRL_PFC_SH73A0
+       {
+               .compatible = "renesas,pfc-sh73a0",
+               .data = &sh73a0_pinmux_info,
+       },
+ #endif
+       { },
+ };
+ MODULE_DEVICE_TABLE(of, sh_pfc_of_table);
+ #endif
  static int sh_pfc_probe(struct platform_device *pdev)
  {
+       const struct platform_device_id *platid = platform_get_device_id(pdev);
+ #ifdef CONFIG_OF
+       struct device_node *np = pdev->dev.of_node;
+ #endif
        const struct sh_pfc_soc_info *info;
        struct sh_pfc *pfc;
        int ret;
  
-       info = pdev->id_entry->driver_data
-             ? (void *)pdev->id_entry->driver_data : pdev->dev.platform_data;
+ #ifdef CONFIG_OF
+       if (np)
+               info = of_match_device(sh_pfc_of_table, &pdev->dev)->data;
+       else
+ #endif
+               info = platid ? (const void *)platid->driver_data : NULL;
        if (info == NULL)
                return -ENODEV;
  
  
        spin_lock_init(&pfc->lock);
  
 +      if (info->ops && info->ops->init) {
 +              ret = info->ops->init(pfc);
 +              if (ret < 0)
 +                      return ret;
 +      }
 +
        pinctrl_provide_dummies();
  
        /*
         */
        ret = sh_pfc_register_pinctrl(pfc);
        if (unlikely(ret != 0))
 -              return ret;
 +              goto error;
  
  #ifdef CONFIG_GPIO_SH_PFC
        /*
        dev_info(pfc->dev, "%s support registered\n", info->name);
  
        return 0;
 +
 +error:
 +      if (info->ops && info->ops->exit)
 +              info->ops->exit(pfc);
 +      return ret;
  }
  
  static int sh_pfc_remove(struct platform_device *pdev)
  #endif
        sh_pfc_unregister_pinctrl(pfc);
  
 +      if (pfc->info->ops && pfc->info->ops->exit)
 +              pfc->info->ops->exit(pfc);
 +
        platform_set_drvdata(pdev, NULL);
  
        return 0;
@@@ -438,15 -484,9 +498,15 @@@ static const struct platform_device_id 
  #ifdef CONFIG_PINCTRL_PFC_R8A7740
        { "pfc-r8a7740", (kernel_ulong_t)&r8a7740_pinmux_info },
  #endif
 +#ifdef CONFIG_PINCTRL_PFC_R8A7778
 +      { "pfc-r8a7778", (kernel_ulong_t)&r8a7778_pinmux_info },
 +#endif
  #ifdef CONFIG_PINCTRL_PFC_R8A7779
        { "pfc-r8a7779", (kernel_ulong_t)&r8a7779_pinmux_info },
  #endif
 +#ifdef CONFIG_PINCTRL_PFC_R8A7790
 +      { "pfc-r8a7790", (kernel_ulong_t)&r8a7790_pinmux_info },
 +#endif
  #ifdef CONFIG_PINCTRL_PFC_SH7203
        { "pfc-sh7203", (kernel_ulong_t)&sh7203_pinmux_info },
  #endif
@@@ -501,6 -541,7 +561,7 @@@ static struct platform_driver sh_pfc_dr
        .driver         = {
                .name   = DRV_NAME,
                .owner  = THIS_MODULE,
+               .of_match_table = of_match_ptr(sh_pfc_of_table),
        },
  };
  
diff --combined drivers/spi/spi-pl022.c
index 3b246543282f50a21a04397458097135c52693a3,16247c255688d001a0e43c1aa495e31daf914252..abef061fb84af1537afde292373604be6d1e85b1
@@@ -368,11 -368,6 +368,6 @@@ struct pl022 
        resource_size_t                 phybase;
        void __iomem                    *virtbase;
        struct clk                      *clk;
-       /* Two optional pin states - default & sleep */
-       struct pinctrl                  *pinctrl;
-       struct pinctrl_state            *pins_default;
-       struct pinctrl_state            *pins_idle;
-       struct pinctrl_state            *pins_sleep;
        struct spi_master               *master;
        struct pl022_ssp_controller     *master_info;
        /* Message per-transfer pump */
@@@ -2083,7 -2078,6 +2078,7 @@@ pl022_platform_data_dt_get(struct devic
        }
  
        pd->bus_id = -1;
 +      pd->enable_dma = 1;
        of_property_read_u32(np, "num-cs", &tmp);
        pd->num_chipselect = tmp;
        of_property_read_u32(np, "pl022,autosuspend-delay",
@@@ -2134,32 -2128,7 +2129,7 @@@ static int pl022_probe(struct amba_devi
        pl022->chipselects = devm_kzalloc(dev, num_cs * sizeof(int),
                                          GFP_KERNEL);
  
-       pl022->pinctrl = devm_pinctrl_get(dev);
-       if (IS_ERR(pl022->pinctrl)) {
-               status = PTR_ERR(pl022->pinctrl);
-               goto err_no_pinctrl;
-       }
-       pl022->pins_default = pinctrl_lookup_state(pl022->pinctrl,
-                                                PINCTRL_STATE_DEFAULT);
-       /* enable pins to be muxed in and configured */
-       if (!IS_ERR(pl022->pins_default)) {
-               status = pinctrl_select_state(pl022->pinctrl,
-                               pl022->pins_default);
-               if (status)
-                       dev_err(dev, "could not set default pins\n");
-       } else
-               dev_err(dev, "could not get default pinstate\n");
-       pl022->pins_idle = pinctrl_lookup_state(pl022->pinctrl,
-                                             PINCTRL_STATE_IDLE);
-       if (IS_ERR(pl022->pins_idle))
-               dev_dbg(dev, "could not get idle pinstate\n");
-       pl022->pins_sleep = pinctrl_lookup_state(pl022->pinctrl,
-                                              PINCTRL_STATE_SLEEP);
-       if (IS_ERR(pl022->pins_sleep))
-               dev_dbg(dev, "could not get sleep pinstate\n");
+       pinctrl_pm_select_default_state(dev);
  
        /*
         * Bus Number Which has been Assigned to this SSP controller
        amba_release_regions(adev);
   err_no_ioregion:
   err_no_gpio:
-  err_no_pinctrl:
        spi_master_put(master);
        return status;
  }
@@@ -2349,44 -2317,21 +2318,21 @@@ pl022_remove(struct amba_device *adev
   */
  static void pl022_suspend_resources(struct pl022 *pl022, bool runtime)
  {
-       int ret;
-       struct pinctrl_state *pins_state;
        clk_disable(pl022->clk);
  
-       pins_state = runtime ? pl022->pins_idle : pl022->pins_sleep;
-       /* Optionally let pins go into sleep states */
-       if (!IS_ERR(pins_state)) {
-               ret = pinctrl_select_state(pl022->pinctrl, pins_state);
-               if (ret)
-                       dev_err(&pl022->adev->dev, "could not set %s pins\n",
-                               runtime ? "idle" : "sleep");
-       }
+       if (runtime)
+               pinctrl_pm_select_idle_state(&pl022->adev->dev);
+       else
+               pinctrl_pm_select_sleep_state(&pl022->adev->dev);
  }
  
  static void pl022_resume_resources(struct pl022 *pl022, bool runtime)
  {
-       int ret;
-       /* Optionaly enable pins to be muxed in and configured */
        /* First go to the default state */
-       if (!IS_ERR(pl022->pins_default)) {
-               ret = pinctrl_select_state(pl022->pinctrl, pl022->pins_default);
-               if (ret)
-                       dev_err(&pl022->adev->dev,
-                               "could not set default pins\n");
-       }
-       if (!runtime) {
+       pinctrl_pm_select_default_state(&pl022->adev->dev);
+       if (!runtime)
                /* Then let's idle the pins until the next transfer happens */
-               if (!IS_ERR(pl022->pins_idle)) {
-                       ret = pinctrl_select_state(pl022->pinctrl,
-                                       pl022->pins_idle);
-               if (ret)
-                       dev_err(&pl022->adev->dev,
-                               "could not set idle pins\n");
-               }
-       }
+               pinctrl_pm_select_idle_state(&pl022->adev->dev);
  
        clk_enable(pl022->clk);
  }
index ad41319d1d9b028eaeba3d0dcd08db5e745c0b78,6ac3254bf68cec7bdf6d5ed87c19e39ccbb2a1ee..28b35ad9c6cd361818d94c0cde6ee2aa987979c0
@@@ -79,12 -79,13 +79,12 @@@ struct vendor_data 
        bool                    dma_threshold;
        bool                    cts_event_workaround;
  
 -      unsigned int (*get_fifosize)(unsigned int periphid);
 +      unsigned int (*get_fifosize)(struct amba_device *dev);
  };
  
 -static unsigned int get_fifosize_arm(unsigned int periphid)
 +static unsigned int get_fifosize_arm(struct amba_device *dev)
  {
 -      unsigned int rev = (periphid >> 20) & 0xf;
 -      return rev < 3 ? 16 : 32;
 +      return amba_rev(dev) < 3 ? 16 : 32;
  }
  
  static struct vendor_data vendor_arm = {
@@@ -97,7 -98,7 +97,7 @@@
        .get_fifosize           = get_fifosize_arm,
  };
  
 -static unsigned int get_fifosize_st(unsigned int periphid)
 +static unsigned int get_fifosize_st(struct amba_device *dev)
  {
        return 64;
  }
@@@ -150,10 -151,6 +150,6 @@@ struct pl011_dmatx_data 
  struct uart_amba_port {
        struct uart_port        port;
        struct clk              *clk;
-       /* Two optional pin states - default & sleep */
-       struct pinctrl          *pinctrl;
-       struct pinctrl_state    *pins_default;
-       struct pinctrl_state    *pins_sleep;
        const struct vendor_data *vendor;
        unsigned int            dmacr;          /* dma control reg */
        unsigned int            im;             /* interrupt mask */
@@@ -1479,12 -1476,7 +1475,7 @@@ static int pl011_hwinit(struct uart_por
        int retval;
  
        /* Optionaly enable pins to be muxed in and configured */
-       if (!IS_ERR(uap->pins_default)) {
-               retval = pinctrl_select_state(uap->pinctrl, uap->pins_default);
-               if (retval)
-                       dev_err(port->dev,
-                               "could not set default pins\n");
-       }
+       pinctrl_pm_select_default_state(port->dev);
  
        /*
         * Try to enable the clock producer.
@@@ -1610,7 -1602,6 +1601,6 @@@ static void pl011_shutdown(struct uart_
  {
        struct uart_amba_port *uap = (struct uart_amba_port *)port;
        unsigned int cr;
-       int retval;
  
        /*
         * disable all interrupts
         */
        clk_disable_unprepare(uap->clk);
        /* Optionally let pins go into sleep states */
-       if (!IS_ERR(uap->pins_sleep)) {
-               retval = pinctrl_select_state(uap->pinctrl, uap->pins_sleep);
-               if (retval)
-                       dev_err(port->dev,
-                               "could not set pins to sleep state\n");
-       }
+       pinctrl_pm_select_sleep_state(port->dev);
  
        if (uap->port.dev->platform_data) {
                struct amba_pl011_data *plat;
@@@ -2012,12 -1997,7 +1996,7 @@@ static int __init pl011_console_setup(s
                return -ENODEV;
  
        /* Allow pins to be muxed in and configured */
-       if (!IS_ERR(uap->pins_default)) {
-               ret = pinctrl_select_state(uap->pinctrl, uap->pins_default);
-               if (ret)
-                       dev_err(uap->port.dev,
-                               "could not set default pins\n");
-       }
+       pinctrl_pm_select_default_state(uap->port.dev);
  
        ret = clk_prepare(uap->clk);
        if (ret)
@@@ -2131,21 -2111,6 +2110,6 @@@ static int pl011_probe(struct amba_devi
                goto out;
        }
  
-       uap->pinctrl = devm_pinctrl_get(&dev->dev);
-       if (IS_ERR(uap->pinctrl)) {
-               ret = PTR_ERR(uap->pinctrl);
-               goto out;
-       }
-       uap->pins_default = pinctrl_lookup_state(uap->pinctrl,
-                                                PINCTRL_STATE_DEFAULT);
-       if (IS_ERR(uap->pins_default))
-               dev_err(&dev->dev, "could not get default pinstate\n");
-       uap->pins_sleep = pinctrl_lookup_state(uap->pinctrl,
-                                              PINCTRL_STATE_SLEEP);
-       if (IS_ERR(uap->pins_sleep))
-               dev_dbg(&dev->dev, "could not get sleep pinstate\n");
        uap->clk = devm_clk_get(&dev->dev, NULL);
        if (IS_ERR(uap->clk)) {
                ret = PTR_ERR(uap->clk);
        uap->lcrh_rx = vendor->lcrh_rx;
        uap->lcrh_tx = vendor->lcrh_tx;
        uap->old_cr = 0;
 -      uap->fifosize = vendor->get_fifosize(dev->periphid);
 +      uap->fifosize = vendor->get_fifosize(dev);
        uap->port.dev = &dev->dev;
        uap->port.mapbase = dev->res.start;
        uap->port.membase = base;