1. 07 Sep, 2016 3 commits
  2. 19 Aug, 2016 2 commits
    • Linus Walleij's avatar
      gpio: make any OF dependent driver depend on OF_GPIO · 048c28c9
      Linus Walleij authored
      The drivers that depend on OF but not OF_GPIO are wreaking havoc
      with the autobuilders for archs that have all requirements for
      OF but not for OF_GPIO, particularly the UM (Usermode) arch does
      not have iomem (NO_IOMEM) which result in configuring GPIOLIB but
      without OF_GPIO which is wrong if the driver is using the .of_node
      of the gpiochip, which only appears with OF_GPIO.
      
      After a brief look at the drivers just depending on OF it seems
      most if not all of them actually require stuff from gpiolib-of so
      the dependency is wrong in the first place.
      
      This simply patches the Kconfig so that all GPIO drivers using OF
      depend on OF_GPIO rather than just OF.
      
      Cc: Rabin Vincent <rabin@rab.in>
      Cc: Pramod Gurav <pramod.gurav@smartplayin.com>
      Cc: Andreas Larsson <andreas@gaisler.com>
      Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Cc: Alexandre Courbot <acourbot@nvidia.com>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Phil Reid <preid@electromag.com.au>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      048c28c9
    • Linus Walleij's avatar
      gpio: Fix OF build problem on UM · 2527ecc9
      Linus Walleij authored
      The UserMode (UM) Linux build was failing in gpiolib-of as it requires
      ioremap()/iounmap() to exist, which is absent from UM. The non-existence
      of IO memory is negatively defined as CONFIG_NO_IOMEM which means we
      need to depend on HAS_IOMEM.
      
      Cc: stable@vger.kernel.org
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      2527ecc9
  3. 10 Aug, 2016 1 commit
    • Christophe Leroy's avatar
      gpio: max730x: set gpiochip data pointer before using it · 6f4deb18
      Christophe Leroy authored
      gpiochip_add_data() has to be called before calling
      max7301_direction_input()
      
      [    4.389883] Unable to handle kernel paging request for data at address 0x00000018
      [    4.397282] Faulting instruction address: 0xc01a8cbc
      [    4.402023] Oops: Kernel access of bad area, sig: 11 [#1]
      [    4.407331] PREEMPT CMPC885
      [    4.410131] CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 4.5.0-gacdfdee #39
      [    4.418592] Workqueue: deferwq deferred_probe_work_func
      [    4.423711] task: c60798b0 ti: c608a000 task.ti: c608a000
      [    4.429038] NIP: c01a8cbc LR: c01a8e24 CTR: c01ff028
      [    4.433953] REGS: c608bad0 TRAP: 0300   Not tainted  (4.5.0-s3k-dev-gacdfdee-svn-dirty)
      [    4.441847] MSR: 00009032 <EE,ME,IR,DR,RI>  CR: 33039553  XER: a000f940
      [    4.448395] DAR: 00000018 DSISR: c0000000
      GPR00: c01a8e24 c608bb80 c60798b0 c60d6f6c 00000004 00000002 07de2900 00700000
      GPR08: 00000000 00000000 c608a000 00001032 35039553 00000000 c002f37c c6010b64
      GPR16: c6010a48 c6010a14 c6010a00 00000000 c0450000 c0453568 c0453438 c050db14
      GPR24: c62662bc 00000009 ffffffaa c60d6f5d 00000001 00000000 00000000 00000000
      [    4.480371] NIP [c01a8cbc] max7301_direction_input+0x20/0x9c
      [    4.485951] LR [c01a8e24] __max730x_probe+0xec/0x138
      [    4.490812] Call Trace:
      [    4.493268] [c608bba0] [c01a8e24] __max730x_probe+0xec/0x138
      [    4.498878] [c608bbc0] [c01cc368] driver_probe_device+0x190/0x38c
      [    4.504895] [c608bbf0] [c01ca918] bus_for_each_drv+0x58/0xb4
      [    4.510489] [c608bc20] [c01cc04c] __device_attach+0x8c/0x110
      [    4.516082] [c608bc50] [c01cab80] bus_probe_device+0x34/0xb8
      [    4.521673] [c608bc70] [c01c96c8] device_add+0x3c0/0x598
      [    4.526925] [c608bcb0] [c0200f90] spi_add_device+0x114/0x160
      [    4.532512] [c608bcd0] [c02018d0] spi_register_master+0x6e0/0x7c8
      [    4.538537] [c608bd20] [c02019fc] devm_spi_register_master+0x44/0x8c
      [    4.544824] [c608bd40] [c0203854] of_fsl_spi_probe+0x458/0x57c
      [    4.550587] [c608bda0] [c01cd828] platform_drv_probe+0x30/0x74
      [    4.556366] [c608bdb0] [c01cc368] driver_probe_device+0x190/0x38c
      [    4.562383] [c608bde0] [c01ca918] bus_for_each_drv+0x58/0xb4
      [    4.567977] [c608be10] [c01cc04c] __device_attach+0x8c/0x110
      [    4.573572] [c608be40] [c01cab80] bus_probe_device+0x34/0xb8
      [    4.579170] [c608be60] [c01cb9b4] deferred_probe_work_func+0xa4/0xc4
      [    4.585438] [c608be80] [c0029c04] process_one_work+0x22c/0x414
      [    4.591201] [c608bea0] [c002a100] worker_thread+0x314/0x5c0
      [    4.596722] [c608bef0] [c002f444] kthread+0xc8/0xcc
      [    4.601538] [c608bf40] [c000af84] ret_from_kernel_thread+0x5c/0x64
      [    4.607596] Instruction dump:
      [    4.610530] 7c0803a6 bba10014 38210020 4e800020 7c0802a6 9421ffe0 38840004 bf810010
      [    4.618188] 90010024 549cf0be 83c30010 549d0f7c <813e0018> 7fc3f378 7d3f2430 57ff07fe
      [    4.626041] ---[ end trace 303adb021dd4caf2 ]---
      
      Cc: stable@vger.kernel.org
      fixes: 5e45e019 ("gpio: max730x: use gpiochip data pointer")
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      6f4deb18
  4. 22 Jul, 2016 9 commits
  5. 06 Jul, 2016 3 commits
    • Linus Walleij's avatar
      Revert "gpio: convince line to become input in irq helper" · 78456d6f
      Linus Walleij authored
      This reverts commit 7e7c059c.
      
      I was wrong about trying to do this, as it breaks the
      orthogonality between gpiochips and irqchips.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      78456d6f
    • Lars-Peter Clausen's avatar
      gpiolib: of_find_gpio(): Don't discard errors · da17f8a1
      Lars-Peter Clausen authored
      Since commit dd34c37a ("gpio: of: Allow -gpio suffix for property
      names") when requesting a GPIO from the devicetree gpiolib looks for
      properties with both the '-gpio' and the '-gpios' suffix. This was
      implemented by first searching for the property with the '-gpios' suffix
      and if that yields an error try the '-gpio' suffix. This approach has the
      issue that any error returned when looking for the '-gpios' suffix is
      silently discarded.
      
      Commit 06fc3b70 ("gpio: of: Fix handling for deferred probe for -gpio
      suffix") partially addressed the issue by treating the EPROBE_DEFER error
      as a special condition. This fixed the case when the property is specified,
      but the GPIO provider is not ready yet. But there are other cases in which
      of_get_named_gpiod_flags() returns an error even though the property is
      specified, e.g. if the specification is incorrect.
      
      of_find_gpio() should only try to look for the property with the '-gpio'
      suffix if no property with the '-gpios' suffix was found. If the property
      was not found of_get_named_gpiod_flags() will return -ENOENT, so update the
      condition to abort and propagate the error to the caller in all other
      cases.
      
      This is important for gpiod_get_optinal() and friends to behave correctly
      in case the specifier contains errors. Without this patch they'll return
      NULL if the property uses the '-gpios' suffix and the specifier contains
      errors, which falsely indicates to the caller that no GPIO was specified.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      da17f8a1
    • Thierry Reding's avatar
      gpio: of: Allow overriding the device node · acc6e331
      Thierry Reding authored
      When registering a GPIO chip, drivers can override the device tree node
      associated with the chip by setting the chip's ->of_node field. If set,
      this field is supposed to take precedence over the ->parent->of_node
      field, but the code doesn't actually do that.
      
      Commit 762c2e46 ("gpio: of: remove of_gpiochip_and_xlate() and
      struct gg_data") exposes this because it now no longer matches on the
      GPIO chip's ->of_node field, but the GPIO device's ->of_node field that
      is set using the procedure described above.
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Acked-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
      Reviewed-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      acc6e331
  6. 05 Jul, 2016 1 commit
  7. 04 Jul, 2016 5 commits
  8. 23 Jun, 2016 9 commits
  9. 22 Jun, 2016 4 commits
  10. 18 Jun, 2016 2 commits
  11. 17 Jun, 2016 1 commit