16 Aug, 2018
1 commit
-
Pull GPIO updates from Linus Walleij:
"This is the bulk of GPIO changes for the v4.19 kernel cycle.I don't know if anything in particular stands out. Maybe the Aspeed
coprocessor thing from Benji: Aspeed is doing baseboard management
chips (BMC's) for servers etc.These Aspeed's are ARM processors that exist inside (I guess) Intel
servers, and they are moving forward to using mainline Linux in those.
This is one of the pieces of the puzzle to achive that. They are doing
OpenBMC, it's pretty cool: https://lwn.net/Articles/683320/Summary:
Core changes:
- Add a new API for explicitly naming GPIO consumers, when needed.
- Don't let userspace set values on input lines. While we do not
think anyone would do this crazy thing we better plug the hole
before someone uses it and think it's a nifty feature.- Avoid calling chip->request() for unused GPIOs.
New drivers/subdrivers:
- The Mediatek MT7621 is supported which is a big win for OpenWRT and
similar router distributions using this chip, as it seems every
major router manufacturer on the planet has made products using
this chip: https://wikidevi.com/wiki/MediaTek_MT7621- The Tegra 194 is now supported.
- The IT87 driver now supports IT8786E and IT8718F super-IO chips.
- Add support for Rockchip RK3328 in the syscon GPIO driver.
Driver changes:
- Handle the get/set_multiple() properly on MMIO chips with inverted
direction registers. We didn't have this problem until a new chip
appear that has get/set registers AND inverted direction bits, OK
now we handle it.- A patch series making more error codes percolate upward properly
for different errors on gpiochip_lock_as_irq().- Get/set multiple for the OMAP driver, accelerating these multiple
line operations if possible.- A coprocessor interface for the Aspeed driver. Sometimes a few GPIO
lines need to be grabbed by a co-processor for doing automated
tasks, sometimes they are available as GPIO lines. By adding an
explicit API in this driver we make it possible for the two line
consumers to coexist. (This work was made available on the
ib-aspeed branch, which may be appearing in other pull requests.)- Implemented .get_direction() and open drain in the SCH311x driver.
- Continuing cleanup of included headers in GPIO drivers"
* tag 'gpio-v4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (80 commits)
gpio: it87: Add support for IT8613
gpio: it87: add support for IT8718F Super I/O.
gpiolib: Avoid calling chip->request() for unused gpios
gpio: tegra: Include the right header
gpio: mmio: Fix up inverted direction registers
gpio: xilinx: Use the right include
gpio: timberdale: Include the right header
gpio: tb10x: Use the right include
gpiolib: Fix of_node inconsistency
gpio: vr41xx: Bail out on gpiochip_lock_as_irq() error
gpio: uniphier: Bail out on gpiochip_lock_as_irq() error
gpio: xgene-sb: Don't shadow error code of gpiochip_lock_as_irq()
gpio: em: Don't shadow error code of gpiochip_lock_as_irq()
gpio: dwapb: Don't shadow error code of gpiochip_lock_as_irq()
gpio: bcm-kona: Don't shadow error code of gpiochip_lock_as_irq()
gpiolib: Don't shadow error code of gpiochip_lock_as_irq()
gpio: syscon: rockchip: add GRF GPIO support for rk3328
gpio: omap: Add get/set_multiple() callbacks
gpio: pxa: remove set but not used variable 'gpio_offset'
gpio-it87: add support for IT8786E Super I/O
...
11 Aug, 2018
1 commit
-
This is a GPIO driver so include only .
Drop the use of GPIOF_* flags: these are for consumers, not
drivers. Just return 0/1.Cc: Stefan Agner
Cc: Thierry Reding
Reviewed-by: Dmitry Osipenko
Signed-off-by: Linus Walleij
04 Aug, 2018
1 commit
-
There is a bug in regards to deferred probing within the drivers core
that causes GPIO-driver to suspend after its users. The bug appears if
GPIO-driver probe is getting deferred, which happens after introducing
dependency on PINCTRL-driver for the GPIO-driver by defining "gpio-ranges"
property in device-tree. The bug in the drivers core is old (more than 4
years now) and is well known, unfortunately there is no easy fix for it.
The good news is that we can workaround the deferred probe issue by
changing GPIO / PINCTRL drivers registration order and hence by moving
PINCTRL driver registration to the arch_init level and GPIO to the
subsys_init.Signed-off-by: Dmitry Osipenko
Acked-by: Stefan Agner
Signed-off-by: Linus Walleij
30 Jul, 2018
2 commits
-
Since commit e45d1c80c0ee ("gpio: put GPIO IRQs into their own lock
class") and commit a0a8bcf4670c ("gpiolib: irqchip: use different
lockdep class for each gpio irqchip") GPIO lib takes care of lockdep
classes. In fact, gpiochip_irq_map() overwrites the class anyway, so
the lockdep class set by the driver is useless. Remove it.Signed-off-by: Stefan Agner
Signed-off-by: Linus Walleij -
Commit 36b312792b97 ("gpiolib: Respect error code of ->get_direction()")
broke tegra_gpio_irq_set_type() because requesting of GPIO direction must
be done after enabling GPIO function for a pin.This patch fixes drivers probe failure like this:
gpio gpiochip0: (tegra-gpio): gpiochip_lock_as_irq: cannot get GPIO direction
tegra-gpio 6000d000.gpio: unable to lock Tegra GPIO 144 as IRQFixes: 36b312792b97 ("gpiolib: Respect error code of ->get_direction()")
Signed-off-by: Dmitry Osipenko
Acked-by: Jon Hunter
Tested-by: Jon Hunter
Signed-off-by: Linus Walleij
22 Feb, 2018
1 commit
-
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Axel Lin
Signed-off-by: Linus Walleij
28 Dec, 2017
1 commit
-
The IRQ code already has support for lockdep class for the lock mutex
in an interrupt descriptor. Extend this to add a second class for the
request mutex in the descriptor. Not having a class is resulting in
false positive splats in some code paths.Signed-off-by: Andrew Lunn
Signed-off-by: Thomas Gleixner
Acked-by: linus.walleij@linaro.org
Cc: grygorii.strashko@ti.com
Cc: f.fainelli@gmail.com
Link: https://lkml.kernel.org/r/1512234664-21555-1-git-send-email-andrew@lunn.ch
22 Sep, 2017
1 commit
-
The pinctrl_request_gpio() and pinctrl_free_gpio() break the nice
namespacing in the other cross-calls like pinctrl_gpio_foo().
Just rename them and all references so we have one namespace
with all cross-calls under pinctrl_gpio_*().Signed-off-by: Linus Walleij
14 Aug, 2017
7 commits
-
In most of the cases, integers in this file can't be negative, so the
type can be more restricted for clarity.Signed-off-by: Thierry Reding
Acked-by: Jon Hunter
Signed-off-by: Linus Walleij -
Fix a couple of checkpatch warnings, such as complaints about bare
unsigned being used (instead of unsigned int) and missing blank lines
after declarations.Signed-off-by: Thierry Reding
Acked-by: Jon Hunter
Signed-off-by: Linus Walleij -
Rather than manually compute the size of an array, pass the number and
element size to kcalloc().Signed-off-by: Thierry Reding
Acked-by: Jon Hunter
Signed-off-by: Linus Walleij -
of_device_get_match_data() can never return NULL, therefore the check
for NULL values is unnecessary.Signed-off-by: Thierry Reding
Acked-by: Jon Hunter
Signed-off-by: Linus Walleij -
Instead of using platform_get_resource() and getting the interrupts from
the resource, use platform_get_irq() which is slightly easier to use and
covers some special cases that the former doesn't.Signed-off-by: Thierry Reding
Signed-off-by: Linus Walleij -
Use platform_irq_count() instead of open-coding the same code sequence.
Signed-off-by: Thierry Reding
Signed-off-by: Linus Walleij -
gpio_to_irq() API expected to be used by GPIO consumers and
not drivers and there are no guarantee that its gpiolib implementation
is irq safe.Signed-off-by: Grygorii Strashko
Signed-off-by: Linus Walleij
02 Aug, 2017
1 commit
-
When more than one GPIO IRQs are triggered simultaneously,
tegra_gpio_irq_handler() called chained_irq_exit() multiple
times for one chained_irq_enter().Fixes: 3c92db9ac0ca3eee8e46e2424b6c074e2e394ad9
Signed-off-by: Michał Mirosław
[Also changed the variable to a bool]
Signed-off-by: Linus Walleij
26 Jan, 2017
1 commit
-
Currently we already have two pin configuration related callbacks
available for GPIO chips .set_single_ended() and .set_debounce(). In
future we expect to have even more, which does not scale well if we need
to add yet another callback to the GPIO chip structure for each possible
configuration parameter.Better solution is to reuse what we already have available in the
generic pinconf.To support this, we introduce a new .set_config() callback for GPIO
chips. The callback takes a single packed pin configuration value as
parameter. This can then be extended easily beyond what is currently
supported by just adding new types to the generic pinconf enum.If the GPIO driver is backed up by a pinctrl driver the GPIO driver can
just assign gpiochip_generic_config() (introduced in this patch) to
.set_config and that will take care configuration requests are directed
to the pinctrl driver.We then convert the existing drivers over .set_config() and finally
remove the .set_single_ended() and .set_debounce() callbacks.Suggested-by: Linus Walleij
Signed-off-by: Mika Westerberg
Reviewed-by: Andy Shevchenko
Signed-off-by: Linus Walleij
22 Jun, 2016
1 commit
-
Commit b546be0db955 ("gpio: tegra: Get rid of all file scoped global
variables") moved all file scoped variables into the driver-private
structure to allow potentially multiple instances of the driver. The
change also included turning the lockdep class into a driver-private
field, which doesn't work and produces error messages such as this:[ 0.142310] BUG: key ffff8000fb3f7ab0 not in .data!
Make the lockdep class file-scoped again to fix this issue.
Signed-off-by: Thierry Reding
Signed-off-by: Linus Walleij
30 Apr, 2016
1 commit
-
Implement gpio_get_direction() callback for Tegra GPIO.
The direction is only valid if the pin is configured as
GPIO. If pin is not configured in GPIO mode then this
function return error.Signed-off-by: Laxman Dewangan
Reviewed-by: Stephen Warren
Acked-by: Jon Hunter
Signed-off-by: Linus Walleij
29 Apr, 2016
4 commits
-
NVIDIA's Tegra210 support the HW debounce in the GPIO controller
for all its GPIO pins.Add support for setting debounce timing by implementing the
set_debounce callback of gpiochip.Signed-off-by: Laxman Dewangan
Reviewed-by: Stephen Warren
Reviewed-by: Alexandre Courbot
Signed-off-by: Linus Walleij -
Move the file scoped multiple global variable from Tegra GPIO
driver to the structure and make this as gpiochip data which
can be referred from GPIO chip callbacks.Signed-off-by: Laxman Dewangan
Reviewed-by: Stephen Warren
Reviewed-by: Alexandre Courbot
Signed-off-by: Linus Walleij -
The data member of the of_device_id is the constant type
and hence all static structure which is used for this
initialisation as static.Signed-off-by: Laxman Dewangan
Suggested-by: Thierry Reding
Reviewed-by: Stephen Warren
Signed-off-by: Linus Walleij -
Use of_device_get_match_data() for getting matched data
instead of implementing this locally.Signed-off-by: Laxman Dewangan
Reviewed-by: Stephen Warren
Reviewed-by: Alexandre Courbot
Acked-by: Thierry Reding
Signed-off-by: Linus Walleij
23 Feb, 2016
1 commit
-
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan
Cc: Stephen Warren
Cc: Thierry Reding
05 Jan, 2016
1 commit
-
For completion, sweep the floor from all gpiochip_add() usage so
we can remove that function and get rid of the function wrapper
gpiochip_add().Signed-off-by: Linus Walleij
17 Nov, 2015
1 commit
-
The tegra gpio driver creates the debugfs entry irrespective of
whether the device exists or not. This is enabled on an arm64_defconfig
and leaves an entry in debugfs on all platforms where it is not
useful. This patch fixes the issue by creating the entry only when
a device exists.Signed-off-by: Suzuki K. Poulose
Acked-by: Thierry Reding
Signed-off-by: Linus Walleij
16 Sep, 2015
1 commit
-
Most interrupt flow handlers do not use the irq argument. Those few
which use it can retrieve the irq number from the irq descriptor.Remove the argument.
Search and replace was done with coccinelle and some extra helper
scripts around it. Thanks to Julia for her help!Signed-off-by: Thomas Gleixner
Cc: Julia Lawall
Cc: Jiang Liu
28 Jul, 2015
1 commit
-
set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOENFor IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed as most platforms don't use probing.
There appears to be a great deal of blind copy and paste of this code.Signed-off-by: Rob Herring
Cc: Michael Hennerich
Acked-by: Linus Walleij
Cc: Alexandre Courbot
Cc: Ray Jui
Cc: Stephen Warren
Cc: Thierry Reding
Cc: linux-gpio@vger.kernel.org
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Linus Walleij
14 Jul, 2015
2 commits
-
Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
already have a pointer to corresponding irq_desc.Preparatory patch for the removal of the 'irq' argument from irq flow
handlers.Signed-off-by: Jiang Liu
Acked-by: Linus Walleij
Cc: Alexandre Courbot
Signed-off-by: Thomas Gleixner -
Use irq_set_handler_locked() as it avoids a redundant lookup of the
irq descriptor.Search and replacement was done with coccinelle:
Signed-off-by: Thomas Gleixner
Cc: Jiang Liu
Cc: Julia Lawall
Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: Stephen Warren
Cc: Thierry Reding
Cc: linux-gpio@vger.kernel.org
24 Jun, 2015
1 commit
-
Pull gpio updates from Linus Walleij:
"This is the big bulk of GPIO changes queued for the v4.2 kernel
series:- a big set of cleanups to the aged sysfs interface from Johan
Hovold. To get these in, v4.1-rc3 was merged into the tree as the
first patch in that series had to go into stable. This makes the
locking much more fine-grained (get rid of the "big GPIO lock(s)"
and store states in the GPIO descriptors.- rename gpiod_[g|s]et_array() to gpiod_[g|s]et_array_value() to
avoid confusions.- New drivers for:
* NXP LPC18xx (currently LPC1850)
* NetLogic XLP
* Broadcom STB SoC's
* Axis ETRAXFS
* Zynq Ultrascale+ (subdriver)- ACPI:
* make it possible to retrieve GpioInt resources from a GPIO
device using acpi_dev_gpio_irq_get()
* merge some dependent I2C changes exploiting this.
* support the ARM X-Gene GPIO standby driver.- make it possible for the generic GPIO driver to read back the value
set registers to reflect current status.- loads of OMAP IRQ handling fixes.
- incremental improvements to Kona, max732x, OMAP, MXC, RCAR,
PCA953x, STP-XWAY, PCF857x, Crystalcove, TB10x.- janitorial (constification, checkpatch cleanups)"
* tag 'gpio-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (71 commits)
gpio: Fix checkpatch.pl issues
gpio: pcf857x: handle only enabled irqs
gpio / ACPI: Return -EPROBE_DEFER if the gpiochip was not found
GPIO / ACPI: export acpi_gpiochip_request(free)_interrupts for module use
gpio: improve error reporting on own descriptors
gpio: promote own request failure to pr_err()
gpio: Added support to Zynq Ultrascale+ MPSoC
gpio: add ETRAXFS GPIO driver
fix documentation after renaming gpiod_set_array to gpiod_set_array_value
gpio: Add GPIO support for Broadcom STB SoCs
gpio: xgene: add ACPI support for APM X-Gene GPIO standby driver
gpio: tb10x: Drop unneeded free_irq() call
gpio: crystalcove: set IRQCHIP_SKIP_SET_WAKE for the irqchip
gpio: stp-xway: Use the of_property_read_u32 helper
gpio: pcf857x: Check for irq_set_irq_wake() failures
gpio-stp-xway: Fix enabling the highest bit of the PHY LEDs
gpio: Prevent an integer overflow in the pca953x driver
gpio: omap: rework omap_gpio_irq_startup to handle current pin state properly
gpio: omap: rework omap_gpio_request to touch only gpio specific registers
gpio: omap: rework omap_x_irq_shutdown to touch only irqs specific registers
...
18 Jun, 2015
1 commit
-
Fix a race where a pending interrupt could be received and the handler
called before the handler's data has been setup, by converting to
irq_set_chained_handler_and_data().Signed-off-by: Russell King
Cc: Alexandre Courbot
Cc: Hans Ulli Kroll
Cc: Jason Cooper
Cc: Lee Jones
Cc: Linus Walleij
Cc: Thierry Reding
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/E1Z4z0M-0002Sl-Ti@rmk-PC.arm.linux.org.uk
Signed-off-by: Thomas Gleixner
19 May, 2015
1 commit
-
Fixed several spelling errors in gpio-lynxpoint, gpio-pca953x,
gpio-tegra, gpio-zynq, gpiolib-of, gpiolib.Signed-off-by: Colin Cronin
Signed-off-by: Linus Walleij
15 Dec, 2014
1 commit
-
Pull driver core update from Greg KH:
"Here's the set of driver core patches for 3.19-rc1.They are dominated by the removal of the .owner field in platform
drivers. They touch a lot of files, but they are "simple" changes,
just removing a line in a structure.Other than that, a few minor driver core and debugfs changes. There
are some ath9k patches coming in through this tree that have been
acked by the wireless maintainers as they relied on the debugfs
changes.Everything has been in linux-next for a while"
* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
fs: debugfs: add forward declaration for struct device type
firmware class: Deletion of an unnecessary check before the function call "vunmap"
firmware loader: fix hung task warning dump
devcoredump: provide a one-way disable function
device: Add dev__once variants
ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
ath: use seq_file api for ath9k debugfs files
debugfs: add helper function to create device related seq_file
drivers/base: cacheinfo: remove noisy error boot message
Revert "core: platform: add warning if driver has no owner"
drivers: base: support cpu cache information interface to userspace via sysfs
drivers: base: add cpu_device_create to support per-cpu devices
topology: replace custom attribute macros with standard DEVICE_ATTR*
cpumask: factor out show_cpumap into separate helper function
driver core: Fix unbalanced device reference in drivers_probe
driver core: fix race with userland in device_add()
sysfs/kernfs: make read requests on pre-alloc files use the buffer.
sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
fs: sysfs: return EGBIG on write if offset is larger than file size
...
29 Oct, 2014
1 commit
-
This function actually operates on a gpio_chip, so its prefix should
reflect that fact for consistency with other functions defined in
gpio/driver.h.Signed-off-by: Alexandre Courbot
Signed-off-by: Linus Walleij
20 Oct, 2014
1 commit
-
A platform_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Wolfram Sang
09 May, 2014
2 commits
-
Make of_device_id array const, because all OF functions
handle it as const.Signed-off-by: Jingoo Han
Signed-off-by: Linus Walleij -
The site-specific OOM messages are unnecessary, because they
duplicate the MM subsystem generic OOM message.Signed-off-by: Jingoo Han
Reviewed-by: Javier Martinez Canillas
Signed-off-by: Linus Walleij
11 Dec, 2013
1 commit
-
The call to gpiochip_add() is not currently error-checked. Add the
missing checking.Signed-off-by: Stephen Warren
Reviewed-by: Thierry Reding
Reviewed-by: Alexandre Courbot
Signed-off-by: Linus Walleij
17 Oct, 2013
1 commit
-
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
Reviewed-by: Javier Martinez Canillas
Signed-off-by: Linus Walleij