]> Git Repo - linux.git/commitdiff
Merge tag 'gpio-v4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux...
authorLinus Torvalds <[email protected]>
Wed, 18 May 2016 00:39:42 +0000 (17:39 -0700)
committerLinus Torvalds <[email protected]>
Wed, 18 May 2016 00:39:42 +0000 (17:39 -0700)
Pull GPIO updates from Linus Walleij:
 "This is the bulk of GPIO changes for kernel cycle v4.7:

  Core infrastructural changes:

   - Support for natively single-ended GPIO driver stages.

     This means that if the hardware has registers to configure open
     drain or open source configuration, we use that rather than (as we
     did before) try to emulate it by switching the line to an input to
     get high impedance.

     This is also documented throughly in Documentation/gpio/driver.txt
     for those of you who did not understand one word of what I just
     wrote.

   - Start to do away with the unnecessarily complex and unitelligible
     ARCH_REQUIRE_GPIOLIB and ARCH_WANT_OPTIONAL_GPIOLIB, another
     evolutional artifact from the time when the GPIO subsystem was
     unmaintained.

     Archs can now just select GPIOLIB and be done with it, cleanups to
     arches will trickle in for the next kernel.  Some minor archs ACKed
     the changes immediately so these are included in this pull request.

   - Advancing the use of the data pointer inside the GPIO device for
     storing driver data by switching the PowerPC, Super-H Unicore and
     a few other subarches or subsystem drivers in ALSA SoC, Input,
     serial, SSB, staging etc to use it.

   - The initialization now reads the input/output state of the GPIO
     lines, so that each GPIO descriptor knows - if this callback is
     implemented - whether the line is input or output.  This also
     reflects nicely in userspace "lsgpio".

   - It is now possible to name GPIO producer names, line names, from
     the device tree.  (Platform data has been supported for a while).
     I bet we will get a similar mechanism for ACPI one of those days.
     This makes is possible to get sensible producer names for e.g.
     GPIO rails in "lsgpio" in userspace.

  New drivers:

   - New driver for the Loongson1.

   - The XLP driver now supports Broadcom Vulcan ARM64.

   - The IT87 driver now supports IT8620 and IT8628.

   - The PCA953X driver now supports Galileo Gen2.

  Driver improvements:

   - MCP23S08 was switched to use the gpiolib irqchip helpers and now
     also suppors level-triggered interrupts.

   - 74x164 and RCAR now supports the .set_multiple() callback

   - AMDPT was converted to use generic GPIO.

   - TC3589x, TPS65218, SX150X, F7188X, MENZ127, VX855, WM831X, WM8994
     support the new single ended callback for open drain and in some
     cases open source.

   - Implement the .get_direction() callback for a few more drivers like
     PL061, Xgene.

  Cleanups:

   - Paul Gortmaker combed through the drivers and de-modularized those
     who are not really modules.

   - Move the GPIO poweroff DT bindings to the power subdir where they
     belong.

   - Rename gpio-generic.c to gpio-mmio.c, which is much more to the
     point.  That's what it is handling, nothing more, nothing less"

* tag 'gpio-v4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (126 commits)
  MIPS: do away with ARCH_[WANT_OPTIONAL|REQUIRE]_GPIOLIB
  gpio: zevio: make it explicitly non-modular
  gpio: timberdale: make it explicitly non-modular
  gpio: stmpe: make it explicitly non-modular
  gpio: sodaville: make it explicitly non-modular
  pinctrl: sh-pfc: Let gpio_chip.to_irq() return zero on error
  gpio: dwapb: Add ACPI device ID for DWAPB GPIO controller on X-Gene platforms
  gpio: dt-bindings: add wd,mbl-gpio bindings
  gpio: of: make it possible to name GPIO lines
  gpio: make gpiod_to_irq() return negative for NO_IRQ
  gpio: xgene: implement .get_direction()
  gpio: xgene: Enable ACPI support for X-Gene GFC GPIO driver
  gpio: tegra: Implement gpio_get_direction callback
  gpio: set up initial state from .get_direction()
  gpio: rename gpio-generic.c into gpio-mmio.c
  gpio: generic: fix GPIO_GENERIC_PLATFORM is set to module case
  gpio: dwapb: add gpio-signaled acpi event support
  gpio: dwapb: convert device node to fwnode
  gpio: dwapb: remove name from dwapb_port_property
  gpio/qoriq: select IRQ_DOMAIN
  ...

1  2 
MAINTAINERS
arch/mips/Kconfig
arch/sparc/Kconfig
drivers/gpio/gpio-menz127.c
drivers/gpio/gpio-pca953x.c
drivers/gpio/gpio-rcar.c
drivers/gpio/gpio-xgene.c
drivers/gpio/gpiolib.c
kernel/irq/irqdomain.c
sound/soc/codecs/wm8962.c

diff --combined MAINTAINERS
index 1dd9335de071e69c7ebaa1da1e15ca3f3d934335,a023775b58d7a67ea53b86843efecbab4c39f6f9..8267754b94276296ca50acaeaa0f9b68a7cd4957
@@@ -627,7 -627,6 +627,7 @@@ F: include/linux/altera_jtaguart.
  
  AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER
  M:    Tom Lendacky <[email protected]>
 +M:    Gary Hook <[email protected]>
  L:    [email protected]
  S:    Supported
  F:    drivers/crypto/ccp/
@@@ -873,9 -872,9 +873,9 @@@ F: drivers/perf/arm_pmu.
  F:    include/linux/perf/arm_pmu.h
  
  ARM PORT
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.arm.linux.org.uk/
 +W:    http://www.armlinux.org.uk/
  S:    Maintained
  F:    arch/arm/
  
@@@ -887,35 -886,35 +887,35 @@@ F:      arch/arm/plat-*
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
  
  ARM PRIMECELL AACI PL041 DRIVER
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  S:    Maintained
  F:    sound/arm/aaci.*
  
  ARM PRIMECELL CLCD PL110 DRIVER
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  S:    Maintained
  F:    drivers/video/fbdev/amba-clcd.*
  
  ARM PRIMECELL KMI PL050 DRIVER
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  S:    Maintained
  F:    drivers/input/serio/ambakmi.*
  F:    include/linux/amba/kmi.h
  
  ARM PRIMECELL MMCI PL180/1 DRIVER
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  S:    Maintained
  F:    drivers/mmc/host/mmci.*
  F:    include/linux/amba/mmci.h
  
  ARM PRIMECELL UART PL010 AND PL011 DRIVERS
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  S:    Maintained
  F:    drivers/tty/serial/amba-pl01*.c
  F:    include/linux/amba/serial.h
  
  ARM PRIMECELL BUS SUPPORT
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  S:    Maintained
  F:    drivers/amba/
  F:    include/linux/amba/bus.h
@@@ -1037,7 -1036,7 +1037,7 @@@ L:      [email protected]
  S:    Maintained
  
  ARM/CLKDEV SUPPORT
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/include/asm/clkdev.h
@@@ -1094,9 -1093,9 +1094,9 @@@ F:      arch/arm/boot/dts/cx92755
  N:    digicolor
  
  ARM/EBSA110 MACHINE SUPPORT
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.arm.linux.org.uk/
 +W:    http://www.armlinux.org.uk/
  S:    Maintained
  F:    arch/arm/mach-ebsa110/
  F:    drivers/net/ethernet/amd/am79c961a.*
@@@ -1125,9 -1124,9 +1125,9 @@@ T:      git git://git.berlios.de/gemini-boar
  F:    arch/arm/mm/*-fa*
  
  ARM/FOOTBRIDGE ARCHITECTURE
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.arm.linux.org.uk/
 +W:    http://www.armlinux.org.uk/
  S:    Maintained
  F:    arch/arm/include/asm/hardware/dec21285.h
  F:    arch/arm/mach-footbridge/
@@@ -1323,7 -1322,6 +1323,7 @@@ F:      drivers/rtc/rtc-armada38x.
  F:    arch/arm/boot/dts/armada*
  F:    arch/arm/boot/dts/kirkwood*
  F:    arch/arm64/boot/dts/marvell/armada*
 +F:    drivers/cpufreq/mvebu-cpufreq.c
  
  
  ARM/Marvell Berlin SoC support
@@@ -1459,7 -1457,7 +1459,7 @@@ S:      Maintaine
  ARM/PT DIGITAL BOARD PORT
  M:    Stefan Eletzhofer <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.arm.linux.org.uk/
 +W:    http://www.armlinux.org.uk/
  S:    Maintained
  
  ARM/QUALCOMM SUPPORT
@@@ -1472,10 -1470,7 +1472,10 @@@ F:    arch/arm/boot/dts/qcom-*.dt
  F:    arch/arm/boot/dts/qcom-*.dtsi
  F:    arch/arm/mach-qcom/
  F:    arch/arm64/boot/dts/qcom/*
 +F:    drivers/i2c/busses/i2c-qup.c
 +F:    drivers/clk/qcom/
  F:    drivers/soc/qcom/
 +F:    drivers/spi/spi-qup.c
  F:    drivers/tty/serial/msm_serial.h
  F:    drivers/tty/serial/msm_serial.c
  F:    drivers/*/pm8???-*
@@@ -1498,9 -1493,9 +1498,9 @@@ S:      Supporte
  F:    arch/arm64/boot/dts/renesas/
  
  ARM/RISCPC ARCHITECTURE
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.arm.linux.org.uk/
 +W:    http://www.armlinux.org.uk/
  S:    Maintained
  F:    arch/arm/include/asm/hardware/entry-macro-iomd.S
  F:    arch/arm/include/asm/hardware/ioc.h
