aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-ml-ioh.c
AgeCommit message (Collapse)AuthorFilesLines
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-05-29gpio: ml-ioh: check the return value of irq_alloc_generic_chip()Bartosz Golaszewski1-3/+13
This function can fail, so check the return value before dereferencing the returned pointer. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-03-15gpio: ml-ioh: use resource management for irqsBartosz Golaszewski1-21/+7
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2016-01-05gpio: ml-ioh: use gpiochip data pointerLinus Walleij1-6/+6
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 <[email protected]> Cc: Tomoya MORINAGA <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2015-12-26gpio: ml-ioh: Be sure to clamp return valueLinus Walleij1-1/+1
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 <[email protected]> Cc: Tomoya MORINAGA <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2014-07-22gpio: remove all usage of gpio_remove retval in driver/gpioabdoulaye berthe1-6/+2
Signed-off-by: abdoulaye berthe <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-12-04gpio/pinctrl: make gpio_chip members typed booleanLinus Walleij1-1/+1
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 <[email protected]>
2013-12-03gpio: remove DEFINE_PCI_DEVICE_TABLE macroJingoo Han1-1/+1
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-05-30gpio-ml-ioh: fix error return code in ioh_gpio_probe()Wei Yongjun1-0/+1
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-05-20gpio: Don't override the error code in probe error handlingAxel Lin1-2/+1
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 <[email protected]> Cc: Tomoya MORINAGA <[email protected]> Cc: Denis Turischev <[email protected]> Cc: Lars Poeschel <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2012-11-28gpio: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Grant Likely <[email protected]> Acked-by: Linus Walleij <[email protected]> Cc: Peter Tyser <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28gpio: remove use of __devinitBill Pemberton1-2/+2
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Grant Likely <[email protected]> Cc: Peter Tyser <[email protected]> Cc: Santosh Shilimkar <[email protected]> Cc: Kevin Hilman <[email protected]> Acked-by: Linus Walleij <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28gpio: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Grant Likely <[email protected]> Cc: Peter Tyser <[email protected]> Acked-by: Linus Walleij <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[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-04-07gpio: Convert drivers to use module_pci_driver()Axel Lin1-11/+1
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 <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2012-02-01gpio: Add missing spin_lock_init in gpio-ml-ioh driverAxel Lin1-0/+1
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 <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2012-01-16gpio-ml-ioh: cleanup __iomem annotation usageMárton Németh1-3/+3
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 <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2012-01-16gpio-ml-ioh: cleanup NULL pointer checkingMárton Németh1-1/+1
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 <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-12-13gpio-ml-ioh: Add the irq_disable/irq_enable hooks for ml-ioh irq chipFeng Tang1-0/+30
These hooks will be needed by the general disabl/enable_irq(); Signed-off-by: Feng Tang <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-12-13gpio-ml-ioh: fix a bug in the interrupt handlerFeng Tang1-1/+1
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 <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-10-31drivers/gpio: Fix drivers who are implicit users of module.hPaul Gortmaker1-0/+1
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 <[email protected]>
2011-10-19gpio-ml-ioh: Use NUMA_NO_NODE not GFP_KERNELTomoya MORINAGA1-1/+1
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 <[email protected]> Reported-by: David Rientjes <[email protected]> Signed-off-by: Tomoya MORINAGA <[email protected]> Acked-by: David Rientjes <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-10-05gpio-ml-ioh: Fix suspend/resume issueTomoya MORINAGA1-12/+48
Currently, some registers are not saved in case changing to suspend state. This patch fixes the issue. Signed-off-by: Tomoya MORINAGA <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-10-05gpio-ml-ioh: Support interrupt functionTomoya MORINAGA1-3/+206
Signed-off-by: Tomoya MORINAGA <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-10-05gpio-ml-ioh: Delete unnecessary codeTomoya MORINAGA1-1/+0
This register restore processing is unnecessary in suspend processing. (The restore processing is already in resume processing) Signed-off-by: Tomoya MORINAGA <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-16gpio/ml-ioh: fix off-by-one for displaying variable i in dev_errAxel Lin1-1/+1
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 <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-06gpio: reorganize driversGrant Likely1-0/+357
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 <[email protected]>