22 Jul, 2019
1 commit
-
Instead of always dereferencing &pdev->dev, just assign a helper local
variable of type struct device * and use it where applicable.Signed-off-by: Bartosz Golaszewski
Reviewed-by: Geert Uytterhoeven
15 Jul, 2019
1 commit
-
In commit 8764c4ca5049 ("gpio: em: use the managed version of
gpiochip_add_data()") we implicitly altered the ordering of resource
freeing: since gpiochip_remove() calls gpiochip_irqchip_remove()
internally, we now can potentially use the irq_domain after it was
destroyed in the remove() callback (as devm resources are freed after
remove() has returned).Use devm_add_action_or_reset() to keep the ordering right and entirely
kill the remove() callback in the driver.Reported-by: Geert Uytterhoeven
Fixes: 8764c4ca5049 ("gpio: em: use the managed version of gpiochip_add_data()")
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski
Reviewed-by: Geert Uytterhoeven
10 Jul, 2019
1 commit
-
Pull GPIO updates from Linus Walleij:
"This is the big slew of GPIO changes for the v5.3 kernel cycle. This
is mostly incremental work this time.Three important things:
- The FMC subsystem is deleted through my tree. This happens through
GPIO as its demise was discussed in relation to a patch decoupling
its GPIO implementation from the standard way of handling GPIO. As
it turns out, that is not the only subsystem it reimplements and
the authors think it is better do scratch it and start over using
the proper kernel subsystems than try to polish the rust shiny. See
the commit (ACKed by the maintainers) for details.- Arnd made a small devres patch that was ACKed by Greg and goes into
the device core.- SPDX header change colissions may happen, because at times I've
seen that quite a lot changed during the -rc:s in regards to SPDX.
(It is good stuff, tglx has me convinced, and it is worth the
occasional pain.)Apart from this is is nothing controversial or problematic.
Summary:
Core:
- When a gpio_chip request GPIOs from itself, it can now fully
control the line characteristics, both machine and consumer flags.
This makes a lot of sense, but took some time before I figured out
that this is how it has to work.- Several smallish documentation fixes.
New drivers:
- The PCA953x driver now supports the TI TCA9539.
- The DaVinci driver now supports the K3 AM654 SoCs.
Driver improvements:
- Major overhaul and hardening of the OMAP driver by Russell King.
- Starting to move some drivers to the new API passing irq_chip along
with the gpio_chip when adding the gpio_chip instead of adding it
separately.Unrelated:
- Delete the FMC subsystem"
* tag 'gpio-v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (87 commits)
Revert "gpio: tegra: Clean-up debugfs initialisation"
gpiolib: Use spinlock_t instead of struct spinlock
gpio: stp-xway: allow compile-testing
gpio: stp-xway: get rid of the #include dependency
gpio: stp-xway: improve module clock error handling
gpio: stp-xway: simplify error handling in xway_stp_probe()
gpiolib: Clarify use of non-sleeping functions
gpiolib: Fix references to gpiod_[gs]et_*value_cansleep() variants
gpiolib: Document new gpio_chip.init_valid_mask field
Documentation: gpio: Fix reference to gpiod_get_array()
gpio: pl061: drop duplicate printing of device name
gpio: altera: Pass irqchip when adding gpiochip
gpio: siox: Use devm_ managed gpiochip
gpio: siox: Add struct device *dev helper variable
gpio: siox: Pass irqchip when adding gpiochip
drivers: gpio: amd-fch: make resource struct const
devres: allow const resource arguments
gpio: ath79: Pass irqchip when adding gpiochip
gpio: tegra: Clean-up debugfs initialisation
gpio: siox: Switch to IRQ_TYPE_NONE
...
31 May, 2019
2 commits
-
Use the managed variant of gpiochip_add_data() and remove the call to
gpiochip_remove().Cc: Geert Uytterhoeven
Signed-off-by: Bartosz Golaszewski
Reviewed-by: Geert Uytterhoeven -
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license this
program is distributed in the hope that it will be useful but
without any warranty without even the implied warranty of
merchantability or fitness for a particular purpose see the gnu
general public license for more details you should have received a
copy of the gnu general public license along with this program if
not write to the free software foundation inc 59 temple place suite
330 boston ma 02111 1307 usaextracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 3 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Allison Randal
Reviewed-by: Steve Winslow
Reviewed-by: Alexios Zavras
Reviewed-by: Richard Fontana
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170026.251475812@linutronix.de
Signed-off-by: Greg Kroah-Hartman
28 May, 2019
2 commits
-
em_gio_probe() uses managed initializations for everything but creating
the IRQ domain. Hence in most failure cases, no cleanup needs to be
performed at all.Make this clearer for the casual reviewer by returning early, instead of
jumping to an out-of-sight label.Signed-off-by: Geert Uytterhoeven
Signed-off-by: Bartosz Golaszewski -
There is no need to print error messages when memory allocations or
related operations fail, as the core will take care of that.Change the returned error codes to -ENOMEM to match the failure cause
while at it.Signed-off-by: Geert Uytterhoeven
Signed-off-by: Bartosz Golaszewski
07 Aug, 2018
1 commit
-
gpiochip_lock_as_irq() may return a few error codes,
do not shadow them by -EINVAL and let caller to decide.No functional change intended.
Signed-off-by: Andy Shevchenko
Signed-off-by: Linus Walleij
19 Mar, 2018
1 commit
-
The Emma Mobile (EM) GPIO driver uses the too generic include
. It is a driver so it should just use
.Signed-off-by: Linus Walleij
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
05 Jan, 2016
1 commit
-
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: Geert Uytterhoeven
Cc: Magnus Damm
Signed-off-by: Linus Walleij
27 Dec, 2015
1 commit
-
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: Magnus Damm
Acked-by: Geert Uytterhoeven
Signed-off-by: Linus Walleij
19 Nov, 2015
1 commit
-
The name .dev in a struct is normally reserved for a struct device
that is let us say a superclass to the thing described by the struct.
struct gpio_chip stands out by confusingly using a struct device *dev
to point to the parent device (such as a platform_device) that
represents the hardware. As we want to give gpio_chip:s real devices,
this is not working. We need to rename this member to parent.This was done by two coccinelle scripts, I guess it is possible to
combine them into one, but I don't know such stuff. They look like
this:@@
struct gpio_chip *var;
@@
-var->dev
+var->parentand:
@@
struct gpio_chip var;
@@
-var.dev
+var.parentand:
@@
struct bgpio_chip *var;
@@
-var->gc.dev
+var->gc.parentPlus a few instances of bgpio that I couldn't figure out how
to teach Coccinelle to rewrite.This patch hits all over the place, but I *strongly* prefer this
solution to any piecemal approaches that just exercise patch
mechanics all over the place. It mainly hits drivers/gpio and
drivers/pinctrl which is my own backyard anyway.Cc: Haavard Skinnemoen
Cc: Rafał Miłecki
Cc: Richard Purdie
Cc: Mauro Carvalho Chehab
Cc: Alek Du
Cc: Jaroslav Kysela
Cc: Takashi Iwai
Acked-by: Dmitry Torokhov
Acked-by: Greg Kroah-Hartman
Acked-by: Lee Jones
Acked-by: Jiri Kosina
Acked-by: Hans-Christian Egtvedt
Acked-by: Jacek Anaszewski
Signed-off-by: Linus Walleij
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
16 Jul, 2015
1 commit
-
Since commit 59032702ead90562 ("ARM: shmobile: Remove legacy platform
devices from EMEV2 SoC code"), EMMA Mobile SoCs are only supported in
generic DT-only ARM multi-platform builds. The driver doesn't need to
use platform data anymore, hence remove platform data configuration.Signed-off-by: Geert Uytterhoeven
Acked-by: Simon Horman
Tested-by: Niklas Söderlund
Signed-off-by: Linus Walleij
06 May, 2015
1 commit
-
The irq_domain_ops are not modified by the driver and the irqdomain core
code accepts pointer to a const data.Signed-off-by: Krzysztof Kozlowski
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
...
28 Nov, 2014
1 commit
-
Use dynamic allocation of GPIOs instead of looking at the gpio%u alias
in DT.Signed-off-by: Geert Uytterhoeven
Signed-off-by: Linus Walleij
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
22 Jul, 2014
1 commit
-
Signed-off-by: abdoulaye berthe
Signed-off-by: Linus Walleij
09 May, 2014
1 commit
-
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
04 May, 2014
1 commit
-
Using the BIT() macro instead of shifting bits
makes the code less error prone and also more readable.Signed-off-by: Javier Martinez Canillas
Reviewed-by: Alexandre Courbot
Signed-off-by: Linus Walleij
18 Mar, 2014
1 commit
-
This switches all GPIO and pin control drivers with irqchips
that were using .startup() and .shutdown() callbacks to lock
GPIO lines for IRQ usage over to using the .request_resources()
and .release_resources() callbacks just introduced into the
irqchip vtable.Cc: Thomas Gleixner
Cc: Jean-Jacques Hiblot
Signed-off-by: Linus Walleij
04 Dec, 2013
2 commits
-
Conflicts:
drivers/gpio/gpio-em.c -
This uses the new API for tagging GPIO lines as in use by
IRQs. This enforces a few semantic checks on how the underlying
GPIO line is used.Also assign the gpio_chip.dev pointer to be used for error
messages.ChangeLog v1->v2:
- Satisfy implicit semantics by calling .enable and .disable
callbacks in the startup/shutdown callbacks.Cc: Ian Molton
Cc: Simon Horman
Acked-by: Magnus Damm
Signed-off-by: Linus Walleij
25 Nov, 2013
3 commits
-
Now when lazy interrupt disable has been enabled in the driver
then extend the code to set IRQCHIP_MASK_ON_SUSPEND which tells
the core that only IRQs marked as wakeups need to stay enabled
during Suspend-to-RAM.Tested on the KZM9D board with GPIO-keys.
Signed-off-by: Magnus Damm
Acked-by: Laurent Pinchart
Signed-off-by: Linus Walleij -
Set the ->irq_enable() and ->irq_disable() methods to NULL
to enable lazy disable of interrupts. This by itself provides
some level of optimization, but is mainly enabled as ground
work for future Suspend-to-RAM wake up support.Signed-off-by: Magnus Damm
Acked-by: Laurent Pinchart
Signed-off-by: Linus Walleij -
Make sure gpio_chip->dev is setup so of_gpiochip_add()
will work as expected.Signed-off-by: Magnus Damm
Acked-by: Laurent Pinchart
Signed-off-by: Linus Walleij
16 Oct, 2013
1 commit
-
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
Reviewed-by: Ian Molton
Signed-off-by: Linus Walleij
19 Sep, 2013
1 commit
-
EMEV2 is now a DT platform, however the GPIO driver cannot be used
from a DT file since it does not fill out the of_node field in its
gpio_chip structure.Signed-off-by: Ian Molton
Reviewed-by: Simon Horman
Signed-off-by: Linus Walleij
16 Aug, 2013
1 commit
-
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.Signed-off-by: Jingoo Han
Signed-off-by: Linus Walleij
21 Jul, 2013
1 commit
-
Register the GPIO pin range, and request and free GPIO pins using the
pinctrl API. The pctl_name platform data member should be used by
platform devices to point out which pinctrl device to use.Follows same style as "dc3465a gpio-rcar: Add pinctrl support",
by Laurent Pinchart, thanks to him.Signed-off-by: Magnus Damm
Signed-off-by: Linus Walleij
27 Mar, 2013
1 commit
-
Update the Emma Mobile GPIO driver to make use of devm
functions. This simplifies the error handling and makes
the code more compact.Signed-off-by: Magnus Damm
Signed-off-by: Linus Walleij
06 Mar, 2013
1 commit
-
Update the Emma Mobile GPIO driver to add DT support.
The patch simply adds a two-cell xlate function and
updates the probe code to allow configuration via DT
using the "ngpios" property plus OF id in the same
style as gpio-mvebu.c. The code is also adjusted to
use postcore_initcall() to force early setup.Signed-off-by: Magnus Damm
Signed-off-by: Grant Likely
15 Feb, 2013
1 commit
-
Adjust the gpio-em.c driver to reconsider the pdata->irq_base
variable. Non-DT board code like for instance board-kzm9d.c
needs to operate of a static IRQ range for platform devices.So this patch is updating the code to make use of the function
irq_domain_add_simple() instead of irq_domain_add_linear().Fixes a EMEV2 / KZM9D runtime error caused by the following commit:
7385500 gpio/em: convert to linear IRQ domainCc: stable@kernel.org
Signed-off-by: Magnus Damm
Tested-by: Simon Horman
Reported-by: Simon Horman
Signed-off-by: Linus Walleij
12 Dec, 2012
1 commit
-
Pull driver core updates from Greg Kroah-Hartman:
"Here's the large driver core updates for 3.8-rc1.The biggest thing here is the various __dev* marking removals. This
is going to be a pain for the merge with different subsystem trees, I
know, but all of the patches included here have been ACKed by their
various subsystem maintainers, as they wanted them to go through here.If this is too much of a pain, I can pull all of them out of this tree
and just send you one with the other fixes/updates and then, after
3.8-rc1 is out, do the rest of the removals to ensure we catch them
all, it's up to you. The merges should all be trivial, and Stephen
has been doing them all in linux-next for a few weeks now quite
easily.Other than the __dev* marking removals, there's nothing major here,
some firmware loading updates and other minor things in the driver
core.All of these have (much to Stephen's annoyance), been in linux-next
for a while.Signed-off-by: Greg Kroah-Hartman "
Fixed up trivial conflicts in drivers/gpio/gpio-{em,stmpe}.c due to gpio
update.* tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (93 commits)
modpost.c: Stop checking __dev* section mismatches
init.h: Remove __dev* sections from the kernel
acpi: remove use of __devinit
PCI: Remove __dev* markings
PCI: Always build setup-bus when PCI is enabled
PCI: Move pci_uevent into pci-driver.c
PCI: Remove CONFIG_HOTPLUG ifdefs
unicore32/PCI: Remove CONFIG_HOTPLUG ifdefs
sh/PCI: Remove CONFIG_HOTPLUG ifdefs
powerpc/PCI: Remove CONFIG_HOTPLUG ifdefs
mips/PCI: Remove CONFIG_HOTPLUG ifdefs
microblaze/PCI: Remove CONFIG_HOTPLUG ifdefs
dma: remove use of __devinit
dma: remove use of __devexit_p
firewire: remove use of __devinitdata
firewire: remove use of __devinit
leds: remove use of __devexit
leds: remove use of __devinit
leds: remove use of __devexit_p
mmc: remove use of __devexit
...
29 Nov, 2012
3 commits
-
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.Signed-off-by: Bill Pemberton
Cc: Grant Likely
Acked-by: Linus Walleij
Cc: Peter Tyser
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Grant Likely
Cc: Peter Tyser
Cc: Santosh Shilimkar
Cc: Kevin Hilman
Acked-by: Linus Walleij
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman -
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.Signed-off-by: Bill Pemberton
Cc: Grant Likely
Cc: Peter Tyser
Acked-by: Linus Walleij
Acked-by: Mark Brown
Signed-off-by: Greg Kroah-Hartman