@@@ -1778,9 -1773,9 +1778,9 @@@ F:      drivers/clk/versatile/clk-vexpress-o
  F:    drivers/clocksource/versatile.c
  
  ARM/VFP SUPPORT
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.arm.linux.org.uk/
 +W:    http://www.armlinux.org.uk/
  S:    Maintained
  F:    arch/arm/vfp/
  
@@@ -2208,13 -2203,10 +2208,13 @@@ BATMAN ADVANCE
  M:    Marek Lindner <[email protected]>
  M:    Simon Wunderlich <[email protected]>
  M:    Antonio Quartulli <[email protected]>
 -L:    [email protected]
 +L:    [email protected] (moderated for non-subscribers)
  W:    https://www.open-mesh.org/
  Q:    https://patchwork.open-mesh.org/project/batman/list/
  S:    Maintained
 +F:    Documentation/ABI/testing/sysfs-class-net-batman-adv
 +F:    Documentation/ABI/testing/sysfs-class-net-mesh
 +F:    Documentation/networking/batman-adv.txt
  F:    net/batman-adv/
  
  BAYCOM/HDLCDRV DRIVERS FOR AX.25
@@@ -2929,7 -2921,7 +2929,7 @@@ F:      mm/cleancache.
  F:    include/linux/cleancache.h
  
  CLK API
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    include/linux/clk.h
@@@ -3356,16 -3348,15 +3356,16 @@@ F:   Documentation/powerpc/cxlflash.tx
  
  STMMAC ETHERNET DRIVER
  M:    Giuseppe Cavallaro <[email protected]>
 +M:    Alexandre Torgue <[email protected]>
  L:    [email protected]
  W:    http://www.stlinux.com
  S:    Supported
  F:    drivers/net/ethernet/stmicro/stmmac/
  
  CYBERPRO FB DRIVER
 -M:    Russell King <linux@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -W:    http://www.arm.linux.org.uk/
 +W:    http://www.armlinux.org.uk/
  S:    Maintained
  F:    drivers/video/fbdev/cyber2000fb.*
  
@@@ -3548,15 -3539,6 +3548,15 @@@ F:    drivers/devfreq/devfreq-event.
  F:    include/linux/devfreq-event.h
  F:    Documentation/devicetree/bindings/devfreq/event/
  
 +BUS FREQUENCY DRIVER FOR SAMSUNG EXYNOS
 +M:    Chanwoo Choi <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq.git
 +S:    Maintained
 +F:    drivers/devfreq/exynos-bus.c
 +F:    Documentation/devicetree/bindings/devfreq/exynos-bus.txt
 +
  DEVICE NUMBER REGISTRY
  M:    Torben Mathiasen <[email protected]>
  W:    http://lanana.org/docs/device-list/index.html
@@@ -3899,7 -3881,7 +3899,7 @@@ F:      Documentation/devicetree/bindings/di
  
  DRM DRIVERS FOR VIVANTE GPU IP
  M:    Lucas Stach <[email protected]>
 -R:    Russell King <linux+etnaviv@arm.linux.org.uk>
 +R:    Russell King <[email protected]>
  R:    Christian Gmeiner <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -4241,8 -4223,8 +4241,8 @@@ F:      Documentation/efi-stub.tx
  F:    arch/ia64/kernel/efi.c
  F:    arch/x86/boot/compressed/eboot.[ch]
  F:    arch/x86/include/asm/efi.h
 -F:    arch/x86/platform/efi/*
 -F:    drivers/firmware/efi/*
 +F:    arch/x86/platform/efi/
 +F:    drivers/firmware/efi/
  F:    include/linux/efi*.h
  
  EFI VARIABLE FILESYSTEM
@@@ -4320,7 -4302,7 +4320,7 @@@ F:      drivers/net/ethernet/agere
  
  ETHERNET BRIDGE
  M:    Stephen Hemminger <[email protected]>
 -L:    [email protected]
 +L:    [email protected] (moderated for non-subscribers)
  L:    [email protected]
  W:    http://www.linuxfoundation.org/en/Net:Bridge
  S:    Maintained
@@@ -4762,7 -4744,7 +4762,7 @@@ F:      drivers/platform/x86/fujitsu-tablet.
  
  FUSE: FILESYSTEM IN USERSPACE
  M:    Miklos Szeredi <[email protected]>
 -L:    [email protected]
 +L:    [email protected]
  W:    http://fuse.sourceforge.net/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git
  S:    Maintained
@@@ -4902,6 -4884,7 +4902,7 @@@ M:      Alexandre Courbot <[email protected]
  L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
  S:    Maintained
+ F:    Documentation/devicetree/bindings/gpio/
  F:    Documentation/gpio/
  F:    Documentation/ABI/testing/gpio-cdev
  F:    Documentation/ABI/obsolete/sysfs-gpio
@@@ -4921,7 -4904,7 +4922,7 @@@ F:      net/ipv4/gre_offload.
  F:    include/net/gre.h
  
  GRETH 10/100/1G Ethernet MAC device driver
 -M:    Kristoffer Glembo <kristoffer@gaisler.com>
 +M:    Andreas Larsson <andreas@gaisler.com>
  L:    [email protected]
  S:    Maintained
  F:    drivers/net/ethernet/aeroflex/
@@@ -5060,7 -5043,6 +5061,7 @@@ F:      include/linux/hw_random.
  HARDWARE SPINLOCK CORE
  M:    Ohad Ben-Cohen <[email protected]>
  M:    Bjorn Andersson <[email protected]>
 +L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock.git
  F:    Documentation/hwspinlock.txt
@@@ -5762,7 -5744,14 +5763,7 @@@ F:     drivers/char/hw_random/ixp4xx-rng.
  
  INTEL ETHERNET DRIVERS
  M:    Jeff Kirsher <[email protected]>
 -R:    Jesse Brandeburg <[email protected]>
 -R:    Shannon Nelson <[email protected]>
 -R:    Carolyn Wyborny <[email protected]>
 -R:    Don Skidmore <[email protected]>
 -R:    Bruce Allan <[email protected]>
 -R:    John Ronciak <[email protected]>
 -R:    Mitch Williams <[email protected]>
 -L:    [email protected]
 +L:    [email protected] (moderated for non-subscribers)
  W:    http://www.intel.com/support/feedback.htm
  W:    http://e1000.sourceforge.net/
  Q:    http://patchwork.ozlabs.org/project/intel-wired-lan/list/
@@@ -6038,7 -6027,7 +6039,7 @@@ F:      include/scsi/*iscsi
  
  ISCSI EXTENSIONS FOR RDMA (ISER) INITIATOR
  M:    Or Gerlitz <[email protected]>
 -M:    Sagi Grimberg <sagi[email protected]>
 +M:    Sagi Grimberg <sagi@grimberg.me>
  M:    Roi Dayan <[email protected]>
  L:    [email protected]
  S:    Supported
@@@ -6048,7 -6037,7 +6049,7 @@@ Q:      http://patchwork.kernel.org/project/
  F:    drivers/infiniband/ulp/iser/
  
  ISCSI EXTENSIONS FOR RDMA (ISER) TARGET
 -M:    Sagi Grimberg <sagi[email protected]>
 +M:    Sagi Grimberg <sagi@grimberg.me>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master
  L:    [email protected]
  L:    [email protected]
@@@ -6263,8 -6252,8 +6264,8 @@@ S:      Maintaine
  F:    tools/testing/selftests
  
  KERNEL VIRTUAL MACHINE (KVM)
 -M:    Gleb Natapov <[email protected]>
  M:    Paolo Bonzini <[email protected]>
 +M:    Radim Krčmář <[email protected]>
  L:    [email protected]
  W:    http://www.linux-kvm.org
  T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
@@@ -6411,10 -6400,10 +6412,10 @@@ F:   mm/kmemleak.
  F:    mm/kmemleak-test.c
  
  KPROBES
 -M:    Ananth N Mavinakayanahalli <ananth@in.ibm.com>
 +M:    Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
  M:    Anil S Keshavamurthy <[email protected]>
  M:    "David S. Miller" <[email protected]>
 -M:    Masami Hiramatsu <m[email protected]>
 +M:    Masami Hiramatsu <m[email protected]>
  S:    Maintained
  F:    Documentation/kprobes.txt
  F:    include/linux/kprobes.h
@@@ -6699,7 -6688,6 +6700,7 @@@ F:      kernel/livepatch
  F:    include/linux/livepatch.h
  F:    arch/x86/include/asm/livepatch.h
  F:    arch/x86/kernel/livepatch.c
 +F:    Documentation/livepatch/
  F:    Documentation/ABI/testing/sysfs-kernel-livepatch
  F:    samples/livepatch/
  L:    [email protected]
@@@ -6917,7 -6905,7 +6918,7 @@@ L:      [email protected]
  S:    Maintained
  
  MARVELL ARMADA DRM SUPPORT
 -M:    Russell King <rmk+kernel@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  S:    Maintained
  F:    drivers/gpu/drm/armada/
  
@@@ -7032,9 -7020,9 +7033,9 @@@ M:      Chanwoo Choi <[email protected]
  M:    Krzysztof Kozlowski <[email protected]>
  L:    [email protected]
  S:    Supported
 -F:    drivers/*/max14577.c
 +F:    drivers/*/max14577*.c
  F:    drivers/*/max77686*.c
 -F:    drivers/*/max77693.c
 +F:    drivers/*/max77693*.c
  F:    drivers/extcon/extcon-max14577.c
  F:    drivers/extcon/extcon-max77693.c
  F:    drivers/rtc/rtc-max77686.c
