1. 03 Jul, 2019 1 commit
  2. 10 Jun, 2019 1 commit
    • Phil Reid's avatar
      gpio: altera: Allocate irq_chip dynamically · 9d373aca
      Phil Reid authored
      Keeping the irq_chip definition static shares it with multiple instances
      of the altera gpiochip in the system. This is bad and now we get this
      warning from gpiolib core:
      
      "detected irqchip that is shared with multiple gpiochips: please fix the
      driver."
      
      Hence, move the irq_chip definition from being driver static into the
      struct altera_gpio_chips. So a unique irq_chip is used for each gpiochip
      instance.
      Signed-off-by: default avatarPhil Reid <preid@electromag.com.au>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      9d373aca
  3. 21 May, 2019 1 commit
    • Thomas Gleixner's avatar
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 · 1ccea77e
      Thomas Gleixner authored
      Based on 2 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details you
        should have received a copy of the gnu general public license along
        with this program if not see http www gnu org licenses
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details [based]
        [from] [clk] [highbank] [c] you should have received a copy of the
        gnu general public license along with this program if not see http
        www gnu org licenses
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 355 file(s).
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarJilayne Lovejoy <opensource@jilayne.com>
      Reviewed-by: default avatarSteve Winslow <swinslow@gmail.com>
      Reviewed-by: default avatarAllison Randal <allison@lohutok.net>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190519154041.837383322@linutronix.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1ccea77e
  4. 28 Jan, 2019 1 commit
  5. 13 Jan, 2018 1 commit
  6. 08 Nov, 2017 1 commit
  7. 14 Aug, 2017 1 commit
    • Rob Herring's avatar
      gpio: Convert to using %pOF instead of full_name · 7eb6ce2f
      Rob Herring authored
      Now that we have a custom printf format specifier, convert users of
      full_name to use %pOF instead. This is preparation to remove storing
      of the full path string for each node.
      Signed-off-by: default avatarRob Herring <robh@kernel.org>
      Cc: Tien Hock Loh <thloh@altera.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
      Cc: linux-gpio@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Acked-by: default avatarGregory Fong <gregory.0xf0@gmail.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      7eb6ce2f
  8. 16 Mar, 2017 1 commit
    • Julia Cartwright's avatar
      gpio: altera: make use of raw_spinlock variants · 21d01c9c
      Julia Cartwright authored
      The altera gpio driver currently implements an irq_chip for handling
      interrupts; due to how irq_chip handling is done, it's necessary for the
      irq_chip methods to be invoked from hardirq context, even on a a real-time
      kernel.  Because the spinlock_t type becomes a "sleeping" spinlock w/ RT
      kernels, it is not suitable to be used with irq_chips.
      
      A quick audit of the operations under the lock reveal that they do only
      minimal, bounded work, and are therefore safe to do under a raw spinlock.
      Signed-off-by: default avatarJulia Cartwright <julia@ni.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      21d01c9c
  9. 06 Mar, 2017 1 commit
    • Phil Reid's avatar
      gpio: altera: Use handle_level_irq when configured as a level_high · f759921c
      Phil Reid authored
      When a threaded irq handler is chained attached to one of the gpio
      pins when configure for level irq the altera_gpio_irq_leveL_high_handler
      does not mask the interrupt while being handled by the chained irq.
      This resulting in the threaded irq not getting enough cycles to complete
      quickly enough before the irq was disabled as faulty. handle_level_irq
      should be used in this situation instead of handle_simple_irq.
      
      In gpiochip_irqchip_add set default handler to handle_bad_irq as
      per Documentation/gpio/driver.txt. Then set the correct handler in
      the set_type callback.
      Signed-off-by: default avatarPhil Reid <preid@electromag.com.au>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      f759921c
  10. 15 Sep, 2016 1 commit
    • Paul Gortmaker's avatar
      gpio: altera: fix implicit assumption module.h is present · 7b5409ee
      Paul Gortmaker authored
      The Kconfig for this file is:
      
      drivers/gpio/Kconfig:config GPIO_ALTERA
      drivers/gpio/Kconfig:   tristate "Altera GPIO"
      
      ...but however it does not include module.h -- it in turn gets it from
      another header (gpio/driver.h) and we'd like to replace that with a
      forward delcaration of "struct module;" but if we do, this file will
      fail to compile.
      
      So we fix this first to avoid putting build failures into the bisect
      commit history.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      7b5409ee
  11. 27 Jan, 2016 1 commit
  12. 05 Jan, 2016 1 commit
  13. 19 Nov, 2015 1 commit
    • Linus Walleij's avatar
      gpio: change member .dev to .parent · 58383c78
      Linus Walleij authored
      The name .dev in a struct is normally reserved for a struct device
      that is let us say a superclass to the thing described by the struct.
      struct gpio_chip stands out by confusingly using a struct device *dev
      to point to the parent device (such as a platform_device) that
      represents the hardware. As we want to give gpio_chip:s real devices,
      this is not working. We need to rename this member to parent.
      
      This was done by two coccinelle scripts, I guess it is possible to
      combine them into one, but I don't know such stuff. They look like
      this:
      
      @@
      struct gpio_chip *var;
      @@
      -var->dev
      +var->parent
      
      and:
      
      @@
      struct gpio_chip var;
      @@
      -var.dev
      +var.parent
      
      and:
      
      @@
      struct bgpio_chip *var;
      @@
      -var->gc.dev
      +var->gc.parent
      
      Plus a few instances of bgpio that I couldn't figure out how
      to teach Coccinelle to rewrite.
      
      This patch hits all over the place, but I *strongly* prefer this
      solution to any piecemal approaches that just exercise patch
      mechanics all over the place. It mainly hits drivers/gpio and
      drivers/pinctrl which is my own backyard anyway.
      
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Rafał Miłecki <zajec5@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Cc: Alek Du <alek.du@intel.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Acked-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: default avatarLee Jones <lee.jones@linaro.org>
      Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
      Acked-by: default avatarHans-Christian Egtvedt <egtvedt@samfundet.no>
      Acked-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      58383c78
  14. 02 Oct, 2015 1 commit
    • Linus Walleij's avatar
      gpio: altera: use container_of() to get state container · 231d51b8
      Linus Walleij authored
      The state container of the Altera GPIO driver is extracted from
      the gpio_chip exploiting the fact that offsetof() the
      struct gpio_chip inside the struct of_mm_gpio_chip are both 0, so
      the container_of() is in practice a noop. However if a member
      is added to struct altera_gpio_chip in front of
      struct of_mm_gpio_chip, things will break. Using proper
      container_of() avoids this problem.
      
      Semantically this is a noop, the compiler will optimize it away,
      but syntactically it makes me happier.
      
      Cc: Tien Hock Loh <thloh@altera.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      231d51b8
  15. 16 Sep, 2015 1 commit
    • Thomas Gleixner's avatar
      genirq: Remove irq argument from irq flow handlers · bd0b9ac4
      Thomas Gleixner authored
      Most interrupt flow handlers do not use the irq argument. Those few
      which use it can retrieve the irq number from the irq descriptor.
      
      Remove the argument.
      
      Search and replace was done with coccinelle and some extra helper
      scripts around it. Thanks to Julia for her help!
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      bd0b9ac4
  16. 15 Jul, 2015 2 commits
  17. 16 Jun, 2015 1 commit
  18. 27 Mar, 2015 1 commit
  19. 07 Mar, 2015 1 commit
    • Tien Hock Loh's avatar
      drivers/gpio: Altera soft IP GPIO driver · c5abbba9
      Tien Hock Loh authored
      Adds a new driver for Altera soft GPIO IP. The driver is able to do
      read/write and allows GPIO to be a interrupt controller.
      
      Tested on Altera GHRD on interrupt handling and IO.
      
      v10:
      - Updated conflicting device tree parameters
      - Removed unused headers
      - Used macro instead of magic numbers for ngpio
      - Code readability cleanup using ?: and temporal variables
      - Removed leftover garbage and unnecessary function calls
      - Checked bgpio_init but unusable because Altera GPIO may not
        be a multiple of 8 bits
      
      v9:
      - Removed duplicated initialization on set_type using temporals
        to improve code readability in calling generic_handle_irq
      - Using ?: ternary to reduce code size
      
      v8:
      - Using for_each_set_bit
      - Added const for struct definition
      - Removed naggy pr_err
      - Sort alpha header
      - Remove unused macros
      - Use fixed width data types instead of unsigned long
      - Whitespace issue fixes
      - Removed _relaxed function for better compatibility across different
        CPU
      - Changed irq_create_mapping to platform_get_irq updated implementation
        to use gpiochip_irqchip_add
      - Reserve interrupt-cells number 2 in device tree binding for future
        use
      - Remove confusing sections on devicetree bindings
      - Added tristate Kconfig help text
      
      v7:
      - Used dev_warn instead of pr_warn
      - Clean up unnecesarry if else indentation
      
      v6:
      - Added irq_startup and irq_shutdown
      - Changed bitwise clamping style
      - Cleanup bitwise operation to improve readability change naming of
        mapped irqs from virq to mapped_irq
      
      v5:
      - Dispose irq_domain mapping correctly
      - Update optional binding description in binding docs
      
      v4:
      - Added vendor prefix to devicetree binding for IP specific properties
        using MMIO GPIO helper library instead of manually map PIO to memory
      - altera_gpio_chip inline struct documentation to kerneldoc
      - Using dev_ print to print a better failure message
      
      v2, v3:
      - Do not reference NO_IRQ
      - Updated irq_set_type to only allow the hardware configured irq type
      Signed-off-by: default avatarTien Hock Loh <thloh@altera.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      c5abbba9