summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-ml-ioh.c
AgeCommit message (Collapse)Author
2017-08-21gpio: ml-ioh: use devres for irq generic chipBartosz Golaszewski
Use resource managed variants of irq_alloc_generic_chip() and irq_setup_generic_chip(). Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-05-29gpio: ml-ioh: check the return value of irq_alloc_generic_chip()Bartosz Golaszewski
This function can fail, so check the return value before dereferencing the returned pointer. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2017-03-15gpio: ml-ioh: use resource management for irqsBartosz Golaszewski
Use device resource managed variants of irq_alloc_descs() and request_irq() and remove the code manually freeing irq resources. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-01-05gpio: ml-ioh: use gpiochip data pointerLinus Walleij
This makes the driver use the data pointer added to the gpio_chip to store a pointer to the state container instead of relying on container_of(). Cc: Feng Tang <feng.tang@intel.com> Cc: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-12-26gpio: ml-ioh: Be sure to clamp return valueLinus Walleij
As we want gpio_chip .get() calls to be able to return negative error codes and propagate to drivers, we need to go over all drivers and make sure their return values are clamped to [0,1]. We do this by using the ret = !!(val) design pattern. Cc: Feng Tang <feng.tang@intel.com> Cc: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-07-22gpio: remove all usage of gpio_remove retval in driver/gpioabdoulaye berthe
Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-12-04gpio/pinctrl: make gpio_chip members typed booleanLinus Walleij
This switches the two members of struct gpio_chip that were defined as unsigned foo:1 to bool, because that is indeed what they are. Switch all users in the gpio and pinctrl subsystems to assign these values with true/false instead of 0/1. The users outside these subsystems will survive since true/false is 1/0, atleast we set some kind of more strict typing example. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-12-03gpio: remove DEFINE_PCI_DEVICE_TABLE macroJingoo Han
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-05-30gpio-ml-ioh: fix error return code in ioh_gpio_probe()Wei Yongjun
Fix to return a negative error code in the irq descs alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2013-05-20gpio: Don't override the error code in probe error handlingAxel Lin
Otherwise, we return 0 in probe error paths when gpiochip_remove() returns 0. Also show error message if gpiochip_remove() fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Cc: Tomoya MORINAGA <tomoya.rohm@gmail.com> Cc: Denis Turischev <denis@compulab.co.il> Cc: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-11-28gpio: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Grant Likely <grant.likely@secretlab.ca> Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: Peter Tyser <ptyser@xes-inc.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28gpio: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Peter Tyser <ptyser@xes-inc.com> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Kevin Hilman <khilman@ti.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28gpio: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Peter Tyser <ptyser@xes-inc.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-17gpio: gpio-ml-ioh: Use spinlock for register access protectionAxel Lin
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 <axel.lin@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-04-07gpio: Convert drivers to use module_pci_driver()Axel Lin
This patch converts the drivers in drivers/gpio/* to use module_pci_driver() macro which makes the code smaller and a bit simpler by having less boilerplate. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-02-01gpio: Add missing spin_lock_init in gpio-ml-ioh driverAxel Lin
This bug was introduced by commit 54be5663 "gpio-ml-ioh: Support interrupt function" which adds a spinlock to struct ioh_gpio but never init the spinlock. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-01-16gpio-ml-ioh: cleanup __iomem annotation usageMárton Németh
The __iomem annotation is to be used together with pointers used in iowrite32() but not for pointers returned by kzalloc(). For more details see [1] and [2]. This patch will remove the following sparse warning (i.e. when copiling with "make C=1"): * warning: incorrect type in assignment (different address spaces) References: [1] A new I/O memory access mechanism (Sep 15, 2004) http://lwn.net/Articles/102232/ [2] Being more anal about iospace accesses (Sep 15, 2004) http://lwn.net/Articles/102240/ Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2012-01-16gpio-ml-ioh: cleanup NULL pointer checkingMárton Németh
This patch will remove the following sparse warning ("make C=1"): * warning: Using plain integer as NULL pointer Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-12-13gpio-ml-ioh: Add the irq_disable/irq_enable hooks for ml-ioh irq chipFeng Tang
These hooks will be needed by the general disabl/enable_irq(); Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-12-13gpio-ml-ioh: fix a bug in the interrupt handlerFeng Tang
GPIO's irq action's dev_id is set to the first struct ioh_gpio chip, so when loop checking the 8 chips, the "chip" should be changed according. Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-10-31drivers/gpio: Fix drivers who are implicit users of module.hPaul Gortmaker
A pending cleanup will mean that module.h won't be implicitly everywhere anymore. Make sure the modular drivers in gpio are actually calling out for <module.h> explicitly in advance. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-19gpio-ml-ioh: Use NUMA_NO_NODE not GFP_KERNELTomoya MORINAGA
Currently, GFP_KERNEL is used as parameter of irq_alloc_descs like below. irq_base = irq_alloc_descs(-1, IOH_IRQ_BASE, num_ports[j], GFP_KERNEL); This is not true. So, this patch uses NUMA_NO_NODE not GFP_KERNEL. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reported-by: David Rientjes <rientjes@google.com> Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-10-05gpio-ml-ioh: Fix suspend/resume issueTomoya MORINAGA
Currently, some registers are not saved in case changing to suspend state. This patch fixes the issue. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-10-05gpio-ml-ioh: Support interrupt functionTomoya MORINAGA
Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-10-05gpio-ml-ioh: Delete unnecessary codeTomoya MORINAGA
This register restore processing is unnecessary in suspend processing. (The restore processing is already in resume processing) Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-06-16gpio/ml-ioh: fix off-by-one for displaying variable i in dev_errAxel Lin
with the "for (; i != 0; i--)" sytax, i-- will be executed after the iteration. thus dev_err shows wrong i value. Switch to "while(--i >= 0)" which is better in readability. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-06-06gpio: reorganize driversGrant Likely
Sort the gpio makefile and enforce the naming convention gpio-*.c for gpio drivers. v2: cleaned up filenames in Kconfig and comment blocks v3: fixup use of BASIC_MMIO to GENERIC_GPIO for mxc Signed-off-by: Grant Likely <grant.likely@secretlab.ca>