@@@ -7588,7 -7576,7 +7589,7 @@@ F:      drivers/infiniband/hw/nes
  
  NETEM NETWORK EMULATOR
  M:    Stephen Hemminger <[email protected]>
 -L:    [email protected]
 +L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
  F:    net/sched/sch_netem.c
  
@@@ -7917,7 -7905,7 +7918,7 @@@ S:      Supporte
  F:    drivers/nfc/nxp-nci
  
  NXP TDA998X DRM DRIVER
 -M:    Russell King <rmk+kernel@arm.linux.org.uk>
 +M:    Russell King <[email protected]>
  S:    Supported
  F:    drivers/gpu/drm/i2c/tda998x_drv.c
  F:    include/drm/i2c/tda998x.h
@@@ -7990,7 -7978,7 +7991,7 @@@ F:      arch/arm/*omap*/*pm
  F:    drivers/cpufreq/omap-cpufreq.c
  
  OMAP POWERDOMAIN SOC ADAPTATION LAYER SUPPORT
 -M:    Rajendra Nayak <rnayak@ti.com>
 +M:    Rajendra Nayak <rnayak@codeaurora.org>
  M:    Paul Walmsley <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -8266,7 -8254,7 +8267,7 @@@ F:      Documentation/filesystems/overlayfs.
  
  ORANGEFS FILESYSTEM
  M:    Mike Marshall <[email protected]>
 -L:    [email protected]
 +L:    [email protected] (subscribers-only)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux.git
  S:    Supported
  F:    fs/orangefs/
@@@ -8724,8 -8712,6 +8725,8 @@@ F:      drivers/pinctrl/sh-pfc
  
  PIN CONTROLLER - SAMSUNG
  M:    Tomasz Figa <[email protected]>
 +M:    Krzysztof Kozlowski <[email protected]>
 +M:    Sylwester Nawrocki <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  L:    [email protected] (moderated for non-subscribers)
  S:    Maintained
@@@ -9154,13 -9140,6 +9155,13 @@@ T:    git git://github.com/KrasnikovEugene
  S:    Supported
  F:    drivers/net/wireless/ath/wcn36xx/
  
 +QEMU MACHINE EMULATOR AND VIRTUALIZER SUPPORT
 +M:    Gabriel Somlo <[email protected]>
 +M:    "Michael S. Tsirkin" <[email protected]>
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/firmware/qemu_fw_cfg.c
 +
  RADOS BLOCK DEVICE (RBD)
  M:    Ilya Dryomov <[email protected]>
  M:    Sage Weil <[email protected]>
@@@ -9336,7 -9315,6 +9337,7 @@@ F:      include/linux/regmap.
  REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM
  M:    Ohad Ben-Cohen <[email protected]>
  M:    Bjorn Andersson <[email protected]>
 +L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc.git
  S:    Maintained
  F:    drivers/remoteproc/
@@@ -9346,7 -9324,6 +9347,7 @@@ F:      include/linux/remoteproc.
  REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM
  M:    Ohad Ben-Cohen <[email protected]>
  M:    Bjorn Andersson <[email protected]>
 +L:    [email protected]
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg.git
  S:    Maintained
  F:    drivers/rpmsg/
@@@ -9501,7 -9478,7 +9502,7 @@@ F:      drivers/net/wireless/realtek/rtlwifi
  RTL8XXXU WIRELESS DRIVER (rtl8xxxu)
  M:    Jes Sorensen <[email protected]>
  L:    [email protected]
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jes/linux.git rtl8723au-mac80211
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jes/linux.git rtl8xxxu-devel
  S:    Maintained
  F:    drivers/net/wireless/realtek/rtl8xxxu/
  
@@@ -10026,8 -10003,7 +10027,8 @@@ F:   drivers/infiniband/hw/ocrdma
  
  SFC NETWORK DRIVER
  M:    Solarflare linux maintainers <[email protected]>
 -M:    Shradha Shah <[email protected]>
 +M:    Edward Cree <[email protected]>
 +M:    Bert Kenward <[email protected]>
  L:    [email protected]
  S:    Supported
  F:    drivers/net/ethernet/sfc/
  S:    Maintained
  F:    drivers/staging/nvec/
  
 +STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON)
 +M:    Jens Frederich <[email protected]>
 +M:    Daniel Drake <[email protected]>
 +M:    Jon Nettleton <[email protected]>
 +W:    http://wiki.laptop.org/go/DCON
 +S:    Maintained
 +F:    drivers/staging/olpc_dcon/
 +
  STAGING - REALTEK RTL8712U DRIVERS
  M:    Larry Finger <[email protected]>
  M:    Florian Schilhabel <[email protected]>.
@@@ -11084,15 -11052,6 +11085,15 @@@ S: Maintaine
  F:    drivers/clk/ti/
  F:    include/linux/clk/ti.h
  
 +TI ETHERNET SWITCH DRIVER (CPSW)
 +M:    Mugunthan V N <[email protected]>
 +R:    Grygorii Strashko <[email protected]>
 +L:    [email protected]
 +L:    [email protected]
 +S:    Maintained
 +F:    drivers/net/ethernet/ti/cpsw*
 +F:    drivers/net/ethernet/ti/davinci*
 +
  TI FLASH MEDIA INTERFACE DRIVER
  M:    Alex Dubov <[email protected]>
  S:    Maintained
@@@ -11179,8 -11138,8 +11180,8 @@@ F:   include/uapi/linux/tipc*.
  F:    net/tipc/
  
  TILE ARCHITECTURE
 -M:    Chris Metcalf <cmetcalf@ezchip.com>
 -W:    http://www.ezchip.com/scm/
 +M:    Chris Metcalf <cmetcalf@mellanox.com>
 +W:    http://www.mellanox.com/repository/solutions/tile-scm/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile.git
  S:    Supported
  F:    arch/tile/
@@@ -11258,13 -11217,14 +11259,13 @@@ S:        Maintaine
  F:    drivers/media/i2c/tc358743*
  F:    include/media/i2c/tc358743.h
  
 -TMIO MMC DRIVER
 -M:    Ian Molton <[email protected]>
 +TMIO/SDHI MMC DRIVER
 +M:    Wolfram Sang <[email protected]>
  L:    [email protected]
 -S:    Maintained
 +S:    Supported
  F:    drivers/mmc/host/tmio_mmc*
  F:    drivers/mmc/host/sh_mobile_sdhi.c
 -F:    include/linux/mmc/tmio.h
 -F:    include/linux/mmc/sh_mobile_sdhi.h
 +F:    include/linux/mfd/tmio.h
  
  TMP401 HARDWARE MONITOR DRIVER
  M:    Guenter Roeck <[email protected]>
@@@ -11329,20 -11289,6 +11330,20 @@@ F: include/trace
  F:    kernel/trace/
  F:    tools/testing/selftests/ftrace/
  
 +TRACING MMIO ACCESSES (MMIOTRACE)
 +M:    Steven Rostedt <[email protected]>
 +M:    Ingo Molnar <[email protected]>
 +R:    Karol Herbst <[email protected]>
 +R:    Pekka Paalanen <[email protected]>
 +S:    Maintained
 +L:    [email protected]
 +L:    [email protected]
 +F:    kernel/trace/trace_mmiotrace.c
 +F:    include/linux/mmiotrace.h
 +F:    arch/x86/mm/kmmio.c
 +F:    arch/x86/mm/mmio-mod.c
 +F:    arch/x86/mm/testmmiotrace.c
 +
  TRIVIAL PATCHES
  M:    Jiri Kosina <[email protected]>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial.git
  W:    http://www.slimlogic.co.uk/?p=48
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
  S:    Supported
 +F:    Documentation/devicetree/bindings/regulator/
  F:    drivers/regulator/
 +F:    include/dt-bindings/regulator/
  F:    include/linux/regulator/
  
  VRF
@@@ -12259,9 -12203,9 +12260,9 @@@ S:   Maintaine
  F:    drivers/media/tuners/tuner-xc2028.*
  
  XEN HYPERVISOR INTERFACE
 -M:    Konrad Rzeszutek Wilk <[email protected]>
  M:    Boris Ostrovsky <[email protected]>
  M:    David Vrabel <[email protected]>
 +M:    Juergen Gross <[email protected]>
  L:    [email protected] (moderated for non-subscribers)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git
  S:    Supported
