1. 08 Nov, 2017 1 commit
  2. 29 Jun, 2017 1 commit
    • Kuppuswamy Sathyanarayanan's avatar
      gpio: gpio-wcove: Fix GPIO control register offset calculation · 3a02dc97
      Kuppuswamy Sathyanarayanan authored
      According to Whiskey Cove PMIC GPIO controller specification, for GPIO
      pins 0-12, GPIO input and output register control address range from,
      
      0x4e44-0x4e50 for GPIO outputs control register
      
      0x4e51-0x4e5d for GPIO input control register
      
      But, currently when calculating the GPIO register offsets in to_reg()
      function, all GPIO pins in the same bank uses the same GPIO control
      register address. This logic is incorrect. This patch fixes this
      issue.
      
      This patch also adds support to selectively skip register modification
      for virtual GPIOs.
      
      In case of Whiskey Cove PMIC, ACPI code may use up 94 virtual GPIOs.
      These virtual GPIOs are used by the ACPI code as means to access various
      non GPIO bits of PMIC. So for these virtual GPIOs, we don't need to
      manipulate the physical GPIO pin register. A similar patch has been
      merged recently by Hans for Crystal Cove PMIC GPIO driver. You can
      find more details about it in Commit 9a752b4c ("gpio: crystalcove:
      Do not write regular gpio registers for virtual GPIOs")
      Signed-off-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
      Reported-by: default avatarJukka Laitinen <jukka.laitinen@intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      3a02dc97
  3. 19 Jun, 2017 1 commit
  4. 28 Apr, 2017 1 commit
  5. 24 Apr, 2017 1 commit
  6. 26 Jan, 2017 1 commit
    • Mika Westerberg's avatar
      pinctrl / gpio: Introduce .set_config() callback for GPIO chips · 2956b5d9
      Mika Westerberg authored
      Currently we already have two pin configuration related callbacks
      available for GPIO chips .set_single_ended() and .set_debounce(). In
      future we expect to have even more, which does not scale well if we need
      to add yet another callback to the GPIO chip structure for each possible
      configuration parameter.
      
      Better solution is to reuse what we already have available in the
      generic pinconf.
      
      To support this, we introduce a new .set_config() callback for GPIO
      chips. The callback takes a single packed pin configuration value as
      parameter. This can then be extended easily beyond what is currently
      supported by just adding new types to the generic pinconf enum.
      
      If the GPIO driver is backed up by a pinctrl driver the GPIO driver can
      just assign gpiochip_generic_config() (introduced in this patch) to
      .set_config and that will take care configuration requests are directed
      to the pinctrl driver.
      
      We then convert the existing drivers over .set_config() and finally
      remove the .set_single_ended() and .set_debounce() callbacks.
      Suggested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      2956b5d9
  7. 25 Nov, 2016 2 commits
    • Linus Walleij's avatar
      gpio: set explicit nesting on drivers · 35ca3f61
      Linus Walleij authored
      The ADNP, CrystalCove and WhiskeyCove are all nested GPIO
      irqchips, but were avoiding to connect the parent IRQ to
      the gpiochip. This works, but is kind of sloppy as the
      child IRQs are not marked as having the parent IRQ as
      parent.
      
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Ajay Thomas <ajay.thomas.david.rajamanickam@intel.com>
      Cc: Bin Gao <bin.gao@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      35ca3f61
    • Linus Walleij's avatar
      gpio: simplify adding threaded interrupts · d245b3f9
      Linus Walleij authored
      This tries to simplify the use of CONFIG_GPIOLIB_IRQCHIP when
      using threaded interrupts: add a new call
      gpiochip_irqchip_add_nested() to indicate that we're dealing
      with a nested rather than a chained irqchip, then create a
      separate gpiochip_set_nested_irqchip() to mirror
      the gpiochip_set_chained_irqchip() call to connect the
      parent and child interrupts.
      
      In the nested case gpiochip_set_nested_irqchip() does nothing
      more than call irq_set_parent() on each valid child interrupt,
      which has little semantic effect in the kernel, but this is
      probably still formally correct.
      
      Update all drivers using nested interrupts to use
      gpiochip_irqchip_add_nested() so we can now see clearly
      which these users are.
      
      The DLN2 driver can drop its specific hack with
      .irq_not_threaded as we now recognize whether a chip is
      threaded or not from its use of gpiochip_irqchip_add_nested()
      signature rather than from inspecting .can_sleep.
      
      We rename the .irq_parent to .irq_chained_parent since this
      parent IRQ is only really kept around for the chained
      interrupt handlers.
      
      Cc: Lars Poeschel <poeschel@lemonage.de>
      Cc: Octavian Purdila <octavian.purdila@intel.com>
      Cc: Daniel Baluta <daniel.baluta@intel.com>
      Cc: Bin Gao <bin.gao@linux.intel.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Ajay Thomas <ajay.thomas.david.rajamanickam@intel.com>
      Cc: Semen Protsenko <semen.protsenko@globallogic.com>
      Cc: Alexander Stein <alexander.stein@systec-electronic.com>
      Cc: Phil Reid <preid@electromag.com.au>
      Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      d245b3f9
  8. 15 Sep, 2016 1 commit
    • Paul Gortmaker's avatar
      gpio: wcove: fix implicit assumption module.h is present · 39d80072
      Paul Gortmaker authored
      The Kconfig for this file is:
      
      drivers/gpio/Kconfig:config GPIO_WHISKEY_COVE
      drivers/gpio/Kconfig:   tristate "GPIO support for Whiskey Cove PMIC"
      
      ...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: Ajay Thomas <ajay.thomas.david.rajamanickam@intel.com>
      Cc: Bin Gao <bin.gao@intel.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      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>
      39d80072
  9. 19 Aug, 2016 1 commit
  10. 11 Aug, 2016 1 commit
    • Bin Gao's avatar
      gpio: Add Intel WhiskeyCove PMIC GPIO driver · 0ba19cfc
      Bin Gao authored
      This patch introduces a separate GPIO driver for Intel WhiskeyCove PMIC.
      This driver is based on gpio-crystalcove.c.
      
      Changes in v7:
       - Fixed various coding style comments from Andy Shevchenko
      Changes in v6:
       - Removed unnecessary wcove_gpio_remove()
       - Used devm_gpiochip_remove() instead of gpiochip_remove()
       - Various coding style changes per Mika's comment
      Changes in v5:
       - Revisited the interrupt handler code to iterate until all pending
         interrupts are handled. This change is to avoid missing interrupt
         when we're inside the interrupt handler.
       - Used regmap_bulk_read() to read address adjacent registers.
      Changes in v4:
       - Converted CTLI_INTCNT_XX macros to less verbose ones INT_DETECT_XX.
       - Add comments about why there is no .pm for the driver.
       - Header files re-ordered.
       - Various coding style change to address Andy's comments.
      Changes in v3:
       - Fixed the year in copyright line(2015-->2016).
       - Removed DRV_NAME macro.
       - Added kernel-doc for regmap_irq_chip of the wcove_gpio structure.
       - Line length fix.
      Changes in v2:
       - Typo fix (Whsikey --> Whiskey).
       - Included linux/gpio/driver.h instead of linux/gpio.h
       - Implemented .set_single_ended().
       - Added GPIO register description.
       - Replaced container_of() with gpiochip_get_data().
       - Removed unnecessary "if (gpio > WCOVE_VGPIO_NUM" check.
       - Removed the device id table and added MODULE_ALIAS().
      Signed-off-by: default avatarAjay Thomas <ajay.thomas.david.rajamanickam@intel.com>
      Signed-off-by: default avatarBin Gao <bin.gao@intel.com>
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      0ba19cfc