Age | Commit message (Collapse) | Author | Files | Lines |
|
Whenever an IRQ is claimed or freed, call gpio_lock_as_irq() or
gpio_unlock_as_irq() on the associated GPIO, to prevent that GPIO from
being configured in a manner incompatible with an interrupt.
Signed-off-by: Stephen Warren <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This patch adds the infrastructure required to register non-linear gpio
ranges through gpiolib and the standard GPIO device tree bindings.
Signed-off-by: Christian Ruppert <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The OMAP GPIO driver keeps track about GPIO pins that are
used as IRQ lines for two reasons:
1) To prevent GPIO banks to be disabled while one of their
GPIO pins are only used as an interrupt line.
2) To not allow another caller to set the GPIO pin as output.
Now gpiolib has an API to mark GPIO pins as used as IRQ lines
so the GPIO core only allows to set as output GPIO pins not
tied to an IRQ. So there is no need to have custom code for 2).
The IRQ usage still has to be maintained locally for 1) though.
Signed-off-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Linux 3.12-rc4
|
|
It is currently often possible in many GPIO drivers to request
a GPIO line to be used as IRQ after calling gpio_to_irq() and,
as the gpiolib is not aware of this, set the same line to
output and start driving it, with undesired side effects.
As it is a bogus usage scenario to request a line flagged as
output to used as IRQ, we introduce APIs to let gpiolib track
the use of a line as IRQ, and also set this flag from the
userspace ABI.
The API is symmetric so that lines can also be flagged from
.irq_enable() and unflagged from IRQ by .irq_disable().
The debugfs file is altered so that we see if a line is
reserved for IRQ.
Cc: Enric Balletbo i Serra <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Acked-by: Alexandre Courbot <[email protected]>
Reviewed-by: Stephen Warren <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
I have no idea why this driver is using __raw* accessors for
reading and writing registers, I suspect it is just force of
habit or copy/paste. Change all to readb()/writeb() except
one chain where I used writeb_relaxed() up until the last
writeb().
Cc: Ryan Mallon <[email protected]>
Cc: H Hartley Sweeten <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus.
When doing this I see that the hwirq argument is used
for mapping rather than the Linux IRQ in the map function.
This doesn't look right. Use the Linux IRQ instead.
I cannot test this patch so I don't know if the mapping change
is correct, however since absolutely every other driver does
it the other way around this doesn't look sound at all. Please
help out with review.
Cc: Vipul Kumar Samar <[email protected]>
Cc: Lee Jones <[email protected]>
Cc: Gabriel Fernandez <[email protected]>
Cc: Jean-Nicolas Graux <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus.
Cc: Magnus Damm <[email protected]>
Acked-by: Laurent Pinchart <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus.
Cc: Haojian Zhuang <[email protected]>
Cc: Rob Herring <[email protected]>
Acked-by: Baruch Siach <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus.
Cc: Anatolij Gustschin <[email protected]>
Cc: Uwe Kleine-König <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus. Take this
opportunity to sink a variable into a loop.
Acked-by: Mathias Nyman <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus.
Acked-by: David Cohen <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus.
Cc: Magnus Damm <[email protected]>
Reviewed-by: Ian Molton <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus. Rename the
"gpio" variable to "hwirq" to reflect what it is. Rename one
instance of "virq" to "child_irq" that better describes what
it is.
Cc: Markus Mayer <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This variable is confusingly named, the different Linux IRQs
aren't any more virtual than any other Linux IRQ. Give it a
non-misleading name.
Acked-by: Lars Poeschel <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt
From Tony Lindgren:
Changes needed to prepare for making omap3 device tree only:
- Always build in board-generic, and add pdata quirks and auxdata
support for it so we have all the pdata related quirks
in the same place.
- Merge of the drivers/pinctrl changes that are needed for PM
to continue working on omap3 and also needed for other omaps
eventually. The three pinctrl related patches have been acked
by Linus Walleij and are pulled into both the pinctrl tree
and this branch.
- Few defconfig related changes for drivers needed.
* tag 'omap-for-v3.13/quirk-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (523 commits)
ARM: configs: omap2plus_defconfig: enable dwc3 and dependencies
ARM: OMAP2+: Add WLAN modules and of_serial to omap2plus_defconfig
ARM: OMAP2+: Run make savedefconfig on omap2plus_defconfig to shrink it
ARM: OMAP2+: Add minimal 8250 support for GPMC
ARM: OMAP2+: Use pdata quirks for wl12xx for omap3 evm and zoom3
ARM: OMAP: Move DT wake-up event handling over to use pinctrl-single-omap
ARM: OMAP2+: Add support for auxdata
pinctrl: single: Add support for auxdata
pinctrl: single: Add support for wake-up interrupts
pinctrl: single: Prepare for supporting SoC specific features
ARM: OMAP2+: igep0020: use display init from dss-common
ARM: OMAP2+: pdata-quirks: add legacy display init for IGEPv2 board
+Linux 3.12-rc4
Signed-off-by: Kevin Hilman <[email protected]>
|
|
Rename the argument "virq" to just "irq", this IRQ isn't any
more "virtual" than any other Linux IRQ number, we use "hwirq"
for the actual hw-numbers, "virq" is just bogus.
Signed-off-by: Linus Walleij <[email protected]>
|
|
The GPIO interrupt handler does not need to be marked as nested.
Signed-off-by: Markus Mayer <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Patch be1a4b brought some improvements to the GPIO error handling code,
but also changed the return value of gpiod_request() when called on a
not yet initialized GPIO descriptor: it now returns -EINVAL instead of
-EPROBE_DEFER, and this affects some drivers.
This patch restores the original behavior for gpiod_request(). It is
safe to do so now that desc_to_gpio() does not rely on the GPIO
descriptor to be initialized. Other functions changed by patch be1a4b
do not see their return value affected, so these are not reverted.
Signed-off-by: Alexandre Courbot <[email protected]>
Reported-by: Dr. H. Nikolaus Schaller <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The current implementation of desc_to_gpio() relies on the chip pointer
to be set to a valid value in order to compute the GPIO number. This
was done in the hope that we can get rid of the gpio_desc global array,
but this is not happening anytime soon.
This patch reimplements desc_to_gpio() in a fashion similar to that of
gpio_to_desc(). As a result, desc_to_gpio(gpio_to_desc(gpio)) == gpio is
now always true. This allows to call desc_to_gpio() on non-initialized
descriptors as some error-handling code currently does.
Signed-off-by: Alexandre Courbot <[email protected]>
Reported-by: Dr. H. Nikolaus Schaller <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
After file was renamed from gpio-langwell to gpio-intel-mid, this patch
updates the variables, functions and structs to be based on intel-mid
instead of langwell.
There is no function change.
Signed-off-by: David Cohen <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
gpio-langwell is a deprecated name. Despite the driver was made
initially for Langwell, it supports now other Intel Mid SoC's.
This patch does no change beside the file renaming with Kconfig/Makefile
update.
Signed-off-by: David Cohen <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This patch implements a better way to handle multiple SoC's and adds
Intel Merrifield support to gpio-langwell.
It was based on previous work from Ning Li <[email protected]>
Signed-off-by: David Cohen <[email protected]>
Signed-off-by: Fei Yang <[email protected]>
Signed-off-by: Ning Li <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Checking LP_INT_STAT is not enough in the interrupt handler because its
contents get updated regardless of whether the pin has interrupt enabled or
not. This causes the driver to loop forever for GPIOs that are pulled up.
Fix this by checking the interrupt enable bit for the pin as well.
Cc: [email protected]
Signed-off-by: Mika Westerberg <[email protected]>
Acked-by: Mathias Nyman <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
It makes more sense to have these functions close to each other. No
functional changes.
Signed-off-by: Mika Westerberg <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Powerpc is a mess of implicit includes by prom.h. Add the necessary
explicit includes to drivers in preparation of prom.h cleanup.
Signed-off-by: Rob Herring <[email protected]>
Acked-by: Grant Likely <[email protected]>
|
|
Since CONFIG_PLAT_S3C64XX is going to be removed, this patch modifies
the gpio-samsung driver to use the proper way of checking for S3C64xx
support - CONFIG_ARCH_S3C64XX.
Signed-off-by: Tomasz Figa <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Kukjin Kim <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij:
"Two patches for the OMAP driver, dealing with setting up IRQs properly
on the device tree boot path"
* tag 'gpio-v3.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
gpio/omap: auto-setup a GPIO when used as an IRQ
gpio/omap: maintain GPIO and IRQ usage separately
|
|
We need to use the of_node from the main Arizona device as that
holds our configuration.
Signed-off-by: Charles Keepax <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The OMAP GPIO controller HW requires a pin to be configured in GPIO
input mode in order to operate as an interrupt input. Since drivers
should not be aware of whether an interrupt pin is also a GPIO or not,
the HW should be fully configured/enabled as an IRQ if a driver solely
uses IRQ APIs such as request_irq(), and never calls any GPIO-related
APIs. As such, add the missing HW setup to the OMAP GPIO controller's
irq_chip driver.
Since this bypasses the GPIO subsystem we have to ensure that another
driver won't be able to request the same GPIO pin that is used as an
IRQ and set its direction as output. Requesting the GPIO and setting
its direction as input is allowed though.
This fixes smsc911x ethernet support for tobi and igep OMAP3 boards
and OMAP4 SDP SPI based ethernet that use a GPIO as an interrupt line.
Cc: [email protected]
Acked-by: Stephen Warren <[email protected]>
Tested-by: George Cherian <[email protected]>
Tested-by: Aaro Koskinen <[email protected]>
Tested-by: Lars Poeschel <[email protected]>
Reviewed-by: Kevin Hilman <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Signed-off-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The GPIO OMAP controller pins can be used as IRQ and GPIO
independently so is necessary to keep track GPIO pins and
IRQ lines usage separately to make sure that the bank will
always be enabled while being used.
Also move gpio_is_input() definition in preparation for the
next patch that setups the controller's irq_chip driver when
a caller requests an interrupt line.
Cc: [email protected]
Acked-by: Stephen Warren <[email protected]>
Tested-by: George Cherian <[email protected]>
Tested-by: Aaro Koskinen <[email protected]>
Tested-by: Lars Poeschel <[email protected]>
Reviewed-by: Kevin Hilman <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Signed-off-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The pre-existing sysfs interfaces which take explicit namespace
argument are weird in that they place the optional @ns in front of
@name which is contrary to the established convention. For example,
we end up forcing vast majority of sysfs_get_dirent() users to do
sysfs_get_dirent(parent, NULL, name), which is silly and error-prone
especially as @ns and @name may be interchanged without causing
compilation warning.
This renames sysfs_get_dirent() to sysfs_get_dirent_ns() and swap the
positions of @name and @ns, and sysfs_get_dirent() is now a wrapper
around sysfs_get_dirent_ns(). This makes confusions a lot less
likely.
There are other interfaces which take @ns before @name. They'll be
updated by following patches.
This patch doesn't introduce any functional changes.
v2: EXPORT_SYMBOL_GPL() wasn't updated leading to undefined symbol
error on module builds. Reported by build test robot. Fixed.
Signed-off-by: Tejun Heo <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Cc: Kay Sievers <[email protected]>
Cc: Fengguang Wu <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Remove NEED_MACH_GPIO_H config select option for ARCH_DAVINCI
to start using gpiolib interface for davinci platforms. This makes
it easier to use the gpio driver on other platforms as it breaks
dependency on mach-davinci.
Latencies for gpio_get/set APIs will increase. On measurement,
latency was found to have increased by 18 microsecond with
gpiolib API as compared to inline APIs.
Measurement was done on DA850 EVM for gpio_get_value() API by
taking the printk timing across the call with interrupts disabled.
inline gpio API with interrupt disabled
[ 29.734337] before gpio_get
[ 29.736847] after gpio_get
Time difference 0.00251
gpio library with interrupt disabled
[ 272.876763] before gpio_get
[ 272.879291] after gpio_get
Time difference 0.002528
Latency increased by (0.002528 - 0.00251) = 18 microsecond.
While at it, remove GPIO_TYPE_DAVINCI enum definition as
gpio-davinci.c is converted to Linux device driver model.
Signed-off-by: Philip Avinash <[email protected]>
Signed-off-by: Lad, Prabhakar <[email protected]>
Acked-by: Linus Walleij <[email protected]>
[[email protected]: minor edits to commit message]
Signed-off-by: Sekhar Nori <[email protected]>
|
|
Modify DaVinci GPIO driver to become a platform device
driver.
The driver does not have platform driver structure or
a probe. Instead, it has pure_initcall function for
initialization. The platform specific informaiton is
obtained using the DaVinci specific davinci_soc_info
structure. This is a problem for Device Tree (DT)
implementation.
As a first stage of DT conversion, we implement a probe.
Additional notes:
- The driver registration happens as postcore_initcall.
This is required since machine init functions like
da850_lcd_hw_init() make use of GPIO.
- Start using devres APIs for simpler error handling.
Signed-off-by: KV Sujith <[email protected]>
[[email protected]: Move global definition of
"davinci_gpio_controller" to local]
Signed-off-by: Philip Avinash <[email protected]>
Acked-by: Linus Walleij <[email protected]>
[[email protected]: drop unused structure member, rebase to new
clean-up patch and fix error messages]
Signed-off-by: Sekhar Nori <[email protected]>
Signed-off-by: Lad, Prabhakar <[email protected]>
|
|
Make some minor coding style fixes. Use proper multi-line
commenting style, and use a macro for register offset.
Signed-off-by: Philip Avinash <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Lad, Prabhakar <[email protected]>
[[email protected]: drop changes which are considered
unnecessary churn - line break fixes
variable name changes and include file
reordering]
Signed-off-by: Sekhar Nori <[email protected]>
|
|
Add DT bindings for the pcf857x-compatible chips and parse the device
tree node in the driver.
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
The pca957x driver supports a handful of I2C GPIO expanders from NXP, Maxim,
and TI. For the PCA9574 and PCA9575 devices only, the driver resets the GPIO
level and direction in the pca957x_probe function. This seems like the wrong
thing to do, since it can cause hardware bit twiddles during warm reboots when
the chip state and reset values don't match.
This kind of initialization is best left upstream (in a bootloader) or
downstream (in userspace). It's also an inconsistency across devices supported
by this driver.
This patch is NOT boot-tested: the SoC I'm using is stuck on 2.6.37, and the
patch doesn't apply trivially.
Signed-off-by: Graeme Smecher <[email protected]>
Acked-by: Haojian Zhuang <[email protected]>
Tested-by: Gregory CLEMENT <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Driver core sets driver data to NULL upon failure or remove.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
'gen_74x164_dt_ids' is always compiled in. Hence the macro is not
necessary.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Driver core sets driver data to NULL upon failure or remove.
Signed-off-by: Sachin Kamat <[email protected]>
Cc: Gabor Juhos <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
|
|
Commit a1bc260bb5f5d95da854be7898202d788e94448d ("gpio: clean up
gpio-ranges documentation") deprecated the #gpio-range-cells property.
Replace its usage with a hardcoded value in the gpio-rcar driver.
Signed-off-by: Laurent Pinchart <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
|
|
As per the pattern from other GPIO drivers, use set_irq_flags()
on ARM only, use irq_set_noprobe() on other archs.
Also rename the argument "virq" to just "irq", this IRQ isn't
any more "virtual" than any other Linux IRQ number, we use
"hwirq" for the actual hw-numbers, "virq" is just bogus.
Reviewed-by: Markus Mayer <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
This alters the IOP platforms to pass a physical base for their
GPIO blocks and alters the driver to remap it when probing
instead of relying on the virtual addresses to be used.
Cc: Lennert Buytenhek <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Mikael Pettersson <[email protected]>
Tested-by: Aaro Koskinen <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|
|
Use the standard 32bit I/O accessors instead of just assigning
addresses.
Cc: Lennert Buytenhek <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Mikael Pettersson <[email protected]>
Tested-by: Aaro Koskinen <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
|