@@@ -12273,16 -12217,16 +12274,16 @@@ F:        include/xen
  F:    include/uapi/xen/
  
  XEN HYPERVISOR ARM
 -M:    Stefano Stabellini <s[email protected]>
 +M:    Stefano Stabellini <s[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -S:    Supported
 +S:    Maintained
  F:    arch/arm/xen/
  F:    arch/arm/include/asm/xen/
  
  XEN HYPERVISOR ARM64
 -M:    Stefano Stabellini <s[email protected]>
 +M:    Stefano Stabellini <s[email protected]>
  L:    [email protected] (moderated for non-subscribers)
 -S:    Supported
 +S:    Maintained
  F:    arch/arm64/xen/
  F:    arch/arm64/include/asm/xen/
  
diff --combined arch/mips/Kconfig
index 3ee1ea61b2dc7b571efe16bc66b133eddfdfed62,512b5def854db043509f20cef4dd6ab682c2c1d6..d2ac1174ee17ab0c088c91cbf37151e855a46062
@@@ -15,7 -15,7 +15,7 @@@ config MIP
        select HAVE_ARCH_KGDB
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
 -      select HAVE_BPF_JIT if !CPU_MICROMIPS
 +      select HAVE_CBPF_JIT if !CPU_MICROMIPS
        select HAVE_FUNCTION_TRACER
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE_MCOUNT_RECORD
@@@ -79,7 -79,7 +79,7 @@@ config MIPS_ALCHEM
        select SYS_HAS_CPU_MIPS32_R1
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_APM_EMULATION
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        select SYS_SUPPORTS_ZBOOT
        select COMMON_CLK
  
@@@ -98,7 -98,7 +98,7 @@@ config AR
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_SUPPORTS_MIPS16
        select SYS_SUPPORTS_ZBOOT_UART16550
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        select VLYNQ
        select HAVE_CLK
        help
@@@ -122,11 -122,11 +122,11 @@@ config ATH2
  config ATH79
        bool "Atheros AR71XX/AR724X/AR913X based boards"
        select ARCH_HAS_RESET_CONTROLLER
-       select ARCH_REQUIRE_GPIOLIB
        select BOOT_RAW
        select CEVT_R4K
        select CSRC_R4K
        select DMA_NONCOHERENT
+       select GPIOLIB
        select HAVE_CLK
        select COMMON_CLK
        select CLKDEV_LOOKUP
@@@ -170,7 -170,6 +170,6 @@@ config BMIPS_GENERI
        select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
        select USB_OHCI_BIG_ENDIAN_DESC if CPU_BIG_ENDIAN
        select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
-       select ARCH_WANT_OPTIONAL_GPIOLIB
        help
          Build a generic DT-based kernel image that boots on select
          BCM33xx cable modem chips, BCM63xx DSL chips, and BCM7xxx set-top
  
  config BCM47XX
        bool "Broadcom BCM47XX based boards"
-       select ARCH_WANT_OPTIONAL_GPIOLIB
        select BOOT_RAW
        select CEVT_R4K
        select CSRC_R4K
@@@ -211,7 -209,7 +209,7 @@@ config BCM63X
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_HAS_EARLY_PRINTK
        select SWAP_IO_SPACE
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        select HAVE_CLK
        select MIPS_L1_CACHE_SHIFT_4
        help
@@@ -305,7 -303,7 +303,7 @@@ config MACH_INGENI
        select SYS_SUPPORTS_ZBOOT_UART16550
        select DMA_NONCOHERENT
        select IRQ_MIPS_CPU
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        select COMMON_CLK
        select GENERIC_IRQ_CHIP
        select BUILTIN_DTB
@@@ -325,7 -323,7 +323,7 @@@ config LANTI
        select SYS_SUPPORTS_MIPS16
        select SYS_SUPPORTS_MULTITHREADING
        select SYS_HAS_EARLY_PRINTK
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        select SWAP_IO_SPACE
        select BOOT_RAW
        select CLKDEV_LOOKUP
@@@ -377,7 -375,6 +375,6 @@@ config MACH_LOONGSON6
  
  config MACH_PISTACHIO
        bool "IMG Pistachio SoC based boards"
-       select ARCH_REQUIRE_GPIOLIB
        select BOOT_ELF32
        select BOOT_RAW
        select CEVT_R4K
        select COMMON_CLK
        select CSRC_R4K
        select DMA_MAYBE_COHERENT
+       select GPIOLIB
        select IRQ_MIPS_CPU
        select LIBFDT
        select MFD_SYSCON
  
  config MACH_XILFPGA
        bool "MIPSfpga Xilinx based boards"
-       select ARCH_REQUIRE_GPIOLIB
        select BOOT_ELF32
        select BOOT_RAW
        select BUILTIN_DTB
        select CEVT_R4K
        select COMMON_CLK
        select CSRC_R4K
+       select GPIOLIB
        select IRQ_MIPS_CPU
        select LIBFDT
        select MIPS_CPU_SCACHE
@@@ -536,7 -534,7 +534,7 @@@ config MACH_VR41X
        select CSRC_R4K
        select SYS_HAS_CPU_VR41XX
        select SYS_SUPPORTS_MIPS16
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
  
  config NXP_STB220
        bool "NXP STB220 board"
@@@ -856,7 -854,7 +854,7 @@@ config MIKROTIK_RB53
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SWAP_IO_SPACE
        select BOOT_RAW
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        select MIPS_L1_CACHE_SHIFT_4
        help
          Support the Mikrotik(tm) RouterBoard 532 series,
@@@ -879,7 -877,7 +877,7 @@@ config CAVIUM_OCTEON_SO
        select HW_HAS_PCI
        select ZONE_DMA32
        select HOLES_IN_ZONE
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        select LIBFDT
        select USE_OF
        select ARCH_SPARSEMEM_ENABLE
@@@ -937,7 -935,7 +935,7 @@@ config NLM_XLP_BOAR
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_64BIT_KERNEL
        select ARCH_PHYS_ADDR_T_64BIT
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        select SYS_SUPPORTS_BIG_ENDIAN
        select SYS_SUPPORTS_LITTLE_ENDIAN
        select SYS_SUPPORTS_HIGHMEM
@@@ -1077,7 -1075,7 +1075,7 @@@ config MIPS_CLOCK_VSYSCAL
        def_bool CSRC_R4K || CLKSRC_MIPS_GIC
  
  config GPIO_TXX9
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        bool
  
  config FW_CFE
@@@ -1342,7 -1340,7 +1340,7 @@@ config CPU_LOONGSON
        select CPU_SUPPORTS_HUGEPAGES
        select WEAK_ORDERING
        select WEAK_REORDERING_BEYOND_LLSC
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        help
                The Loongson 3 processor implements the MIPS64R2 instruction
                set with many extensions.
@@@ -1362,7 -1360,7 +1360,7 @@@ config CPU_LOONGSON2
        bool "Loongson 2F"
        depends on SYS_HAS_CPU_LOONGSON2F
        select CPU_LOONGSON2
-       select ARCH_REQUIRE_GPIOLIB
+       select GPIOLIB
        help
          The Loongson 2F processor implements the MIPS III instruction set
          with many extensions.
diff --combined arch/sparc/Kconfig
index d5003812c7485b3b35a2bfc53865bde047b1e38b,6bd1b1c3f5cc1c93093da2fccc29adc4f599b71a..db0a26cffa97a77a6ddeae359ce033e26493709b
@@@ -21,7 -21,6 +21,6 @@@ config SPAR
        select HAVE_ARCH_KGDB if !SMP || SPARC64
        select HAVE_ARCH_TRACEHOOK
        select SYSCTL_EXCEPTION_TRACE
-       select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select RTC_CLASS
        select RTC_DRV_M48T59
@@@ -32,7 -31,7 +31,7 @@@
        select ARCH_WANT_IPC_PARSE_VERSION
        select GENERIC_PCI_IOMAP
        select HAVE_NMI_WATCHDOG if SPARC64
 -      select HAVE_BPF_JIT
 +      select HAVE_CBPF_JIT
        select HAVE_DEBUG_BUGVERBOSE
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_CLOCKEVENTS
index c5c9599a3a71b3182d2e269fa01173b6cdf570cc,334fe270dcf18295564afb90ae0827d13f84e7bd..cc103aff45e45fc4d76faa2137770b0742730d0e
  struct men_z127_gpio {
        struct gpio_chip gc;
        void __iomem *reg_base;
-       struct mcb_device *mdev;
        struct resource *mem;
 -      spinlock_t lock;
  };
  
  static int men_z127_debounce(struct gpio_chip *gc, unsigned gpio,
                             unsigned debounce)
  {
        struct men_z127_gpio *priv = gpiochip_get_data(gc);
-       struct device *dev = &priv->mdev->dev;
+       struct device *dev = gc->parent;
        unsigned int rnd;
        u32 db_en, db_cnt;
  
@@@ -68,7 -68,7 +67,7 @@@
                debounce /= 50;
        }
  
 -      spin_lock(&priv->lock);
 +      spin_lock(&gc->bgpio_lock);
  
        db_en = readl(priv->reg_base + MEN_Z127_DBER);
  
        writel(db_en, priv->reg_base + MEN_Z127_DBER);
        writel(db_cnt, priv->reg_base + GPIO_TO_DBCNT_REG(gpio));
  
 -      spin_unlock(&priv->lock);
 +      spin_unlock(&gc->bgpio_lock);
  
        return 0;
  }
  
- static int men_z127_request(struct gpio_chip *gc, unsigned gpio_pin)
+ static int men_z127_set_single_ended(struct gpio_chip *gc,
+                                    unsigned offset,
+                                    enum single_ended_mode mode)
  {
        struct men_z127_gpio *priv = gpiochip_get_data(gc);
        u32 od_en;
  
-       if (gpio_pin >= gc->ngpio)
-               return -EINVAL;
+       if (mode != LINE_MODE_OPEN_DRAIN &&
+           mode != LINE_MODE_PUSH_PULL)
+               return -ENOTSUPP;
  
 -      spin_lock(&priv->lock);
 +      spin_lock(&gc->bgpio_lock);
        od_en = readl(priv->reg_base + MEN_Z127_ODER);
  
-       if (gpiochip_line_is_open_drain(gc, gpio_pin))
-               od_en |= BIT(gpio_pin);
+       if (mode == LINE_MODE_OPEN_DRAIN)
+               od_en |= BIT(offset);
        else
-               od_en &= ~BIT(gpio_pin);
+               /* Implicitly LINE_MODE_PUSH_PULL */
+               od_en &= ~BIT(offset);
  
        writel(od_en, priv->reg_base + MEN_Z127_ODER);
 -      spin_unlock(&priv->lock);
 +      spin_unlock(&gc->bgpio_lock);
  
        return 0;
  }
