aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)AuthorFilesLines
2012-09-04gpio: wm831x: Convert to use devm_kzalloc APIAxel Lin1-14/+5
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-04gpio: adp5588: Use module_i2c_driverAxel Lin1-13/+1
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-04gpio: Use DEFINE_PCI_DEVICE_TABLE macroAxel Lin2-2/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-03gpio/mxs: adopt irq_domain support for mxs gpio driverShawn Guo1-18/+30
Remove irq_domain_add_legacy call from mach-mxs.c and have the gpio driver adopt irqdomain support, so that we can have the mapping between gpio and irq number available without using virtual_irq_start and MXS_GPIO_IRQ_START. Signed-off-by: Shawn Guo <[email protected]> Acked-by: Linus Walleij <[email protected]>
2012-09-01gpio: tps65912: Convert to use devm_kzalloc APIAxel Lin1-13/+4
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-01gpio: da9052: Convert to use devm_kzalloc APIAxel Lin1-12/+3
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-01gpio: rdc321x: Prevent removal of modules exporting active GPIOsAxel Lin1-0/+1
This driver can be built as a module, set the missing owner field of struct gpio_chip to prevent removal of modules exporting active GPIOs. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-01drivers/gpio/gpio-pxa.c: use clk_prepare_enable and clk_disable_unprepareJulia Lawall1-8/+1
Clk_prepare_enable and clk_disable_unprepare combine clk_prepare and clk_enable, and clk_disable and clk_unprepare. They make the code more concise, and ensure that clk_unprepare is called when clk_enable fails. A simplified version of the semantic patch that introduces calls to these functions is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e; @@ - clk_prepare(e); - clk_enable(e); + clk_prepare_enable(e); @@ expression e; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-01gpio: em: Fix checking return value of irq_alloc_descsAxel Lin1-2/+2
irq_alloc_descs() returns negative error code on failure. Signed-off-by: Axel Lin <[email protected]> Acked-by: Magnus Damm <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-01gpio: davinci: preparation for switch to common clock frameworkMurali Karicheri1-1/+1
As a first step towards migrating davinci platforms to use common clock framework, replace all instances of clk_enable() with clk_prepare_enable() and clk_disable() with clk_disable_unprepare(). Until the platform is switched to use the CONFIG_HAVE_CLK_PREPARE Kconfig variable, this just adds a might_sleep() call and would work without any issues. This will make it easy later to switch to common clk based implementation of clk driver from DaVinci specific driver. Signed-off-by: Murali Karicheri <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-01gpio: Remove broken mark for da9052 gpio driverAxel Lin1-1/+1
The fix for MFD part is merged so remove the broken mark for da9052 gpio driver. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-01gpio: mc9s08dz60: Use devm_kzalloc APIAxel Lin1-18/+3
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-09-01gpio: mc9s08dz60: Fix build error if I2C=mAxel Lin1-1/+1
Make GPIO_MC9S08DZ60 depend on I2C=y, this fixes below build error: LD init/built-in.o drivers/built-in.o: In function `mc9s08dz60_get_value': clk-fixed-factor.c:(.text+0x7214): undefined reference to `i2c_smbus_read_byte_data' drivers/built-in.o: In function `mc9s08dz60_set': clk-fixed-factor.c:(.text+0x727c): undefined reference to `i2c_smbus_read_byte_data' clk-fixed-factor.c:(.text+0x72bc): undefined reference to `i2c_smbus_write_byte_data' drivers/built-in.o: In function `mc9s08dz60_i2c_driver_init': clk-fixed-factor.c:(.init.text+0x290): undefined reference to `i2c_register_driver' drivers/built-in.o: In function `mc9s08dz60_i2c_driver_exit': clk-fixed-factor.c:(.exit.text+0x2c): undefined reference to `i2c_del_driver' make: *** [vmlinux] Error 1 Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-28gpio-samsung: Remove now unused s3c2410_gpio* APISylwester Nawrocki1-40/+0
There is no more users of s3c2410_gpio_pullup(), s3c2410_gpio_setpin() and s3c2410_gpio_getpin() so remove theese functions. Signed-off-by: Sylwester Nawrocki <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2012-08-24Merge tag 'v3.6-rc3' into staging/for_v3.7Mauro Carvalho Chehab7-17/+46
Linux 3.6-rc3 * tag 'v3.6-rc3': (764 commits) Linux 3.6-rc3 task_work: add a scheduling point in task_work_run() fs: fix fs/namei.c kernel-doc warnings eventpoll: use-after-possible-free in epoll_create1() vfio: grab vfio_device reference *before* exposing the sucker via fd_install() vfio: get rid of vfio_device_put()/vfio_group_get_device* races vfio: get rid of open-coding kref_put_mutex introduce kref_put_mutex() vfio: don't dereference after kfree... fbcon: fix race condition between console lock and cursor timer (v1.1) mm: compaction: Abort async compaction if locks are contended or taking too long mm: have order > 0 compaction start near a pageblock with free pages rapidio/tsi721: fix unused variable compiler warning rapidio/tsi721: fix inbound doorbell interrupt handling drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode mm: correct page->pfmemalloc to fix deactivate_slab regression drivers/rtc/rtc-pcf2123.c: initialize dynamic sysfs attributes mm/compaction.c: fix deferring compaction mistake drivers/misc/sgi-xp/xpc_uv.c: SGI XPC fails to load when cpu 0 is out of IRQ resources string: do not export memweight() to userspace ...
2012-08-23gpio: pcf857x: enable gpio_to_irq() supportKuninori Morimoto1-0/+122
pcf857x chip has some pins, but interrupt pin is only 1 pin. And gpiolib requests 1 interrupt per 1 gpio pin. Thus, this patch added demuxed irq to pcf857x driver, and enabled gpio_to_irq(). Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-21gpio: bt8xx: Fix build error due to missing include fileAxel Lin1-1/+1
This patch fixes below build error: CC [M] drivers/gpio/gpio-bt8xx.o drivers/gpio/gpio-bt8xx.c:53:40: fatal error: ../media/video/bt8xx/bt848.h: No such file or directory compilation terminated. make[2]: *** [drivers/gpio/gpio-bt8xx.o] Error 1 make[1]: *** [drivers/gpio] Error 2 make: *** [drivers] Error 2 drivers/media/video/bt8xx/bt848.h is moved to drivers/media/pci/bt8xx/bt848.h by commit 68de959f773a1d49096835c411390bceff5d1549 "[media] bt8xx: move analog TV part to be together with DTV one". Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2012-08-17gpio: gpio-pch: Use spinlock for register access protectionAxel Lin1-12/+10
gpio_chip.can_sleep is 0, but current code uses mutex in pch_gpio_set pch_gpio_get and pch_gpio_direction_input functions. Thus those functions are not callable from interrupt context. This patch converts mutex into spinlock. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-17gpio: gpio-ml-ioh: Use spinlock for register access protectionAxel Lin1-10/+10
gpio_chip.can_sleep is 0, but current code uses mutex in ioh_gpio_set, ioh_gpio_get and ioh_gpio_direction_input functions. Thus those functions are not callable from interrupt context. This patch converts mutex into spinlock. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-17gpiolib: Use seq_file's iterator interfaceThierry Reding1-28/+74
When dumping a collection of items via seq_file, it is recommended to use the iterator interface. For the gpiolib debugfs interface this can be done to dump each GPIO chip in turn. Note that for gpiolib this is a little cumbersome because it does not provide a list of registered GPIO chips and the only way to iterate is over each GPIO individually. Once a chip is found, the number of GPIOs it provides can be skipped as a small optimization. This patch was requested by Arnd Bergmann here: http://article.gmane.org/gmane.linux.ports.tegra/3535 Signed-off-by: Thierry Reding <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Grant Likely <[email protected]> Cc: [email protected] Reviewed-by: Arnd Bergmann <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-17gpio: Fix debug message in of_get_named_gpio_flags()Thierry Reding1-1/+1
This was probably missed in the conversion done in commit 3d0f7cf ("gpio: Adjust of_xlate API to support multiple GPIO chips"). Signed-off-by: Thierry Reding <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-16gpio: pxa: add chain_eneter and chain_exit for irq handlerChao Xie1-0/+7
Signed-off-by: Chao Xie <[email protected]> Signed-off-by: Haojian Zhuang <[email protected]>
2012-08-16GPIO: gpio-pxa: simplify pxa_gpio_to_irq() and pxa_irq_to_chip()Daniel Mack1-54/+16
Simplify the code in gpio-pxa.c and make them based on irq_base. When not probed from devicetree, initialize irq_base from PXA_GPIO_TO_IRQ() or MMP_GPIO_TO_IRQ(), respectively, so the non-DT case still works. Only tested on PXA3xx. Signed-off-by: Daniel Mack <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Haojian Zhuang <[email protected]>
2012-08-14GPIO: gpio-pxa: fix building without CONFIG_OFArnd Bergmann1-2/+2
Commit 7212157267 ("GPIO: gpio-pxa: fix devicetree functions") added an "xlate" function pointer to the irq_domain_ops, but this function is nor declared or defined anywhere when CONFIG_OF is disabled, causing the build error: drivers/gpio/gpio-pxa.c:532:11: error: 'irq_domain_xlate_twocell' undeclared here (not in a function) Extending the DT-only code section to cover the irq_domain_ops and the pxa_gpio_dt_ids solves this problem and makes it clearer which code is actually used without DT. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-08-12Merge tag 'gpio-fixes-v3.6-rc1' of ↵Linus Torvalds6-14/+43
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull gpio fixes from Linus Walleij: - Fix a resource leak in the SCH driver - Fix the register address calculation in the MSIC driver - Fix the PXA driver's devicetree functions - Delete redundant shadow variable leftovers in the MXC driver - Specify the GPIO base for the device tree probe in the MXC driver - Add a modalias for the i.MX driver - Fix off-by-one bug in the Samsung driver - Fix erroneous errorpath in the Langwell driver * tag 'gpio-fixes-v3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: drivers/gpio/gpio-langwell.c: fix error return code gpio: samsung: Fix off-by-one bug in gpio addresses ARM: dts: imx: add alias for gpio gpio/mxc: specify gpio base for device tree probe gpio/mxc: remove redundant shadow variables initialization GPIO: gpio-pxa: fix devicetree functions gpio: msic: Fix calculating register address in msic_gpio_to_oreg() gpio-sch: Fix leak of resource
2012-08-10gpio: em: do not discard em_gio_irq_domain_cleanupArnd Bergmann1-1/+1
The newly added gpio-em driver marks its em_gio_irq_domain_cleanup function as __devexit, which would lead to that function being discarded in case CONFIG_HOTPLUG is disabled. However, the function is also called by the error handling logic em_gio_probe, which would cause a jump into a NULL pointer if it was removed from the kernel or module. Without this patch, building kzm9d_defconfig results in: WARNING: drivers/gpio/built-in.o(.devinit.text+0x330): Section mismatch in reference from the function em_gio_probe() to the function .devexit.text:em_gio_irq_domain_cleanup() The function __devinit em_gio_probe() references a function __devexit em_gio_irq_domain_cleanup(). This is often seen when error handling in the init function uses functionality in the exit path. The fix is often to remove the __devexit annotation of em_gio_irq_domain_cleanup() so it may be used outside an exit section. Signed-off-by: Arnd Bergmann <[email protected]> Cc: Magnus Damm <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Rafael J. Wysocki <[email protected]>
2012-08-07drivers/gpio/gpio-langwell.c: fix error return codeJulia Lawall1-2/+5
Convert a 0 error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ identifier ret; expression e,e1,e2,e3,e4,x; @@ ( if (\(ret != 0\|ret < 0\) || ...) { ... return ...; } | ret = 0 ) ... when != ret = e1 *x = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\|ioremap\|ioremap_nocache\|devm_ioremap\|devm_ioremap_nocache\)(...); ... when != x = e2 when != ret = e3 *if (x == NULL || ...) { ... when != ret = e4 * return ret; } // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-07gpio: samsung: Fix off-by-one bug in gpio addressesSean Paul1-7/+7
Move gpc4 to the end of the automatically processed gpio controllers so we don't taint the automatic offset calculation. This bug caused all controllers coming after gpc4 to map to the incorrect address. The result is <&gpd1 0 0 0 0> would actually map to GPIO 0 in gpd0. Signed-off-by: Sean Paul <[email protected]> Reviewed-by: Thomas Abraham <[email protected]> Acked-by: Doug Anderson <[email protected]> Acked-by: Kukjin Kim <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-07gpio/mxc: specify gpio base for device tree probeShawn Guo1-1/+2
Currently, unlike the non-DT probe where the gpio base is specified with pdev->id, the DT probe uses the base dynamically allocated by gpio core, which uses a completely different numbering scheme. This causes two issues to user space applications which access sysfs entry /sys/class/gpio/gpioN. * It breaks the compatibility with user space applications between non-DT and DT kernels. * It's not intuitive and sometimes hard for users to map the Linux gpio number to the actual hardware pin. Use alias to identify the gpio port/bank, and then the gpio base can be specified with port id to solve above issues. If alias is not defined in device tree, the base number dynamically allocated by gpio core will be used. Signed-off-by: Shawn Guo <[email protected]> Tested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-07gpio/mxc: remove redundant shadow variables initializationShawn Guo1-2/+0
With commit 3e11f7b (gpio/generic: initialize basic_mmio_gpio shadow variables properly) in place, the shadow variables initialization is being done in generic driver bgpio_init call. Remove the redundant shadow variables initialization from gpio-mxc driver. Signed-off-by: Shawn Guo <[email protected]> Tested-by: Dirk Behme <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-05GPIO: gpio-pxa: fix devicetree functionsDaniel Mack1-0/+26
Provide an of_xlate function for the PXA GPIO chips and make it work for devicetree environments. Successfully tested on a PXA3xx board. Signed-off-by: Daniel Mack <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-05gpio: msic: Fix calculating register address in msic_gpio_to_oreg()Axel Lin1-1/+1
In the case offset is 20 ... 23, the equation to get the register should be: INTEL_MSIC_GPIO1HV0CTLO - offset + 20 With above equation, we can get below mapping between offset and the register: offset is 20: INTEL_MSIC_GPIO1HV0CTLO offset is 21: INTEL_MSIC_GPIO1HV1CTLO offset is 22: INTEL_MSIC_GPIO1HV2CTLO offset is 23: INTEL_MSIC_GPIO1HV3CTLO Signed-off-by: Axel Lin <[email protected]> Acked-by: Mathias Nyman <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-08-05gpio-sch: Fix leak of resourceAlan Cox1-1/+2
Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-30Merge tag 'mfd-3.6-1' of ↵Linus Torvalds3-0/+166
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 Pull MFD bits from Samuel Ortiz: "We have support for a few new drivers: - Samsung s2mps11 - Wolfson Microelectronics wm5102 and wm5110 - Marvell 88PM800 and 88PM805 - TI twl6041 We also have our regular driver improvements: - Device tree and IRQ domain support for STE AB8500 - Regmap and devm_* API conversion for TI tps6586x - Device tree support for Samsung max77686 - devm_* API conversion for STE AB3100 Besides that, quite a lot of fixing and cleanup for mc13xxx, tps65910, tps65090, da9052 and twl-core." Fix up mostly trivial conflicts, with the exception of drivers/usb/host/ehci-omap.c in particular, which had some re-organization of the reset sequence (commit 1a49e2ac9651: "EHCI: centralize controller initialization") that clashed with commit 2761a6394516 ("mfd: USB: Fix the omap-usb EHCI ULPI PHY reset fix issues"). In particular, commit 2761a6394516 moved the usb_add_hcd() to the *middle* of the reset sequence, which clashes fairly badly with the reset sequence re-organization (although it could have been done inside the new omap_ehci_init() function). I left that part of commit 2761a6394516 just undone. * tag 'mfd-3.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (110 commits) mfd: Ensure AB8500 platform data is passed through db8500-prcmu to MFD Core mfd: Arizone core should select MFD_CORE mfd: Fix arizona-irq.c build by selecting REGMAP_IRQ mfd: Add debug trace on entering and leaving arizone runtime suspend mfd: Correct tps65090 cell names mfd: Remove gpio support from tps6586x core driver ARM: tegra: defconfig: Enable tps6586x gpio gpio: tps6586x: Add gpio support through platform driver mfd: Cache tps6586x register through regmap mfd: Use regmap for tps6586x register access. mfd: Use devm managed resources for tps6586x input: Add onkey support for 88PM80X PMIC mfd: Add support for twl6041 mfd: Fix twl6040 revision information mfd: Matches should be NULL when populate anatop child devices input: ab8500-ponkey: Create AB8500 domain IRQ mapping mfd: Add missing out of memory check for pcf50633 Documentation: Describe the AB8500 Device Tree bindings mfd: Add tps65910 32-kHz-crystal-input init mfd: Drop modifying mc13xxx driver's id_table in probe ...
2012-07-26Merge tag 'gpio-for-v3.6' of ↵Linus Torvalds13-138/+639
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO changes from Linus Walleij: - New driver for AMD-8111 southbridge GPIOs - New driver for Wolfson Micro Arizona devices - Propagate device tree parse errors - Probe deferral finalizations - all expected calls to GPIO will now hopefully request deferral where apropriate - Misc updates to TCA6424, WM8994, LPC32xx, PCF857x, Samsung MXC, OMAP and PCA953X drivers. Fix up gpio_idx conflicts in drivers/gpio/gpio-mxc.c * tag 'gpio-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: of_get_named_gpio_flags() return -EPROBE_DEFER if GPIO not yet available gpiolib: Defer failed gpio requests by default MAINTAINERS: add entry OMAP GPIO driver gpio/pca953x: increase variables size to support 24 bit of data GPIO: PCA953X: Increase size of invert variable to support 24 bit gpio/omap: move bank->dbck initialization to omap_gpio_mod_init() gpio/mxc: use the edge_sel feature if available gpio: propagate of_parse_phandle_with_args errors gpio: samsung: add flags specifier to device-tree binding gpiolib: Add support for Wolfson Microelectronics Arizona class devices gpio: gpio-lpc32xx: Add gpio_to_irq mapping gpio: pcf857x: share 8/16 bit access functions gpio: LPC32xx: Driver cleanup MAINTAINERS: Add Wolfson gpiolib drivers to the Wolfson entry gpiolib: wm8994: Convert to devm_kzalloc() gpiolib: wm8994: Use irq_domain mappings for gpios gpio: add a driver for GPIO pins found on AMD-8111 south bridge chips gpio/tca6424: merge I2C transactions, remove cast gpio/of: fix a typo of comment message
2012-07-25gpio: tps6586x: Add gpio support through platform driverLaxman Dewangan3-0/+166
Converting the gpio driver of tps6586x to a platform driver in place of registering the gpio through core driver. The motivation of the change is: - This is inline with the mfd drivers implementation. - This will move the related gpio support to gpio driver folder where all gpio related drivers are available. This will be easy the maintenance and enhancement is anything done for gpio. - The gpio functionality can be selected through config variable. Signed-off-by: Laxman Dewangan <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
2012-07-23Merge tag 'irq' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds1-24/+32
Pull arm-soc sparse IRQ conversion from Arnd Bergmann: "The I.MX platform is getting converted to use sparse IRQs. We are doing this for all platforms over time, because this is one of the requirements for building a multiplatform kernel, and generally a good idea." * tag 'irq' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: imx: select USE_OF ARM: imx: Fix build error due to missing irqs.h include ARM: imx: enable SPARSE_IRQ for imx platform ARM: fiq: change FIQ_START to a variable tty: serial: imx: remove the use of MXC_INTERNAL_IRQS ARM: imx: remove unneeded mach/irq.h inclusion i2c: imx: remove unneeded mach/irqs.h inclusion ARM: imx: add a legacy irqdomain for mx31ads ARM: imx: add a legacy irqdomain for 3ds_debugboard ARM: imx: pass gpio than irq number into mxc_expio_init ARM: imx: leave irq_base of wm8350_platform_data uninitialized dma: ipu: remove the use of ipu_platform_data ARM: imx: move irq_domain_add_legacy call into avic driver ARM: imx: move irq_domain_add_legacy call into tzic driver gpio/mxc: move irq_domain_add_legacy call into gpio driver ARM: imx: eliminate macro IRQ_GPIOx() ARM: imx: eliminate macro IOMUX_TO_IRQ() ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()
2012-07-17gpio: of_get_named_gpio_flags() return -EPROBE_DEFER if GPIO not yet availableRoland Stigge1-1/+4
of_get_named_gpio_flags() and of_get_named_gpio() return -EPROBE_DEFER if the respective GPIO is not (yet) available. This is useful if driver's probe() functions try to get a GPIO whose controller isn't probed yet. Thus, the driver can be probed again later on. The function still returns -EINVAL on other errors (parse error or node doesn't exist). This way, the case of an optional/intentionally missing GPIO is handled appropriately. Signed-off-by: Roland Stigge <[email protected]> Acked-by: Alexandre Pereira da Silva <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-17gpiolib: Defer failed gpio requests by defaultMark Brown1-1/+1
Since users must be explicitly provided with a GPIO number in order to request one the overwhelmingly common case for failing to request will be that the required GPIO driver has not yet registered and we should therefore defer until it has registered. In order to avoid having to code this logic in individual drivers have gpio_request() return -EPROBE_DEFER when failing to look up the GPIO. Drivers which don't want this behaviour can override it if they desire. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-17gpio/pca953x: increase variables size to support 24 bit of dataLeed Aguilar1-14/+14
Increase variable size from u16 to u32 to allocate 24 bit of data required for the TCA6424 I/O expander device type. Signed-off-by: Leed Aguilar <[email protected]> Signed-off-by: Chandrabhanu Mahapatra <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-17GPIO: PCA953X: Increase size of invert variable to support 24 bitChandrabhanu Mahapatra1-5/+6
TCA6424 is a low voltage 24 bit I2C and SMBus I/O expander of pca953x family similar to its 16 bit predecessor TCA6416. It comes with three 8-bit active Input, Output, Polarity Inversion and Configuration registers each. The polarity of Input ports can be reversed by setting the appropiate bit in Polarity Inversion registers. The variables corresponding to Input, Output and Configuration registers have already been updated to support 24 bit values. This patch thus updates the invert variable of PCA953X platform data to support 24 bit. Signed-off-by: Chandrabhanu Mahapatra <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-17gpio/omap: move bank->dbck initialization to omap_gpio_mod_init()Tarun Kanti DebBarma1-6/+4
Since the bank->dbck initialization in a one time operation there is no need to keep this within gpio_debounce(). Therefore, moving clk_get(bank->dbck) to omap_gpio_mod_init(). Since the value of bank->dbck would be NULL at the beginning, this check has been removed. Signed-off-by: Tarun Kanti DebBarma <[email protected]> Reported-by: Paul Walmsley <[email protected]> Reviewed-by: Jon Hunter <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Rajendra Nayak <[email protected]> Cc: Santosh Shilimkar <[email protected]> Cc: Cousson, Benoit <[email protected]> Reviewed-by: Paul Walmsley <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-17gpio/mxc: use the edge_sel feature if availableBenoît Thébaudeau1-14/+57
Some mxc processors have an edge_sel feature, which allows the IRQ to be triggered by any edge. This patch makes use of this feature if available, which skips mxc_flip_edge(). Cc: Grant Likely <[email protected]> Cc: Linus Walleij <[email protected]> Acked-by: Sascha Hauer <[email protected]> Cc: <[email protected]> Signed-off-by: Benoît Thébaudeau <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-17gpio: propagate of_parse_phandle_with_args errorsAlexandre Courbot1-1/+1
Make of_get_named_gpio_flags propagate any error it receives from of_parse_phandle_with_args instead of inconditionally returning -EINVAL. Signed-off-by: Alexandre Courbot <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-17gpio: samsung: add flags specifier to device-tree bindingOlof Johansson1-1/+4
This adds a flags field to the gpio specifier for Samsung. I didn't want to add yet another field in the already quite long specifier, so I decided to compress it together with the Pull Up/Down settings instead. This is needed to, for example, have a gpio-keys input that is active low. Signed-off-by: Olof Johansson <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-17gpiolib: Add support for Wolfson Microelectronics Arizona class devicesMark Brown3-0/+170
The Arizona class devices provide some GPIOs for use in the system. This driver provides support for these via gpiolib. Currently interrupts are not supported, normally the GPIOs are outputs only. Signed-off-by: Mark Brown <[email protected]> [Fold in WM5110 support patch] Signed-off-by: Linus Walleij <[email protected]>
2012-07-12gpio: gpio-lpc32xx: Add gpio_to_irq mappingRoland Stigge1-0/+65
This patch helps mapping with gpio_to_irq for the GPIOs that are irq enabled. Signed-off-by: Roland Stigge <[email protected]> Tested-by: Alexandre Pereira da Silva <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-12gpio: pcf857x: share 8/16 bit access functionsKuninori Morimoto1-62/+31
This patch adds 8/16 bit write/read functions, and shared gpio input/output/set/get functions. Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-12gpio: LPC32xx: Driver cleanupRoland Stigge1-8/+1
Since LPC32xx is now switched over to devicetree based GPIO, the unused lpc32xx_gpio_init() can be removed. Further, the driver title changed since it referred to the wrong file. Signed-off-by: Roland Stigge <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-07-12gpiolib: wm8994: Convert to devm_kzalloc()Mark Brown1-8/+3
Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Linus Walleij <[email protected]>