13 Sep, 2016
1 commit
-
These structures are only used to copy into other structures, so declare
them as const.The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct gpio_chip i@p = { ... };@ok@
identifier r.i;
expression e;
position p;
@@
e = i@p;@bad@
position p != {r.p,ok.p};
identifier r.i;
struct gpio_chip e;
@@
e@i@p@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct gpio_chip i = { ... };
//Signed-off-by: Julia Lawall
Acked-by: Joachim Eastwood
Signed-off-by: Linus Walleij
08 Jun, 2016
1 commit
-
The bcm_kona_gpio_reset() calls bcm_kona_gpio_write_lock_regs()
with what looks like the wrong parameter. The write_lock_regs
function takes a pointer to the registers, not the bcm_kona_gpio
structure.Fix the warning, and probably bug by changing the function to
pass reg_base instead of kona_gpio, fixing the following warning:drivers/gpio/gpio-bcm-kona.c:550:47: warning: incorrect type in argument 1
(different address spaces)
expected void [noderef] *reg_base
got struct bcm_kona_gpio *kona_gpio
warning: incorrect type in argument 1 (different address spaces)
expected void [noderef] *reg_base
got struct bcm_kona_gpio *kona_gpioCc: stable@vger.kernel.org
Signed-off-by: Ben Dooks
Acked-by: Ray Jui
Reviewed-by: Markus Mayer
Signed-off-by: Linus Walleij
31 Mar, 2016
1 commit
-
The Kconfig currently controlling compilation of this code is:
config GPIO_BCM_KONA
bool "Broadcom Kona GPIO"...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the
driver there is no doubt it is builtin-only.Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.Cc: Ray Jui
Cc: Alexandre Courbot
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker
Signed-off-by: Linus Walleij
23 Feb, 2016
1 commit
-
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan
Cc: Ray Jui
Acked-by: Ray Jui
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: Markus Mayer
Cc: Tim Kryger
Cc: Matt Porter
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
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
1 commit
-
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
02 Jul, 2015
1 commit
-
Pull irq fixes from Thomas Gleixner:
"This contains:- a series of fixes for interrupt drivers to prevent a potential race
when installing a chained interrupt handler- a fix for cpumask pointer misuse
- a fix for using the wrong interrupt number from struct irq_data
- removal of unused code and outdated comments
- a few new helper functions which allow us to cleanup the interrupt
handling code further in 4.3I decided against doing the cleanup at the end of this merge window
and rather do the preparatory steps for 4.3, so we can run the final
ABI change at the end of the 4.3 merge window with less risk"* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
ARM/LPC32xx: Use irq not hwirq for __irq_set_handler_locked()
genirq: Implement irq_set_handler_locked()/irq_set_chip_handler_name_locked()
genirq: Introduce helper irq_desc_get_irq()
genirq: Remove irq_node()
genirq: Clean up outdated comments related to include/linux/irqdesc.h
mn10300: Fix incorrect use of irq_data->affinity
MIPS/ralink: Fix race in installing chained IRQ handler
MIPS/pci: Fix race in installing chained IRQ handler
MIPS/ath25: Fix race in installing chained IRQ handler
MIPS/ath25: Fix race in installing chained IRQ handler
m68k/psc: Fix race in installing chained IRQ handler
avr32/at32ap: Fix race in installing chained IRQ handler
sh/intc: Fix race in installing chained IRQ handler
sh/intc: Fix potential race in installing chained IRQ handler
pinctrl/sun4i: Fix race in installing chained IRQ handler
pinctrl/samsung: Fix race in installing chained IRQ handler
pinctrl/samsung: Fix race in installing chained IRQ handler
pinctrl/exynos: Fix race in installing chained IRQ handler
pinctrl/st: Fix race in installing chained IRQ handler
pinctrl/adi2: Fix race in installing chained IRQ handler
...
25 Jun, 2015
2 commits
-
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().Search and conversion was done with coccinelle:
@@
expression E1, E2, E3;
@@
(
-if (irq_set_chained_handler(E1, E3) != 0)
- BUG();
|
-irq_set_chained_handler(E1, E3);
)
-irq_set_handler_data(E1, E2);
+irq_set_chained_handler_and_data(E1, E3, E2);@@
expression E1, E2, E3;
@@
(
-if (irq_set_chained_handler(E1, E3) != 0)
- BUG();
...
|
-irq_set_chained_handler(E1, E3);
...
)
-irq_set_handler_data(E1, E2);
+irq_set_chained_handler_and_data(E1, E3, E2);Reported-by: Russell King
Signed-off-by: Thomas Gleixner
Cc: Julia Lawall
Cc: Ray Jui
Cc: Linus Walleij
Cc: Alexandre Courbot
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-gpio@vger.kernel.org -
Pull pin control updates from Linus Walleij:
"Here is the bulk of pin control changes for the v4.2 series: Quite a
lot of new SoC subdrivers and two new main drivers this time, apart
from that business as usual.Details:
Core functionality:
- Enable exclusive pin ownership: it is possible to flag a pin
controller so that GPIO and other functions cannot use a single pin
simultaneously.New drivers:
- NXP LPC18xx System Control Unit pin controller
- Imagination Pistachio SoC pin controllerNew subdrivers:
- Freescale i.MX7d SoC
- Intel Sunrisepoint-H PCH
- Renesas PFC R8A7793
- Renesas PFC R8A7794
- Mediatek MT6397, MT8127
- SiRF Atlas 7
- Allwinner A33
- Qualcomm MSM8660
- Marvell Armada 395
- Rockchip RK3368Cleanups:
- A big cleanup of the Marvell MVEBU driver rectifying it to
correspond to reality
- Drop platform device probing from the SH PFC driver, we are now a
DT only shop for SuperH
- Drop obsolte multi-platform check for SH PFC
- Various janitorial: constification, grammar etcImprovements:
- The AT91 GPIO portions now supports the set_multiple() feature
- Split out SPI pins on the Xilinx Zynq
- Support DTs without specific function nodes in the i.MX driver"* tag 'pinctrl-v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (99 commits)
pinctrl: rockchip: add support for the rk3368
pinctrl: rockchip: generalize perpin driver-strength setting
pinctrl: sh-pfc: r8a7794: add SDHI pin groups
pinctrl: sh-pfc: r8a7794: add MMCIF pin groups
pinctrl: sh-pfc: add R8A7794 PFC support
pinctrl: make pinctrl_register() return proper error code
pinctrl: mvebu: armada-39x: add support for Armada 395 variant
pinctrl: mvebu: armada-39x: add missing SATA functions
pinctrl: mvebu: armada-39x: add missing PCIe functions
pinctrl: mvebu: armada-38x: add ptp functions
pinctrl: mvebu: armada-38x: add ua1 functions
pinctrl: mvebu: armada-38x: add nand functions
pinctrl: mvebu: armada-38x: add sata functions
pinctrl: mvebu: armada-xp: add dram functions
pinctrl: mvebu: armada-xp: add nand rb function
pinctrl: mvebu: armada-xp: add spi1 function
pinctrl: mvebu: armada-39x: normalize ref clock naming
pinctrl: mvebu: armada-xp: rename spi to spi0
pinctrl: mvebu: armada-370: align spi1 clock pin naming
pinctrl: mvebu: armada-370: align VDD cpu-pd pin naming with datasheet
...
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
27 Apr, 2015
1 commit
-
Implement gpio_chip's get_direction() callback, that lets other drivers get
particular GPIOs direction using gpiod_get_direction().Signed-off-by: Axel Lin
Reviewed-by: Ray Jui
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
24 Sep, 2014
1 commit
-
The __initconst is in the wrong place, and when moved to the correct place
it uncovers an error where the variable is used by non-init data structures.Instead merely make them const and put the const in the right spot.
Signed-off-by: Behan Webster
Reviewed-by: Mark Charlebois
Acked-by: Arnd Bergmann
Acked-by: Matt Porter
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
14 Mar, 2014
1 commit
-
Linux 3.14-rc6
06 Feb, 2014
3 commits
-
This patch removes some inconsistencies caused by the use of "int gpio"
in some parts of the code and "unsigned gpio" in others.Signed-off-by: Markus Mayer
Reviewed-by: Tim Kryger
Signed-off-by: Linus Walleij -
Rather than unlock/re-lock for every write access, unlock a GPIO when
it is requested and re-lock it when it is freed. As a result, the GPIO
helper functions no longer have to deal with unlocking and re-locking
the register.In addition, only unlock a specific GPIO rather than unlocking the
entire GPIO bank as before.Signed-off-by: Markus Mayer
Reviewed-by: Tim Kryger
Signed-off-by: Linus Walleij -
The GPIO_CONTROL macro returns the control register offset when given a
GPIO number.Update the argument name in the macro to reflect that it takes in a
GPIO number and not a bank.Signed-off-by: Markus Mayer
Reviewed-by: Tim Kryger
Signed-off-by: Linus Walleij
05 Feb, 2014
1 commit
-
Add Broadcom's upstreaming mailing list address to MODULE_AUTHOR.
Signed-off-by: Markus Mayer
Signed-off-by: Linus Walleij
09 Dec, 2013
1 commit
-
Linux 3.13-rc3
04 Dec, 2013
1 commit
-
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.Cc: Christian Daudt
Cc: Grygorii Strashko
Reviewed-by: Markus Mayer
Tested-by: Markus Mayer
Reviewed-by: Javier Martinez Canillas
Signed-off-by: Linus Walleij
27 Nov, 2013
1 commit
-
We need to return the corresponding bit for a particular GPIO. This bit
contains shift not mask.Signed-off-by: Markus Mayer
Reviewed-by: Tim Kryger
Reviewed-by: Matt Porter
Signed-off-by: Linus Walleij
31 Oct, 2013
1 commit
-
Add missing .owner of struct gpio_chip. This prevents the
module from being removed from underneath its users.Signed-off-by: Wei Yongjun
Signed-off-by: Linus Walleij
19 Oct, 2013
1 commit
-
The physical address of the GPIO memory address is already printed
implicitly by dev_info() as part of the device name. The virtual
address doesn't add any value. In addition, printing a resource_size_t
with %x lead to a compiler warning on some platforms.Signed-off-by: Markus Mayer
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. 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
Signed-off-by: Linus Walleij
11 Oct, 2013
1 commit
-
The GPIO interrupt handler does not need to be marked as nested.
Signed-off-by: Markus Mayer
Signed-off-by: Linus Walleij
21 Sep, 2013
2 commits
-
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
Signed-off-by: Linus Walleij -
Add the GPIO driver for the Broadcom bcm281xx family of mobile SoCs.
These GPIO controllers may contain up to 8 banks where each bank
includes 32 pins that can be driven high or low and act as an edge
sensitive interrupt.Signed-off-by: Markus Mayer
Reviewed-by: Christian Daudt
Reviewed-by: Tim Kryger
Reviewed-by: Matt Porter
Reviewed-by: Stephen Warren
[Added depends on OF_GPIO]
Signed-off-by: Linus Walleij