@@@ -135,7 -139,6 +138,6 @@@ static int men_z127_probe(struct mcb_de
                goto err_release;
        }
  
-       men_z127_gpio->mdev = mdev;
        mcb_set_drvdata(mdev, men_z127_gpio);
  
        ret = bgpio_init(&men_z127_gpio->gc, &mdev->dev, 4,
                goto err_unmap;
  
        men_z127_gpio->gc.set_debounce = men_z127_debounce;
-       men_z127_gpio->gc.request = men_z127_request;
+       men_z127_gpio->gc.set_single_ended = men_z127_set_single_ended;
  
        ret = gpiochip_add_data(&men_z127_gpio->gc, men_z127_gpio);
        if (ret) {
index e66084c295fbff18a115927ecc28822aae6b3e63,8d8f06dc0686f4464ac67d1764858934027a34eb..5e3be32ebb8d8f74dd0f7616d462f777d6db071a
@@@ -18,7 -18,6 +18,7 @@@
  #include <linux/i2c.h>
  #include <linux/platform_data/pca953x.h>
  #include <linux/slab.h>
 +#include <asm/unaligned.h>
  #include <linux/of_platform.h>
  #include <linux/acpi.h>
  
  #define PCA957X_MSK           6
  #define PCA957X_INTS          7
  
+ #define PCAL953X_IN_LATCH     34
+ #define PCAL953X_INT_MASK     37
+ #define PCAL953X_INT_STAT     38
  #define PCA_GPIO_MASK         0x00FF
  #define PCA_INT                       0x0100
+ #define PCA_PCAL                      0x0200
  #define PCA953X_TYPE          0x1000
  #define PCA957X_TYPE          0x2000
  #define PCA_TYPE_MASK         0xF000
@@@ -77,7 -81,7 +82,7 @@@ static const struct i2c_device_id pca95
  MODULE_DEVICE_TABLE(i2c, pca953x_id);
  
  static const struct acpi_device_id pca953x_acpi_ids[] = {
-       { "INT3491", 16 | PCA953X_TYPE | PCA_INT, },
+       { "INT3491", 16 | PCA953X_TYPE | PCA_INT | PCA_PCAL, },
        { }
  };
  MODULE_DEVICE_TABLE(acpi, pca953x_acpi_ids);
@@@ -160,7 -164,7 +165,7 @@@ static int pca953x_write_regs(struct pc
                switch (chip->chip_type) {
                case PCA953X_TYPE:
                        ret = i2c_smbus_write_word_data(chip->client,
 -                                                      reg << 1, (u16) *val);
 +                          reg << 1, cpu_to_le16(get_unaligned((u16 *)val)));
                        break;
                case PCA957X_TYPE:
                        ret = i2c_smbus_write_byte_data(chip->client, reg << 1,
@@@ -437,6 -441,18 +442,18 @@@ static void pca953x_irq_bus_sync_unlock
        struct pca953x_chip *chip = gpiochip_get_data(gc);
        u8 new_irqs;
        int level, i;
+       u8 invert_irq_mask[MAX_BANK];
+       if (chip->driver_data & PCA_PCAL) {
+               /* Enable latch on interrupt-enabled inputs */
+               pca953x_write_regs(chip, PCAL953X_IN_LATCH, chip->irq_mask);
+               for (i = 0; i < NBANK(chip); i++)
+                       invert_irq_mask[i] = ~chip->irq_mask[i];
+               /* Unmask enabled interrupts */
+               pca953x_write_regs(chip, PCAL953X_INT_MASK, invert_irq_mask);
+       }
  
        /* Look for any newly setup interrupt */
        for (i = 0; i < NBANK(chip); i++) {
@@@ -498,6 -514,29 +515,29 @@@ static bool pca953x_irq_pending(struct 
        u8 trigger[MAX_BANK];
        int ret, i, offset = 0;
  
+       if (chip->driver_data & PCA_PCAL) {
+               /* Read the current interrupt status from the device */
+               ret = pca953x_read_regs(chip, PCAL953X_INT_STAT, trigger);
+               if (ret)
+                       return false;
+               /* Check latched inputs and clear interrupt status */
+               ret = pca953x_read_regs(chip, PCA953X_INPUT, cur_stat);
+               if (ret)
+                       return false;
+               for (i = 0; i < NBANK(chip); i++) {
+                       /* Apply filter for rising/falling edge selection */
+                       pending[i] = (~cur_stat[i] & chip->irq_trig_fall[i]) |
+                               (cur_stat[i] & chip->irq_trig_raise[i]);
+                       pending[i] &= trigger[i];
+                       if (pending[i])
+                               pending_seen = true;
+               }
+               return pending_seen;
+       }
        switch (chip->chip_type) {
        case PCA953X_TYPE:
                offset = PCA953X_INPUT;
diff --combined drivers/gpio/gpio-rcar.c
index 4d9a315cfd43ea8fb9d97b0578f9c6bd4c38ef00,3fe8e773d95c3b6286226888d9e16fddf6f60091..681c93fb9e7003bfbd2482eff52aff6d35a9fa4c
@@@ -196,6 -196,44 +196,6 @@@ static int gpio_rcar_irq_set_wake(struc
        return 0;
  }
  
 -static void gpio_rcar_irq_bus_lock(struct irq_data *d)
 -{
 -      struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 -      struct gpio_rcar_priv *p = gpiochip_get_data(gc);
 -
 -      pm_runtime_get_sync(&p->pdev->dev);
 -}
 -
 -static void gpio_rcar_irq_bus_sync_unlock(struct irq_data *d)
 -{
 -      struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 -      struct gpio_rcar_priv *p = gpiochip_get_data(gc);
 -
 -      pm_runtime_put(&p->pdev->dev);
 -}
 -
 -
 -static int gpio_rcar_irq_request_resources(struct irq_data *d)
 -{
 -      struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 -      struct gpio_rcar_priv *p = gpiochip_get_data(gc);
 -      int error;
 -
 -      error = pm_runtime_get_sync(&p->pdev->dev);
 -      if (error < 0)
 -              return error;
 -
 -      return 0;
 -}
 -
 -static void gpio_rcar_irq_release_resources(struct irq_data *d)
 -{
 -      struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
 -      struct gpio_rcar_priv *p = gpiochip_get_data(gc);
 -
 -      pm_runtime_put(&p->pdev->dev);
 -}
 -
  static irqreturn_t gpio_rcar_irq_handler(int irq, void *dev_id)
  {
        struct gpio_rcar_priv *p = dev_id;
@@@ -242,18 -280,32 +242,18 @@@ static void gpio_rcar_config_general_in
  
  static int gpio_rcar_request(struct gpio_chip *chip, unsigned offset)
  {
 -      struct gpio_rcar_priv *p = gpiochip_get_data(chip);
 -      int error;
 -
 -      error = pm_runtime_get_sync(&p->pdev->dev);
 -      if (error < 0)
 -              return error;
 -
 -      error = pinctrl_request_gpio(chip->base + offset);
 -      if (error)
 -              pm_runtime_put(&p->pdev->dev);
 -
 -      return error;
 +      return pinctrl_request_gpio(chip->base + offset);
  }
  
  static void gpio_rcar_free(struct gpio_chip *chip, unsigned offset)
  {
 -      struct gpio_rcar_priv *p = gpiochip_get_data(chip);
 -
        pinctrl_free_gpio(chip->base + offset);
  
 -      /* Set the GPIO as an input to ensure that the next GPIO request won't
 +      /*
 +       * Set the GPIO as an input to ensure that the next GPIO request won't
         * drive the GPIO pin as an output.
         */
        gpio_rcar_config_general_input_output_mode(chip, offset, false);
 -
 -      pm_runtime_put(&p->pdev->dev);
  }
  
  static int gpio_rcar_direction_input(struct gpio_chip *chip, unsigned offset)
@@@ -284,6 -336,25 +284,25 @@@ static void gpio_rcar_set(struct gpio_c
        spin_unlock_irqrestore(&p->lock, flags);
  }
  
+ static void gpio_rcar_set_multiple(struct gpio_chip *chip, unsigned long *mask,
+                                  unsigned long *bits)
+ {
+       struct gpio_rcar_priv *p = gpiochip_get_data(chip);
+       unsigned long flags;
+       u32 val, bankmask;
+       bankmask = mask[0] & GENMASK(chip->ngpio - 1, 0);
+       if (!bankmask)
+               return;
+       spin_lock_irqsave(&p->lock, flags);
+       val = gpio_rcar_read(p, OUTDT);
+       val &= ~bankmask;
+       val |= (bankmask & bits[0]);
+       gpio_rcar_write(p, OUTDT, val);
+       spin_unlock_irqrestore(&p->lock, flags);
+ }
  static int gpio_rcar_direction_output(struct gpio_chip *chip, unsigned offset,
                                      int value)
  {
@@@ -400,7 -471,6 +419,7 @@@ static int gpio_rcar_probe(struct platf
        }
  
        pm_runtime_enable(dev);
 +      pm_runtime_get_sync(dev);
  
        io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        gpio_chip->get = gpio_rcar_get;
        gpio_chip->direction_output = gpio_rcar_direction_output;
        gpio_chip->set = gpio_rcar_set;
+       gpio_chip->set_multiple = gpio_rcar_set_multiple;
        gpio_chip->label = name;
        gpio_chip->parent = dev;
        gpio_chip->owner = THIS_MODULE;
        irq_chip->irq_unmask = gpio_rcar_irq_enable;
        irq_chip->irq_set_type = gpio_rcar_irq_set_type;
        irq_chip->irq_set_wake = gpio_rcar_irq_set_wake;
 -      irq_chip->irq_bus_lock = gpio_rcar_irq_bus_lock;
 -      irq_chip->irq_bus_sync_unlock = gpio_rcar_irq_bus_sync_unlock;
 -      irq_chip->irq_request_resources = gpio_rcar_irq_request_resources;
 -      irq_chip->irq_release_resources = gpio_rcar_irq_release_resources;
        irq_chip->flags = IRQCHIP_SET_TYPE_MASKED | IRQCHIP_MASK_ON_SUSPEND;
  
        ret = gpiochip_add_data(gpio_chip, p);
  err1:
        gpiochip_remove(gpio_chip);
  err0:
 +      pm_runtime_put(dev);
        pm_runtime_disable(dev);
        return ret;
  }
@@@ -478,7 -552,6 +498,7 @@@ static int gpio_rcar_remove(struct plat
  
        gpiochip_remove(&p->gpio_chip);
  
 +      pm_runtime_put(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
        return 0;
  }
index 0dc916191689e9f72e4e737157ca1ad4aae7ef5c,dc85dcd47d19b8824109146b1a6d382f6fe07569..40a8881c2ce882bc1eef7eb59fff492afa6f378b
@@@ -17,7 -17,7 +17,7 @@@
   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   */
  
- #include <linux/module.h>
+ #include <linux/acpi.h>
  #include <linux/kernel.h>
  #include <linux/init.h>
  #include <linux/io.h>
@@@ -85,6 -85,17 +85,17 @@@ static void xgene_gpio_set(struct gpio_
        spin_unlock_irqrestore(&chip->lock, flags);
  }
  
+ static int xgene_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
+ {
+       struct xgene_gpio *chip = gpiochip_get_data(gc);
+       unsigned long bank_offset, bit_offset;
+       bank_offset = GPIO_SET_DR_OFFSET + GPIO_BANK_OFFSET(offset);
+       bit_offset = GPIO_BIT_OFFSET(offset);
+       return !!(ioread32(chip->base + bank_offset) & BIT(bit_offset));
+ }
  static int xgene_gpio_dir_in(struct gpio_chip *gc, unsigned int offset)
  {
        struct xgene_gpio *chip = gpiochip_get_data(gc);
@@@ -173,11 -184,6 +184,11 @@@ static int xgene_gpio_probe(struct plat
        }
  
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 +      if (!res) {
 +              err = -EINVAL;
 +              goto err;
 +      }
 +
        gpio->base = devm_ioremap_nocache(&pdev->dev, res->start,
                                                        resource_size(res));
        if (!gpio->base) {
  
        spin_lock_init(&gpio->lock);
        gpio->chip.parent = &pdev->dev;
+       gpio->chip.get_direction = xgene_gpio_get_direction;
        gpio->chip.direction_input = xgene_gpio_dir_in;
        gpio->chip.direction_output = xgene_gpio_dir_out;
        gpio->chip.get = xgene_gpio_get;
@@@ -216,19 -223,21 +228,21 @@@ static const struct of_device_id xgene_
        { .compatible = "apm,xgene-gpio", },
        {},
  };
- MODULE_DEVICE_TABLE(of, xgene_gpio_of_match);
+ #ifdef CONFIG_ACPI
+ static const struct acpi_device_id xgene_gpio_acpi_match[] = {
+       { "APMC0D14", 0 },
+       { },
+ };
+ #endif
  
  static struct platform_driver xgene_gpio_driver = {
        .driver = {
                .name = "xgene-gpio",
                .of_match_table = xgene_gpio_of_match,
+               .acpi_match_table = ACPI_PTR(xgene_gpio_acpi_match),
                .pm     = XGENE_GPIO_PM_OPS,
        },
        .probe = xgene_gpio_probe,
  };
- module_platform_driver(xgene_gpio_driver);
- MODULE_AUTHOR("Feng Kan <[email protected]>");
- MODULE_DESCRIPTION("APM X-Gene GPIO driver");
- MODULE_LICENSE("GPL");
+ builtin_platform_driver(xgene_gpio_driver);
diff --combined drivers/gpio/gpiolib.c
index b747c76fd2b1f4f8f1e117b6ce2836525b1166fd,a68c6d7328189a94444829fda5760c891920d248..d407f904a31cf475647d2624ac84cd5f624c425d
@@@ -68,7 -68,6 +68,7 @@@ LIST_HEAD(gpio_devices)
  static void gpiochip_free_hogs(struct gpio_chip *chip);
  static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip);
  
 +static bool gpiolib_initialized;
  
  static inline void desc_set_label(struct gpio_desc *d, const char *label)
  {
@@@ -441,63 -440,9 +441,63 @@@ static void gpiodevice_release(struct d
        cdev_del(&gdev->chrdev);
        list_del(&gdev->list);
        ida_simple_remove(&gpio_ida, gdev->id);
 +      kfree(gdev->label);
 +      kfree(gdev->descs);
        kfree(gdev);
  }
  
 +static int gpiochip_setup_dev(struct gpio_device *gdev)
 +{
 +      int status;
 +
 +      cdev_init(&gdev->chrdev, &gpio_fileops);
 +      gdev->chrdev.owner = THIS_MODULE;
 +      gdev->chrdev.kobj.parent = &gdev->dev.kobj;
 +      gdev->dev.devt = MKDEV(MAJOR(gpio_devt), gdev->id);
 +      status = cdev_add(&gdev->chrdev, gdev->dev.devt, 1);
 +      if (status < 0)
 +              chip_warn(gdev->chip, "failed to add char device %d:%d\n",
 +                        MAJOR(gpio_devt), gdev->id);
 +      else
 +              chip_dbg(gdev->chip, "added GPIO chardev (%d:%d)\n",
 +                       MAJOR(gpio_devt), gdev->id);
 +      status = device_add(&gdev->dev);
 +      if (status)
 +              goto err_remove_chardev;
 +
 +      status = gpiochip_sysfs_register(gdev);
 +      if (status)
 +              goto err_remove_device;
 +
 +      /* From this point, the .release() function cleans up gpio_device */
 +      gdev->dev.release = gpiodevice_release;
 +      get_device(&gdev->dev);
 +      pr_debug("%s: registered GPIOs %d to %d on device: %s (%s)\n",
 +               __func__, gdev->base, gdev->base + gdev->ngpio - 1,
 +               dev_name(&gdev->dev), gdev->chip->label ? : "generic");
 +
 +      return 0;
 +
 +err_remove_device:
 +      device_del(&gdev->dev);
 +err_remove_chardev:
 +      cdev_del(&gdev->chrdev);
 +      return status;
 +}
 +
 +static void gpiochip_setup_devs(void)
 +{
 +      struct gpio_device *gdev;
 +      int err;
 +
 +      list_for_each_entry(gdev, &gpio_devices, list) {
 +              err = gpiochip_setup_dev(gdev);
 +              if (err)
 +                      pr_err("%s: Failed to initialize gpio device (%d)\n",
 +                             dev_name(&gdev->dev), err);
 +      }
 +}
 +
  /**
   * gpiochip_add_data() - register a gpio_chip
   * @chip: the chip to register, with chip->base initialized
   * the gpio framework's arch_initcall().  Otherwise sysfs initialization
   * for GPIOs will fail rudely.
   *
 + * gpiochip_add_data() must only be called after gpiolib initialization,
 + * ie after core_initcall().
 + *
   * If chip->base is negative, this requests dynamic assignment of
   * a range of valid GPIOs.
   */
@@@ -562,7 -504,8 +562,7 @@@ int gpiochip_add_data(struct gpio_chip 
        else
                gdev->owner = THIS_MODULE;
  
 -      gdev->descs = devm_kcalloc(&gdev->dev, chip->ngpio,
 -                                 sizeof(gdev->descs[0]), GFP_KERNEL);
 +      gdev->descs = kcalloc(chip->ngpio, sizeof(gdev->descs[0]), GFP_KERNEL);
        if (!gdev->descs) {
                status = -ENOMEM;
                goto err_free_gdev;
        if (chip->ngpio == 0) {
                chip_err(chip, "tried to insert a GPIO chip with zero lines\n");
                status = -EINVAL;
 -              goto err_free_gdev;
 +              goto err_free_descs;
        }
  
        if (chip->label)
 -              gdev->label = devm_kstrdup(&gdev->dev, chip->label, GFP_KERNEL);
 +              gdev->label = kstrdup(chip->label, GFP_KERNEL);
        else
 -              gdev->label = devm_kstrdup(&gdev->dev, "unknown", GFP_KERNEL);
 +              gdev->label = kstrdup("unknown", GFP_KERNEL);
        if (!gdev->label) {
                status = -ENOMEM;
 -              goto err_free_gdev;
 +              goto err_free_descs;
        }
  
        gdev->ngpio = chip->ngpio;
                if (base < 0) {
                        status = base;
                        spin_unlock_irqrestore(&gpio_lock, flags);
 -                      goto err_free_gdev;
 +                      goto err_free_label;
                }
                /*
                 * TODO: it should not be necessary to reflect the assigned
        status = gpiodev_add_to_list(gdev);
        if (status) {
                spin_unlock_irqrestore(&gpio_lock, flags);
 -              goto err_free_gdev;
 +              goto err_free_label;
        }
  
        for (i = 0; i < chip->ngpio; i++) {
                struct gpio_desc *desc = &gdev->descs[i];
  
                desc->gdev = gdev;
-               /* REVISIT: most hardware initializes GPIOs as inputs (often
-                * with pullups enabled) so power usage is minimized. Linux
-                * code should set the gpio direction first thing; but until
-                * it does, and in case chip->get_direction is not set, we may
-                * expose the wrong direction in sysfs.
+               /*
+                * REVISIT: most hardware initializes GPIOs as inputs
+                * (often with pullups enabled) so power usage is
+                * minimized. Linux code should set the gpio direction
+                * first thing; but until it does, and in case
+                * chip->get_direction is not set, we may expose the
+                * wrong direction in sysfs.
                 */
-               desc->flags = !chip->direction_input ? (1 << FLAG_IS_OUT) : 0;
+               if (chip->get_direction) {
+                       /*
+                        * If we have .get_direction, set up the initial
+                        * direction flag from the hardware.
+                        */
+                       int dir = chip->get_direction(chip, i);
+                       if (!dir)
+                               set_bit(FLAG_IS_OUT, &desc->flags);
+               } else if (!chip->direction_input) {
+                       /*
+                        * If the chip lacks the .direction_input callback
+                        * we logically assume all lines are outputs.
+                        */
+                       set_bit(FLAG_IS_OUT, &desc->flags);
+               }
        }
  
        spin_unlock_irqrestore(&gpio_lock, flags);
         * we get a device node entry in sysfs under
         * /sys/bus/gpio/devices/gpiochipN/dev that can be used for
         * coldplug of device nodes and other udev business.
 +       * We can do this only if gpiolib has been initialized.
 +       * Otherwise, defer until later.
         */
 -      cdev_init(&gdev->chrdev, &gpio_fileops);
 -      gdev->chrdev.owner = THIS_MODULE;
 -      gdev->chrdev.kobj.parent = &gdev->dev.kobj;
 -      gdev->dev.devt = MKDEV(MAJOR(gpio_devt), gdev->id);
 -      status = cdev_add(&gdev->chrdev, gdev->dev.devt, 1);
 -      if (status < 0)
 -              chip_warn(chip, "failed to add char device %d:%d\n",
 -                        MAJOR(gpio_devt), gdev->id);
 -      else
 -              chip_dbg(chip, "added GPIO chardev (%d:%d)\n",
 -                       MAJOR(gpio_devt), gdev->id);
 -      status = device_add(&gdev->dev);
 -      if (status)
 -              goto err_remove_chardev;
 -
 -      status = gpiochip_sysfs_register(gdev);
 -      if (status)
 -              goto err_remove_device;
 -
 -      /* From this point, the .release() function cleans up gpio_device */
 -      gdev->dev.release = gpiodevice_release;
 -      get_device(&gdev->dev);
 -      pr_debug("%s: registered GPIOs %d to %d on device: %s (%s)\n",
 -               __func__, gdev->base, gdev->base + gdev->ngpio - 1,
 -               dev_name(&gdev->dev), chip->label ? : "generic");
 -
 +      if (gpiolib_initialized) {
 +              status = gpiochip_setup_dev(gdev);
 +              if (status)
 +                      goto err_remove_chip;
 +      }
        return 0;
  
 -err_remove_device:
 -      device_del(&gdev->dev);
 -err_remove_chardev:
 -      cdev_del(&gdev->chrdev);
  err_remove_chip:
        acpi_gpiochip_remove(chip);
        gpiochip_free_hogs(chip);
@@@ -671,10 -654,6 +688,10 @@@ err_remove_from_list
        spin_lock_irqsave(&gpio_lock, flags);
        list_del(&gdev->list);
        spin_unlock_irqrestore(&gpio_lock, flags);
 +err_free_label:
 +      kfree(gdev->label);
 +err_free_descs:
 +      kfree(gdev->descs);
  err_free_gdev:
        ida_simple_remove(&gpio_ida, gdev->id);
        /* failures here can mean systems won't boot... */
@@@ -1547,8 -1526,8 +1564,8 @@@ EXPORT_SYMBOL_GPL(gpiod_direction_input
  
  static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value)
  {
-       struct gpio_chip        *chip;
-       int                     status = -EINVAL;
+       struct gpio_chip *gc = desc->gdev->chip;
+       int ret;
  
        /* GPIOs used for IRQs shall not be set as output */
        if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) {
                return -EIO;
        }
  
-       /* Open drain pin should not be driven to 1 */
-       if (value && test_bit(FLAG_OPEN_DRAIN,  &desc->flags))
-               return gpiod_direction_input(desc);
-       /* Open source pin should not be driven to 0 */
-       if (!value && test_bit(FLAG_OPEN_SOURCE,  &desc->flags))
-               return gpiod_direction_input(desc);
+       if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) {
+               /* First see if we can enable open drain in hardware */
+               if (gc->set_single_ended) {
+                       ret = gc->set_single_ended(gc, gpio_chip_hwgpio(desc),
+                                                  LINE_MODE_OPEN_DRAIN);
+                       if (!ret)
+                               goto set_output_value;
+               }
+               /* Emulate open drain by not actively driving the line high */
+               if (value)
+                       return gpiod_direction_input(desc);
+       }
+       else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) {
+               if (gc->set_single_ended) {
+                       ret = gc->set_single_ended(gc, gpio_chip_hwgpio(desc),
+                                                  LINE_MODE_OPEN_SOURCE);
+                       if (!ret)
+                               goto set_output_value;
+               }
+               /* Emulate open source by not actively driving the line low */
+               if (!value)
+                       return gpiod_direction_input(desc);
+       } else {
+               /* Make sure to disable open drain/source hardware, if any */
+               if (gc->set_single_ended)
+                       gc->set_single_ended(gc,
+                                            gpio_chip_hwgpio(desc),
+                                            LINE_MODE_PUSH_PULL);
+       }
  
-       chip = desc->gdev->chip;
-       if (!chip->set || !chip->direction_output) {
+ set_output_value:
+       if (!gc->set || !gc->direction_output) {
                gpiod_warn(desc,
                       "%s: missing set() or direction_output() operations\n",
                       __func__);
                return -EIO;
        }
  
-       status = chip->direction_output(chip, gpio_chip_hwgpio(desc), value);
-       if (status == 0)
+       ret = gc->direction_output(gc, gpio_chip_hwgpio(desc), value);
+       if (!ret)
                set_bit(FLAG_IS_OUT, &desc->flags);
        trace_gpio_value(desc_to_gpio(desc), 0, value);
-       trace_gpio_direction(desc_to_gpio(desc), 0, status);
-       return status;
+       trace_gpio_direction(desc_to_gpio(desc), 0, ret);
+       return ret;
  }
  
  /**
@@@ -1841,10 -1842,10 +1880,10 @@@ static void gpio_chip_set_multiple(stru
        }
  }
  
static void gpiod_set_array_value_priv(bool raw, bool can_sleep,
-                                      unsigned int array_size,
-                                      struct gpio_desc **desc_array,
-                                      int *value_array)
void gpiod_set_array_value_complex(bool raw, bool can_sleep,
+                                  unsigned int array_size,
+                                  struct gpio_desc **desc_array,
+                                  int *value_array)
  {
        int i = 0;
  
@@@ -1950,8 -1951,8 +1989,8 @@@ void gpiod_set_raw_array_value(unsigne
  {
        if (!desc_array)
                return;
-       gpiod_set_array_value_priv(true, false, array_size, desc_array,
-                                  value_array);
+       gpiod_set_array_value_complex(true, false, array_size, desc_array,
+                                     value_array);
  }
  EXPORT_SYMBOL_GPL(gpiod_set_raw_array_value);
  
@@@ -1972,8 -1973,8 +2011,8 @@@ void gpiod_set_array_value(unsigned in
  {
        if (!desc_array)
                return;
-       gpiod_set_array_value_priv(false, false, array_size, desc_array,
-                                  value_array);
+       gpiod_set_array_value_complex(false, false, array_size, desc_array,
+                                     value_array);
  }
  EXPORT_SYMBOL_GPL(gpiod_set_array_value);
  
@@@ -1998,13 -1999,22 +2037,22 @@@ EXPORT_SYMBOL_GPL(gpiod_cansleep)
   */
  int gpiod_to_irq(const struct gpio_desc *desc)
  {
-       struct gpio_chip        *chip;
-       int                     offset;
+       struct gpio_chip *chip;
+       int offset;
  
        VALIDATE_DESC(desc);
        chip = desc->gdev->chip;
        offset = gpio_chip_hwgpio(desc);
-       return chip->to_irq ? chip->to_irq(chip, offset) : -ENXIO;
+       if (chip->to_irq) {
+               int retirq = chip->to_irq(chip, offset);
+               /* Zero means NO_IRQ */
+               if (!retirq)
+                       return -ENXIO;
+               return retirq;
+       }
+       return -ENXIO;
  }
  EXPORT_SYMBOL_GPL(gpiod_to_irq);
  
@@@ -2176,8 -2186,8 +2224,8 @@@ void gpiod_set_raw_array_value_cansleep
        might_sleep_if(extra_checks);
        if (!desc_array)
                return;
-       gpiod_set_array_value_priv(true, true, array_size, desc_array,
-                                  value_array);
+       gpiod_set_array_value_complex(true, true, array_size, desc_array,
+                                     value_array);
  }
  EXPORT_SYMBOL_GPL(gpiod_set_raw_array_value_cansleep);
  
@@@ -2199,8 -2209,8 +2247,8 @@@ void gpiod_set_array_value_cansleep(uns
        might_sleep_if(extra_checks);
        if (!desc_array)
                return;
-       gpiod_set_array_value_priv(false, true, array_size, desc_array,
-                                  value_array);
+       gpiod_set_array_value_complex(false, true, array_size, desc_array,
+                                     value_array);
  }
  EXPORT_SYMBOL_GPL(gpiod_set_array_value_cansleep);
  
@@@ -2269,11 -2279,9 +2317,11 @@@ static struct gpio_desc *of_find_gpio(s
        return desc;
  }
  
 -static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id,
 +static struct gpio_desc *acpi_find_gpio(struct device *dev,
 +                                      const char *con_id,
                                        unsigned int idx,
 -                                      enum gpio_lookup_flags *flags)
 +                                      enum gpiod_flags flags,
 +                                      enum gpio_lookup_flags *lookupflags)
  {
        struct acpi_device *adev = ACPI_COMPANION(dev);
        struct acpi_gpio_info info;
                desc = acpi_get_gpiod_by_index(adev, NULL, idx, &info);
                if (IS_ERR(desc))
                        return desc;
 +
 +              if ((flags == GPIOD_OUT_LOW || flags == GPIOD_OUT_HIGH) &&
 +                  info.gpioint) {
 +                      dev_dbg(dev, "refusing GpioInt() entry when doing GPIOD_OUT_* lookup\n");
 +                      return ERR_PTR(-ENOENT);
 +              }
        }
  
        if (info.polarity == GPIO_ACTIVE_LOW)
 -              *flags |= GPIO_ACTIVE_LOW;
 +              *lookupflags |= GPIO_ACTIVE_LOW;
  
        return desc;
  }
@@@ -2576,7 -2578,7 +2624,7 @@@ struct gpio_desc *__must_check gpiod_ge
                        desc = of_find_gpio(dev, con_id, idx, &lookupflags);
                } else if (ACPI_COMPANION(dev)) {
                        dev_dbg(dev, "using ACPI for GPIO lookup\n");
 -                      desc = acpi_find_gpio(dev, con_id, idx, &lookupflags);
 +                      desc = acpi_find_gpio(dev, con_id, idx, flags, &lookupflags);
                }
        }
  
@@@ -2726,15 -2728,16 +2774,16 @@@ int gpiod_hog(struct gpio_desc *desc, c
  
        local_desc = gpiochip_request_own_desc(chip, hwnum, name);
        if (IS_ERR(local_desc)) {
-               pr_err("requesting hog GPIO %s (chip %s, offset %d) failed\n",
-                      name, chip->label, hwnum);
-               return PTR_ERR(local_desc);
+               status = PTR_ERR(local_desc);
+               pr_err("requesting hog GPIO %s (chip %s, offset %d) failed, %d\n",
+                      name, chip->label, hwnum, status);
+               return status;
        }
  
        status = gpiod_configure_flags(desc, name, dflags);
        if (status < 0) {
-               pr_err("setup of hog GPIO %s (chip %s, offset %d) failed\n",
-                      name, chip->label, hwnum);
+               pr_err("setup of hog GPIO %s (chip %s, offset %d) failed, %d\n",
+                      name, chip->label, hwnum, status);
                gpiochip_free_own_desc(desc);
                return status;
        }
@@@ -2875,9 -2878,6 +2924,9 @@@ static int __init gpiolib_dev_init(void
        if (ret < 0) {
                pr_err("gpiolib: failed to allocate char dev region\n");
                bus_unregister(&gpio_bus_type);
 +      } else {
 +              gpiolib_initialized = true;
 +              gpiochip_setup_devs();
        }
        return ret;
  }
diff --combined kernel/irq/irqdomain.c
index 503c5b9dd030a0eb2fa35c9de0122810f09a6609,245a485ffb61becec87def2718c8395f27947f14..d65f6f31a5b315d7595e335458cde26115e7dca0
@@@ -243,15 -243,14 +243,15 @@@ struct irq_domain *irq_domain_add_legac
  EXPORT_SYMBOL_GPL(irq_domain_add_legacy);
  
  /**
 - * irq_find_matching_fwnode() - Locates a domain for a given fwnode
 - * @fwnode: FW descriptor of the interrupt controller
 + * irq_find_matching_fwspec() - Locates a domain for a given fwspec
 + * @fwspec: FW specifier for an interrupt
   * @bus_token: domain-specific data
   */
 -struct irq_domain *irq_find_matching_fwnode(struct fwnode_handle *fwnode,
 +struct irq_domain *irq_find_matching_fwspec(struct irq_fwspec *fwspec,
                                            enum irq_domain_bus_token bus_token)
  {
        struct irq_domain *h, *found = NULL;
 +      struct fwnode_handle *fwnode = fwspec->fwnode;
        int rc;
  
        /* We might want to match the legacy controller last since
         */
        mutex_lock(&irq_domain_mutex);
        list_for_each_entry(h, &irq_domain_list, link) {
 -              if (h->ops->match)
 +              if (h->ops->select && fwspec->param_count)
 +                      rc = h->ops->select(h, fwspec, bus_token);
 +              else if (h->ops->match)
                        rc = h->ops->match(h, to_of_node(fwnode), bus_token);
                else
                        rc = ((fwnode != NULL) && (h->fwnode == fwnode) &&
        mutex_unlock(&irq_domain_mutex);
        return found;
  }
 -EXPORT_SYMBOL_GPL(irq_find_matching_fwnode);
 +EXPORT_SYMBOL_GPL(irq_find_matching_fwspec);
  
  /**
   * irq_set_default_host() - Set a "default" irq domain
@@@ -577,9 -574,11 +577,9 @@@ unsigned int irq_create_fwspec_mapping(
        int virq;
  
        if (fwspec->fwnode) {
 -              domain = irq_find_matching_fwnode(fwspec->fwnode,
 -                                                DOMAIN_BUS_WIRED);
 +              domain = irq_find_matching_fwspec(fwspec, DOMAIN_BUS_WIRED);
                if (!domain)
 -                      domain = irq_find_matching_fwnode(fwspec->fwnode,
 -                                                        DOMAIN_BUS_ANY);
 +                      domain = irq_find_matching_fwspec(fwspec, DOMAIN_BUS_ANY);
        } else {
                domain = irq_default_domain;
        }
@@@ -1100,6 -1099,7 +1100,7 @@@ void irq_domain_free_irqs_common(struc
        }
        irq_domain_free_irqs_parent(domain, virq, nr_irqs);
  }
+ EXPORT_SYMBOL_GPL(irq_domain_free_irqs_common);
  
  /**
   * irq_domain_free_irqs_top - Clear handler and handler data, clear irqdata and free parent
index 720a14e0687d8140f95279b4bbe662ded13ff2e2,7976df02d09002afebd442ca6428d6eafcb5ed2b..fc164d69a557e92759252b48e9a786ab07780e88
@@@ -18,7 -18,7 +18,7 @@@
  #include <linux/delay.h>
  #include <linux/pm.h>
  #include <linux/gcd.h>
- #include <linux/gpio.h>
+ #include <linux/gpio/driver.h>
  #include <linux/i2c.h>
  #include <linux/input.h>
  #include <linux/pm_runtime.h>
@@@ -2471,7 -2471,7 +2471,7 @@@ static void wm8962_configure_bclk(struc
                break;
        default:
                dev_warn(codec->dev, "Unknown DSPCLK divisor read back\n");
 -              dspclk = wm8962->sysclk;
 +              dspclk = wm8962->sysclk_rate;
        }
  
        dev_dbg(codec->dev, "DSPCLK is %dHz, BCLK %d\n", dspclk, wm8962->bclk);
@@@ -3307,14 -3307,9 +3307,9 @@@ static void wm8962_set_gpio_mode(struc
  }
  
  #ifdef CONFIG_GPIOLIB
- static inline struct wm8962_priv *gpio_to_wm8962(struct gpio_chip *chip)
- {
-       return container_of(chip, struct wm8962_priv, gpio_chip);
- }
  static int wm8962_gpio_request(struct gpio_chip *chip, unsigned offset)
  {
-       struct wm8962_priv *wm8962 = gpio_to_wm8962(chip);
+       struct wm8962_priv *wm8962 = gpiochip_get_data(chip);
  
        /* The WM8962 GPIOs aren't linearly numbered.  For simplicity
         * we export linear numbers and error out if the unsupported
  
  static void wm8962_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
  {
-       struct wm8962_priv *wm8962 = gpio_to_wm8962(chip);
+       struct wm8962_priv *wm8962 = gpiochip_get_data(chip);
        struct snd_soc_codec *codec = wm8962->codec;
  
        snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset,
  static int wm8962_gpio_direction_out(struct gpio_chip *chip,
                                     unsigned offset, int value)
  {
-       struct wm8962_priv *wm8962 = gpio_to_wm8962(chip);
+       struct wm8962_priv *wm8962 = gpiochip_get_data(chip);
        struct snd_soc_codec *codec = wm8962->codec;
        int ret, val;
  
@@@ -3386,7 -3381,7 +3381,7 @@@ static void wm8962_init_gpio(struct snd
        else
                wm8962->gpio_chip.base = -1;
  
-       ret = gpiochip_add(&wm8962->gpio_chip);
+       ret = gpiochip_add_data(&wm8962->gpio_chip, wm8962);
        if (ret != 0)
                dev_err(codec->dev, "Failed to add GPIOs: %d\n", ret);
  }
This page took 0.199216 seconds and 4 git commands to generate.