aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)AuthorFilesLines
2017-08-22gpio: brcmstb: check return value of gpiochip_irqchip_add()Masahiro Yamada1-4/+5
Because gpiochip_irqchip_add() may fail, its return value should be checked. Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Gregory Fong <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-22gpio: Add gpio driver support for ThunderX and OCTEON-TXDavid Daney3-0/+649
Cavium ThunderX and OCTEON-TX are arm64 based SoCs. Add driver for the on-chip GPIO pins. Signed-off-by: David Daney <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: mockup: use irq_simBartosz Golaszewski2-71/+8
Shrink the driver by removing the code dealing with dummy interrupts and replacing it with calls to the irq_sim API. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: mxs: use devres for irq generic chipBartosz Golaszewski1-5/+9
Use resource managed variants of irq_alloc_generic_chip() and irq_setup_generic_chip(). Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: mxc: use devres for irq generic chipBartosz Golaszewski1-5/+10
Use resource managed variants of irq_alloc_generic_chip() and irq_setup_generic_chip(). Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: pch: use devres for irq generic chipBartosz Golaszewski1-5/+7
Use resource managed variants of irq_alloc_generic_chip() and irq_setup_generic_chip(). Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: ml-ioh: use devres for irq generic chipBartosz Golaszewski1-5/+7
Use resource managed variants of irq_alloc_generic_chip() and irq_setup_generic_chip(). Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: sta2x11: use devres for irq generic chipBartosz Golaszewski1-4/+9
Use resource managed variants of irq_alloc_generic_chip() and irq_setup_generic_chip(). Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: sta2x11: disallow unbinding the driverBartosz Golaszewski1-0/+1
This driver is non-modular so explicitly disallow a driver unbind. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: mxs: disallow unbinding the driverBartosz Golaszewski1-0/+1
This driver is non-modular so explicitly disallow a driver unbind. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-21gpio: mxc: disallow unbinding the driverBartosz Golaszewski1-0/+1
This driver is non-modular so explicitly disallow a driver unbind. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-15gpio: aspeed: Remove reference to clock name in debounce warning messageAndrew Jeffery1-1/+1
HPLL is in fact not the clock we need. Remove the description of which clock we failed to find a phandle to in order to avoid any further error. Signed-off-by: Andrew Jeffery <[email protected]> Acked-by: Joel Stanley <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: 74x164: Introduce 'enable-gpios' propertyFabio Estevam1-0/+10
74HC595 has an /OE (output enable) pin that can be controlled by a GPIO. Introduce an optional property called 'enable-gpios' that allows controlling the /OE pin. Signed-off-by: Fabio Estevam <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: max77620: Make regmap_irq_chip constBhumika Goyal1-1/+1
Make the structure const as it is only passed to the function devm_regmap_add_irq_chip having the corresponding argument as const. Done using Coccinelle. Signed-off-by: Bhumika Goyal <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: zynq: Fix driver function parameters alignmentMichal Simek1-8/+9
Fix function parameters alignment reported by checkpatch. Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: zynq: Fix warnings in the driverNava kishore Manne1-6/+6
This patch fixes the below warning -->Block comments should align the * on each line. -->suspect code indent for conditional statements. -->Prefer 'unsigned int' to bare use of 'unsigned' Signed-off-by: Nava kishore Manne <[email protected]> Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: zynq: Fix empty lines in driverMichal Simek1-1/+2
Remove one additional line and add two new. All are reported by checkpatch. Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: zynq: Fix kernel doc warningsNava kishore Manne1-2/+3
This patch fixes the kernel doc warnings in the driver. Signed-off-by: Nava kishore Manne <[email protected]> Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: zynq: Provided workaround for GPIOSwapna Manupati1-4/+37
This patch provides workaround in the gpio driver for Zynq and ZynqMP Platforms by reading pin value of EMIO banks through DATA register as it was unable to read the value of it from DATA_RO register. Signed-off-by: Swapna Manupati <[email protected]> Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: zynq: Add support for suspend resumeShubhrajyoti Datta1-3/+79
Add support for suspend resume. Now that we can lose context across a suspend/ resume cycle. Add support for the context restore. Signed-off-by: Shubhrajyoti Datta <[email protected]> Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: Add support for TPS68470 GPIOsRajmohan Mani3-0/+192
This patch adds support for TPS68470 GPIOs. There are 7 GPIOs and a few sensor related GPIOs. These GPIOs can be requested and configured as appropriate. The GPIOs are also provided with descriptive names. However, the typical use case is that the OS GPIO driver will interact with TPS68470 GPIO driver to configure these GPIOs, as requested by the platform firmware. Signed-off-by: Rajmohan Mani <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: davinci: Handle the return value of davinci_gpio_irq_setup functionKeerthy1-1/+4
Currently davinci_gpio_irq_setup return value is ignored. Handle the return value appropriately. Signed-off-by: Keerthy <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: vf610: add imx7ulp supportDong Aisheng1-3/+44
The Rapid General-Purpose Input and Output with 2 Ports (RGPIO2P) on MX7ULP is similar to GPIO on Vibrid. But unlike Vibrid, the RGPIO2P has an extra Port Data Direction Register (PDDR) used to configure the individual port pins for input or output. We introduce a bool have_paddr with fsl_gpio_soc_data data to distinguish this differences. And we support getting the output status by checking the GPIO direction in PDDR. Cc: Alexandre Courbot <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Stefan Agner <[email protected]> Cc: Fugang Duan <[email protected]> Cc: Peter Chen <[email protected]> Signed-off-by: Dong Aisheng <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: msic: fix error return code in platform_msic_gpio_probe()Gustavo A. R. Silva1-2/+2
platform_get_irq() returns an error code, but the gpio-msic driver ignores it and always returns -EINVAL. This is not correct, and prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print and propagate the return value of platform_get_irq on failure. Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: omap : Add missing clk_unprepare().Arvind Yadav1-0/+2
omap_gpio_probe() can fail here and we must disable clock. Signed-off-by: Arvind Yadav <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: mb86s7x: Handle return value of clk_prepare_enable.Arvind Yadav1-1/+3
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: it87: add support for IT8772F Super I/O.Diego Elio Pettenò1-0/+3
From the datasheet, the GPIO interface is identical to IT8728 (same description), so just add it to the same case as the other chip. Signed-off-by: Diego Elio Pettenò <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: tegra: Use unsigned int where possibleThierry Reding1-32/+24
In most of the cases, integers in this file can't be negative, so the type can be more restricted for clarity. Signed-off-by: Thierry Reding <[email protected]> Acked-by: Jon Hunter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: tegra: Fix checkpatch warningsThierry Reding1-12/+20
Fix a couple of checkpatch warnings, such as complaints about bare unsigned being used (instead of unsigned int) and missing blank lines after declarations. Signed-off-by: Thierry Reding <[email protected]> Acked-by: Jon Hunter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: tegra: Prefer kcalloc() over kzalloc() with multipliesThierry Reding1-2/+2
Rather than manually compute the size of an array, pass the number and element size to kcalloc(). Signed-off-by: Thierry Reding <[email protected]> Acked-by: Jon Hunter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: tegra: Remove unnecessary checkThierry Reding1-9/+2
of_device_get_match_data() can never return NULL, therefore the check for NULL values is unnecessary. Signed-off-by: Thierry Reding <[email protected]> Acked-by: Jon Hunter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: sysfs: Fixup kerneldocThierry Reding1-4/+4
Fix up some references to parameters to match the code. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: acpi: Fixup kerneldocThierry Reding1-2/+2
Fix up a parameter description to match the code and fix markup for a constant to prettify output. Signed-off-by: Thierry Reding <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: devres: Improve kerneldocThierry Reding1-0/+3
Add missing descriptions for some parameters to match the code. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: of: Improve kerneldocThierry Reding1-4/+3
Add descriptions for missing fields and fix up some parameter references to match the code. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: Cleanup kerneldocThierry Reding1-22/+60
Some kerneldoc has become stale or wasn't quite correct from the outset. Fix up the most serious issues to silence warnings when building the documentation. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: tegra: Use platform_get_irq()Thierry Reding1-5/+5
Instead of using platform_get_resource() and getting the interrupts from the resource, use platform_get_irq() which is slightly easier to use and covers some special cases that the former doesn't. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: tegra: Use platform_irq_count()Thierry Reding1-7/+6
Use platform_irq_count() instead of open-coding the same code sequence. Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: Convert to using %pOF instead of full_nameRob Herring10-35/+31
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: Rob Herring <[email protected]> Cc: Tien Hock Loh <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Alexandre Courbot <[email protected]> Cc: Brian Norris <[email protected]> Cc: Florian Fainelli <[email protected]> Cc: [email protected] Cc: Michal Simek <[email protected]> Cc: "Sören Brinkmann" <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Gregory Fong <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: davinci: Convert prinkt to dev_errKeerthy1-2/+1
In case of devm_clk_get failure use dev_err instead of printk Signed-off-by: Keerthy <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: davinci: Use devm_gpiochip_add_data in place of gpiochip_add_dataKeerthy1-2/+12
Use the devm version of gpiochip_add_data and pass on the return value. This avoids memory leak due to gpiochip_add_data in case the driver is unbound. Signed-off-by: Keerthy <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: altera-a10sr: constify gpio_chip structureGustavo A. R. Silva1-1/+1
This structure is only used to copy into another structure, so declare it as const. This issue was detected using Coccinelle and the following semantic patch: @r disable optional_qualifier@ identifier i; position p; @@ static struct gpio_chip i@p = { ... }; @ok@ identifier r.i; expression e; position p; @@ e = i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct gpio_chip e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct gpio_chip i = { ... }; In the following log you can see a significant difference in the code size and data segment, hence in the dec segment. This log is the output of the size command, before and after the code change: before: text data bss dec hex filename 1954 600 0 2554 9fa drivers/gpio/gpio-altera-a10sr.o after: text data bss dec hex filename 1655 512 0 2167 877 drivers/gpio/gpio-altera-a10sr.o Signed-off-by: Gustavo A. R. Silva <[email protected]> Reviewed-by: Thor Thayer <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: gpio-mxc: gpio_set_wake_irq() use proper return valuesPhilipp Rosenberger1-5/+6
Errors from enable_irq_wake() in gpio_set_wake_irq() were silently ignored. Thus led to the problem that gpio_set_wake_irq() always returned successfully, even if enable_irq_wake() returned an error. Signed-off-by: Philipp Rosenberger <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: rcar: add gen[123] fallback compatibility stringsSimon Horman1-0/+10
Add fallback compatibility string for R-Car Gen 1, 2 and 3. In the case of Renesas R-Car hardware we know that there are generations of SoCs, f.e. Gen 1 and 2. But beyond that its not clear what the relationship between IP blocks might be. For example, I believe that r8a7790 is older than r8a7791 but that doesn't imply that the latter is a descendant of the former or vice versa. We can, however, by examining the documentation and behaviour of the hardware at run-time observe that the current driver implementation appears to be compatible with the IP blocks on SoCs within a given generation. For the above reasons and convenience when enabling new SoCs a per-generation fallback compatibility string scheme being adopted for drivers for Renesas SoCs. Also deprecate renesas,gpio-rcar as its name is more generic than its implementation. Signed-off-by: Simon Horman <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: replace __maybe_unused in gpiolib.h with static inlineMasahiro Yamada1-1/+1
In header files, static inline is more commonly used. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: tegra: remove gpio_to_irq() from hw irq handlersGrygorii Strashko1-1/+2
gpio_to_irq() API expected to be used by GPIO consumers and not drivers and there are no guarantee that its gpiolib implementation is irq safe. Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: pxa: remove gpio_to_irq() from hw irq handlersGrygorii Strashko1-3/+5
gpio_to_irq() API expected to be used by GPIO consumers and not drivers and there are no guarantee that its gpiolib implementation is irq safe. Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpiolib: allow gpio irqchip to map irqs dynamicallyGrygorii Strashko1-23/+6
Now IRQ mappings are always created for all (allowed) GPIOs in gpiochip in gpiochip_irqchip_add_key() which goes against the idea of SPARSE_IRQ and, as result, leads to: - increasing of memory consumption for IRQ descriptors most of which will never ever be used (espessially on platform with a high number of GPIOs). (sizeof(struct irq_desc) == 256 on my tested platforms) - imposibility to use GPIO irqchip APIs by gpio drivers when HW implements GPIO IRQ functionality as IRQ crossbar/router which has only limited number of IRQ outputs (example from [1], all GPIOs can be mapped on only 8 IRQs). Hence, remove static IRQ mapping code from gpiochip_irqchip_add_key() and instead replace irq_find_mapping() with irq_create_mapping() in gpiochip_to_irq(). Also add additional gpiochip_irqchip_irq_valid() calls in gpiochip_to_irq() and gpiochip_irq_map(). After this change gpio2irq mapping will happen the following way when GPIO irqchip APIs are used by gpio driver: - IRQ mappings will be created statically if driver passes first_irq>0 vlaue in gpiochip_irqchip_add_key(). - IRQ mappings will be created dynamically from gpio_to_irq() or of_irq_get(). Tested on am335x-evm and dra72-evm-revc. - dra72-evm-revc: number of created irq mappings decreased from 402 -> 135 Mem savings 267*256 = 68352 (66kB) - am335x-evm: number of created irq mappings decreased from 188 -> 63 Mem savings 125*256 = 32000 (31kB) [1] https://lkml.org/lkml/2017/6/15/428 Signed-off-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpiolib: request the gpio before querying its directionTimur Tabi1-0/+11
Before querying a GPIO to determine its direction, the GPIO should be formally requested. This allows the GPIO driver to block access to unavailable GPIOs, which makes it easier for some drivers to support sparse GPIO maps. Signed-off-by: Timur Tabi <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-08-14gpio: pca953x: remove incorrect le16_to_cpu callsAndy Shevchenko1-5/+3
i2c_smbus commands handle the correct byte order for smbus transactions internally. This will currently result in incorrect operation on big endian systems. Suggested-by: Sebastian Reichel <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Linus Walleij <[email protected]>