- 15 Dec, 2015 1 commit
-
-
Robert Jarzmik authored
If a pin control driver is available, use it to change the gpio direction. If not fallback to directly manipulating the gpio direction register. The reason to use the pin control driver first is that pin control in pxa2xx architecture implies changing the gpio direction, even for non gpio functions. In order to do it atomically, only one driver should control the gpio direction, and if a pin controller is available, it has to be him. There is a small catch : if CONFIG_PINCTRL is selected, then a pinctrl driver has to be probed. If not, gpio_request() will return -EPROBE_DEFER as pinctrl_request_gpio() returns it in that case. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 14 Dec, 2015 2 commits
-
-
Sudeep Holla authored
The PL061 supports interrupts and those can be wakeup interrupts. We need to provide support for configuring those interrupts as wakeup sources. This patch adds irq_set_wake callback for PL061 so that GPIO interrupts can be configured as wakeup. Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Alexandre Courbot <gnurou@gmail.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Michal Simek authored
GPIO hogs registration is call at the end of gpiochip_add() function. Calling sequence is: gpiochip_add -> of_gpiochip_add -> of_gpiochip_scan_hogs -> gpiod_hog -> gpiochip_request_own_desc -> __gpiod_request -> chip->request -> zynq_gpio_request which calls pm_runtime_get_sync() which returns -13 because PM is not initialized yet. Initialize PM before gpiochip_add is called to fix this issue. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 11 Dec, 2015 3 commits
-
-
Linus Walleij authored
This enum is used in the gpiolib.h header file, yet <linux/gpio/consumer.h> is not included so plainly including this file (and some drivers do) will raise compile problems. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Geert Uytterhoeven authored
If the Renesas R-Car GPIO driver cannot find a functional clock, it prints a warning, .e.g. gpio_rcar ffc40000.gpio: unable to get clock and continues, as the clock is optional, depending on the SoC type. This warning may confuse users. To fix this, add a flag to indicate that the clock is mandatory or optional: - If the clock is mandatory (on R-Car Gen2 and Gen3), a missing clock is now treated as a fatal error, - If the clock is optional (on R-Car Gen1), the warning is no longer printed. Suggested-by: Magnus Damm <magnus.damm@gmail.com> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Geert Uytterhoeven authored
Since commit 4baadb9e ("ARM: shmobile: r8a7778: remove obsolete setup code"), Renesas R-Car SoCs are only supported in generic DT-only ARM multi-platform builds. The driver doesn't need to use platform data anymore, hence remove platform data configuration. Make gpio_rcar_priv.has_both_edge_trigger a boolean for consistency with gpio_rcar_info.has_both_edge_trigger. Move gpio_rcar_priv.irq_parent down while we're at it, to prevent gaps on 64-bit. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 10 Dec, 2015 17 commits
-
-
Geert Uytterhoeven authored
Fixes: 58383c78 ("gpio: change member .dev to .parent") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
John Crispin authored
Some drivers require a way to translate GPIO pins to their IRQ numbers. This patch adds the .to_irq() gpiolib callback to the pinctrl-xway driver, which returns an IRQ mapping for a given GPIO pin. Signed-off-by: John Crispin <blogic@openwrt.org> Signed-off-by: Martin Schiller <mschiller@tdt.de> [Switched ->dev to ->parent] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Phil Reid authored
Tested with TCA6408 / TCA6416 devices. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Thierry Reding authored
These new helpers simplify implementing multi-driver modules and properly handle failure to register one driver by unregistering all previously registered drivers. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
William Breathitt Gray authored
The ACCES 104-IDIO-16 uses a single interrupt to indicate a possible change-of-state in any of the digital input lines. As such, only a single write to the device's "Clear Interrupt" register is necessary to acknowledge the IRQ for all respective GPIO. This patch moves the "Clear Interrupt" register write operation from the irq_ack callback to the IRQ handler function, wherefore each interrupt may be cleared respectively by executing a single outb call at the end of the idio_16_irq_handler function, rather than multiple redundant outb calls as a result of the generic_handle_irq call for each masked GPIO. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Linus Walleij authored
The .dev field has been renamed .parent in the GPIO tree. Fix it up. Cc: Yendapally Reddy Dhananjaya Reddy <yrdreddy@broadcom.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Linus Walleij authored
-
Yendapally Reddy Dhananjaya Reddy authored
This adds the initial support of the Broadcom NSP gpio-a driver. Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yrdreddy@broadcom.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Yendapally Reddy Dhananjaya Reddy authored
Device tree binding documentation for Broadcom NSP GPIO-a Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yrdreddy@broadcom.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Andrew F. Davis authored
The PCI/USB expander menus already depend on PCI/USB, drop subdependecies on individual drivers. Signed-off-by: Andrew F. Davis <afd@ti.com> [Rebased to the GPIO tree] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Paul Burton authored
Allow GPIOs from the gpio-pch driver to be referenced from device tree by simply setting the struct gpio_chip of_node pointer to that of the struct pci_dev. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Paul Burton authored
Allow the pch_gpio driver to be built for MIPS platforms, in preparation for use on the MIPS Boston board. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Geert Uytterhoeven authored
Currently the 74x164 driver assembles an SPI message from an array of one-byte SPI transfers, one for each daisy-chained shift register, as the first byte sent will end up in the last register. This array is allocated and deallocated on each GPIO write access. By storing the data in the internal buffer in reverse order, we can use a single SPI transfer with the internal buffer directly, simplifying the code a lot, and avoiding memory (de)allocations. This also avoids transient values on the GPIO outputs when using an SPI master that cannot keep the hardware chip select asserted in between multiple transfers (and would need cs-gpios for proper operation). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Mark Brown <broonie@kernel.org> [Rebased changing .dev to .parent] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Geert Uytterhoeven authored
By moving the internal buffer to the end of struct gen_74x164_chip and converting it from a pointer to a zero-sized array, it can be allocated together with gen_74x164_chip, reducing the number of managed allocations. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Robert Jarzmik authored
The interrupt management is changed by this patch to rely on chip data instead of chained interrupts. The main goal is to loosen the dependency on the global pxa chip structure in favor of the passed chip data. The secondary goal is to better show in /proc/interrupts the difference between interrupts for gpio0 and gpio1 (directly wired to interrupt controller), and the other gpios (wired onto a third line in the interrupt controller). The last advantage of this patch is that the interrupt is actually requested, so that another driver cannot steal this line, or overwrite the handler. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Robert Jarzmik authored
Use the device managed ioremap to simplify the probe function. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Robert Jarzmik authored
The pxa gpio IP is provided by one chip, which holds multiple banks. Another reason the driver should register only one gpiochip instead of multiple gpiochips (ie. 1 per each bank) is that for pincontrol and devicetree integration (think gpio-ranges), it's impossible to have the contiguous pin range 0..127 mapped to gpios 0..127. This patch, amongst other thinks, paves the path to loosen the bond with the global structure variable pxa_gpio_chip. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 09 Dec, 2015 3 commits
-
-
Linus Walleij authored
After adding the DT matching in commit 6f29c9af "gpio: pca935x: fix of-only probed devices" compilation fails like this: CC [M] drivers/gpio/gpio-pca953x.o gpio-pca953x.c: In function ‘pca953x_probe’: gpio-pca953x.c:693:11: error: implicit declaration of function ‘of_match_device’ [-Werror=implicit-function-declaration] match = of_match_device(pca953x_dt_ids, &client->dev); ^ gpio-pca953x.c:693:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion] match = of_match_device(pca953x_dt_ids, &client->dev); ^ cc1: some warnings being treated as errors ../scripts/Makefile.build:264: recipe for target 'drivers/gpio/gpio-pca953x.o' failed After removing the conditional inclusion guards compilation works fine again. Might be a module problem so that fix. Cc: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Ben Dooks authored
If the pca953x device is probed from OF using the proper OF probing then the i2c-client will be NULL and the device probe will fail as id is NULL and it isn't an ACPI device (previous drivers would simply OOPS out). Add support for the of_device_id table having the same data as the others so that the correct paths will be taken when registering a device. An example of current valid of node which did not work: gpio@38 { compatible = "onsemi,pca9654", "nxp,pca9534"; reg = <0x38>; interrupt-parent = <&gpio5>; interrupts = <25 IRQ_TYPE_LEVEL_LOW>; }; Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Ben Dooks authored
Add onsemi,pca9654 which is also compatible with the nxp,pca9524 as it is an 8bit expander with an interrupt output. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 07 Dec, 2015 2 commits
-
-
Linus Walleij authored
Upstream GPIO has substituted .dev for .parent in struct gpio_chip. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Linus Walleij authored
Merge tag 'asoc-ac97-gpio' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into devel ASoC: Add a GPIO chip for AC'97 GPIOs are part of the AC'97 spec, enable their use on embedded platforms using AC'97.
-
- 04 Dec, 2015 1 commit
-
-
Linus Walleij authored
I missed to convert this driver properly to use .parent to point to the parent device. ARMv7 multiplatform would not compile. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 01 Dec, 2015 1 commit
-
-
William Breathitt Gray authored
The ACCES 104-IDI-48 family of PC/104 utility boards feature 48 individually optically isolated digital inputs. Enabled inputs feature change-of-state detection capability; if change-of-state detection is enabled, an interrupt is fired off if a change of input level (low-to-high or high-to-low) is detected. Change-of-state IRQs are enabled/disabled on 8-bit boundaries, for a total of six boundaries. This driver provides GPIO and IRQ support for these 48 channels of digital input. The base port address for the device may be configured via the idi_48_base module parameter. The interrupt line number for the device may be configured via the idi_48_irq module parameter. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 30 Nov, 2015 3 commits
-
-
Nizam Haider authored
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Nizam Haider <nijamh@cdac.in> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
William Breathitt Gray authored
IRQ should be disabled on device probe so that the device IRQ is in a known starting state. If IRQ is not disabled, interrupts may be reported as handled by the IRQ handler, despite no irq_unmask calls made by the user. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Krzysztof Kozlowski authored
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 29 Nov, 2015 1 commit
-
-
Bamvor Jian Zhang authored
Commit f4d566a8a0e6 ("gpio: change member .dev to .parent") changes member of gpiochip from .dev to .parent. Update the corresponding comment. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
- 19 Nov, 2015 6 commits
-
-
William Breathitt Gray authored
To prevent confusion, and to match the existing coding style used in other GPIO drivers, symbol names within the 104-idio-16 GPIO driver should be lowercase. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Bamvor Jian Zhang authored
We need to check if number of gpio is positive if there is no such check in devicetree or acpi or whatever called before gpiochip_add. I suppose that devicetree and acpi do not allow insert gpiochip with zero number but I do not know if it is enough to ignore this check in gpiochip_add. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Bamvor Jian Zhang authored
There are limitations for the current checker: 1. Could not check the overlap if the new gpiochip is the secondly gpiochip. 2. Could not check the overlap if the new gpiochip is overlap with the left of gpiochip. E.g. if we insert [c, d] between [a,b] and [e, f], and e >= c + d, it will successful even if c < a + b. 3. Allow overlap of base of different gpiochip. This patch fix these issues by checking the overlap of both right and left gpiochip in the same loop statement. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> [Tweaked to remove unnecessary ret variable] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Bamvor Jian Zhang authored
The commit f881bab0 ("gpio: keep the GPIO line names internal") change the error to warning in gpiochip_set_desc_names. Update the comment accordingly. Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Robert Jarzmik authored
This patch is a second attempt at what was previously in commit 6c7e660a ("gpio: pxa: set initcall level to module init"). The goal is the same : enable gpio & pinctrl driver to work together. As pinctrl driver will be initialized at device level, the gpio should be as well, so that the deferring mechanism is honored. Yet this patch should also respect the legacy platforms, so the set of constraints is : - in legacy platforms (ie. non dt), gpio_[gs]et_*() should be available for machine code => core initcall - in new platforms (ie. dt based), pinctrl will be available and no machine code => device initcall In order to fullfill all these constraints, the initcall level is either postcore for non devicetree platforms, and device for devicetree platforms. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-
Javier Martinez Canillas authored
I'm not as involved in OMAP as I used to be and Grygorii is the most active developer working on this driver and has also been reviewing patches so let's add him as a driver maintainer instead of me. While being there, add the driver's DT binding doc to the file list. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-