summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'gpio-v4.11-1' of ↵Linus Torvalds2017-02-2324-538/+1671
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for the v4.11 cycle Core changes: - Augment fwnode_get_named_gpiod() to configure the GPIO pin immediately after requesting it like all other APIs do. This is a treewide change also updating all users. - Pass a GPIO label down to gpiod_request() from fwnode_get_named_gpiod(). This makes debugfs and the userspace ABI correctly reflect the current in-kernel consumer of a pin taken using this abstraction. This is a treewide change also updating all users. - Rename devm_get_gpiod_from_child() to devm_fwnode_get_gpiod_from_child() to reflect the fact that this function is operating on a fwnode object. This is a treewide change also updating all users. - Make it possible to take multiple GPIOs in a single hog of device tree hogs. - The refactorings switching GPIO chips to use the .set_config() callback using standard pin control properties and providing a backend into the pin control subsystem that were also merged into the pin control tree naturally appear here too. Testing instrumentation: - A whole slew of cleanups and improvements to the mockup GPIO driver. We now have an extended userspace test exercising the subsystem, and we can inject interrupts etc from userspace to fully test the core GPIO functionality. New drivers: - New driver for the Cortina Systems Gemini GPIO controller. - New driver for the Exar XR17V352/354/358 chips. - New driver for the ACCES PCI-IDIO-16 PCI GPIO card. Driver changes: - RCAR: set the irqchip parent device, add fine-grained runtime PM support. - pca953x: support optional RESET control line on the chip. - DaVinci: cleanups and simplifications. Add support for multiple instances. - .set_multiple() and naming of lines on more or less all of the ISA/PCI GPIO controllers. - mcp23s08: refactored to use regmap as a first step to further rewrites and modernizations" * tag 'gpio-v4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (61 commits) gpio: reintroduce devm_get_gpiod_from_child() gpio: pci-idio-16: Fix PCI BAR index gpio: pci-idio-16: Fix PCI device ID code gpio: mockup: implement event injecting over debugfs gpio: mockup: add a dummy irqchip gpio: mockup: implement naming the lines gpio: mockup: code shrink gpio: mockup: readability tweaks gpio: Add GPIO support for the ACCES PCI-IDIO-16 gpio: Add the devm_fwnode_get_index_gpiod_from_child() helper gpio: Rename devm_get_gpiod_from_child() gpio: mcp23s08: Select REGMAP/REGMAP_I2C to fix build error gpio: ws16c48: Add support for GPIO names gpio: gpio-mm: Add support for GPIO names gpio: 104-idio-16: Add support for GPIO names gpio: 104-idi-48: Add support for GPIO names gpio: 104-dio-48e: Add support for GPIO names gpio: ws16c48: Remove unnecessary driver_data set gpio: gpio-mm: Remove unnecessary driver_data set gpio: 104-idio-16: Remove unnecessary driver_data set ...
| * gpio: pci-idio-16: Fix PCI BAR indexWilliam Breathitt Gray2017-02-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | The PCI BAR0 and BAR1 for the PCI-IDIO-16 hold information for the PLX 9052 bridge chip on the device. The PCI BAR2 holds the necessary base address for I/O control of the PCI-IDIO-16. This patch corrects the PCI BAR index mismatch for the PCI-IDIO-16 GPIO driver. Fixes: 02e74fc0401a ("gpio: Add GPIO support for the ACCES PCI-IDIO-16") Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: pci-idio-16: Fix PCI device ID codeWilliam Breathitt Gray2017-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | The ACCES PCI-IDIO-16 has a PCI device ID code of 0x0DC8. It is incorrect to use the PCI device ID code of the ACCES PCI-IIRO-8 (0x0F00). This patch fixes the said PCI device ID code mismatch. Fixes: 02e74fc0401a ("gpio: Add GPIO support for the ACCES PCI-IDIO-16") Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: mockup: implement event injecting over debugfsBartosz Golaszewski2017-02-131-1/+115
| | | | | | | | | | | | | | | | | | Create a debugfs directory for every mockup chip and a single file for every line. Writing (0 or 1) to these files allows the user to inject line events (falling or rising edge respectively). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: mockup: add a dummy irqchipBartosz Golaszewski2017-02-132-0/+81
| | | | | | | | | | | | | | | | Setup a dummy irqchip that will allow us to inject line events for testing purposes. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: mockup: implement naming the linesBartosz Golaszewski2017-02-061-0/+35
| | | | | | | | | | | | | | | | | | | | In order to allow testing line lookup by name from user space, add a new boolean parameter that indicates whether we want the lines to be named. The name is created by concatenating the chip name and the line offset value. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: mockup: code shrinkBartosz Golaszewski2017-02-061-21/+8
| | | | | | | | | | | | | | | | Moving a couple of lines around allows us to shrink the code a bit while keeping the same functionality. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: mockup: readability tweaksBartosz Golaszewski2017-02-061-57/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following patch tries to improve the readability of the mockup driver. The driver is called gpio-mockup, so add the same prefix to all functions and structures. Add some newlines and use a temporary pointer in gpio_mockup_add(). Drop the name of the direction enum and rename the enum values to better reflect their purpose. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * gpio: Add GPIO support for the ACCES PCI-IDIO-16William Breathitt Gray2017-02-063-0/+358
| | | | | | | | | | | | | | | | | | | | | | | | The ACCES PCI-IDIO-16 device provides 32 lines of digital I/O (16 lines of optically-isolated digital inputs for AC and DC control signals, and 16 lines of solid state switch digital outputs). An interrupt is generated when any of the inputs change state (low to high or high to low). Input filter control is not supported by this driver, and input filters are deactivated by this driver. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * Merge branch 'ib-gpiod-flags' into develLinus Walleij2017-02-052-12/+16
| |\
| | * gpio: Add the devm_fwnode_get_index_gpiod_from_child() helperBoris Brezillon2017-02-042-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devm_fwnode_get_gpiod_from_child() currently allows GPIO users to request a GPIO that is defined in a child fwnode instead of directly in the device fwnode. Extend this API by adding the devm_fwnode_get_index_gpiod_from_child() helper which does the same except you can also specify an index in case the 'xx-gpios' property describe several GPIOs. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * gpio: Rename devm_get_gpiod_from_child()Boris Brezillon2017-02-041-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename devm_get_gpiod_from_child() into devm_fwnode_get_gpiod_from_child() to reflect the fact that this function is operating on a fwnode object. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: mcp23s08: Select REGMAP/REGMAP_I2C to fix build errorAxel Lin2017-02-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver now using devm_regmap_init/devm_regmap_init_i2c, so it needs to select REGMAP/REGMAP_I2C accordingly. Fixes: ("3d84fdb3f0b5 gpio: mcp23s08: use regmap") Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-By: Sebastian Reichel <sre@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: ws16c48: Add support for GPIO namesWilliam Breathitt Gray2017-02-011-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the WinSystems WS16C48. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: gpio-mm: Add support for GPIO namesWilliam Breathitt Gray2017-02-011-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the Diamond Systems GPIO-MM. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-idio-16: Add support for GPIO namesWilliam Breathitt Gray2017-02-011-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the ACCES 104-IDIO-16. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-idi-48: Add support for GPIO namesWilliam Breathitt Gray2017-02-011-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the ACCES 104-IDI-48. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-dio-48e: Add support for GPIO namesWilliam Breathitt Gray2017-02-011-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch sets the gpio_chip names option with an array of GPIO line names that match the manual documentation for the ACCES 104-DIO-48E. This should make it easier for users to identify which GPIO line corresponds to a respective GPIO pin on the device. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: ws16c48: Remove unnecessary driver_data setWilliam Breathitt Gray2017-02-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Setting driver_data was necessary to access private data in the ws16c48_remove function. Now that the ws16c48_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: gpio-mm: Remove unnecessary driver_data setWilliam Breathitt Gray2017-02-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Setting driver_data was necessary to access private data in the gpiomm_remove function. Now that the gpiomm_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-idio-16: Remove unnecessary driver_data setWilliam Breathitt Gray2017-02-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Setting driver_data was necessary to access private data in the idio_16_remove function. Now that the idio_16_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-idi-48: Remove unnecessary driver_data setWilliam Breathitt Gray2017-02-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Setting driver_data was necessary to access private data in the idi_48_remove function. Now that the idi_48_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-dio-48e: Remove unnecessary driver_data setWilliam Breathitt Gray2017-02-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Setting driver_data was necessary to access private data in the dio48e_remove function. Now that the dio48e_remove function is gone, driver_data is no longer used. This patch removes the relevant code. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpiolib: Fix a WARN_ON that can never triggerChristophe JAILLET2017-01-311-2/+1
| | | | | | | | | | | | | | | | | | | | | "if (!x) WARN_ON(x)" can never trigger. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: mcp23s08: use regmapSebastian Reichel2017-01-301-190/+130
| | | | | | | | | | | | | | | | | | | | | | | | Use regmap API to save some lines of codes and have debugfs support for all of the MCP's registers. Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: ws16c48: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray2017-01-261-23/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call and request_irq call with the devm_gpiochip_add_data call and devm_request_irq call respectively. In addition, the ws16c48_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: gpio-mm: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray2017-01-261-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call with the devm_gpiochip_add_data call. In addition, the gpiomm_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-idio-16: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray2017-01-261-22/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call and request_irq call with the devm_gpiochip_add_data call and devm_request_irq call respectively. In addition, the idio_16_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-idi-48: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray2017-01-261-23/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call and request_irq call with the devm_gpiochip_add_data call and devm_request_irq call respectively. In addition, the idi_48_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | gpio: 104-dio-48e: Utilize devm_ functions in driver probe callbackWilliam Breathitt Gray2017-01-261-22/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devm_ resource manager functions allow memory to be automatically released when a device is unbound. This patch takes advantage of the resource manager functions and replaces the gpiochip_add_data call and request_irq call with the devm_gpiochip_add_data call and devm_request_irq call respectively. In addition, the dio48e_remove function has been removed as no longer necessary due to the use of the relevant devm_ resource manager functions. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | Merge branch 'ib-pinctrl-genprops' of /home/linus/linux-pinctrl into develLinus Walleij2017-01-2618-114/+211
| |\ \
| * | | gpio: exar: add gpio for exar cardsSudip Mukherjee2017-01-263-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exar XR17V352/354/358 chips have 16 multi-purpose inputs/outputs which can be controlled using gpio interface. Add the gpio specific code. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: ws16c48: Add set_multiple callback function supportWilliam Breathitt Gray2017-01-261-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WinSystems WS16C48 provides registers where 8 lines of GPIO may be set at a time. This patch add support for the set_multiple callback function, thus allowing multiple GPIO output lines to be set more efficiently in groups. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: gpio-mm: Add set_multiple callback function supportWilliam Breathitt Gray2017-01-261-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Diamond Systems GPIO-MM series provides registers where 8 lines of GPIO may be set at a time. This patch add support for the set_multiple callback function, thus allowing multiple GPIO output lines to be set more efficiently in groups. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: 104-idio-16: Add set_multiple callback function supportWilliam Breathitt Gray2017-01-261-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ACCES 104-IDIO-16 series provides registers where 8 lines of GPIO may be set at a time. This patch add support for the set_multiple callback function, thus allowing multiple GPIO output lines to be set more efficiently in groups. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: 104-dio-48e: Add set_multiple callback function supportWilliam Breathitt Gray2017-01-261-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ACCES 104-DIO-48E series provides registers where 8 lines of GPIO may be set at a time. This patch add support for the set_multiple callback function, thus allowing multiple GPIO output lines to be set more efficiently in groups. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | Merge branch 'ib-gpiod-flags' into develLinus Walleij2017-01-262-7/+26
| |\ \ \ | | | |/ | | |/|
| | * | gpio: Pass GPIO label down to gpiod_requestAlexander Stein2017-01-262-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently all users of fwnode_get_named_gpiod() have no way to specify a label for the GPIO. So GPIOs listed in debugfs are shown with label "?". With this change a proper label is used. Also adjust all users so they can pass a label, properly retrieved from device tree properties. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| | * | gpiolib: Convert fwnode_get_named_gpiod() to configure GPIOAndy Shevchenko2017-01-262-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make fwnode_get_named_gpiod() consistent with the rest of gpiod_get() like API, i.e. configure GPIO pin immediately after request. Besides obvious clean up it will help to configure pins based on firmware provided resources. Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: Add a driver for Cortina Systems Gemini GPIOLinus Walleij2017-01-263-0/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a heavy edit/rewrite of the GPIO driver for the Gemini SoC from arch/arm/mach-gemini/gpio.c. This rewrite uses all the best-in-class helper like generic GPIO and GPIOLIB_IRQCHIP and has been tested on ITian Square One Gemini-based NAS/router. Cc: Janos Laube <janos.dev@gmail.com> Cc: Paulius Zaleckas <paulius.zaleckas@gmail.com> Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: davinci: Remove custom .xlateKeerthy2017-01-261-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the current redesign of driver it's not necessary to have custom .xlate() as the gpiolib will assign default of_gpio_simple_xlate(). Suggested-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: davinci: Add support for multiple GPIO controllersKeerthy2017-01-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update GPIO driver to support Multiple GPIO controllers by updating the base of subsequent GPIO chips with total of previous chips gpio count so that gpio_add_chip gets unique numbers. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: davinci: Redesign driver to accommodate ngpios in one gpio chipKeerthy2017-01-261-54/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Davinci GPIO driver is implemented to work with one monolithic Davinci GPIO platform device which may have up to Y(144) gpios. The Davinci GPIO driver instantiates number of GPIO chips with max 32 gpio pins per each during initialization and one IRQ domain. So, the current GPIO's opjects structure is: <platform device> Davinci GPIO controller |- <gpio0_chip0> ------| ... |--- irq_domain (hwirq [0..143]) |- <gpio0_chipN> ------| Current driver creates one chip for every 32 GPIOs in a controller. This was a limitation earlier now there is no need for that. Hence redesigning the driver to create one gpio chip for all the ngpio in the controller. |- <gpio0_chip0> ------|--- irq_domain (hwirq [0..143]). The previous discussion on this can be found here: https://www.spinics.net/lists/linux-omap/msg132869.html Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: davinci: Remove gpio2regs functionKeerthy2017-01-261-24/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gpio2regs is written making an assumption that driver supports only one instance of gpio controller. Removing this and adding a generic array so as to support multiple instances of gpio controllers. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: intel-mid: Fix build warning when !CONFIG_PMAugusto Mecking Caringi2017-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only usage of function intel_gpio_runtime_idle() is here (in the same file): static const struct dev_pm_ops intel_gpio_pm_ops = { SET_RUNTIME_PM_OPS(NULL, NULL, intel_gpio_runtime_idle) }; And when CONFIG_PM is not set, the macro SET_RUNTIME_PM_OPS expands to nothing, causing the following compiler warning: drivers/gpio/gpio-intel-mid.c:324:12: warning: ‘intel_gpio_runtime_idle’ defined but not used [-Wunused-function] static int intel_gpio_runtime_idle(struct device *dev) Fix it by annotating the function with __maybe_unused. Signed-off-by: Augusto Mecking Caringi <augustocaringi@gmail.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: mvebu: fix warning when building on 64-bitRussell King2017-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Casting a pointer to an int is not portable, and provokes a compiler warning. Cast to unsigned long instead to avoid the warning. drivers/gpio/gpio-mvebu.c: In function 'mvebu_gpio_probe': drivers/gpio/gpio-mvebu.c:662:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] soc_variant = (int) match->data; ^ This will be needed when building gpio-mvebu for Armada 7k/8k ARM64 SoCs. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: pca953x: Add optional reset gpio controlSteve Longerbeam2017-01-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add optional reset-gpios pin control. If present, de-assert the specified reset gpio pin to bring the chip out of reset. v2: - Specify that reset signal to PCA953x chip is active low, in binding doc. - reorder includes in gpio-pca953x.c. - remove dev_err() on devm_gpiod_get_optional() error return. Cc: Alexandre Courbot <gnurou@gmail.com> Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpio: Remove impossible checks on container_of() resultStephen Boyd2017-01-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | container_of() does pointer math on the pointer that's passed in. If it were to return a NULL pointer the value passed in would need to be perfectly offset from 0 to make that so. Remove these checks because they don't make sense. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpiolib: Update documentation of struct acpi_gpio_infoAndy Shevchenko2017-01-112-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems the code had been changed, but description left untouched. Update description of the struct acpi_gpio_info and relative comments accordingly. Fixes: commit 52044723cd27 ("ACPI / gpio: Add irq_type when a GPIO is used as an interrupt") Cc: Christophe RICARD <christophe.ricard@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| * | | gpiolib: Switch to for_each_set_bit()Andy Shevchenko2017-01-111-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro for_each_set_bit() effectively looks up to the next set bit in array of bits. Instead of open coding that switch to for_each_set_bit() in gpio_chip_set_multiple(). While here, make gpio_chip_set_multiple() non-destructive against its parameters. We are safe since all callers, i.e. gpiod_set_array_value_complex(), handle that already. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>