aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)AuthorFilesLines
2011-07-15mcp23s08: isolate spi specific partsPeter Korsgaard1-24/+57
Change spi member of struct mcp23s08 to be a ops-specific opaque data pointer, and move spi specific knowledge out of mcp23s08_probe_one(). No functional change, but is needed to add i2c support. Signed-off-by: Peter Korsgaard <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-15mcp23s08: get rid of setup/teardown callbacksPeter Korsgaard1-19/+0
There's no in-tree users, and bus notifiers are more generic anyway. Signed-off-by: Peter Korsgaard <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-14mcp23s08: remove unused work queuePeter Korsgaard1-3/+0
Never accessed anywhere. Signed-off-by: Peter Korsgaard <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-14gpio/da9052: remove a redundant assignment for gpio->da9052Axel Lin1-1/+0
We just set it twice in da9052_gpio_probe. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-11Merge branch 'master' into for-nextJiri Kosina4-14/+35
Sync with Linus' tree to be able to apply pending patches that are based on newer code already present upstream.
2011-07-08gpio/mxc: add device tree probe supportShawn Guo1-6/+28
The patch adds device tree probe support for gpio-mxc driver. Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-08gpio/mxc: get rid of the uses of cpu_is_mx()Shawn Guo1-18/+107
The patch removes all the uses of cpu_is_mx(). Instead, it utilizes platform_device_id to distinguish the different gpio types, IMX1_GPIO on i.mx1, IMX21_GPIO on i.mx21 and i.mx27, IMX31_GPIO on all other i.mx SoCs. Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-08gpio/langwell_gpio: ack the correct bit for langwell gpio interruptsMathias Nyman1-1/+1
The wrong bit was masked when acking langwell gpio interrupts. Reason for maskig the wrong bit was probably because__ffs() and ffs() functions return bit indexes differently (0..31 vs 1..32) This fixes langwell based devices from hanging when a gpio interrupt is triggered and undoes the breakage which occurred in change set 732063b92bb727b27e61580ce278dddefe31c6ad Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-07gpio/mxc: add missing initialization of basic_mmio_gpio shadow variablesLothar Waßmann1-0/+2
The bgpio_init() function does not initialise the shadow register for the GPIO direction register. Thus, when configuring the first GPIO with gpio_set_direction() all other GPIOs of the same bank will be configured as inputs. Since the bgpio layer cannot know whether the register is readable, the initialisation should be done by the caller of bgpio_init(). Also, the 'data' shadow variable that is used inside basic_mmio_gpio to cache the current value of the GPIO_DR register is initialised from the GPIO_PSR register within bgpio_init(). Thus when setting the output value of a certain GPIO, the other GPIO outputs of the same bank will be set or cleared depending on the pin state of the GPIO inputs during bgpio_init(). Signed-off-by: Lothar Waßmann <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-07Update my e-mail addressMichael Büsch1-1/+1
Signed-off-by: Michael Buesch <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2011-07-06gpio: Move mpc5200 gpio driver to drivers/gpioGrant Likely3-0/+381
GPIO drivers are getting consolidated into drivers/gpio. While at it, change the driver name to mpc5200-gpio* to avoid collisions. Signed-off-by: Grant Likely <[email protected]>
2011-07-06GPIO: DA9052 GPIO module v3ashishj33-0/+285
DA9052 PMIC has 16 bit GPIO bus for peripheral control. This patch add support for the GPIO pins on the DA9052. Signed-off-by: David Dajun Chen <[email protected]> Signed-off-by: Ashish Jangam <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-05gpio/tegra: Use engineering names in DT compatible propertyStephen Warren1-1/+1
Engineering names are more stable than marketing names. Hence, use them for Device Tree compatible properties instead. Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-07-05gpio: tps65910: add missing breaks in tps65910_gpio_initAxel Lin1-0/+2
Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-20treewide: remove duplicate includesVitaliy Ivanov1-1/+0
Many stupid corrections of duplicated includes based on the output of scripts/checkincludes.pl. Signed-off-by: Vitaliy Ivanov <[email protected]> Signed-off-by: Jiri Kosina <[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-16gpio/pca953x: Deprecate meaningless device-tree bindingsDavid Jander1-2/+9
The property 'polarity' is handled by the GPIO core, and the 'gpio-base' should be assigned automatically. It is meaningless in the device-tree, since GPIO's are identified by the "chip-name"/offset pair. This way, the whole pca953x_get_alt_pdata() can hopefully soon go away. We still need to check whether we really want GPIO-interrupt functionality by simply looking if the I2C node has an interrupts property defined, since this property is not used for anything else. Signed-off-by: David Jander <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-16gpio/pca953x: Remove dynamic platform data pointerDavid Jander1-49/+28
In the case that we obtain device-tree data to fill in platform_data, the new platform data struct was dynamically allocated, but the pointer to it was not used everywhere it should. It seems easier to fix this issue by removing the dynamic allocation altogether since its data is only used during driver probing. Signed-off-by: David Jander <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-16gpio/pca953x: Fix IRQ support.David Jander1-1/+3
It seems that in the normal case, IRQ_NOREQUEST needs to be explicitly cleared, otherwise claiming the interrupt fails. In the case of sparse interrupts, the descriptor needs to be allocated first. Signed-off-by: David Jander <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-16Merge branch 'for_3.1/gpio-cleanup' of ↵Grant Likely1-570/+153
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into gpio/next
2011-06-16gpio/omap: cleanup show revision, remove cpu_is checks, display only onceKevin Hilman1-8/+6
Remove cpu_is_* checks from gpio_show_revision() by passing in the revision address offset from platform data. SoCs with no revision register (15xx, 7xx, and all MPUIOs) use -1 (actually, USHRT_MAX) to signify no register. While here, all GPIO banks are assumed to be the same revision, so fix show_revision() to only show the revision for the first bank it finds. This removes duplicate GPIO revision prints during boot. Thanks to Charulatha V <[email protected]> for finding/fixing a few -1s that were missed in the original patch. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: debounce remove SoC specific registers, use pdataKevin Hilman1-12/+3
Use register offsets passed in from pdata for accessing debounce registers. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: cleanup _set_gpio_wakeup(), remove ifdefsKevin Hilman1-34/+16
Make _set_gpio_wakeup() generic by removing ifdefs. Code for the various SoCs/bank-methods was already the same, except for the non-wakeup GPIO checking. But that flag is set on a per-SoC basis, so can be used for all SoCs. While here, use dev_err() and remove GPIO bank calculation assumption based on subtracting bank pointers. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: remove useless gpio_valid() & check_gpio() checksKevin Hilman1-45/+0
These functions are useless. They are only called in a few places, and where they are called, the GPIO has already been converted from an IRQ or masked, so these functions will never fail. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: convert MPUIO IRQ over to generic irq_chipKevin Hilman1-44/+30
MPUIO banks have their own dedicated IRQ chip interface, separate from the "normal" GPIO banks. Convert the MPUIO IRQ chip over to using the new generic IRQ chip interface. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: conslidate enable/disable of GPIO IRQs, remove ifdefsKevin Hilman1-99/+30
Cleanup GPIO IRQ enable/disable handling by removing SoC-specific Also split enable/disable IRQ into separate functions for better readability and also facilitate potentially moving to generic irq_chip in the future. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: consolidate IRQ status handling, remove #ifdefsKevin Hilman1-61/+5
Cleanup IRQ status handling by passing IRQ status register offsets via platform data. Cleans up clearing of GPIO IRQ status and GPIO ISR handler. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: consolidate direction, input, output, remove #ifdefsKevin Hilman1-200/+43
Add register offset fields to GPIO platform_data for registers. This patch adds registers that control direction, input and output data. Using these register offsets in the common driver allows removal of #ifdefs and greatly improves readability. Also create dedicated data out functions: one for banks with dedicated set/clear registers, and another for banks with a single mask register. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: remove get_gpio_bank()Charulatha V1-27/+2
use chip info to get the pointer to the struct gpio_bank for a given GPIO bank and remove get_gpio_bank(). Signed-off-by: Charulatha V <[email protected]>
2011-06-16gpio/omap: replace get_gpio_index() by using bank widthKevin Hilman1-25/+17
The get_gpio_index() function, littered with cpu_is_* checks can be easily replaced by using bitops based on the GPIO bank width. Do so. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: _get_gpio_irqbank_mask: replace hard-coded mask with bank->widthKevin Hilman1-7/+1
Replace hard-coded mask values with bank->width which is already coming from platform_data. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: move bank width into struct gpio_bankKevin Hilman1-7/+6
Rather than having a file-global bank_width variable, move it into struct gpio_bank so it can be bank-specific. Note the bank width is already passed per-bank via platform_data, so current code would be incorrect if any banks had different width. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: remove MPUIO handling from _clear_gpio_irqbank()Kevin Hilman1-6/+0
Remove the OMAP1 #ifdef and MPUIO special case for _clear_gpio_irqbank() The MPUIOs do not need a register access to ack/clear the IRQ status, since reading the IRQ status clears it. In addition, the MPUIO irq_chip has an empty ack method, so _clear_gpio_irqbank() is never used for MPUIOs. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap: _clear_gpio_irqbank: fix flushing of posted writeKevin Hilman1-2/+1
In commit 78a1a6d3411de1a8b0dc1cb92754b5f12f251912 (ARM: OMAP4: Update the GPIO support) braces were mistakenly added to included the register read-back inside the cpu_is_* checking. Remove the braces, ensuring that a register read-back is done, even when the IRQSTATUS2 register is not written. Note that the register read-back might be IRQSTATUS1 or IRQSTATUS2 depending on the CPU, but a read-back of any register in that region will cause a flush of the posted writes. Signed-off-by: Kevin Hilman <[email protected]>
2011-06-16gpio/omap4: Fix missing interrupts during device wakeup due to IOPAD.Ambresh K1-2/+3
If gpio pins from bank[2-5] are marked as wakeup enable and if the wake is through gpio IO pad wakeup, then that wakeup gpio interrupt is lost. In the current implementation, GPIO driver stores the context of DATAIN of all the gpio in the bank. During GPIO resuming, it checks DATAIN with wakeup enabled pins of gpio bank. If there is status change, then manually toggle GPIO_LEVELDETECT to generate pseudo interrupt. Reported-by: Philippe Mazet <[email protected]> Tested-by: Philippe Mazet <[email protected]> Signed-off-by: Ambresh K <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-15Merge branch 'gpio/next-tegra' into gpio/nextGrant Likely5-26/+508
Conflicts: drivers/gpio/Kconfig drivers/gpio/Makefile
2011-06-15gpio/tegra: add devicetree supportGrant Likely1-0/+10
Add support for decoding gpios from the device tree Signed-off-by: Grant Likely <[email protected]> Acked-by: Olof Johansson <[email protected]>
2011-06-15gpio/tegra: Move Tegra gpio driver to drivers/gpioGrant Likely2-0/+432
As part of the gpio driver consolidation, this patch moves the Tegra driver into drivers/gpio Signed-off-by: Grant Likely <[email protected]> Acked-by: Olof Johansson <[email protected]> Acked-by: Colin Cross <[email protected]>
2011-06-13gpio/74x164: fix clash with gpiolib namespaceLinus Walleij1-3/+3
The 74x164 GPIO driver has a static inline helper called gpio_to_chip which clashes with the gpiolib namespace if we try to expose the function with the same name from gpiolib, and it's still confusing even if we don't do that. So rename it to gpio_to_74x164_chip(). Reported-by: H Hartley Sweeten <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-11gpio/mxc: fix a bug with gpio_get_value callingShawn Guo1-1/+1
When calling gpio_get_value, the gpio number other than bit offset should be passed as the argument. Signed-off-by: Shawn Guo <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-10gpio/vr41xx: Convert use of struct resource to resource_size(ptr)Joe Perches1-1/+1
Remove miscellaneous use of direct calculation by using resource_size(). Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-10treewide: Convert uses of struct resource to resource_size(ptr)Joe Perches1-4/+4
Several fixes as well where the +1 was missing. Done via coccinelle scripts like: @@ struct resource *ptr; @@ - ptr->end - ptr->start + 1 + resource_size(ptr) and some grep and typing. Mostly uncompiled, no cross-compilers. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2011-06-09gpio/nomadik: fix sleepmode for elder NomadikLinus Walleij1-11/+29
The mach-nomadik machine did not compile properly due to bad ux500-specific functions being called. Introduce new state variables to fix this up. Reported-by: Axel Lin <[email protected]> Cc: Alessandro Rubini <[email protected]> Cc: Prafulla Wadaskar <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-09gpio/ep93xx: Remove superfluous debug pr_info statementGrant Likely1-1/+0
Reported-by: H Hartley Sweeten <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-08gpio/ep93xx: convert to platform_driver and use basic_mmio_gpio libraryH Hartley Sweeten2-121/+120
This converts the gpio-ep93xx driver into a platform_driver and uses the basic_mmio_gpio library. Signed-off-by: H Hartley Sweeten <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-08gpio/pca953x: Fix warning of enabled interrupts in handlerDavid Jander1-3/+3
When using nested threaded irqs, use handle_nested_irq(). This function does not call the chip handler, so no handler is set. Signed-off-by: David Jander <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-08gpio/pca953x: Interrupt pin is active-lowDavid Jander1-1/+1
The interrupt pin of the PCA953x is active low, and on the rising edge no interrupt should be produced. Signed-off-by: David Jander <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-08gpio/pca953x: Fix IRQ support.David Jander1-1/+5
It seems that in the normal case, IRQ_NOREQUEST needs to be explicitly cleared, otherwise claiming the interrupt fails. In the case of sparse interrupts, the descriptor needs to be allocated first. Signed-off-by: David Jander <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2011-06-08Merge branch 'for_3.0/gpio-fixes' of ↵Grant Likely1-11/+12
git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into gpio/merge
2011-06-07gpio/ep93xx: fix pr_fmt outputH Hartley Sweeten1-1/+1
With this driver now being moved from arch/arm/mach-ep93xx/gpio.c to drivers/gpio/gpio-ep93xx.c the prefix "ep93xx" is now redundant in the pr_* output. Using KBUILD_MODNAME is sufficient. Signed-off-by: H Hartley Sweeten <[email protected]> Signed-off-by: Grant Likely <[email protected]>